From: Alina Quereilhac Date: Thu, 29 Mar 2012 16:33:51 +0000 (+0200) Subject: Bug fixing for ns-3 unit tests. ns-3.13 generates different output X-Git-Tag: nepi-3.0.0~163^2~26 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=6e75bc3f6b80b35cf2c146698842c3067b164359;p=nepi.git Bug fixing for ns-3 unit tests. ns-3.13 generates different output --- diff --git a/test/testbeds/netns/execute.py b/test/testbeds/netns/execute.py index 1ab3fc23..5e361f1f 100755 --- a/test/testbeds/netns/execute.py +++ b/test/testbeds/netns/execute.py @@ -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() diff --git a/test/testbeds/ns3/execute.py b/test/testbeds/ns3/execute.py index 5445b4af..9a6e2368 100755 --- a/test/testbeds/ns3/execute.py +++ b/test/testbeds/ns3/execute.py @@ -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() diff --git a/test/testbeds/ns3/execute2.py b/test/testbeds/ns3/execute2.py index 20a9bea9..f193af80 100755 --- a/test/testbeds/ns3/execute2.py +++ b/test/testbeds/ns3/execute2.py @@ -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() diff --git a/test/testbeds/ns3/integration.py b/test/testbeds/ns3/integration.py index 1164c99d..e2c24c78 100755 --- a/test/testbeds/ns3/integration.py +++ b/test/testbeds/ns3/integration.py @@ -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: