rubbos installation guide
[bottlenecks.git] / vstf / vstf / agent / unittest / perf / test_utils.py
1 """
2 Created on 2015-9-24
3
4 @author: y00228926
5 """
6 import unittest
7 from vstf.common import utils
8
9
10 class TestUtils(unittest.TestCase):
11     def setUp(self):
12         pass
13
14     def tearDown(self):
15         pass
16
17     def test_ns_cmd(self):
18         cmd = "ls"
19         ns = "xx"
20         exp_cmd = "ip netns exec xx ls"
21         ret = utils.ns_cmd(ns, cmd)
22         self.assertEqual(ret, exp_cmd, "ns_cmd failed to add ns header prefix:%s != %s" % (ret, exp_cmd))
23
24
25 if __name__ == "__main__":
26     import logging
27
28     logging.getLogger(__name__)
29     logging.basicConfig(level=logging.DEBUG)
30     # import sys;sys.argv = ['', 'Test.testName']
31     unittest.main()