Merge with head
[nepi.git] / test / testbeds / planetlab / integration_cross.py
index bbb1918..8dcb8cb 100755 (executable)
@@ -16,7 +16,6 @@ import re
 
 class PlanetLabMultiIntegrationTestCase(unittest.TestCase):
     testbed_id = "planetlab"
-    testbed_version = "01"
     
     slicename1 = "inria_nepi"
     plchost1 = "nepiplc.pl.sophia.inria.fr"
@@ -27,11 +26,14 @@ class PlanetLabMultiIntegrationTestCase(unittest.TestCase):
     host1pl1 = "nepi1.pl.sophia.inria.fr"
     host2pl1 = "nepi2.pl.sophia.inria.fr"
 
-    host1pl2 = "onelab11.pl.sophia.inria.fr"
-    host2pl2 = "onelab10.pl.sophia.inria.fr"
+    host1pl2 = "planetlab1.utt.fr"
+    host2pl2 = "planetlab2.utt.fr"
 
+    port_base = 2000 + (os.getpid() % 1000) * 13
+    
     def setUp(self):
         self.root_dir = tempfile.mkdtemp()
+        self.__class__.port_base = self.port_base + 100
 
     def tearDown(self):
         try:
@@ -43,7 +45,6 @@ class PlanetLabMultiIntegrationTestCase(unittest.TestCase):
 
     def make_experiment_desc(self):
         testbed_id = self.testbed_id
-        testbed_version = self.testbed_version
         
         slicename1 = self.slicename1
         plchost1 = self.plchost1
@@ -57,7 +58,7 @@ class PlanetLabMultiIntegrationTestCase(unittest.TestCase):
         pl_user, pl_pwd = test_util.pl_auth()
 
         exp_desc = ExperimentDescription()
-        pl_provider = FactoriesProvider(testbed_id, testbed_version)
+        pl_provider = FactoriesProvider(testbed_id)
         pl_desc = exp_desc.add_testbed_description(pl_provider)
         pl_desc.set_attribute_value("homeDirectory", self.root_dir)
         pl_desc.set_attribute_value("slice", slicename1)
@@ -65,6 +66,8 @@ class PlanetLabMultiIntegrationTestCase(unittest.TestCase):
         pl_desc.set_attribute_value("authUser", pl_user)
         pl_desc.set_attribute_value("authPass", pl_pwd)
         pl_desc.set_attribute_value("plcHost", plchost1)
+        pl_desc.set_attribute_value("tapPortBase", self.port_base)
+        pl_desc.set_attribute_value("p2pDeployment", False) # it's interactive, we don't want it in tests
 
         pl_desc2 = exp_desc.add_testbed_description(pl_provider)
         pl_desc2.set_attribute_value("homeDirectory", self.root_dir+"v2")
@@ -73,6 +76,8 @@ class PlanetLabMultiIntegrationTestCase(unittest.TestCase):
         pl_desc2.set_attribute_value("authUser", pl_user)
         pl_desc2.set_attribute_value("authPass", pl_pwd)
         pl_desc2.set_attribute_value("plcHost", plchost2)
+        pl_desc2.set_attribute_value("tapPortBase", self.port_base+500)
+        pl_desc2.set_attribute_value("p2pDeployment", False) # it's interactive, we don't want it in tests
         
         return pl_desc, pl_desc2, exp_desc
     
@@ -80,7 +85,6 @@ class PlanetLabMultiIntegrationTestCase(unittest.TestCase):
         node1 = pl.create("Node")
         node1.set_attribute_value("hostname", hostname)
         node1.set_attribute_value("label", label_prefix)
-        node1.set_attribute_value("emulation", True) # require emulation
         iface1 = pl.create("NodeInterface")
         iface1.set_attribute_value("label", label_prefix+"iface")
         if tapip:
@@ -105,7 +109,6 @@ class PlanetLabMultiIntegrationTestCase(unittest.TestCase):
 
     def make_ns_in_pl(self, pl, exp, node1, iface1, root):
         ns3_testbed_id = "ns3"
-        ns3_testbed_version = "3_9_RC3"
         
         # Add NS3 support in node1
         plnepi = pl.create("NepiDependency")
@@ -114,7 +117,7 @@ class PlanetLabMultiIntegrationTestCase(unittest.TestCase):
         plns3.connector("node").connect(node1.connector("deps"))
 
         # Create NS3 testbed running in node1
-        ns3_provider = FactoriesProvider(ns3_testbed_id, ns3_testbed_version)
+        ns3_provider = FactoriesProvider(ns3_testbed_id)
         ns3_desc = exp.add_testbed_description(ns3_provider)
         ns3_desc.set_attribute_value("rootDirectory", root)
         ns3_desc.set_attribute_value("SimulatorImplementationType", "ns3::RealtimeSimulatorImpl")
@@ -193,8 +196,8 @@ class PlanetLabMultiIntegrationTestCase(unittest.TestCase):
             while not controller.is_finished(ping.guid):
                 time.sleep(0.5)
               
-            ping_result = controller.trace(pl2.guid, ping.guid, "stdout")
-            tap2_trace = controller.trace(pl2.guid, tap2.guid, "packets")
+            ping_result = controller.trace(ping.guid, "stdout")
+            tap2_trace = controller.trace(tap2.guid, "packets")
         finally:
             controller.stop()
             controller.shutdown()