X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=system%2FTestNode.py;h=f990e7161efb9a377f8e2cec3518fe87eed2673d;hb=ebcbcb01d4bf1085500bf53d1fe962ac9d273912;hp=7cc360231ea0ec741b786ffdb5fd67937c2c5eff;hpb=d68e56ef2a918d14a68d6d25915a2c1edbacf15a;p=tests.git diff --git a/system/TestNode.py b/system/TestNode.py index 7cc3602..f990e71 100644 --- a/system/TestNode.py +++ b/system/TestNode.py @@ -1,4 +1,4 @@ -import os, sys, time, base64 +import sys, os, os.path, time, base64 import xmlrpclib import utils @@ -208,3 +208,27 @@ class TestNode: def clear_known_hosts (self): TestSsh(self.name()).clear_known_hosts() return True + + def check_sanity_node_script (self,local_script): + # get the plc's keys for entering the node + vservername=self.test_plc.vservername + key = "keys/%(vservername)s.rsa"%locals() + # push the script on the node's root context + ssh_handle = TestSsh(self.name(), + buildname=self.buildname(), + key=key) + 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