aboutsummaryrefslogtreecommitdiffstats
path: root/test/util.py
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2017-01-02 08:22:23 +0100
committerDamjan Marion <dmarion.lists@gmail.com>2017-01-17 22:02:02 +0000
commit46a87adf10d41af4b1b14f06bdab33228cbaae95 (patch)
tree9ddb252a4d843eee0caf45fd18cbf68aca764f20 /test/util.py
parenta18c7c0d5c117aab65b2be1facd646ec393a1a80 (diff)
BFD: IPv6 support
Change-Id: Iaa9538c7cca500c04cf2704e5bf87480543cfcdf Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'test/util.py')
-rw-r--r--test/util.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/util.py b/test/util.py
index 79893602..24e9af44 100644
--- a/test/util.py
+++ b/test/util.py
@@ -76,19 +76,24 @@ class Host(object):
@property
def ip4(self):
- """ IPv4 address """
+ """ IPv4 address - string """
return self._ip4
@property
def ip4n(self):
- """ IPv4 address """
+ """ IPv4 address of remote host - raw, suitable as API parameter."""
return socket.inet_pton(socket.AF_INET, self._ip4)
@property
def ip6(self):
- """ IPv6 address """
+ """ IPv6 address - string """
return self._ip6
+ @property
+ def ip6n(self):
+ """ IPv6 address of remote host - raw, suitable as API parameter."""
+ return socket.inet_pton(socket.AF_INET6, self._ip6)
+
def __init__(self, mac=None, ip4=None, ip6=None):
self._mac = mac
self._ip4 = ip4