diff options
author | Yiting.Li <liyiting@huawei.com> | 2015-12-22 17:11:12 -0800 |
---|---|---|
committer | Yiting.Li <liyiting@huawei.com> | 2015-12-22 17:11:12 -0800 |
commit | 8f1101df131a4d3e03b377738507d88b745831c0 (patch) | |
tree | 73f140474fcec2a77c85a453f6946957ca0742d1 /vstf/vstf/agent/unittest/env/test_bridge_plugin.py | |
parent | 1a24ebbda3f95600c0e7d5ed8661317a8ff7e265 (diff) |
Upload the contribution of vstf as bottleneck network framework.
End to End Performance test
JIRA:BOTTLENECK-29
Change-Id: Ib2c553c8b60d6cda9e7a7b52b737c9139f706ebd
Signed-off-by: Yiting.Li <liyiting@huawei.com>
Diffstat (limited to 'vstf/vstf/agent/unittest/env/test_bridge_plugin.py')
-rwxr-xr-x | vstf/vstf/agent/unittest/env/test_bridge_plugin.py | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/vstf/vstf/agent/unittest/env/test_bridge_plugin.py b/vstf/vstf/agent/unittest/env/test_bridge_plugin.py new file mode 100755 index 00000000..ac4eb268 --- /dev/null +++ b/vstf/vstf/agent/unittest/env/test_bridge_plugin.py @@ -0,0 +1,56 @@ +""" +Created on 2015-10-12 + +@author: y00228926 +""" +import unittest + +from vstf.common.utils import check_call +from vstf.agent.unittest.env import model +from vstf.agent.env.vswitch_plugins import bridge_plugin +from vstf.agent.env.driver_plugins import manager + + +class Test(model.Test): + def setUp(self): + super(Test, self).setUp() + self.plugin = bridge_plugin.BridgePlugin() + self.dr_mgr = manager.DriverPluginManager() + self.br_cfg = { + "name": "br1", + "uplinks": [ + { + "bdf": self.bdf_of_eth[0], + }, + { + "bdf": self.bdf_of_eth[1], + } + ] + } + self.dr_mgr.clean() + self.dr_mgr.load(['ixgbe']) + + def tearDown(self): + super(Test, self).tearDown() + + def _check_br_exists(self, name): + try: + check_call('ifconfig %s' % name, shell=True) + except Exception, e: + return False + return True + + def test_create_br(self): + self.plugin.clean() + self.plugin.create_br(self.br_cfg) + self.assertTrue(self._check_br_exists(self.br_cfg['name'])) + self.plugin.clean() + self.assertFalse(self._check_br_exists(self.br_cfg['name'])) + + +if __name__ == "__main__": + import logging + + logging.basicConfig(level=logging.INFO) + LOG = logging.getLogger(__name__) + unittest.main() |