- def slice_fs_present (self, options):
- "check that /vservers/<slicename> can be found"
- return self.check_rootfs (expected=True)
- def slice_fs_deleted (self, options):
- "check that /vservers/<slicename> has been properly wiped off on all nodes"
- return self.check_rootfs (expected=False)
+ def check_rootfs_tasks (self, options, expected):
+ # use constant admin key
+ local_key = "keys/key_admin.rsa"
+ node_infos = self.test_plc.all_node_infos()
+ rootfs="/vservers/{}".format(self.name())
+ class CompleterTaskRootfs (CompleterTaskNodeSsh):
+ def __init__ (self, nodename, qemuname):
+ CompleterTaskNodeSsh.__init__(self, nodename, qemuname, local_key, expected=expected,
+ command="ls -d {}".format(rootfs))
+ def failure_epilogue (self):
+ if expected:
+ print("Could not stat {} - was expected to be present".format(rootfs))
+ else:
+ print("Sliver rootfs {} still present - this is unexpected".format(rootfs))
+ utils.system(self.test_ssh.actual_command("ls -l {rootfs}; du -hs {rootfs}".format(**locals()),
+ dry_run=self.dry_run, timeout=20))
+ return [ CompleterTaskRootfs (nodename, qemuname) for (nodename,qemuname) in node_infos ]