summaryrefslogtreecommitdiffstats
path: root/test/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/util.py')
-rw-r--r--test/util.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/util.py b/test/util.py
index 8d7c9202a41..6e7e275cddc 100644
--- a/test/util.py
+++ b/test/util.py
@@ -1,8 +1,7 @@
-from logging import *
+import socket
-
-class TestHost(object):
- """ Generic test host "connected" to VPP. """
+class Host(object):
+ """ Generic test host "connected" to VPPs interface. """
@property
def mac(self):
@@ -15,6 +14,11 @@ class TestHost(object):
return self._ip4
@property
+ def ip4n(self):
+ """ IPv4 address """
+ return socket.inet_pton(socket.AF_INET, self._ip4)
+
+ @property
def ip6(self):
""" IPv6 address """
return self._ip6