diff options
author | Steven Laver <lavers@google.com> | 2019-12-12 15:29:36 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-12-12 15:29:36 +0000 |
commit | a239544c7b06814b70fd970de7eaac234682fa52 (patch) | |
tree | a4298d61f9b73642f350799b1157e49b65f4e1e8 /adb/test_adb.py | |
parent | 63de1e1c8d7824c241f22de67edf54f4f1eaeea5 (diff) | |
parent | 5319412e5305a3b4bcecf251a2955c09a6e9837e (diff) |
Merge "Merge RP1A.191203.001" into r-keystone-qcom-dev
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.""" |