X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=test%2Ftestbeds%2Fns3%2Fexecute2.py;h=854e02c7f8dc6df29231d90c73423bb1b4eca41b;hb=a88d5281ddf098d16eb223c7b95866cfdc186d38;hp=52ac526467bcd29b8943e5b20dc3e3b020598cc9;hpb=552a2b6824a9e07fa6a5189bc7404fed12378d55;p=nepi.git diff --git a/test/testbeds/ns3/execute2.py b/test/testbeds/ns3/execute2.py index 52ac5264..854e02c7 100755 --- a/test/testbeds/ns3/execute2.py +++ b/test/testbeds/ns3/execute2.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from nepi.util.constants import STATUS_FINISHED +from nepi.util.constants import ApplicationStatus as AS from nepi.testbeds import ns3 import os import shutil @@ -23,8 +23,7 @@ class Ns3ExecuteTestCase(unittest.TestCase): @test_util.skipUnless(test_util.ns3_usable(), "Test requires working ns-3 bindings") def test_run_ping_routing(self): - testbed_version = "3_9_RC3" - instance = ns3.TestbedController(testbed_version) + instance = ns3.TestbedController() instance.defer_configure("homeDirectory", self.root_dir) instance.defer_create(2, "ns3::Node") instance.defer_create(3, "ns3::Ipv4L3Protocol") @@ -104,8 +103,9 @@ class Ns3ExecuteTestCase(unittest.TestCase): instance.do_connect_compl() instance.do_preconfigure() instance.do_configure() + instance.do_prestart() instance.start() - while instance.status(27) != STATUS_FINISHED: + while instance.status(27) != AS.STATUS_FINISHED: time.sleep(0.1) ping_result = instance.trace(24, "P2PAsciiTrace") comp_result = "- 9.04199 /NodeList/2/DeviceList/0/$ns3::PointToPointNetDevice/TxQueue/Dequeue ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 ttl 64 id 9 protocol 1 offset 0 flags [none] length: 84 10.0.1.2 > 10.0.0.1) ns3::Icmpv4Header (type=0, code=0) ns3::Icmpv4Echo (identifier=0, sequence=9)"