'check ping server via source ssh connection
:param source: RemoteClient: an ssh connection from which to ping
:param dest: and IP to ping against
:param should_succeed: boolean should ping succeed or not
:param nic: specific network interface to ping from
:param mtu: mtu size for the packet to be sent
:param fragmentation: Flag for packet fragmentation
:returns: boolean -- should_succeed == ping
:returns: ping is false if ping failed'

def _check_remote_connectivity(self, source, dest, should_succeed=True, nic=None, mtu=None, fragmentation=True):

    def ping_host(source, host, count=CONF.validation.ping_count, size=CONF.validation.ping_size, nic=None, mtu=None, fragmentation=True):
        addr = netaddr.IPAddress(host)
        cmd = ('ping6' if (addr.version == 6) else 'ping')
        if nic:
            cmd = 'sudo    {cmd}    -I    {nic}'.format(cmd=cmd, nic=nic)
        if mtu:
            if (not fragmentation):
                cmd += '    -M    do'
            size = str(net_utils.get_ping_payload_size(mtu=mtu, ip_version=addr.version))
        cmd += '    -c{0}    -w{0}    -s{1}    {2}'.format(count, size, host)
        return source.exec_command(cmd)
    def ping_remote():
        try:
            result = ping_host(source, dest, nic=nic, mtu=mtu, fragmentation=fragmentation)
        except lib_exc.SSHExecCommandFailed:
            LOG.warning('Failed    to    ping    IP:    %s    via    a    ssh    connection    from:    %s.', dest, source.host)
            return (not should_succeed)
        LOG.debug('ping    result:    %s', result)
        from_source = ('from    %s' % dest)
        self.assertIn(from_source, result)
        return should_succeed
    return test_utils.call_until_true(ping_remote, CONF.validation.ping_timeout, 1)
