enable automatic node stack
authorAlina Quereilhac <alina.quereilhac@inria.fr>
Tue, 3 Jun 2014 07:18:12 +0000 (09:18 +0200)
committerAlina Quereilhac <alina.quereilhac@inria.fr>
Tue, 3 Jun 2014 07:18:12 +0000 (09:18 +0200)
src/nepi/resources/ns3/ns3node.py
test/resources/linux/ns3/ccn/ns3dceccnpeek.py

index a6cf19e..8598979 100644 (file)
@@ -97,9 +97,13 @@ class NS3BaseNode(NS3Base):
         return rms
 
     def _configure_object(self):
-        ### node.AggregateObject(PacketSocketFactory())
-        uuid_packet_socket_factory = self.simulation.create("PacketSocketFactory")
-        self.simulation.invoke(self.uuid, "AggregateObject", uuid_packet_socket_factory)
+        if self.get("enableStack"):
+            uuid_stack_helper = self.simulation.create("InternetStackHelper")
+            self.simulation.invoke(uuid_stack_helper, "Install", self.uuid)
+        else:
+            ### node.AggregateObject(PacketSocketFactory())
+            uuid_packet_socket_factory = self.simulation.create("PacketSocketFactory")
+            self.simulation.invoke(self.uuid, "AggregateObject", uuid_packet_socket_factory)
 
         dceapplications = self.dceapplications
         if dceapplications:
@@ -110,10 +114,6 @@ class NS3BaseNode(NS3Base):
         if ipv4:
             self.simulation.invoke(self.uuid, "AggregateObject", ipv4.uuid)
 
-        if self.get("enableStack"):
-            uuid_stack_helper = self.simulation.create("InternetStackHelper")
-            self.simulation.invoke(uuid_stack_helper, "Install", self.uuid)
-
         mobility = self.mobility
         if mobility:
             self.simulation.invoke(self.uuid, "AggregateObject", mobility.uuid)
index 65f23a4..a795bad 100644 (file)
@@ -169,7 +169,7 @@ class LinuxNS3CCNPeekDceApplicationTest(unittest.TestCase):
         ec.shutdown()
 
     def test_dce_ccnpeek_local_with_stack(self):
-        ec = ExperimentController(exp_id = "testdcepeeklostack")
+        ec = ExperimentController(exp_id = "test-dce-ccnpeek-lostack")
         
         node = ec.register_resource("LinuxNode")
         ec.set(node, "hostname", "localhost")