From: Thierry Parmentelat Date: Tue, 27 May 2008 09:45:27 +0000 (+0000) Subject: new step for (re)starting the vserver when needed X-Git-Tag: tests-4.3-0~175 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=7c52d86611e6469ee804d9dd6a788f3423c4c8f0;p=tests.git new step for (re)starting the vserver when needed --- diff --git a/system/TestApiserver.py b/system/TestApiserver.py index 5459abf..006c990 100644 --- a/system/TestApiserver.py +++ b/system/TestApiserver.py @@ -15,7 +15,7 @@ server_methods = [ ('GetNodes' , []), ('GetBootMedium' , True), ('GetNodeGroups' , True), ('AddNodeGroup' , True), - ('GetNodeTagTypes' , True), + ('GetNodeTagTypes' , []), ('AddNodeTagType', True), ('AddNodeTag', True), ('GetNodeTags', True), diff --git a/system/TestPlc.py b/system/TestPlc.py index efb7776..d1f2320 100644 --- a/system/TestPlc.py +++ b/system/TestPlc.py @@ -71,7 +71,7 @@ class TestPlc: 'nodes_booted', 'nodes_ssh', 'check_slice', 'check_initscripts', 'check_tcp',SEP, 'force_gather_logs', 'force_kill_qemus', 'force_record_tracker','force_free_tracker' ] - other_steps = [ 'stop_all_vservers','fresh_install', 'cache_rpm', 'stop', SEP, + other_steps = [ 'stop_all_vservers','fresh_install', 'cache_rpm', 'stop', 'vs_start', SEP, 'clean_initscripts', 'clean_sites', 'clean_nodes', 'clean_slices', 'clean_keys', SEP, 'show_boxes', 'list_all_qemus', 'list_qemus', SEP, @@ -117,6 +117,9 @@ class TestPlc: def actual_command_in_guest (self,command): return self.test_ssh.actual_command(self.host_to_guest(command)) + def start_guest (self): + return utils.system(self.test_ssh.actual_command(self.start_guest_in_host())) + def run_in_guest (self,command): return utils.system(self.actual_command_in_guest(command)) @@ -127,6 +130,10 @@ class TestPlc: def host_to_guest(self,command): return "vserver %s exec %s"%(self.vservername,command) + #command gets run in the vserver + def start_guest_in_host(self): + return "vserver %s start"%(self.vservername) + # xxx quick n dirty def run_in_guest_piped (self,local,remote): return utils.system(local+" | "+self.test_ssh.actual_command(self.host_to_guest(remote),keep_stdin=True)) @@ -344,11 +351,15 @@ class TestPlc: def start(self): self.run_in_guest('service plc start') return True - + def stop(self): self.run_in_guest('service plc stop') return True + def vs_start (self): + self.start_guest() + return True + # could use a TestKey class def store_keys(self): for key_spec in self.plc_spec['keys']: