aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/VIM
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2015-12-24 17:51:58 +0100
committerJose Lausuch <jose.lausuch@ericsson.com>2016-01-07 09:02:00 +0000
commit367f8f2ab9fccbd9ce0566598ef00cad745a296a (patch)
tree22f420d94aea5d28e9f23d3152615e0088900e7e /testcases/VIM
parentbfdf561e941f8fc4f925b026aace13989b5c3176 (diff)
Move openstack defaults to a yaml file
Change-Id: I52a9304dff987f33265c47ba5510f9f96afe0a5a Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'testcases/VIM')
-rw-r--r--testcases/VIM/OpenStack/CI/libraries/clean_openstack.py23
-rw-r--r--testcases/VIM/OpenStack/CI/libraries/os_defaults.yaml31
2 files changed, 46 insertions, 8 deletions
diff --git a/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py b/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py
index dca188f5..fe11861f 100644
--- a/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py
+++ b/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py
@@ -20,6 +20,7 @@ import os
import re
import sys
import time
+import yaml
import novaclient.v2.client as novaclient
from neutronclient.v2_0 import client as neutronclient
@@ -52,14 +53,20 @@ if not os.path.exists(REPO_PATH):
sys.path.append(REPO_PATH + "testcases/")
import functest_utils
-default_images = ['TestVM']
-default_networks = ['net04', 'net04_ext', 'functest-net', 'ext-net']
-default_routers = ['router04', 'functest-router']
-default_users = ["heat", "heat-cfn", "cinder", "nova", "swift", "glance",
- "neutron", "admin", "fuel_stats_user", "quantum", "heat-cfn_heat",
- "ceilometer", "cinder_cinderv2", "demo"]
-default_tenants = ["admin", "services", "service", "demo"]
-default_security_groups = ['default']
+with open("os_defaults.yaml") as f:
+ defaults_yaml = yaml.safe_load(f)
+f.close()
+
+installer = os.environ["INSTALLER_TYPE"]
+
+default_images = defaults_yaml.get(installer).get("images")
+default_networks = defaults_yaml.get(installer).get("networks") +\
+ defaults_yaml.get("common").get("networks")
+default_routers = defaults_yaml.get(installer).get("routers") +\
+ defaults_yaml.get("common").get("routers")
+default_security_groups = defaults_yaml.get(installer).get("security_groups")
+default_users = defaults_yaml.get(installer).get("users")
+default_tenants = defaults_yaml.get(installer).get("tenants")
def separator():
logger.debug("-------------------------------------------")
diff --git a/testcases/VIM/OpenStack/CI/libraries/os_defaults.yaml b/testcases/VIM/OpenStack/CI/libraries/os_defaults.yaml
new file mode 100644
index 00000000..6c9d6c33
--- /dev/null
+++ b/testcases/VIM/OpenStack/CI/libraries/os_defaults.yaml
@@ -0,0 +1,31 @@
+fuel:
+ images: ['TestVM']
+ networks: ['net04', 'net04_ext']
+ routers: ['router04']
+ security_groups: ['default']
+ tenants: ['admin', 'services']
+ users: ['heat', 'heat-cfn', 'cinder', 'nova', 'swift', 'glance', 'neutron', 'admin', 'fuel_stats_user']
+apex:
+ images: []
+ networks: ['internal', 'external']
+ routers: []
+ security_groups: ['default']
+ tenants: ['admin', 'services']
+ users: ['heat', 'heat-cfn', 'cinder', 'nova', 'swift', 'glance', 'neutron', 'admin']
+compass:
+ images: []
+ networks: ['ext-net']
+ routers: []
+ security_groups: ['default']
+ tenants: ['admin', 'service', 'demo']
+ users: ['heat', 'cinder', 'nova', 'glance', 'neutron', 'admin', 'ceilometer', 'demo', 'keystone']
+joid:
+ images: []
+ networks: []
+ routers: []
+ security_groups: []
+ tenants: []
+ users: ['admin', 'glance', 'nova', 'quantum', 'heat-cfn_heat', 'ceilometer', 'cinder_cinderv2']
+common:
+ networks: ['functest-net']
+ routers: ['functest-router']