Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: booth cannot cope with <address>%<device> IPv6 addresses
...at least for the time being.  So craft ::1 address in that case
as a substitute.
  • Loading branch information
jnpkrn committed Apr 27, 2016
commit 4754bd5a62283359caa0867c4e6a463d2c62193c
6 changes: 4 additions & 2 deletions test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ def get_IP():
(stdout, stderr, returncode) = run_cmd(['hostname', '-i'])
if returncode != 0:
raise RuntimeError, "Failed to run hostname -i:\n" + stderr
# in case multiple IP addresses are returned, use only the first.
return re.sub(r'\s.*', '', stdout)
# in case multiple IP addresses are returned, use only the first
# and also strip '%<device>' part possibly present with IPv6 address
ret = re.sub(r'\s.*', '', stdout)
return "::1" if '%' in ret else ret