Add params for validation
Add run_validation, image_ssh_user, image_ssh_password and connect_method params
Related-prod: PROD-19442
Change-Id: Ie0a70b78a7594bdc21ca5c02b40cb35ac5583e28
diff --git a/_modules/runtest/tempest_sections/validation.py b/_modules/runtest/tempest_sections/validation.py
index 9adf570..c2b1c47 100644
--- a/_modules/runtest/tempest_sections/validation.py
+++ b/_modules/runtest/tempest_sections/validation.py
@@ -1,6 +1,8 @@
import base_section
+from runtest import conditions
+
class Validation(base_section.BaseSection):
name = "validation"
@@ -30,7 +32,19 @@
@property
def connect_method(self):
- pass
+ c = conditions.BaseRule(field='keystone.client.enabled', op='eq',
+ val=True)
+ nodes = self.get_nodes_where_condition_match(c)
+
+ keystone_profile_admin = self.runtest_opts.get('keystone_profile_admin', {})
+ res = self.authenticated_openstack_module_call(
+ nodes[0], 'neutronng.list_networks', profile=keystone_profile_admin)[nodes[0]]['networks']
+ external_routers = [net['router:external'] for net in res]
+
+ if True in external_routers:
+ return 'floating'
+ else:
+ return 'fixed'
@property
def connect_timeout(self):
@@ -42,11 +56,25 @@
@property
def image_ssh_password(self):
- pass
+ image_name = self.runtest_opts.get('convert_to_uuid', {}).get(
+ 'compute', {}).get('image_ref')
+ if not image_name:
+ return
+
+ image_map = {'TestCirros-0.3.5': 'cubswin:)', 'TestFedora-27-1.6': ''}
+
+ return image_map.get(image_name)
@property
def image_ssh_user(self):
- pass
+ image_name = self.runtest_opts.get('convert_to_uuid', {}).get(
+ 'compute', {}).get('image_ref')
+ if not image_name:
+ return
+
+ image_map = {'TestCirros-0.3.5': 'cirros', 'TestFedora-27-1.6': 'fedora'}
+
+ return image_map.get(image_name)
@property
def ip_version_for_ssh(self):
diff --git a/metadata/service/tempest/init.yml b/metadata/service/tempest/init.yml
index 33fca88..2c61d2f 100644
--- a/metadata/service/tempest/init.yml
+++ b/metadata/service/tempest/init.yml
@@ -84,3 +84,5 @@
scenario:
img_file: ${_param:runtest_local_img_file}
img_dir: ${_param:runtest_local_img_dir}
+ validation:
+ run_validation: true