blob: 01ba862395285e7675c3110e01e618fa0cf9bbb9 [file] [log] [blame]
Ole Troan7f991832018-12-06 17:35:12 +01001#!/usr/bin/env python
2"""Test framework utilitty functions tests"""
3
4import unittest
5from framework import VppTestCase, VppTestRunner
Ole Troan8006c6a2018-12-17 12:02:26 +01006from vpp_papi import mac_pton, mac_ntop
Ole Troan7f991832018-12-06 17:35:12 +01007
8
9class TestUtil (VppTestCase):
10 """ MAC to binary and back """
11 def test_mac_to_binary(self):
12 mac = 'aa:bb:cc:dd:ee:ff'
Ole Troan8006c6a2018-12-17 12:02:26 +010013 b = mac_pton(mac)
14 mac2 = mac_ntop(b)
Ole Troan7f991832018-12-06 17:35:12 +010015 self.assertEqual(type(mac), type(mac2))
16 self.assertEqual(mac2, mac)
17
18if __name__ == '__main__':
19 unittest.main(testRunner=VppTestRunner)