Bug fixing for ns-3 unit tests. ns-3.13 generates different output
authorAlina Quereilhac <alina.quereilhac@inria.fr>
Thu, 29 Mar 2012 16:33:51 +0000 (18:33 +0200)
committerAlina Quereilhac <alina.quereilhac@inria.fr>
Thu, 29 Mar 2012 16:33:51 +0000 (18:33 +0200)
test/testbeds/netns/execute.py
test/testbeds/ns3/execute.py
test/testbeds/ns3/execute2.py
test/testbeds/ns3/integration.py

index 1ab3fc2..5e361f1 100755 (executable)
@@ -201,6 +201,7 @@ class NetnsExecuteTestCase(unittest.TestCase):
 
         while instance.status(6) != AS.STATUS_FINISHED:
             time.sleep(0.5)
+        
         pcap_result = instance.trace(2, "pcap")
         self.assertEquals(len(pcap_result), 1024)
         instance.stop()
index 5445b4a..9a6e236 100755 (executable)
@@ -1,5 +1,4 @@
 #!/usr/bin/env python
-# -*- coding: utf-8 -*-
 
 from nepi.util.constants import ApplicationStatus as AS
 from nepi.testbeds import ns3
@@ -75,7 +74,7 @@ class Ns3ExecuteTestCase(unittest.TestCase):
             time.sleep(0.1)
         ping_result = instance.trace(14, "P2PAsciiTrace")
         ping_rtt = instance.trace(17, "Rtt")
-        comp_result = "- 9.021 /NodeList/1/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.0.2 > 10.0.0.1) ns3::Icmpv4Header (type=0, code=0) ns3::Icmpv4Echo (identifier=0, sequence=9)"
+        comp_result = "- 9.021 /NodeList/1/DeviceList/0/$ns3::PointToPointNetDevice/TxQueue/Dequeue ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 9 protocol 1 offset (bytes) 0 flags [none] length: 84 10.0.0.2 > 10.0.0.1) ns3::Icmpv4Header (type=0, code=0) ns3::Icmpv4Echo (identifier=0, sequence=9)"
         comp_rtt_result = """+41992186.0ns\t+41992186.0ns
 +1041992186.0ns\t+41992186.0ns
 +2041992186.0ns\t+41992186.0ns
@@ -85,7 +84,9 @@ class Ns3ExecuteTestCase(unittest.TestCase):
 +6041992186.0ns\t+41992186.0ns
 +7041992186.0ns\t+41992186.0ns
 +8041992186.0ns\t+41992186.0ns
-+9041992186.0ns\t+41992186.0ns"""
++9041992186.0ns\t+41992186.0ns
+"""
+
         self.assertNotEqual(ping_result.find(comp_result), -1)
         self.assertEqual(ping_rtt.strip(), comp_rtt_result.strip())
         instance.stop()
index 20a9bea..f193af8 100755 (executable)
@@ -109,7 +109,8 @@ class Ns3ExecuteTestCase(unittest.TestCase):
         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)"
+        comp_result = "- 9.04199 /NodeList/2/DeviceList/0/$ns3::PointToPointNetDevice/TxQueue/Dequeue ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 9 protocol 1 offset (bytes) 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)"
+
         self.assertNotEqual(ping_result.find(comp_result), -1)
         instance.stop()
         instance.shutdown()
index 1164c99..e2c24c7 100755 (executable)
@@ -178,7 +178,9 @@ r [-+0-9.e]+ /NodeList/0/DeviceList/0/\$ns3::FdNetDevice/Rx Payload \(size=98\)
             while not controller.is_finished(app.guid):
                 time.sleep(0.5)
             ping_result = controller.trace(iface2.guid, "P2PAsciiTrace")
-            comp_result = "- 19.021 /NodeList/1/DeviceList/0/$ns3::PointToPointNetDevice/TxQueue/Dequeue ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 ttl 64 id 19 protocol 1 offset 0 flags [none] length: 84 10.0.0.2 > 10.0.0.1) ns3::Icmpv4Header (type=0, code=0) ns3::Icmpv4Echo (identifier=0, sequence=19)"
+
+            comp_result = "- 19.021 /NodeList/1/DeviceList/0/$ns3::PointToPointNetDevice/TxQueue/Dequeue ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 19 protocol 1 offset (bytes) 0 flags [none] length: 84 10.0.0.2 > 10.0.0.1) ns3::Icmpv4Header (type=0, code=0) ns3::Icmpv4Echo (identifier=0, sequence=19)"
+            
             if ping_result.find(comp_result) == -1:
                 self.fail("Unexpected trace: %s" % (ping_result,))
         finally: