self.peer_proto_impl.shutdown()
self.peer_proto_impl = None
+ def async_launch_wait(self):
+ if self.peer_proto_impl:
+ self.peer_proto_impl.async_launch_wait()
+
def sync_trace(self, local_dir, whichtrace):
if self.peer_proto_impl:
return self.peer_proto_impl.sync_trace(local_dir, whichtrace)
# Second-phase setup
element.setup()
+def wait_tuniface(testbed_instance, guid):
+ element = testbed_instance._elements[guid]
+
+ # Second-phase setup
+ element.async_launch_wait()
+
def configure_node(testbed_instance, guid):
node = testbed_instance._elements[guid]
"create_function": create_tuniface,
"preconfigure_function": preconfigure_tuniface,
"configure_function": postconfigure_tuniface,
+ "start_function": wait_tuniface,
"box_attributes": [
"up", "device_name", "mtu", "snat",
"txqueuelen",
"create_function": create_tapiface,
"preconfigure_function": preconfigure_tuniface,
"configure_function": postconfigure_tuniface,
+ "start_function": wait_tuniface,
"box_attributes": [
"up", "device_name", "mtu", "snat",
"txqueuelen",
import time
import base64
+import time
+print >>sys.stderr, time.time()
+
tun_name = 'tun0'
tun_path = '/dev/net/tun'
hostaddr = socket.gethostbyname(socket.gethostname())
sock.connect(options.pass_fd)
except socket.error:
# wait a while, retry
+ print >>sys.stderr, "Could not connect. Retrying in a sec..."
time.sleep(1)
sock.connect(options.pass_fd)
passfd.sendfd(sock, tun.fileno(), '0')
while True:
time.sleep(1)
remote = None
+
+ import time
+ print >>sys.stderr, time.time()
+
elif options.udp:
# connect to remote endpoint
if remaining_args and not remaining_args[0].startswith('-'):
if peer and peer.peer_proto_impl:
peer.peer_proto_impl.async_launch_wait()
- self.launch('tcp', False)
+ if not self._started:
+ self.launch('tcp', False)
else:
# make sure WE are ready
self.async_launch_wait()
comp_result = r"""PING .* \(.*\) \d*\(\d*\) bytes of data.
--- .* ping statistics ---
-1 packets transmitted, 1 received, 0% packet loss, time \d*ms.*
+10 packets transmitted, 10 received, 0% packet loss, time \d*ms.*
"""
xml = exp.to_xml()