+ test_ssh = self.test_node.create_test_ssh()
+ dir_to_tar = "/vservers/{}/var/log".format(self.test_slice.name())
+ return test_ssh.actual_command("tar -C {} -cf - .".format(dir_to_tar))
+
+ def check_hooks (self):
+ print('NOTE: slice hooks check scripts NOT (yet?) run in sudo')
+ extensions = [ 'py','pl','sh' ]
+ path = 'hooks/slice/'
+ scripts = utils.locate_hooks_scripts ('sliver '+self.name(), path,extensions)
+ overall = True
+ for script in scripts:
+ if not self.check_hooks_script (script):
+ overall = False
+ return overall
+
+ def check_hooks_script (self,local_script):
+ script_name = os.path.basename(local_script)
+ utils.header ("SLIVER hook {} ({})".format(script_name, self.name()))
+ test_ssh = self.create_test_ssh()
+ test_ssh.copy_home(local_script)
+ if test_ssh.run("./"+script_name) != 0:
+ utils.header ("WARNING: hooks check script {} FAILED (ignored)".format(script_name))
+ #return False
+ return True
+ else:
+ utils.header ("SUCCESS: sliver hook {} OK".format(script_name))
+ return True