A simple socket server, for use with my_ip_address()[source]

verifies the specified ip_address is reachable or not.

Parameters:ip_addr – ip_address to verify the PING.

returns: return True is ip_address is pinging else returns False.[source]

Get the ip address of the host running tests using the service listed in cfme_data[‘ip_echo’]

The ip echo endpoint is expected to write the ip address to the socket and close the connection. See a working example of this in ip_echo_socket()., addr=None, force=False)[source]

Checks the availablility of a port, addr=None, machine_addr=None, ssh_creds=None, force=False)[source]

Checks the availability of a port from outside using another machine (over SSH)[source]

Get a random port number for making a socket

Parameters:tcp – Return a TCP port number if True, UDP if False

This may not be reliable at all due to an inherent race condition. This works by creating a socket on an ephemeral port, inspecting it to see what port was used, closing it, and returning that port number. In the time between closing the socket and opening a new one, it’s possible for the OS to reopen that port for another purpose.

In practical testing, this race condition did not result in a failure to (re)open the returned port number, making this solution squarely “good enough for now”., force=False)[source]

Cached DNS resolver. If the hostname does not resolve to an IP, returns None., force_dns=False)[source]

Takes list of hostnames, ips and another things. If the item is not an IP, it will be tried to be converted to an IP. If that succeeds, it is appended to the set together with original hostname. If it can’t be resolved, just the original hostname is appended.