Added configuration of ssh_user_regex parameter 05/9505/1
authorViktor Tikkanen <viktor.tikkanen@nokia.com>
Mon, 8 Feb 2016 10:42:32 +0000 (12:42 +0200)
committerViktor Tikkanen <viktor.tikkanen@nokia.com>
Mon, 8 Feb 2016 10:50:13 +0000 (12:50 +0200)
Some Rally versions don't set correctly SSH user name into
tempest.conf file so that e.g. test_server_basicops test case
of Tempest suite fails with "Please login as 'cirros' user,
not as root" error. This change ensures that correct SSH user
info will be used for Cirros images created by Rally.

Change-Id: I90dcad0024f2034ef3ed20d2c6981e675213558d
Signed-off-by: Viktor Tikkanen <viktor.tikkanen@nokia.com>
testcases/VIM/OpenStack/CI/libraries/run_tempest.py
testcases/config_functest.yaml

index 6b15305..5738fd4 100644 (file)
@@ -73,6 +73,7 @@ TENANT_NAME = functest_yaml.get("tempest").get("identity").get("tenant_name")
 TENANT_DESCRIPTION = functest_yaml.get("tempest").get("identity").get("tenant_description")
 USER_NAME = functest_yaml.get("tempest").get("identity").get("user_name")
 USER_PASSWORD = functest_yaml.get("tempest").get("identity").get("user_password")
+SSH_USER_REGEX = functest_yaml.get("tempest").get("input-scenario").get("ssh_user_regex")
 DEPLOYMENT_MAME = functest_yaml.get("rally").get("deployment_name")
 RALLY_INSTALLATION_DIR = functest_yaml.get("general").get("directories").get("dir_rally_inst")
 RESULTS_DIR = functest_yaml.get("general").get("directories").get("dir_results")
@@ -202,6 +203,10 @@ def configure_tempest():
     cmd = "crudini --set "+tempest_conf_file+" identity password " \
           +USER_PASSWORD
     functest_utils.execute_command(cmd,logger)
+    cmd = "crudini --set "+tempest_conf_file+" input-scenario ssh_user_regex " \
+          +SSH_USER_REGEX
+    functest_utils.execute_command(cmd,logger)
+
 
     # Copy tempest.conf to /home/opnfv/functest/results/tempest/
     print shutil.copyfile(tempest_conf_file,TEMPEST_RESULTS_DIR+'/tempest.conf')
index 28455a3..6d2f4c1 100644 (file)
@@ -82,6 +82,8 @@ tempest:
         tenant_description: Tenant for Tempest test suite
         user_name: tempest
         user_password: tempest
+    input-scenario:
+        ssh_user_regex: [["^.*[Cc]irros.*$", "cirros"], ["^.*[Tt]est[VvMm].*$", "cirros"], ["^.*rally_verify.*$", "cirros"]]
 
 rally:
     deployment_name: opnfv-rally