diff options
author | Josh Gao <jmgao@google.com> | 2018-03-19 18:18:21 -0700 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2018-03-19 18:19:47 -0700 |
commit | 52d0660a193ae6c49706fad11e485d7114a2f336 (patch) | |
tree | 49cb0dc93a8f873a7df611c60b1675002236512b /test_adb.py | |
parent | ee65d9e614b575e3eba096946eb330adb24bf04f (diff) | |
download | adb-52d0660a193ae6c49706fad11e485d7114a2f336.tar.gz |
adb: skip IPv6 test if IPv6 isn't available.
Bug: http://b/69813298
Test: none
Change-Id: I0793e793bd52c5f1c639faedf09a513df263db78
Diffstat (limited to 'test_adb.py')
-rw-r--r-- | test_adb.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test_adb.py b/test_adb.py index 98c8a592..e7711062 100644 --- a/test_adb.py +++ b/test_adb.py @@ -217,8 +217,12 @@ class NonApiTest(unittest.TestCase): ipv4.listen(1) ipv6 = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) - ipv6.bind(('::1', ipv4.getsockname()[1] + 1)) - ipv6.listen(1) + try: + ipv6.bind(('::1', ipv4.getsockname()[1] + 1)) + ipv6.listen(1) + except socket.error: + print("IPv6 not available, skipping") + return for s in (ipv4, ipv6): port = s.getsockname()[1] |