Create flavor for Quagga ubuntu VM 81/31381/1
authortomsou <soth@intracom-telecom.com>
Fri, 17 Mar 2017 09:26:06 +0000 (09:26 +0000)
committerRomanos Skiadas <rski@intracom-telecom.com>
Wed, 22 Mar 2017 12:50:26 +0000 (12:50 +0000)
- Implement a  new function in lib/utils ensures
(gets or creates) a new flavor existence
- Use this new function within Testcase3, in order
to create a flavor big enough to start ubuntu with

JIRA: SDNVPN-120

Change-Id: I5c7d9c855f083b96bfd056bb5d935baa851420c9
Signed-off-by: tomsou <soth@intracom-telecom.com>
(cherry picked from commit f368948e25f78c64c328662b52d6b139b02826b4)

sdnvpn/lib/config.py
sdnvpn/lib/utils.py
sdnvpn/test/functest/config.yaml
sdnvpn/test/functest/testcase_3.py

index 4fd40ed..52e328d 100644 (file)
@@ -47,6 +47,10 @@ class CommonConfig(object):
         self.ubuntu_image_path = '{0}/{1}'.format(
             CONST.dir_functest_data,
             "ubuntu-16.04-server-cloudimg-amd64-disk1.img")
+        self.custom_flavor_name = 'm1.custom'
+        self.custom_flavor_ram = 1024
+        self.custom_flavor_disk = 10
+        self.custom_flavor_vcpus = 1
 
 
 class TestcaseConfig(object):
index a047269..2aef689 100644 (file)
@@ -28,6 +28,13 @@ ODL_USER = 'admin'
 ODL_PASS = 'admin'
 
 
+def create_custom_flavor():
+    return os_utils.get_or_create_flavor(common_config.custom_flavor_name,
+                                         common_config.custom_flavor_ram,
+                                         common_config.custom_flavor_disk,
+                                         common_config.custom_flavor_vcpus)
+
+
 def create_net(neutron_client, name):
     logger.debug("Creating network %s", name)
     net_id = os_utils.create_neutron_net(neutron_client, name)
index 4359f2f..6480c4c 100644 (file)
@@ -84,7 +84,6 @@ testcases:
       quagga_router_name: sdnvpn-3-2-quagga-router
       quagga_instance_name: sdnvpn-3-2-quagga
       quagga_instance_ip: 10.10.11.5
-      quagga_instance_flavor: m1.small
       instance_1_name: sdnvpn-3-1
       instance_1_ip: 10.10.10.5
       import_targets: '31:31'
index 8a8aa30..cc0f6b0 100644 (file)
@@ -199,6 +199,9 @@ def main():
         controller_ext_ip,
         fake_fip['fip_addr'],
         ext_net_mask)
+
+    test_utils.create_custom_flavor()
+
     quagga_vm = test_utils.create_instance(
         nova_client,
         TESTCASE_CONFIG.quagga_instance_name,
@@ -206,7 +209,7 @@ def main():
         quagga_net_id,
         sg_id,
         fixed_ip=TESTCASE_CONFIG.quagga_instance_ip,
-        flavor=TESTCASE_CONFIG.quagga_instance_flavor,
+        flavor=COMMON_CONFIG.custom_flavor_name,
         userdata=quagga_bootstrap_script,
         compute_node=quagga_compute_node)