5 from asfframework import VppAsfTestCase, VppTestRunner
9 class TestMpcap(VppAsfTestCase):
10 """Mpcap Unit Test Cases"""
14 super(TestMpcap, cls).setUpClass()
17 def tearDownClass(cls):
18 super(TestMpcap, cls).tearDownClass()
21 super(TestMpcap, self).setUp()
24 super(TestMpcap, self).tearDown()
26 def test_mpcap_unittest(self):
27 """Mapped pcap file test"""
29 "packet-generator new {\n"
34 " node mpcap-unittest\n"
36 " IP6: 00:d0:2d:5e:86:85 -> 00:0d:ea:d0:00:00\n"
37 " ICMP: db00::1 -> db00::2\n"
40 "trace add pg-input 15",
47 self.logger.info(self.vapi.cli(cmd))
49 size = os.path.getsize("/tmp/mpcap_unittest.pcap")
50 os.remove("/tmp/mpcap_unittest.pcap")
52 self.logger.critical("BUG: file size %d not 2184" % size)
53 self.assertNotIn("WrongMPCAPFileSize", "WrongMPCAPFileSize")
56 if __name__ == "__main__":
57 unittest.main(testRunner=VppTestRunner)