blob: b47b1a275a0845e54645bc90d2f9ba25e3fdc374 [file] [log] [blame]
Jakub Grajciar5de4fb72019-09-03 10:40:01 +02001import unittest
2import os
3
4from framework import VppTestCase, VppTestRunner
5from vpp_devices import VppTAPInterface
6
7
8def check_tuntap_driver_access():
Paul Vinciguerrade35cdb2019-12-16 18:24:24 -05009 return os.access("/dev/net/tun", os.R_OK and os.W_OK)
Jakub Grajciar5de4fb72019-09-03 10:40:01 +020010
11
Andrew Yourtchenkof63bf6a2020-01-11 17:57:31 +000012@unittest.skip("Requires root")
Jakub Grajciar5de4fb72019-09-03 10:40:01 +020013class TestTAP(VppTestCase):
14 """ TAP Test Case """
15
16 def test_tap_add_del(self):
17 """Create TAP interface"""
18 tap0 = VppTAPInterface(self, tap_id=0)
19 tap0.add_vpp_config()
20 self.assertTrue(tap0.query_vpp_config())
21
22
23if __name__ == '__main__':
24 unittest.main(testRunner=VppTestRunner)