Merge "adb: skip IPv6 test if IPv6 isn't available." am: 46e59af921

am: c4072ed605

Change-Id: I5e66a4c56247e7f588feece0d1d8f6dee2dda278
This commit is contained in:
Josh Gao 2018-03-20 07:34:18 +00:00 committed by android-build-merger
commit fb2f969286
1 changed files with 6 additions and 2 deletions

View File

@ -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]