Ole Troan | 7f99183 | 2018-12-06 17:35:12 +0100 | [diff] [blame^] | 1 | #!/usr/bin/env python |
| 2 | """Test framework utilitty functions tests""" |
| 3 | |
| 4 | import unittest |
| 5 | from framework import VppTestCase, VppTestRunner |
| 6 | from vpp_mac import mactobinary, binarytomac |
| 7 | |
| 8 | |
| 9 | class TestUtil (VppTestCase): |
| 10 | """ MAC to binary and back """ |
| 11 | def test_mac_to_binary(self): |
| 12 | mac = 'aa:bb:cc:dd:ee:ff' |
| 13 | b = mactobinary(mac) |
| 14 | mac2 = binarytomac(b) |
| 15 | self.assertEqual(type(mac), type(mac2)) |
| 16 | self.assertEqual(mac2, mac) |
| 17 | |
| 18 | if __name__ == '__main__': |
| 19 | unittest.main(testRunner=VppTestRunner) |