vlib: improve code coverage, part deux

Type: test

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: If31f4b50da7a6e4a9704ceb3415c582143c08355
This commit is contained in:
Dave Barach
2019-11-19 10:36:41 -05:00
committed by Damjan Marion
parent a548d134ae
commit e51a9bbe76
4 changed files with 80 additions and 30 deletions

View File

@ -127,6 +127,7 @@ class TestVlib(VppTestCase):
" }\n",
"}\n",
"pa en",
"clear interfaces",
"test vlib",
"show buffers",
]
@ -139,5 +140,22 @@ class TestVlib(VppTestCase):
else:
self.logger.info(cmd + " FAIL retval " + str(r.retval))
def test_vlib_format_unittest(self):
""" Vlib format.c Code Coverage Test """
cmds = ["loopback create",
"classify filter pcap mask l2 proto ipv6 match l2 proto 86dd",
"classify filter del",
"test format-vlib",
]
for cmd in cmds:
r = self.vapi.cli_return_response(cmd)
if r.retval != 0:
if hasattr(r, 'reply'):
self.logger.info(cmd + " FAIL reply " + r.reply)
else:
self.logger.info(cmd + " FAIL retval " + str(r.retval))
if __name__ == '__main__':
unittest.main(testRunner=VppTestRunner)