diff options
Diffstat (limited to 'adb/test_adb.py')
-rwxr-xr-x | adb/test_adb.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/adb/test_adb.py b/adb/test_adb.py index 8272722e8..3d6de2665 100755 --- a/adb/test_adb.py +++ b/adb/test_adb.py @@ -281,6 +281,37 @@ class ServerTest(unittest.TestCase): subprocess.check_output(["adb", "-P", str(port), "kill-server"], stderr=subprocess.STDOUT) + @unittest.skipUnless( + os.name == "posix", + "adb doesn't yet support IPv6 on Windows", + ) + def test_starts_on_ipv6_localhost(self): + """ + Tests that the server can start up on ::1 and that it's accessible + """ + server_port = 5037 + # Kill any existing server on this non-default port. + subprocess.check_output( + ["adb", "-P", str(server_port), "kill-server"], + stderr=subprocess.STDOUT, + ) + try: + subprocess.check_output( + ["adb", "-L", "tcp:[::1]:{}".format(server_port), "server"], + stderr=subprocess.STDOUT, + ) + with fake_adbd() as (port, _): + with adb_connect(self, serial="localhost:{}".format(port)): + pass + finally: + # If we started a server, kill it. + subprocess.check_output( + ["adb", "-P", str(server_port), "kill-server"], + stderr=subprocess.STDOUT, + ) + + + class EmulatorTest(unittest.TestCase): """Tests for the emulator connection.""" |