Add tests for connecting to IPv4 and IPv6