+ overall = True
+
+ # first wait for the network to be up and ready from the slices
+ class CompleterTaskNetworkReadyInSliver(CompleterTask):
+ def __init__(self, test_sliver):
+ self.test_sliver = test_sliver
+ def actual_run(self):
+ return self.test_sliver.check_tcp_ready(port=9999)
+ def message(self):
+ return "network ready checker for %s" % self.test_sliver.name()
+ def failure_epilogue(self):
+ print "could not bind port from sliver %s" % self.test_sliver.name()
+
+ tasks = []
+ for spec in specs:
+ # locate the TestSliver instances involved, and cache them in the spec instance
+ spec['s_sliver'] = self.locate_sliver_obj_cross (spec['server_node'], spec['server_slice'], other_plcs)
+ spec['c_sliver'] = self.locate_sliver_obj_cross (spec['client_node'], spec['client_slice'], other_plcs)
+ message = "Will check TCP between s=%s and c=%s" % \
+ (spec['s_sliver'].name(), spec['c_sliver'].name())
+ if 'client_connect' in spec:
+ message += " (using %s)" % spec['client_connect']
+ utils.header(message)
+ tasks.append(CompleterTaskNetworkReadyInSliver (spec['s_sliver']))
+
+ # wait for the netork to be OK in all server sides
+ if not Completer(tasks, message='check for network readiness in slivers').\
+ run(timedelta(seconds=30), timedelta(seconds=24), period=timedelta(seconds=5)):
+ return False
+
+ # run server and client