summaryrefslogtreecommitdiffstats
path: root/test/test_interface_crud.py
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2019-12-02 22:38:00 -0500
committerNeale Ranns <nranns@cisco.com>2019-12-04 23:16:44 +0000
commit207083f59524a8523e7c4ab4eeff3cbc7b21c6a0 (patch)
treebf5dae832d3b16ce6f971948a6feede1332fd09e /test/test_interface_crud.py
parent3f4be92ce54e565e1c0814450b26b937143062b7 (diff)
tests: add interface function chaining
Type: test Change-Id: I24e740aa87a8a4061fa98740f2d636997e18f08d Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'test/test_interface_crud.py')
-rw-r--r--test/test_interface_crud.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/test/test_interface_crud.py b/test/test_interface_crud.py
index 3ab83c95e98..2f08f33c704 100644
--- a/test/test_interface_crud.py
+++ b/test/test_interface_crud.py
@@ -30,8 +30,7 @@ class TestLoopbackInterfaceCRUD(VppTestCase):
try:
cls.create_pg_interfaces(range(1))
for i in cls.pg_interfaces:
- i.config_ip4()
- i.resolve_arp()
+ i.config_ip4().resolve_arp()
except:
cls.tearDownClass()
raise
@@ -86,8 +85,7 @@ class TestLoopbackInterfaceCRUD(VppTestCase):
loopbacks = self.create_loopback_interfaces(20)
for i in loopbacks:
i.local_ip4_prefix_len = 32
- i.config_ip4()
- i.admin_up()
+ i.config_ip4().admin_up()
# read (check sw if dump, ip4 fib, ip6 fib)
if_dump = self.vapi.sw_interface_dump(name_filter_valid=True,
@@ -133,13 +131,11 @@ class TestLoopbackInterfaceCRUD(VppTestCase):
loopbacks = self.create_loopback_interfaces(20)
for i in loopbacks:
i.local_ip4_prefix_len = 32
- i.config_ip4()
- i.admin_up()
+ i.config_ip4().admin_up()
# disable
for i in loopbacks:
- i.admin_down()
- i.unconfig_ip4()
+ i.admin_down().unconfig_ip4()
# read (check not in sw if dump, ip4 fib, ip6 fib)
if_dump = self.vapi.sw_interface_dump()
@@ -189,5 +185,6 @@ class TestInterfaceDumpApi(VppTestCase):
rv = self.vapi.sw_interface_dump(sw_if_index=0xffffffff)
self.assertEqual(len(rv), 3, 'Expected 3 interfaces.')
+
if __name__ == '__main__':
unittest.main(testRunner=VppTestRunner)