X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Ftest_util.py;h=421afce4d5d4a20d7b0feb623be861da0d5001a7;hb=07bc8bb1edff6d50b45116a36bb973d06968c3c5;hp=01ba862395285e7675c3110e01e618fa0cf9bbb9;hpb=8006c6aa425126529b4017768a9201e4f03964ad;p=vpp.git diff --git a/test/test_util.py b/test/test_util.py index 01ba8623952..421afce4d5d 100755 --- a/test/test_util.py +++ b/test/test_util.py @@ -1,19 +1,36 @@ -#!/usr/bin/env python -"""Test framework utilitty functions tests""" +#!/usr/bin/env python3 +"""Test framework utility functions tests""" import unittest -from framework import VppTestCase, VppTestRunner +from framework import VppTestRunner from vpp_papi import mac_pton, mac_ntop -class TestUtil (VppTestCase): - """ MAC to binary and back """ +class TestUtil (unittest.TestCase): + """ Test framework utility tests """ + + @classmethod + def is_tagged_run_solo(cls): + """ if the test case class is timing-sensitive - return true """ + return False + + @classmethod + def has_tag(cls, tag): + """ if the test case has a given tag - return true """ + try: + return tag in cls.test_tags + except AttributeError: + pass + return False + def test_mac_to_binary(self): + """ MAC to binary and back """ mac = 'aa:bb:cc:dd:ee:ff' b = mac_pton(mac) mac2 = mac_ntop(b) self.assertEqual(type(mac), type(mac2)) self.assertEqual(mac2, mac) + if __name__ == '__main__': unittest.main(testRunner=VppTestRunner)