moving former sanity tests into system/hooks + iterating
Thierry Parmentelat [Thu, 14 May 2009 18:46:25 +0000 (18:46 +0000)]
26 files changed:
system/TestNode.py
system/TestPlc.py
system/TestResources.py
system/TestSliver.py
system/hooks/node/AA-README.txt [moved from qaapi/qa/tests/node/AA-README.txt with 100% similarity]
system/hooks/node/_busyloop.py [moved from qaapi/qa/tests/node/_busyloop.py with 100% similarity]
system/hooks/node/baseconfig.help [moved from qaapi/qa/tests/node/baseconfig.help with 100% similarity]
system/hooks/node/node_cpu_sched.py [moved from qaapi/qa/tests/node/node_cpu_sched.py with 100% similarity]
system/hooks/node/pf2test.help [moved from qaapi/qa/tests/node/pf2test.help with 100% similarity]
system/hooks/node/pf2test.pl [moved from qaapi/qa/tests/node/pf2test.pl with 100% similarity]
system/hooks/node/support/Makefile [moved from qaapi/qa/tests/node/support/Makefile with 100% similarity]
system/hooks/node/support/t9.cc [moved from qaapi/qa/tests/node/support/t9.cc with 100% similarity]
system/hooks/node/support/vsys_conctest.c [moved from qaapi/qa/tests/node/support/vsys_conctest.c with 100% similarity]
system/hooks/node/util-vserver-enabled.help [moved from qaapi/qa/tests/node/util-vserver-enabled.help with 100% similarity]
system/hooks/node/util-vserver-enabled.py [moved from qaapi/qa/tests/node/util-vserver-enabled.py with 100% similarity]
system/hooks/node/vsys_launch.help [moved from qaapi/qa/tests/node/vsys_launch.help with 100% similarity]
system/hooks/node/vsys_launch.pl [moved from qaapi/qa/tests/node/vsys_launch.pl with 100% similarity]
system/hooks/slice/AA-README.txt [moved from qaapi/qa/tests/slice/AA-README.txt with 100% similarity]
system/hooks/slice/nmapitest.help [moved from qaapi/qa/tests/slice/nmapitest.help with 100% similarity]
system/hooks/slice/nmapitest.py [moved from qaapi/qa/tests/slice/nmapitest.py with 100% similarity]
system/hooks/slice/ping.help [moved from qaapi/qa/tests/slice/ping.help with 100% similarity]
system/hooks/slice/ping.pl [moved from qaapi/qa/tests/slice/ping.pl with 100% similarity]
system/hooks/slice/synacks.help [moved from qaapi/qa/tests/slice/synacks.help with 100% similarity]
system/hooks/slice/synacks.pl [moved from qaapi/qa/tests/slice/synacks.pl with 100% similarity]
system/hooks/slice/traceroutes.pl [moved from qaapi/qa/tests/slice/traceroutes.pl with 100% similarity]
system/utils.py

index 5615095..8f49945 100644 (file)
@@ -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
 
index bd6b9ae..38f2cc0 100644 (file)
@@ -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):
index 9d95b1f..1dbdc4f 100644 (file)
@@ -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()
index 86491d2..1947fdb 100644 (file)
@@ -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
     
index ba1226a..e6700f1 100644 (file)
@@ -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: