X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Ftest_tap.py;h=0e5b315963e2695fe4b8fd79565e9fe6af92ab84;hb=d0d4b43374f6cb873ef189d91cab4482753e0f38;hp=2e66da30c022a213f36043873334fe9e5f33ea43;hpb=de35cdb7780cf313170397a55f2cef0959e70068;p=vpp.git diff --git a/test/test_tap.py b/test/test_tap.py index 2e66da30c02..0e5b315963e 100644 --- a/test/test_tap.py +++ b/test/test_tap.py @@ -9,7 +9,7 @@ def check_tuntap_driver_access(): return os.access("/dev/net/tun", os.R_OK and os.W_OK) -@unittest.skipIf(check_tuntap_driver_access(), "Permission denied") +@unittest.skip("Requires root") class TestTAP(VppTestCase): """ TAP Test Case """ @@ -19,6 +19,20 @@ class TestTAP(VppTestCase): tap0.add_vpp_config() self.assertTrue(tap0.query_vpp_config()) + def test_tap_dump(self): + """ Test api dump w/ and w/o sw_if_index filtering""" + MAX_INSTANCES = 10 + tap_instances = [] + for instance in range(MAX_INSTANCES): + i = VppTAPInterface(self, tap_id=instance) + i.add_vpp_config() + tap_instances.append(i) + details = self.vapi.sw_interface_tap_v2_dump() + self.assertEqual(MAX_INSTANCES, len(details)) + details = self.vapi.sw_interface_tap_v2_dump( + tap_instances[5].sw_if_index) + self.assertEqual(1, len(details)) + if __name__ == '__main__': unittest.main(testRunner=VppTestRunner)