summaryrefslogtreecommitdiffstats
path: root/test/test_vlib.py
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-11-18 17:16:49 -0500
committerDave Barach <dave@barachs.net>2019-11-18 17:17:40 -0500
commitc17fc44735b509b22476e8663e33be62678837a2 (patch)
tree4e58b24de8b81e1dc95ad1bea5b41ca8d3a7e271 /test/test_vlib.py
parent920180e5e0722c78c258ff26476fd5efa434032d (diff)
vlib: improve code coverage in src/vlib
Type: test Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I2dc4c09730f77931a2b484a6dd5dc669068f8e57
Diffstat (limited to 'test/test_vlib.py')
-rw-r--r--test/test_vlib.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/test_vlib.py b/test/test_vlib.py
index 20b60be7d0c..36a4340fa57 100644
--- a/test/test_vlib.py
+++ b/test/test_vlib.py
@@ -110,5 +110,34 @@ class TestVlib(VppTestCase):
else:
self.logger.info(cmd + " FAIL retval " + str(r.retval))
+ def test_vlib_buffer_c_unittest(self):
+ """ Vlib buffer.c Code Coverage Test """
+
+ cmds = ["loopback create",
+ "packet-generator new {\n"
+ " name vlib\n"
+ " limit 15\n"
+ " size 128-128\n"
+ " interface loop0\n"
+ " node ethernet-input\n"
+ " data {\n"
+ " IP6: 00:d0:2d:5e:86:85 -> 00:0d:ea:d0:00:00\n"
+ " ICMP: db00::1 -> db00::2\n"
+ " incrementing 30\n"
+ " }\n",
+ "}\n",
+ "pa en",
+ "test vlib",
+ "show buffers",
+ ]
+
+ 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)