From d031cc546aa1d7684263790dba21e08d55e5f085 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Tue, 29 Jan 2008 17:08:13 +0000 Subject: [PATCH] use a more sensitive name --- system/TestNode.py | 25 +++++++++++++------------ system/TestPlc.py | 10 +++++----- system/config_onelab.py | 4 ++-- system/config_onelab_qemu.py | 2 +- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/system/TestNode.py b/system/TestNode.py index 16395ac..d95962b 100644 --- a/system/TestNode.py +++ b/system/TestNode.py @@ -60,7 +60,7 @@ class TestNode: auth=self.test_plc.auth_root() self.test_plc.server.DeleteNode(auth,self.name()) - def get_node_status(self,hostname,host_machine): + def get_node_status(self,hostname,host_box): filter=['boot_state'] status=False node_status=self.test_plc.server.GetNodes(self.test_plc.auth_root(),hostname, filter) @@ -74,14 +74,15 @@ class TestNode: def conffile(self,image,hostname,path): model=self.node_spec['node_fields']['model'] - host_machine=self.node_spec['node_fields']['host_machine'] if model.find("vmware") >= 0: + host_box=self.node_spec['node_fields']['host_box'] template='%s/template-vmplayer/node.vmx'%(path) actual='%s/vmplayer-%s/node.vmx'%(path,hostname) sed_command="sed -e s,@BOOTCD@,%s,g %s > %s"%(image,template,actual) utils.header('Creating %s from %s'%(actual,template)) utils.system(sed_command) elif model.find("qemu") >= 0: + host_box=self.node_spec['node_fields']['host_box'] mac=self.node_spec['network_fields']['mac'] dest_dir="qemu-%s"%(hostname) utils.header('Storing the mac address for node %s'%hostname) @@ -89,12 +90,12 @@ class TestNode: file.write('%s\n'%mac) file.write(dest_dir) file.close() - utils.header ('Transfert of configuration files for node %s into %s '%(hostname,host_machine)) - cleandir_command="ssh root@%s rm -rf %s"%(host_machine, dest_dir) - createdir_command = "ssh root@%s mkdir -p %s"%(host_machine, dest_dir) + utils.header ('Transfert of configuration files for node %s into %s '%(hostname,host_box)) + cleandir_command="ssh root@%s rm -rf %s"%(host_box, dest_dir) + createdir_command = "ssh root@%s mkdir -p %s"%(host_box, dest_dir) utils.system(cleandir_command) utils.system(createdir_command) - scp_command = "scp -r %s/qemu-%s/* root@%s:/root/%s"%(path,hostname,host_machine,dest_dir) + scp_command = "scp -r %s/qemu-%s/* root@%s:/root/%s"%(path,hostname,host_box,dest_dir) utils.system(scp_command) def create_boot_cd(self,path): @@ -152,16 +153,16 @@ class TestNode: utils.system('cd %s/vmplayer-%s ; DISPLAY=%s vmplayer node.vmx < /dev/null >/dev/null 2>/dev/null &'%(path,hostname,display)) def start_qemu (self, options): - host_machine=self.node_spec['node_fields']['host_machine'] + host_box=self.node_spec['node_fields']['host_box'] hostname=self.node_spec['node_fields']['hostname'] path=options.path display=options.display dest_dir="qemu-%s"%(hostname) utils.header('Starting qemu for node %s '%(hostname)) - utils.system("ssh root@%s ~/%s/env-qemu start "%(host_machine, dest_dir )) - utils.system("ssh root@%s DISPLAY=%s ~/%s/start-qemu-node %s & "%( host_machine, display, dest_dir, dest_dir)) + utils.system("ssh root@%s ~/%s/env-qemu start "%(host_box, dest_dir )) + utils.system("ssh root@%s DISPLAY=%s ~/%s/start-qemu-node %s & "%( host_box, display, dest_dir, dest_dir)) - def stop_qemu(self,host_machine, hostname): + def stop_qemu(self,host_box, hostname): utils.header('Stoping qemu emulation of %s on the host machine %s and Restoring the initial network' - %(hostname,host_machine)) - utils.system("ssh root@%s ~/qemu-%s/env-qemu stop "%(host_machine, hostname )) + %(hostname,host_box)) + utils.system("ssh root@%s ~/qemu-%s/env-qemu stop "%(host_box, hostname )) diff --git a/system/TestPlc.py b/system/TestPlc.py index 5437699..8244d4c 100644 --- a/system/TestPlc.py +++ b/system/TestPlc.py @@ -105,12 +105,12 @@ class TestPlc: for node_spec in site_spec['nodes']: test_node=TestNode (self,test_site,node_spec) model=node_spec['node_fields']['model'] - host_machine=node_spec['node_fields']['host_machine'] + host_box=node_spec['node_fields']['host_box'] hostname=node_spec['node_fields']['hostname'] print model if model.find("qemu") >= 0: - utils.system('ssh root@%s killall qemu'%host_machine) - test_node.stop_qemu(host_machine,hostname) + utils.system('ssh root@%s killall qemu'%host_box) + test_node.stop_qemu(host_box,hostname) #################### step methods @@ -319,8 +319,8 @@ class TestPlc: hostname=node_spec['node_fields']['hostname'] if (hostname in notfullybooted_nodes): #to avoid requesting already booted node test_node=TestNode (self,test_site,node_spec) - host_machine=node_spec['node_fields']['host_machine'] - node_status=test_node.get_node_status(hostname,host_machine) + host_box=node_spec['node_fields']['host_box'] + node_status=test_node.get_node_status(hostname,host_box) if (node_status): booted_nodes.append(hostname) del notfullybooted_nodes[notfullybooted_nodes.index(hostname)] diff --git a/system/config_onelab.py b/system/config_onelab.py index 4769ff7..bf32fc2 100644 --- a/system/config_onelab.py +++ b/system/config_onelab.py @@ -11,7 +11,7 @@ onelab="one-lab.org" def nodes(): nodes= [ {'node_fields': {'hostname': 'test1.one-lab.org', 'model':'vmware/minhw', - 'host_machine' : 'localhost'}, + 'host_box' : 'localhost'}, 'owner' : 'pi', 'network_fields': { 'method':'static', 'type':'ipv4', @@ -25,7 +25,7 @@ def nodes(): }, { 'node_fields': {'hostname':'test2.one-lab.org', 'model':'vmware/minhw', - 'host_machine': 'localhost'}, + 'host_box': 'localhost'}, 'owner' : 'tech', 'network_fields': {'method':'static', 'type':'ipv4', diff --git a/system/config_onelab_qemu.py b/system/config_onelab_qemu.py index d84ab2e..1f2039d 100644 --- a/system/config_onelab_qemu.py +++ b/system/config_onelab_qemu.py @@ -11,7 +11,7 @@ onelab="one-lab.org" def nodes(): nodes= [ {'node_fields': {'hostname': 'lysithea.inria.fr', 'model':'qemu/minhw', - 'host_machine': 'bellami.inria.fr'}, + 'host_box': 'bellami.inria.fr'}, 'owner' : 'pi', 'network_fields': { 'method':'static', 'type':'ipv4', -- 2.43.0