X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=system%2FTestPlc.py;h=b61cce209a735c63fde1a0b6a6954cafe8dc4a87;hb=a9e5d3afadff87fa868bd6c2e6c2dd31ae80f816;hp=f55ee1250bc7ba316eab3af09613a83d31c85e0d;hpb=5148b9f217612f5044034a3f2efd7a69a9a25529;p=tests.git diff --git a/system/TestPlc.py b/system/TestPlc.py index f55ee12..b61cce2 100644 --- a/system/TestPlc.py +++ b/system/TestPlc.py @@ -259,6 +259,7 @@ class TestPlc: self.test_ssh = TestSsh(self.plc_spec['host_box'], self.options.buildname) self.vserverip = plc_spec['vserverip'] self.vservername = plc_spec['vservername'] + self.vplchostname = self.vservername.split('-')[-1] self.url = "https://{}:443/PLCAPI/".format(plc_spec['vserverip']) self.apiserver = TestApiserver(self.url, options.dry_run) (self.ssh_node_boot_timeout, self.ssh_node_boot_silent) = plc_spec['ssh_node_boot_timers'] @@ -306,15 +307,8 @@ class TestPlc: # see e.g. plc_start esp. the version for f14 #command gets run in the plc's vm def host_to_guest(self, command): - vservername = self.vservername - personality = self.options.personality - raw = "{personality} virsh -c lxc:/// lxc-enter-namespace --noseclabel {vservername}".format(**locals()) - # f14 still needs some extra help - if self.options.fcdistro == 'f14': - raw +=" -- /usr/bin/env PATH=/bin:/sbin:/usr/bin:/usr/sbin {command}".format(**locals()) - else: - raw +=" -- /usr/bin/env {command}".format(**locals()) - return raw + ssh_leg = TestSsh(self.vplchostname) + return ssh_leg.actual_command(command) # this /vservers thing is legacy... def vm_root_in_host(self): @@ -528,9 +522,8 @@ class TestPlc: fqdn = "{}.{}".format(self.plc_spec['host_box'], domain) print("export BUILD={}".format(self.options.buildname)) print("export PLCHOSTLXC={}".format(fqdn)) - print("export GUESTNAME={}".format(self.plc_spec['vservername'])) - vplcname = self.plc_spec['vservername'].split('-')[-1] - print("export GUESTHOSTNAME={}.{}".format(vplcname, domain)) + print("export GUESTNAME={}".format(self.vservername)) + print("export GUESTHOSTNAME={}.{}".format(self.vplchostname, domain)) # find hostname of first node hostname, qemubox = self.all_node_infos()[0] print("export KVMHOST={}.{}".format(qemubox, domain)) @@ -897,7 +890,7 @@ class TestPlc: @staticmethod def translate_timestamp(start, grain, timestamp): if timestamp < TestPlc.YEAR: - return start+timestamp*grain + return start + timestamp*grain else: return timestamp @@ -927,7 +920,7 @@ class TestPlc: lease_spec['t_from'] = TestPlc.translate_timestamp(start, grain, lease_spec['t_from']) lease_spec['t_until'] = TestPlc.translate_timestamp(start, grain, lease_spec['t_until']) lease_addition = self.apiserver.AddLeases(self.auth_root(), nodes, lease_spec['slice'], - lease_spec['t_from'],lease_spec['t_until']) + lease_spec['t_from'], lease_spec['t_until']) if lease_addition['errors']: utils.header("Cannot create leases, {}".format(lease_addition['errors'])) ok = False