2 # -*- coding: utf-8 -*-
5 from nepi.util.constants import ApplicationStatus as AS
6 from nepi.testbeds import planetlab
16 class PlanetLabExecuteTestCase(unittest.TestCase):
17 testbed_id = "planetlab"
18 slicename = "inria_nepi"
19 plchost = "nepiplc.pl.sophia.inria.fr"
21 host1 = "nepi1.pl.sophia.inria.fr"
22 host2 = "nepi2.pl.sophia.inria.fr"
24 port_base = 2000 + (os.getpid() % 1000) * 13
26 PLR50_PY = os.path.join(
27 os.path.dirname(planetlab.__file__),
30 PLR50_C = os.path.join(
31 os.path.dirname(planetlab.__file__),
34 TOS_PY = os.path.join(
35 os.path.dirname(planetlab.__file__),
38 CLS_PY = os.path.join(
39 os.path.dirname(planetlab.__file__),
44 self.root_dir = tempfile.mkdtemp()
45 self.__class__.port_base = self.port_base + 100
49 shutil.rmtree(self.root_dir)
53 shutil.rmtree(self.root_dir)
55 def make_instance(self):
56 testbed_id = self.testbed_id
57 slicename = self.slicename
58 plchost = self.plchost
60 instance = planetlab.TestbedController()
61 pl_ssh_key = os.environ.get(
63 "%s/.ssh/id_rsa_planetlab" % (os.environ['HOME'],) )
64 slicename = os.environ.get(
67 pl_user, pl_pwd = test_util.pl_auth()
69 instance.defer_configure("homeDirectory", self.root_dir)
70 instance.defer_configure("slice", slicename)
71 instance.defer_configure("sliceSSHKey", pl_ssh_key)
72 instance.defer_configure("authUser", pl_user)
73 instance.defer_configure("authPass", pl_pwd)
74 instance.defer_configure("plcHost", plchost)
75 instance.defer_configure("tapPortBase", self.port_base)
76 instance.defer_configure("p2pDeployment", False) # it's interactive, we don't want it in tests
77 instance.defer_configure("cleanProc", True)
79 # Hack, but we need vsys_vnet
81 vnet = instance.vsys_vnet
82 self.net_prefix = vnet.rsplit('.',1)[0]
86 @test_util.skipUnless(test_util.pl_auth() is not None, "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)")
87 def test_simple(self):
88 instance = self.make_instance()
90 instance.defer_create(2, "Node")
91 instance.defer_create_set(2, "hostname", self.host1)
92 instance.defer_create(3, "Node")
93 instance.defer_create_set(3, "hostname", self.host2)
94 instance.defer_create(4, "NodeInterface")
95 instance.defer_connect(2, "devs", 4, "node")
96 instance.defer_create(5, "NodeInterface")
97 instance.defer_connect(3, "devs", 5, "node")
98 instance.defer_create(6, "Internet")
99 instance.defer_connect(4, "inet", 6, "devs")
100 instance.defer_connect(5, "inet", 6, "devs")
101 instance.defer_create(7, "Application")
102 instance.defer_create_set(7, "command", "ping -qc1 {#[GUID-5].addr[0].[Address]#}")
103 instance.defer_add_trace(7, "stdout")
104 instance.defer_add_trace(7, "stderr")
105 instance.defer_connect(7, "node", 2, "apps")
107 comp_result = r"""PING .* \(.*\) \d*\(\d*\) bytes of data.
109 --- .* ping statistics ---
110 1 packets transmitted, 1 received, 0% packet loss, time \d*ms.*
116 instance.do_connect_init()
117 instance.do_connect_compl()
118 instance.do_preconfigure()
120 # Manually replace netref
121 instance.set(7, "command",
122 instance.get(7, "command")
123 .replace("{#[GUID-5].addr[0].[Address]#}",
124 instance.get_address(5, 0, "Address") )
127 instance.do_configure()
129 instance.do_prestart()
131 while instance.status(7) != AS.STATUS_FINISHED:
133 ping_result = instance.trace(7, "stdout") or ""
141 # asserts at the end, to make sure there's proper cleanup
142 self.assertTrue(re.match(comp_result, ping_result, re.MULTILINE),
143 "Unexpected trace:\n" + ping_result)
145 @test_util.skipUnless(test_util.pl_auth() is not None, "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)")
146 def test_depends(self):
147 instance = self.make_instance()
149 instance.defer_create(2, "Node")
150 instance.defer_create_set(2, "hostname", self.host1)
151 instance.defer_create(3, "NodeInterface")
152 instance.defer_connect(2, "devs", 3, "node")
153 instance.defer_create(4, "Internet")
154 instance.defer_connect(3, "inet", 4, "devs")
155 instance.defer_create(5, "Application")
156 instance.defer_create_set(5, "command", "gfortran --version")
157 instance.defer_create_set(5, "depends", "gcc-gfortran")
158 instance.defer_add_trace(5, "stdout")
159 instance.defer_add_trace(5, "stderr")
160 instance.defer_connect(5, "node", 2, "apps")
165 instance.do_connect_init()
166 instance.do_connect_compl()
167 instance.do_preconfigure()
168 instance.do_configure()
170 instance.do_prestart()
172 while instance.status(5) != AS.STATUS_FINISHED:
174 ping_result = instance.trace(5, "stdout") or ""
175 comp_result = r".*GNU Fortran \(GCC\).*"
183 # asserts at the end, to make sure there's proper cleanup
184 self.assertTrue(re.match(comp_result, ping_result, re.MULTILINE),
185 "Unexpected trace:\n" + ping_result)
187 @test_util.skipUnless(test_util.pl_auth() is not None, "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)")
188 def test_build(self):
189 instance = self.make_instance()
191 instance.defer_create(2, "Node")
192 instance.defer_create_set(2, "hostname", self.host1)
193 instance.defer_create(3, "NodeInterface")
194 instance.defer_connect(2, "devs", 3, "node")
195 instance.defer_create(4, "Internet")
196 instance.defer_connect(3, "inet", 4, "devs")
197 instance.defer_create(10, "Application")
198 instance.defer_create_set(10, "command", "./consts")
199 instance.defer_create_set(10, "buildDepends", "gcc")
200 instance.defer_create_set(10, "build", "gcc ${SOURCES}/consts.c -o consts")
201 instance.defer_create_set(10, "install", "cp consts ${SOURCES}/consts")
202 instance.defer_create_set(10, "sources", os.path.join(os.path.dirname(planetlab.__file__),'scripts','consts.c'))
203 instance.defer_add_trace(10, "stdout")
204 instance.defer_add_trace(10, "stderr")
205 instance.defer_connect(10, "node", 2, "apps")
208 r""".*ETH_P_ALL = 0x[0-9a-fA-F]{8}
209 ETH_P_IP = 0x[0-9a-fA-F]{8}
210 TUNGETIFF = 0x[0-9a-fA-F]{8}
211 TUNSETIFF = 0x[0-9a-fA-F]{8}
212 IFF_NO_PI = 0x[0-9a-fA-F]{8}
213 IFF_TAP = 0x[0-9a-fA-F]{8}
214 IFF_TUN = 0x[0-9a-fA-F]{8}
215 IFF_VNET_HDR = 0x[0-9a-fA-F]{8}
216 TUN_PKT_STRIP = 0x[0-9a-fA-F]{8}
217 IFHWADDRLEN = 0x[0-9a-fA-F]{8}
218 IFNAMSIZ = 0x[0-9a-fA-F]{8}
219 IFREQ_SZ = 0x[0-9a-fA-F]{8}
220 FIONREAD = 0x[0-9a-fA-F]{8}.*
226 instance.do_connect_init()
227 instance.do_connect_compl()
228 instance.do_preconfigure()
229 instance.do_configure()
231 instance.do_prestart()
233 while instance.status(10) != AS.STATUS_FINISHED:
235 ping_result = instance.trace(10, "stdout") or ""
243 # asserts at the end, to make sure there's proper cleanup
244 self.assertTrue(re.match(comp_result, ping_result, re.MULTILINE),
245 "Unexpected trace:\n" + ping_result)
247 @test_util.skipUnless(test_util.pl_auth() is not None, "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)")
248 def test_simple_vsys(self):
249 instance = self.make_instance()
251 instance.defer_create(2, "Node")
252 instance.defer_create_set(2, "hostname", self.host1)
253 instance.defer_create(3, "NodeInterface")
254 instance.defer_connect(2, "devs", 3, "node")
255 instance.defer_create(4, "Internet")
256 instance.defer_connect(3, "inet", 4, "devs")
257 instance.defer_create(5, "TunInterface")
258 instance.defer_add_address(5, self.net_prefix+".2", 24, False)
259 instance.defer_connect(2, "devs", 5, "node")
260 instance.defer_create(6, "Application")
261 instance.defer_create_set(6, "command", """
263 netconfig help > /dev/null
264 test -e /vsys/vif_up.in > /dev/null
265 test -e /vsys/vif_up.out > /dev/null
266 test -e /vsys/fd_tuntap.control > /dev/null
269 instance.defer_create_set(6, "sudo", True) # only sudo has access to /vsys
270 instance.defer_add_trace(6, "stdout")
271 instance.defer_add_trace(6, "stderr")
272 instance.defer_connect(6, "node", 2, "apps")
277 instance.do_connect_init()
278 instance.do_connect_compl()
279 instance.do_preconfigure()
280 instance.do_configure()
282 instance.do_prestart()
284 while instance.status(6) != AS.STATUS_FINISHED:
286 test_result = (instance.trace(6, "stdout") or "").strip()
287 comp_result = "OKIDOKI"
295 # asserts at the end, to make sure there's proper cleanup
296 self.assertEqual(comp_result, test_result)
298 @test_util.skipUnless(test_util.pl_auth() is not None, "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)")
299 def test_emulation(self):
300 instance = self.make_instance()
302 instance.defer_create(2, "Node")
303 instance.defer_create_set(2, "hostname", self.host1)
304 instance.defer_create(3, "NodeInterface")
305 instance.defer_connect(2, "devs", 3, "node")
306 instance.defer_create(4, "Internet")
307 instance.defer_connect(3, "inet", 4, "devs")
308 instance.defer_create(7, "NetPipe")
309 instance.defer_create_set(7, "mode", "CLIENT")
310 instance.defer_create_set(7, "portList", "80")
311 instance.defer_create_set(7, "bwOut", 12.0/1024.0) # 12kbps
312 instance.defer_create_set(7, "bwIn", 64.0/1024.0) # 64kbps
313 instance.defer_create_set(7, "plrOut", 0.01) # 1% plr outbound - high loss
314 instance.defer_create_set(7, "plrIn", 0.001) # 0.1% plr inbound - regular loss
315 instance.defer_create_set(7, "delayOut", int(1500 * 8 / (12.0/1024.0) / 1000)) # tx delay at 12kbps in ms
316 instance.defer_create_set(7, "delayIn", int(1500 * 8 / (64.0/1024.0) / 1000)) # rx delay at 64kbps in ms
317 instance.defer_add_trace(7, "netpipeStats")
318 instance.defer_connect(2, "pipes", 7, "node")
319 instance.defer_create(8, "Application")
320 instance.defer_create_set(8, "command", "time wget -q -O /dev/null http://www.google.com/") # Fetch ~10kb
321 instance.defer_add_trace(8, "stdout")
322 instance.defer_add_trace(8, "stderr")
323 instance.defer_connect(8, "node", 2, "apps")
328 instance.do_connect_init()
329 instance.do_connect_compl()
330 instance.do_preconfigure()
331 instance.do_configure()
333 instance.do_prestart()
335 while instance.status(8) != AS.STATUS_FINISHED:
337 test_result = (instance.trace(8, "stderr") or "").strip()
338 comp_result = r".*real\s*(?P<min>[0-9]+)m(?P<sec>[0-9]+[.][0-9]+)s.*"
339 netpipe_stats = instance.trace(7, "netpipeStats")
348 # asserts at the end, to make sure there's proper cleanup
349 match = re.match(comp_result, test_result, re.MULTILINE)
350 self.assertTrue(match, "Unexpected output: %s" % (test_result,))
352 minutes = int(match.group("min"))
353 seconds = float(match.group("sec"))
354 self.assertTrue((minutes * 60 + seconds) > 1.0, "Emulation not effective: %s" % (test_result,))
356 self.assertTrue(netpipe_stats, "Unavailable netpipe stats")
358 @test_util.skipUnless(test_util.pl_auth() is not None, "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)")
359 def _pingtest(self, TunClass, ConnectionProto, Cipher, Filter1=None, Filter2=None, Filter1args=None, Filter2args=None, PLREX=None, flood=False):
360 instance = self.make_instance()
362 instance.defer_create(2, "Node")
363 instance.defer_create_set(2, "hostname", self.host1)
364 instance.defer_create(3, "Node")
365 instance.defer_create_set(3, "hostname", self.host2)
366 instance.defer_create(4, "NodeInterface")
367 instance.defer_connect(2, "devs", 4, "node")
368 instance.defer_create(5, "Internet")
369 instance.defer_connect(4, "inet", 5, "devs")
370 instance.defer_create(6, "NodeInterface")
371 instance.defer_connect(3, "devs", 6, "node")
372 instance.defer_connect(6, "inet", 5, "devs")
373 instance.defer_create(7, TunClass)
374 instance.defer_create_set(7, "tun_cipher", Cipher)
375 instance.defer_add_trace(7, "packets")
376 instance.defer_add_address(7, self.net_prefix+".2", 24, False)
378 instance.defer_create_set(7, "bwlimit", 128)
379 instance.defer_connect(2, "devs", 7, "node")
380 instance.defer_create(8, TunClass)
381 instance.defer_create_set(8, "tun_cipher", Cipher)
382 instance.defer_add_trace(8, "packets")
383 instance.defer_add_address(8, self.net_prefix+".3", 24, False)
384 instance.defer_connect(3, "devs", 8, "node")
385 instance.defer_create(9, "Application")
387 instance.defer_create_set(9, "command", "sudo -S ping -s 1000 -l 1000 -qfc1000 {#[GUID-8].addr[0].[Address]#} ; sleep 20 ; ping -qc10 {#[GUID-8].addr[0].[Address]#}")
389 instance.defer_create_set(9, "command", "ping -qc10 {#[GUID-8].addr[0].[Address]#}")
390 instance.defer_add_trace(9, "stdout")
391 instance.defer_add_trace(9, "stderr")
392 instance.defer_connect(9, "node", 2, "apps")
395 instance.defer_create(10, "TunFilter")
396 instance.defer_create_set(10, "module", Filter1)
398 instance.defer_create_set(10, "args", Filter1args)
399 instance.defer_connect(7, "fd->", 10, "->fd")
402 instance.defer_create(11, "TunFilter")
403 instance.defer_create_set(11, "module", Filter2)
405 instance.defer_create_set(11, "args", Filter2args)
406 instance.defer_connect(8, "fd->", 11, "->fd")
409 if Filter1 and Filter2:
411 elif Filter1 or Filter2:
418 instance.defer_connect(
419 (10 if Filter1 else 7), ConnectionProto,
420 (11 if Filter2 else 8), ConnectionProto)
422 comp_result = r"""PING .* \(.*\) \d*\(\d*\) bytes of data.
424 --- .* ping statistics ---
425 10 packets transmitted, [0-9]+ received,.* %s%% packet loss, time \d*ms.*
428 comp_result = ".*" + comp_result
433 instance.do_connect_init()
434 instance.do_connect_compl()
435 instance.do_preconfigure()
437 # Manually replace netref
438 instance.set(9, "command",
439 instance.get(9, "command")
440 .replace("{#[GUID-8].addr[0].[Address]#}",
441 instance.get_address(8, 0, "Address") )
444 instance.do_configure()
446 instance.do_prestart()
448 while instance.status(9) != AS.STATUS_FINISHED:
450 ping_result = instance.trace(9, "stdout") or ""
451 packets1 = instance.trace(7, "packets") or ""
452 packets2 = instance.trace(8, "packets") or ""
460 # asserts at the end, to make sure there's proper cleanup
461 self.assertTrue(re.match(comp_result, ping_result, re.MULTILINE|re.DOTALL),
462 "Unexpected trace:\n%s\nPackets @ source:\n%s\nPackets @ target:\n%s" % (
467 @test_util.skipUnless(test_util.pl_auth() is not None, "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)")
468 def test_tun_ping(self):
469 self._pingtest("TunInterface", "tcp", "AES")
471 @test_util.skipUnless(test_util.pl_auth() is not None, "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)")
472 def test_tun_ping_udp(self):
473 self._pingtest("TunInterface", "udp", "AES")
475 @test_util.skipUnless(test_util.pl_auth() is not None, "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)")
476 def test_tun_ping_gre(self):
477 self._pingtest("TunInterface", "gre", "PLAIN")
479 @test_util.skipUnless(test_util.pl_auth() is not None, "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)")
480 def test_tun_ping_flood(self):
481 self._pingtest("TunInterface", "tcp", "PLAIN", flood = True)
483 @test_util.skipUnless(test_util.pl_auth() is not None, "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)")
484 def test_tun_ping_flood_udp(self):
485 self._pingtest("TunInterface", "udp", "PLAIN", flood = True)
487 @test_util.skipUnless(test_util.pl_auth() is not None, "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)")
488 def test_tap_ping(self):
489 self._pingtest("TapInterface", "tcp", "AES")
491 @test_util.skipUnless(test_util.pl_auth() is not None, "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)")
492 def test_tap_ping_udp(self):
493 self._pingtest("TapInterface", "udp", "AES")
495 @test_util.skipUnless(test_util.pl_auth() is not None, "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)")
496 def test_tap_ping_gre(self):
497 self._pingtest("TapInterface", "gre", "PLAIN")
499 @test_util.skipUnless(test_util.pl_auth() is not None, "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)")
500 def test_tap_ping_udp_loss1_py(self):
501 self._pingtest("TapInterface", "udp", "AES", self.PLR50_PY, None, "plr=50")
503 @test_util.skipUnless(test_util.pl_auth() is not None, "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)")
504 def test_tap_ping_udp_loss2_py(self):
505 self._pingtest("TapInterface", "udp", "AES", self.PLR50_PY, self.PLR50_PY, "plr=40", "plr=40")
507 @test_util.skipUnless(test_util.pl_auth() is not None, "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)")
508 def test_tap_ping_udp_loss1_c(self):
509 self._pingtest("TapInterface", "udp", "AES", self.PLR50_C, None, "plr=50")
511 @test_util.skipUnless(test_util.pl_auth() is not None, "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)")
512 def test_tap_ping_udp_loss2_c(self):
513 self._pingtest("TapInterface", "udp", "AES", self.PLR50_C, self.PLR50_C, "plr=40", "plr=40")
515 @test_util.skipUnless(test_util.pl_auth() is not None, "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)")
516 def test_tun_ping_udp_tos(self):
517 self._pingtest("TunInterface", "udp", "AES", self.TOS_PY, self.TOS_PY, "size=1000", "size=1000", "0")
519 @test_util.skipUnless(test_util.pl_auth() is not None, "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)")
520 def test_tun_ping_udp_class(self):
521 self._pingtest("TunInterface", "udp", "AES", self.CLS_PY, self.CLS_PY, "size=10", "size=10", "0")
523 @test_util.skipUnless(test_util.pl_auth() is not None, "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)")
524 def test_nepi_depends(self):
525 instance = self.make_instance()
527 instance.defer_create(2, "Node")
528 instance.defer_create_set(2, "hostname", self.host1)
529 instance.defer_create(3, "NodeInterface")
530 instance.defer_connect(2, "devs", 3, "node")
531 instance.defer_create(4, "Internet")
532 instance.defer_connect(3, "inet", 4, "devs")
533 instance.defer_create(5, "NepiDependency")
534 instance.defer_connect(5, "node", 2, "deps")
535 instance.defer_create(12, "Application")
536 instance.defer_connect(12, "node", 2, "apps")
537 instance.defer_create_set(12, "command", "python -c 'import nepi'")
538 instance.defer_add_trace(12, "stderr")
543 instance.do_connect_init()
544 instance.do_connect_compl()
545 instance.do_preconfigure()
546 instance.do_configure()
548 instance.do_prestart()
550 while instance.status(12) != AS.STATUS_FINISHED:
552 ping_result = (instance.trace(12, "stderr") or "").strip()
560 # asserts at the end, to make sure there's proper cleanup
561 self.assertEqual(ping_result, "")
563 @test_util.skipUnless(test_util.pl_auth() is not None,
564 "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)")
565 @test_util.skipUnless(os.environ.get('NEPI_FULL_TESTS','').lower() in ('1','yes','true','on'),
566 "Test is expensive, requires NEPI_FULL_TESTS=yes")
567 def test_ns3_depends(self):
568 instance = self.make_instance()
570 instance.defer_create(2, "Node")
571 instance.defer_create_set(2, "hostname", self.host1)
572 instance.defer_create(3, "NodeInterface")
573 instance.defer_connect(2, "devs", 3, "node")
574 instance.defer_create(4, "Internet")
575 instance.defer_connect(3, "inet", 4, "devs")
576 instance.defer_create(5, "NepiDependency")
577 instance.defer_connect(5, "node", 2, "deps")
578 instance.defer_create(6, "NS3Dependency")
579 instance.defer_connect(6, "node", 2, "deps")
580 instance.defer_create(12, "Application")
581 instance.defer_connect(12, "node", 2, "apps")
582 instance.defer_create_set(12, "command", "python -c 'import nepi.testbeds.ns3.execute ; tb = nepi.testbeds.ns3.execute.TestbedController() ; mod = tb._configure_ns3_module()'")
583 instance.defer_add_trace(12, "stderr")
588 instance.do_connect_init()
589 instance.do_connect_compl()
590 instance.do_preconfigure()
591 instance.do_configure()
593 instance.do_prestart()
595 while instance.status(12) != AS.STATUS_FINISHED:
597 ping_result = (instance.trace(12, "stderr") or "").strip()
605 # asserts at the end, to make sure there's proper cleanup
606 self.assertEqual(ping_result, "")
608 @test_util.skipUnless(test_util.pl_auth() is not None, "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)")
609 def test_discovery(self):
610 instance = self.make_instance()
612 instance.defer_create(2, "Node")
613 instance.defer_create_set(2, "operatingSystem", "f12")
614 instance.defer_create(3, "Node")
615 instance.defer_create_set(3, "operatingSystem", "f12")
616 instance.defer_create(4, "NodeInterface")
617 instance.defer_connect(2, "devs", 4, "node")
618 instance.defer_create(5, "NodeInterface")
619 instance.defer_connect(3, "devs", 5, "node")
620 instance.defer_create(6, "Internet")
621 instance.defer_connect(4, "inet", 6, "devs")
622 instance.defer_connect(5, "inet", 6, "devs")
623 instance.defer_create(7, "Application")
624 instance.defer_create_set(7, "command", "ping -qc1 {#[GUID-5].addr[0].[Address]#}")
625 instance.defer_add_trace(7, "stdout")
626 instance.defer_add_trace(7, "stderr")
627 instance.defer_connect(7, "node", 2, "apps")
629 comp_result = r"""PING .* \(.*\) \d*\(\d*\) bytes of data.
631 --- .* ping statistics ---
632 1 packets transmitted, 1 received, 0% packet loss, time \d*ms.*
638 instance.do_connect_init()
639 instance.do_connect_compl()
640 instance.do_preconfigure()
642 # Manually replace netref
643 instance.set(7, "command",
644 instance.get(7, "command")
645 .replace("{#[GUID-5].addr[0].[Address]#}",
646 instance.get_address(5, 0, "Address") )
649 instance.do_configure()
651 instance.do_prestart()
653 while instance.status(7) != AS.STATUS_FINISHED:
655 ping_result = instance.trace(7, "stdout") or ""
663 # asserts at the end, to make sure there's proper cleanup
664 self.assertTrue(re.match(comp_result, ping_result, re.MULTILINE),
665 "Unexpected trace:\n" + ping_result)
669 if __name__ == '__main__':