From: Thierry Parmentelat Date: Thu, 14 May 2009 18:46:25 +0000 (+0000) Subject: moving former sanity tests into system/hooks + iterating X-Git-Tag: tests-4.3-2~8 X-Git-Url: http://git.onelab.eu/?p=tests.git;a=commitdiff_plain;h=ab1742cec9707654d574cd62199d811fc5a79b1d moving former sanity tests into system/hooks + iterating --- diff --git a/system/TestNode.py b/system/TestNode.py index 5615095..8f49945 100644 --- a/system/TestNode.py +++ b/system/TestNode.py @@ -219,28 +219,28 @@ class TestNode: key = "keys/%(vservername)s.rsa"%locals() return TestSsh(self.name(), buildname=self.buildname(), key=key) - def check_sanity (self): + def check_hooks (self): extensions = [ 'py','pl','sh' ] - path='tests/qaapi/qa/tests/node/' - scripts=utils.locate_sanity_scripts ('node '+self.name(), path,extensions) + path='hooks/node' + scripts=utils.locate_hooks_scripts ('node '+self.name(), path,extensions) overall = True for script in scripts: - if not self.check_sanity_script (script): + if not self.check_hooks_script (script): overall = False return overall - def check_sanity_script (self,local_script): + def check_hooks_script (self,local_script): # push the script on the node's root context script_name=os.path.basename(local_script) - utils.header ("NODE %s : running sanity check script %s"%(self.name(),script_name)) + utils.header ("NODE %s : running hooks check script %s"%(self.name(),script_name)) ssh_handle=self.create_test_ssh() ssh_handle.copy_home(local_script) if ssh_handle.run("./"+script_name) != 0: - utils.header ("WARNING: node sanity check script %s FAILED"%script_name) + utils.header ("WARNING: node hooks check script %s FAILED"%script_name) print 'temporary : ignoring result and always return true for now' #return False return True else: - utils.header ("SUCCESS: node sanity check script %s OK"%script_name) + utils.header ("SUCCESS: node hooks check script %s OK"%script_name) return True diff --git a/system/TestPlc.py b/system/TestPlc.py index bd6b9ae..38f2cc0 100644 --- a/system/TestPlc.py +++ b/system/TestPlc.py @@ -76,7 +76,7 @@ class TestPlc: # better use of time: do this now that the nodes are taking off 'plcsh_stress_test', SEP, 'nodes_ssh_debug', 'nodes_ssh_boot', 'check_slice', 'check_initscripts', SEP, - 'check_tcp', 'check_sanity', SEP, + 'check_tcp', 'check_hooks', SEP, 'force_gather_logs', 'force_local_post', ] other_steps = [ @@ -795,15 +795,15 @@ class TestPlc: "all nodes: push local node-dep directory on the qemu box" pass - ### check sanity : invoke scripts from qaapi/qa/tests/{node,slice} - def check_sanity_node (self): - return self.locate_first_node().check_sanity() - def check_sanity_sliver (self) : - return self.locate_first_sliver().check_sanity() + ### check hooks : invoke scripts from hooks/{node,slice} + def check_hooks_node (self): + return self.locate_first_node().check_hooks() + def check_hooks_sliver (self) : + return self.locate_first_sliver().check_hooks() - def check_sanity (self): - "runs unit tests in the node and slice contexts - see tests/qaapi/qa/tests/{node,slice}" - return self.check_sanity_node() and self.check_sanity_sliver() + def check_hooks (self): + "runs unit tests in the node and slice contexts - see hooks/{node,slice}" + return self.check_hooks_node() and self.check_hooks_sliver() ### initscripts def do_check_initscripts(self): diff --git a/system/TestResources.py b/system/TestResources.py index 9d95b1f..1dbdc4f 100644 --- a/system/TestResources.py +++ b/system/TestResources.py @@ -165,13 +165,13 @@ class TestResources: return True ### - def trplc_record (self): + def trplc_record (self,plc): tracker = TrackerPlc(plc.options,instances=self.max_plcs()) tracker.record(self.test_ssh.hostname,self.vservername) tracker.store() return True - def trplc_free (self): + def trplc_free (self,plc): tracker = TrackerPlc(plc.options,instances=self.max_plcs()) tracker.free() tracker.store() diff --git a/system/TestSliver.py b/system/TestSliver.py index 86491d2..1947fdb 100644 --- a/system/TestSliver.py +++ b/system/TestSliver.py @@ -55,28 +55,28 @@ class TestSliver: dir_to_tar="/vservers/%s/var/log"%self.test_slice.name() return test_ssh.actual_command("tar -C %s -cf - ."%dir_to_tar) - def check_sanity (self): - print 'NOTE: slice sanity check scripts NOT (yet?) run in sudo' + def check_hooks (self): + print 'NOTE: slice hooks check scripts NOT (yet?) run in sudo' extensions = [ 'py','pl','sh' ] - path='tests/qaapi/qa/tests/slice/' - scripts=utils.locate_sanity_scripts ('sliver '+self.name(), path,extensions) + path='hooks/slice/' + scripts=utils.locate_hooks_scripts ('sliver '+self.name(), path,extensions) overall = True for script in scripts: - if not self.check_sanity_script (script): + if not self.check_hooks_script (script): overall = False return overall - def check_sanity_script (self,local_script): + def check_hooks_script (self,local_script): script_name=os.path.basename(local_script) - utils.header ("SLIVER %s : running sanity check script %s"%(self.name(),script_name)) + utils.header ("SLIVER %s : running hooks check script %s"%(self.name(),script_name)) ssh_handle=self.create_test_ssh() ssh_handle.copy_home(local_script) if ssh_handle.run("./"+script_name) != 0: - utils.header ("WARNING: sanity check script %s FAILED"%script_name) + utils.header ("WARNING: hooks check script %s FAILED"%script_name) print 'temporary : ignoring result and always return true for now' #return False return True else: - utils.header ("SUCCESS: sliver sanity check script %s OK"%script_name) + utils.header ("SUCCESS: sliver hooks check script %s OK"%script_name) return True diff --git a/qaapi/qa/tests/node/AA-README.txt b/system/hooks/node/AA-README.txt similarity index 100% rename from qaapi/qa/tests/node/AA-README.txt rename to system/hooks/node/AA-README.txt diff --git a/qaapi/qa/tests/node/_busyloop.py b/system/hooks/node/_busyloop.py similarity index 100% rename from qaapi/qa/tests/node/_busyloop.py rename to system/hooks/node/_busyloop.py diff --git a/qaapi/qa/tests/node/baseconfig.help b/system/hooks/node/baseconfig.help similarity index 100% rename from qaapi/qa/tests/node/baseconfig.help rename to system/hooks/node/baseconfig.help diff --git a/qaapi/qa/tests/node/node_cpu_sched.py b/system/hooks/node/node_cpu_sched.py similarity index 100% rename from qaapi/qa/tests/node/node_cpu_sched.py rename to system/hooks/node/node_cpu_sched.py diff --git a/qaapi/qa/tests/node/pf2test.help b/system/hooks/node/pf2test.help similarity index 100% rename from qaapi/qa/tests/node/pf2test.help rename to system/hooks/node/pf2test.help diff --git a/qaapi/qa/tests/node/pf2test.pl b/system/hooks/node/pf2test.pl similarity index 100% rename from qaapi/qa/tests/node/pf2test.pl rename to system/hooks/node/pf2test.pl diff --git a/qaapi/qa/tests/node/support/Makefile b/system/hooks/node/support/Makefile similarity index 100% rename from qaapi/qa/tests/node/support/Makefile rename to system/hooks/node/support/Makefile diff --git a/qaapi/qa/tests/node/support/t9.cc b/system/hooks/node/support/t9.cc similarity index 100% rename from qaapi/qa/tests/node/support/t9.cc rename to system/hooks/node/support/t9.cc diff --git a/qaapi/qa/tests/node/support/vsys_conctest.c b/system/hooks/node/support/vsys_conctest.c similarity index 100% rename from qaapi/qa/tests/node/support/vsys_conctest.c rename to system/hooks/node/support/vsys_conctest.c diff --git a/qaapi/qa/tests/node/util-vserver-enabled.help b/system/hooks/node/util-vserver-enabled.help similarity index 100% rename from qaapi/qa/tests/node/util-vserver-enabled.help rename to system/hooks/node/util-vserver-enabled.help diff --git a/qaapi/qa/tests/node/util-vserver-enabled.py b/system/hooks/node/util-vserver-enabled.py similarity index 100% rename from qaapi/qa/tests/node/util-vserver-enabled.py rename to system/hooks/node/util-vserver-enabled.py diff --git a/qaapi/qa/tests/node/vsys_launch.help b/system/hooks/node/vsys_launch.help similarity index 100% rename from qaapi/qa/tests/node/vsys_launch.help rename to system/hooks/node/vsys_launch.help diff --git a/qaapi/qa/tests/node/vsys_launch.pl b/system/hooks/node/vsys_launch.pl similarity index 100% rename from qaapi/qa/tests/node/vsys_launch.pl rename to system/hooks/node/vsys_launch.pl diff --git a/qaapi/qa/tests/slice/AA-README.txt b/system/hooks/slice/AA-README.txt similarity index 100% rename from qaapi/qa/tests/slice/AA-README.txt rename to system/hooks/slice/AA-README.txt diff --git a/qaapi/qa/tests/slice/nmapitest.help b/system/hooks/slice/nmapitest.help similarity index 100% rename from qaapi/qa/tests/slice/nmapitest.help rename to system/hooks/slice/nmapitest.help diff --git a/qaapi/qa/tests/slice/nmapitest.py b/system/hooks/slice/nmapitest.py similarity index 100% rename from qaapi/qa/tests/slice/nmapitest.py rename to system/hooks/slice/nmapitest.py diff --git a/qaapi/qa/tests/slice/ping.help b/system/hooks/slice/ping.help similarity index 100% rename from qaapi/qa/tests/slice/ping.help rename to system/hooks/slice/ping.help diff --git a/qaapi/qa/tests/slice/ping.pl b/system/hooks/slice/ping.pl similarity index 100% rename from qaapi/qa/tests/slice/ping.pl rename to system/hooks/slice/ping.pl diff --git a/qaapi/qa/tests/slice/synacks.help b/system/hooks/slice/synacks.help similarity index 100% rename from qaapi/qa/tests/slice/synacks.help rename to system/hooks/slice/synacks.help diff --git a/qaapi/qa/tests/slice/synacks.pl b/system/hooks/slice/synacks.pl similarity index 100% rename from qaapi/qa/tests/slice/synacks.pl rename to system/hooks/slice/synacks.pl diff --git a/qaapi/qa/tests/slice/traceroutes.pl b/system/hooks/slice/traceroutes.pl similarity index 100% rename from qaapi/qa/tests/slice/traceroutes.pl rename to system/hooks/slice/traceroutes.pl diff --git a/system/utils.py b/system/utils.py index ba1226a..e6700f1 100644 --- a/system/utils.py +++ b/system/utils.py @@ -51,7 +51,7 @@ def match (string, pattern): pattern=pattern.replace("?",".") return re.compile(pattern).match(string) -def locate_sanity_scripts (message,path,extensions): +def locate_hooks_scripts (message,path,extensions): print message,'searching',path,'for extensions',extensions scripts=[] for ext in extensions: