Revised using classSetup method
@@ -46,15 +46,9 @@ The "server' URL points to the location of the OS executables in an image reposi
'''
-import os
-import sys
-import subprocess
+import fit_path # NOQA: unused import
from nose.plugins.attrib import attr
-
-# set path to common libraries
-sys.path.append(subprocess.check_output("git rev-parse --show-toplevel", shell=True).rstrip("\n") + "/test/common")
import fit_common
-
import flogging
log = flogging.get_loggers()
@@ -103,9 +97,8 @@ def node_taskid(osname, version):
return NODE_STATUS[entry]['id']
return ""
-# run all bootstraps if regression group is specified or no group is specified
-if "regression" in sys.argv or "-a" not in sys.argv:
- oslist = [
+
+OSLIST = [
{"os":"ESXi", "version":"5.5", "path":"/ESXi/5.5", "kvm":False},
{"os":"ESXi", "version":"6.0", "path":"/ESXi/6.0", "kvm":False},
{"os":"CentOS", "version":"6.5", "path":"/CentOS/6.5", "kvm":False},
@@ -115,8 +108,25 @@ if "regression" in sys.argv or "-a" not in sys.argv:
{"os":"RHEL", "version":"7", "path":"/RHEL/7.0", "kvm":False},
{"os":"CentOS+KVM", "version":"7", "path":"/CentOS/7.0", "kvm":True}
]
+
+# Match up tests to node IDs to feed skip decorators
+index = 0 # node index
+for item in OSLIST:
+ NODE_STATUS[NODECATALOG[index]] = {"os":item['os'], "version":item['version'], "id":"Pending"}
+ index += 1
+
+# ------------------------ Tests -------------------------------------
+
+@attr(all=True, regression=True)
+
+
+class redfish_bootstrap_base(fit_common.unittest.TestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ # run all OS install workflows first
nodeindex = 0
- for item in oslist:
+ for item in OSLIST:
# if OS proxy entry exists in RackHD config, run bootstrap against selected node
if proxy_select(item['path']) and nodeindex < len(NODECATALOG):
#delete active workflows for specified node
@@ -152,14 +162,6 @@ if "regression" in sys.argv or "-a" not in sys.argv:
# increment node index to run next bootstrap
nodeindex += 1
-
-# ------------------------ Tests -------------------------------------
-
-@attr(all=True, regression=True)
-
-
-class redfish_bootstrap_base(fit_common.unittest.TestCase):
-
@fit_common.unittest.skipUnless(node_taskid("ESXi", "5.5") != '', "Skipping ESXi5.5, repo not configured or node unavailable")
def test_redfish_bootstrap_esxi55(self):
self.assertTrue(wait_for_task_complete(node_taskid("ESXi", "5.5")), "ESXi5.5 failed.")
