Tests: change the connection handling

Add utility functions in tests/utils/connection.*

Now we use only IPv4.

Signed-off-by: David Navarro <david.navarro@intel.com>