- return [ CompleterTaskNodeSsh (nodename, qemuname, local_key, expected=expected,
- command="ls -d /vservers/%s"%self.name()) \
- for (nodename,qemuname) in node_infos ]
-
- overall=True
- for nodename in self.slice_spec['nodenames']:
- node_spec=self.test_site.locate_node(nodename)
- test_node=TestNode(self.test_plc,self.test_site,node_spec)
- test_node_ssh=test_node.create_test_ssh()
- command="ls /vservers/%s"%self.name()
- full_command = test_node_ssh.actual_command(command)
- retcod=utils.system(full_command,silent=True)
- # we expect the fs to be present, retcod should be 0
- if expected: fine=(retcod==0)
- else: fine=(retcod!=0)
- if not fine: overall=False
- return overall
-
+ 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))
+ return [ CompleterTaskRootfs (nodename, qemuname) for (nodename,qemuname) in node_infos ]