summaryrefslogtreecommitdiffstats
path: root/test/test_dhcp.py
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2018-05-16 04:12:18 -0700
committerNeale Ranns <nranns@cisco.com>2018-06-07 03:11:10 -0400
commitdaff1784037376f4a5caec2f5975f9b5fc23d5a4 (patch)
tree186701f7fcd64d691de5b5d11b477a5d8b7840a2 /test/test_dhcp.py
parent0e969ac8431c80ff4bca5f6985876b1c584eefcd (diff)
DHCP Client Dump
- use types on the DHCP API so that the same data is sent in comfing messages and in dumps - add the DHCP client dump API - update VOM to refelct API changes - rename VOM class dhcp_config* dhcp_client* - the VOM dhcp_client class maintains the lease data (which it reads on a dump) for clients to read Change-Id: I2a43463937cbd80c01d45798e74b21288d8b8ead Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'test/test_dhcp.py')
-rw-r--r--test/test_dhcp.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/test_dhcp.py b/test/test_dhcp.py
index c5b1fa5fe3b..39133a35bd1 100644
--- a/test/test_dhcp.py
+++ b/test/test_dhcp.py
@@ -1422,6 +1422,29 @@ class TestDHCP(VppTestCase):
mactobinary(self.pg3.remote_mac),
self.pg3.remote_ip4,
is_add=0)
+
+ #
+ # read the DHCP client details from a dump
+ #
+ clients = self.vapi.dhcp_client_dump()
+
+ self.assertEqual(clients[0].client.sw_if_index,
+ self.pg3.sw_if_index)
+ self.assertEqual(clients[0].lease.sw_if_index,
+ self.pg3.sw_if_index)
+ self.assertEqual(clients[0].client.hostname.rstrip('\0'),
+ hostname)
+ self.assertEqual(clients[0].lease.hostname.rstrip('\0'),
+ hostname)
+ self.assertEqual(clients[0].lease.is_ipv6, 0)
+ # 0 = DISCOVER, 1 = REQUEST, 2 = BOUND
+ self.assertEqual(clients[0].lease.state, 2)
+ self.assertEqual(clients[0].lease.mask_width, 24)
+ self.assertEqual(clients[0].lease.router_address.rstrip('\0'),
+ self.pg3.remote_ip4n)
+ self.assertEqual(clients[0].lease.host_address.rstrip('\0'),
+ self.pg3.local_ip4n)
+
#
# remove the DHCP config
#