move getaddrs to it own file in test