Removed version number from testbed file names. Only 1 version permitted at the time.
[nepi.git] / test / testbeds / ns3 / execute2.py
index 52ac526..854e02c 100755 (executable)
@@ -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)"