Changed test_ports to use new APIs