X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=system%2FTestNode.py;h=a32ce67c8d30f72bcf32164a8ab3bd3afa75c565;hb=5abc2125f8a5aeb58783affd6a3b532f02acd216;hp=f990e7161efb9a377f8e2cec3518fe87eed2673d;hpb=21f483d26deba13c83d55b46333e5d904bc70c04;p=tests.git diff --git a/system/TestNode.py b/system/TestNode.py index f990e71..a32ce67 100644 --- a/system/TestNode.py +++ b/system/TestNode.py @@ -209,26 +209,29 @@ class TestNode: TestSsh(self.name()).clear_known_hosts() return True - def check_sanity_node_script (self,local_script): + def create_test_ssh(self): # get the plc's keys for entering the node vservername=self.test_plc.vservername + # assuming we've run testplc.fetch_keys() key = "keys/%(vservername)s.rsa"%locals() + return TestSsh(self.name(), buildname=self.buildname(), key=key) + + def check_sanity (self): + extensions = [ 'py','pl','sh' ] + path='tests/qaapi/qa/tests/node/' + scripts=utils.locate_sanity_scripts ('node '+self.name(), path,extensions) + overall = True + for script in scripts: + if not self.check_sanity_script (script): + overall = False + return overall + + def check_sanity_script (self,local_script): # push the script on the node's root context - ssh_handle = TestSsh(self.name(), - buildname=self.buildname(), - key=key) + ssh_handle=self.create_test_ssh() ssh_handle.copy_home(local_script) if ssh_handle.run("./"+os.path.basename(local_script)) != 0: print "WARNING: sanity check script %s FAILED" # xxx - temporary : always return true for now #return False return True - - def check_sanity_node (self): - # locate the relevant scripts - xxx - scripts = [ 'tests/qaapi/qa/tests/node/vsys_launch.pl' ] - overall = True - for script in scripts: - if not self.check_sanity_node_script (script): - overall = False - return overall