Remove rally stderr output from rally-cert
[functest.git] / testcases / config_functest.py
index b4e29bf..70a7d6c 100755 (executable)
@@ -43,7 +43,7 @@ if not os.path.exists(REPO_PATH):
     exit(-1)
 sys.path.append(REPO_PATH + "testcases/")
 
-with open(REPO_PATH+"testcases/config_functest.yaml") as f:
+with open("/home/opnfv/functest/conf/config_functest.yaml") as f:
     functest_yaml = yaml.safe_load(f)
 f.close()
 
@@ -115,18 +115,32 @@ def action_start():
             action_clean()
             exit(-1)
 
+        logger.info("Installing Ruby libraries for vIMS testcase...")
         # Install ruby libraries for vims test-case
         script = 'source /etc/profile.d/rvm.sh; '
         script += 'cd ' + VIMS_TEST_DIR + '; '
+        script += 'rvm autolibs enable ;'
+        script += 'rvm install 1.9.3; '
+        script += 'rvm use 1.9.3;'
         script += 'bundle install'
 
         cmd = "/bin/bash -c '" + script + "'"
-        functest_utils.execute_command(cmd,logger)
+        if os.environ.get("CI_DEBUG") == "false":
+            functest_utils.execute_command(cmd)
+        else:
+            functest_utils.execute_command(cmd,logger)
 
         # Create result folder under functest if necessary
         if not os.path.exists(RALLY_RESULT_DIR):
             os.makedirs(RALLY_RESULT_DIR)
 
+        try:
+            logger.info("CI: Generate the list of executable tests.")
+            runnable_test = functest_utils.generateTestcaseList(functest_yaml)
+            logger.info("List of runnable tests generated: %s" % runnable_test)
+        except:
+            logger.error("Impossible to generate the list of runnable tests")
+
         exit(0)
 
 
@@ -197,7 +211,7 @@ def action_clean():
 
     logger.debug("Cleaning up the OpenStack deployment...")
     cmd='python ' + REPO_PATH + \
-        '/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py -'
+        '/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py --debug'
     functest_utils.execute_command(cmd,logger)
     logger.info("Functest environment clean!")
 
@@ -210,7 +224,10 @@ def install_rally():
         logger.debug("Executing %s/install_rally.sh..." %RALLY_REPO_DIR)
         install_script = RALLY_REPO_DIR + "/install_rally.sh --yes"
         cmd = 'sudo ' + install_script
-        functest_utils.execute_command(cmd,logger)
+        if os.environ.get("CI_DEBUG") == "false":
+            functest_utils.execute_command(cmd)
+        else:
+            functest_utils.execute_command(cmd,logger)
 
         logger.debug("Creating Rally environment...")
         cmd = "rally deployment create --fromenv --name="+DEPLOYMENT_MAME