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_vm_manager.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_vm_manager.py')
-rwxr-xr-x | vstf/vstf/agent/unittest/env/test_vm_manager.py | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/vstf/vstf/agent/unittest/env/test_vm_manager.py b/vstf/vstf/agent/unittest/env/test_vm_manager.py new file mode 100755 index 00000000..3c3deacc --- /dev/null +++ b/vstf/vstf/agent/unittest/env/test_vm_manager.py @@ -0,0 +1,69 @@ +""" +Created on 2015-9-24 + +@author: y00228926 +""" +import unittest + +from vstf.agent.unittest.env import model +from vstf.agent.env.basic.vm9pfs import VMConfigBy9pfs +from vstf.agent.env.basic.vm_manager import VMControlOperation + + +class TestVM9pfs(model.Test): + def setUp(self): + super(TestVM9pfs, self).setUp() + self.vm_config = { + 'vm_name': 'vm1', + 'vm_cpu': 5, + 'image_path': "/mnt/sdb/ubuntu_salt_master.img", + 'child_dir': '/mnt/sdb/', + 'image_type': 'qcow2', + 'ctrl_br': 'br0', + 'ctrl_mac': '56:6f:44:a5:3f:a4', + "taps": [ + { + "tap_name": "tap_in", + "br_type": "bridge", + "br_name": "br0", + "tap_mac": "56:6f:44:a5:3f:a2", + }, + { + "tap_name": "tap_out", + "br_type": "bridge", + "br_name": "br0", + "tap_mac": "56:6f:44:a5:3f:a3", + } + ], + 'init_config': { + "amqp_passwd": "guest", + "amqp_user": "guest", + "amqp_server": "192.168.188.10", + "amqp_port": 5672, + 'ctrl_ip_setting': '192.168.188.200/23', + 'tap_pktloop_config': 'dpdk', + 'ctrl_gw': '192.168.188.1' + } + } + self.mgr = VMControlOperation() + self.mgr.clean_all_vms() + + def tearDown(self): + self.mgr.clean_all_vms() + super(TestVM9pfs, self).tearDown() + + def test_create_vm_bridge(self): + self.mgr.create_vm(self.vm_config) + self.mgr.wait_vm(self.vm_config["vm_name"]) + self.mgr.init_config_vm(self.vm_config["vm_name"]) + + def _replace_opts(self, cfg, br_type): + for tap_cfg in cfg["taps"]: + tap_cfg["br_type"] = br_type + + +if __name__ == "__main__": + import logging + logging.basicConfig(level=logging.INFO) + LOG = logging.getLogger(__name__) + unittest.main() |