X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=system%2FTestNode.py;h=686a38d3970382d64e01e9c4bdfb5eb6b02f4d72;hb=7fbe1127baeeb1b5b5f8d790dd8b439d3abf5248;hp=8f8954c2edca14695c054b53c197a489da74140b;hpb=2624e33e465ca06a3de1ce53c0abbfd008512be5;p=tests.git diff --git a/system/TestNode.py b/system/TestNode.py index 8f8954c..686a38d 100644 --- a/system/TestNode.py +++ b/system/TestNode.py @@ -182,9 +182,9 @@ class TestNode: print("Dry_run: skipped writing of iso image") return True else: - # with python3 we need to call decodestring here + # with python3 we need to call decodebytes here with open(filename,'wb') as storage: - storage.write(base64.decodestring(bencoded)) + storage.write(base64.decodebytes(bencoded)) return True def nodestate_reinstall(self): @@ -237,7 +237,7 @@ class TestNode: self.test_plc.apiserver.SetNodePldistro(self.test_plc.auth_root(), self.name(), pldistro) return True - def nodeflavour_show(self): + def nodedistro_show(self): "display the fcdistro tag - or flavour actually - of node" if self.dry_run(): print("Dry_run: would fetch node flavour") @@ -247,25 +247,6 @@ class TestNode: print("Flavour for {} : {}".format(self.name(), flavour)) return True - def nodeplain_set(self, plain): - " set bootstrapfs-plain tag on nodes" - self.test_plc.apiserver.SetNodePlainBootstrapfs(self.test_plc.auth_root(), - self.name(), plain) - return True - def nodeplain_on(self): - return self.nodeplain_set("True") - def nodeplain_off(self): - return self.nodeplain_set("") - def nodeplain_show(self): - "display bootstrapfs-plain tag" - if self.dry_run(): - print("Dry_run: would fetch node plain-bootstrapfs tag") - return True - plain = self.test_plc.apiserver.GetNodePlainBootstrapfs(self.test_plc.auth_root(), - self.name()) - print("Plain bootstrapfs for {} is {}".format(self.name(), plain)) - return True - def qemu_local_config(self): "all nodes: compute qemu config qemu.conf and store it locally" if not self.is_qemu(): @@ -307,6 +288,13 @@ class TestNode: .format(self.name(), self.host_box())) return self.test_box().copy(self.nodedir(), recursive=True, dry_run=dry_run) == 0 + def qemu_cleanlog(self): + "rename log.txt into log.txt.bak in the qemu dir" + test_box = self.test_box() + test_box.run_in_buildname("cd {}; mv -f log.txt log.txt.bak". + format(self.nodedir()), dry_run=self.dry_run()) + return True + def qemu_start(self): "all nodes: start the qemu instance (also runs qemu-bridge-init start)" model = self.node_spec['node_fields']['model'] @@ -422,7 +410,7 @@ class TestNode: test_ssh = self.create_test_ssh() if self.has_libvirt(): utils.header("Checking system slice {} using virsh".format(slicename)) - return test_ssh.run("virsh --connect lxc:// list | grep -q ' {} '".format(vservername), + return test_ssh.run("virsh --connect lxc:/// list | grep -q ' {} '".format(vservername), dry_run = dry_run) == 0 else: retcod, output = \