Refactor functest environment. Bugfixes: arg dependencies 54/654/1
authorjose.lausuch <jose.lausuch@ericsson.com>
Tue, 26 May 2015 13:34:40 +0000 (15:34 +0200)
committerjose.lausuch <jose.lausuch@ericsson.com>
Tue, 26 May 2015 13:34:40 +0000 (15:34 +0200)
JIRA: FUNCTEST-10

Change-Id: I4b392a76ecbafdc5e4f1909c26a17a934796ec23
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
testcases/VIM/OpenStack/CI/libraries/run_rally.py
testcases/config_functest.py
testcases/config_functest.yaml
testcases/vPing/CI/libraries/vPing.py

index a1f46e5..5e6789c 100644 (file)
 #
 import re, json, os, urllib2, argparse, logging, yaml
 
-HOME = os.environ['HOME']+"/"
-with open(args.repo_path+"testcases/config_functest.yaml") as f:
-    functest_yaml = yaml.safe_load(f)
-f.close()
+
 
 """ get the date """
 cmd = os.popen("date '+%d%m%Y_%H%M'")
 test_date = cmd.read().rstrip()
 
-HOME = os.environ['HOME']+"/"
-SCENARIOS_DIR = HOME + functest_yaml.get("general").get("directories").get("dir_rally_scn")
-RESULTS_DIR = HOME + functest_yaml.get("general").get("directories").get("dir_rally_res") + test_date + "/"
 
 """ tests configuration """
 tests = ['authenticate', 'glance', 'cinder', 'heat', 'keystone', 'neutron', 'nova', 'quotas', 'requests', 'vm', 'tempest', 'all', 'smoke']
@@ -55,6 +49,17 @@ formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(messag
 ch.setFormatter(formatter)
 logger.addHandler(ch)
 
+HOME = os.environ['HOME']+"/"
+with open(args.repo_path+"testcases/config_functest.yaml") as f:
+    functest_yaml = yaml.safe_load(f)
+f.close()
+
+HOME = os.environ['HOME']+"/"
+SCENARIOS_DIR = HOME + functest_yaml.get("general").get("directories").get("dir_rally_scn")
+RESULTS_DIR = HOME + functest_yaml.get("general").get("directories").get("dir_rally_res") + test_date + "/"
+
+
+
 
 def get_tempest_id(cmd_raw):
     """
index 7aa313c..5a3fcbb 100644 (file)
@@ -8,7 +8,7 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 #
 
-import re, json, os, urllib2, argparse, logging, shutil, subprocess, yaml
+import re, json, os, urllib2, argparse, logging, shutil, subprocess, yaml, sys
 from git import Repo
 
 from neutronclient.v2_0 import client
index 5fe7fbf..eb1c9a2 100644 (file)
@@ -1,13 +1,14 @@
 ---
 general:
-    # Relative paths to the path where the repo is cloned
     directories:
+        # Relative to the path where the repo is cloned:
         dir_vping:      testcases/vPing/CI/libraries/
         dir_odl:        testcases/Controllers/ODL/CI/
         dir_rally:      testcases/VIM/OpenStack/CI/libraries/
         dir_rally_scn:  testcases/VIM/OpenStack/CI/suites/
+        # Relative to $HOME:
         dir_rally_res:  functest/results/ # $HOME/functest/results
-        dir_rally_repo: functest/Rally_repo/
+        dir_rally_repo: functest/Rally_repo/ # $HOME/Rally_repo/
         dir_rally_inst: .rally/  # $HOME/.rally/ usually
 
     openstack:
index 8c365ff..5c02d5a 100644 (file)
@@ -18,19 +18,6 @@ import pprint
 import novaclient.v2.client as novaclient
 pp = pprint.PrettyPrinter(indent=4)
 
-HOME = os.environ['HOME']+"/"
-with open(args.repo_path+"testcases/config_functest.yaml") as f:
-    functest_yaml = yaml.safe_load(f)
-f.close()
-
-VM_BOOT_TIMEOUT = 180
-PING_TIMEOUT = functest_yaml.get("vping").get("ping_timeout")
-NAME_VM_1 = functest_yaml.get("vping").get("vm_name_1")
-NAME_VM_2 = functest_yaml.get("vping").get("vm_name_2")
-GLANCE_IMAGE_NAME = functest_yaml.get("general").get("openstack").get("image_name")
-NEUTRON_PRIVATE_NET_NAME = functest_yaml.get("general").get("openstack").get("neutron_private_net_name")
-FLAVOR = functest_yaml.get("vping").get("vm_flavor")
-
 
 parser = argparse.ArgumentParser()
 parser.add_argument("-d", "--debug", help="Debug mode",  action="store_true")
@@ -50,6 +37,19 @@ ch.setFormatter(formatter)
 logger.addHandler(ch)
 
 
+HOME = os.environ['HOME']+"/"
+with open(args.repo_path+"testcases/config_functest.yaml") as f:
+    functest_yaml = yaml.safe_load(f)
+f.close()
+
+VM_BOOT_TIMEOUT = 180
+PING_TIMEOUT = functest_yaml.get("vping").get("ping_timeout")
+NAME_VM_1 = functest_yaml.get("vping").get("vm_name_1")
+NAME_VM_2 = functest_yaml.get("vping").get("vm_name_2")
+GLANCE_IMAGE_NAME = functest_yaml.get("general").get("openstack").get("image_name")
+NEUTRON_PRIVATE_NET_NAME = functest_yaml.get("general").get("openstack").get("neutron_private_net_name")
+FLAVOR = functest_yaml.get("vping").get("vm_flavor")
+
 
 def pMsg(value):
     """pretty printing"""