Ole Troan | 57c3d66 | 2016-09-12 22:00:32 +0200 | [diff] [blame] | 1 | from __future__ import print_function |
| 2 | import unittest, sys, time, threading, struct |
| 3 | |
| 4 | import vpp_papi |
| 5 | from ipaddress import * |
| 6 | import glob, subprocess |
| 7 | class TestPAPI(unittest.TestCase): |
| 8 | def setUp(self): |
| 9 | print("Connecting API") |
| 10 | r = vpp_papi.connect("test_papi") |
| 11 | self.assertEqual(r, 0) |
| 12 | |
| 13 | def tearDown(self): |
| 14 | r = vpp_papi.disconnect() |
| 15 | self.assertEqual(r, 0) |
| 16 | |
| 17 | # |
| 18 | # The tests themselves |
| 19 | # |
| 20 | |
| 21 | # |
| 22 | # Basic request / reply |
| 23 | # |
| 24 | def test_show_version(self): |
| 25 | print(vpp_papi.show_version()) |
| 26 | |
| 27 | # |
| 28 | # Details / Dump |
| 29 | # |
| 30 | def test_details_dump(self): |
| 31 | t = vpp_papi.sw_interface_dump(0, b'') |
| 32 | print('Dump/details T', t) |
| 33 | |
| 34 | if __name__ == '__main__': |
| 35 | unittest.main() |