ExperimentSuite still not working...
authorAlina Quereilhac <alina.quereilhac@inria.fr>
Sun, 11 Sep 2011 11:12:20 +0000 (13:12 +0200)
committerAlina Quereilhac <alina.quereilhac@inria.fr>
Sun, 11 Sep 2011 11:12:20 +0000 (13:12 +0200)
src/nepi/core/execute.py
src/nepi/util/proxy.py
test/core/integration.py

index f7e293e..b9b0773 100644 (file)
@@ -1148,15 +1148,17 @@ class ExperimentSuite(object):
         return self._access_configs[self._current]
 
     def _run_experiment_suite(self):
-        for i in xrange[0, self.repetitions]:
+        for i in xrange(1, self._repetitions):
             self._current = i
             self._run_one_experiment()
-        self._status  = TS.STATUS_STOPPED
+        self._status = TS.STATUS_STOPPED
 
     def _run_one_experiment(self):
+        from nepi.util import proxy
         access_config = proxy.AccessConfiguration()
         for attr in self._access_config.attributes:
-            access_config.set_attribute_value(attr.name, attr.value)
+            if attr.value:
+                access_config.set_attribute_value(attr.name, attr.value)
         access_config.set_attribute_value(DC.DEPLOYMENT_MODE, DC.MODE_DAEMON)
         root_dir = "%s_%d" % (
                 access_config.get_attribute_value(DC.ROOT_DIRECTORY), 
@@ -1177,4 +1179,5 @@ class ExperimentSuite(object):
             while (time.time() - started_at) < self._duration:
                 time.sleep(0.5)
         controller.stop()
+        time.sleep(2)
 
index 69b5c4d..ac2f686 100644 (file)
@@ -626,13 +626,13 @@ class ExperimentSuiteServer(BaseServer):
 
     @Marshalling.handles(START)
     @Marshalling.args()
-    @Marshalling.retval()
+    @Marshalling.retvoid
     def start(self):
         self._experiment_suite.start()
 
     @Marshalling.handles(SHUTDOWN)
     @Marshalling.args()
-    @Marshalling.retval()
+    @Marshalling.retvoid
     def shutdown(self):
         self._experiment_suite.shutdown()
 
index 2b0fba6..55a0975 100755 (executable)
@@ -69,7 +69,7 @@ class ExecuteTestCase(unittest.TestCase):
 
         return exp_desc, desc1, desc2, iface12, iface21
 
-    def test_single_process_cross_integration(self):
+    def ptest_single_process_cross_integration(self):
         exp_desc, desc1, desc2, iface12, iface21 = \
                 self.make_cross_test_experiment()
         xml = exp_desc.to_xml()
@@ -83,7 +83,7 @@ class ExecuteTestCase(unittest.TestCase):
         controller.stop()
         controller.shutdown()
 
-    def test_single_process_integration(self):
+    def ptest_single_process_integration(self):
         exp_desc, desc, app, node1, node2, iface1, iface2 = self.make_test_experiment()
         xml = exp_desc.to_xml()
         access_config = None
@@ -111,7 +111,7 @@ class ExecuteTestCase(unittest.TestCase):
         self.assertTrue(stopped_time < time.time())
         controller.shutdown()
 
-    def test_daemonized_controller_integration(self):
+    def ptest_daemonized_controller_integration(self):
         exp_desc, desc, app, node1, node2, iface1, iface2 = self.make_test_experiment()
         xml = exp_desc.to_xml()
         access_config = proxy.AccessConfiguration()
@@ -147,7 +147,7 @@ class ExecuteTestCase(unittest.TestCase):
         self.assertTrue(stopped_time < time.time())
         controller.shutdown()
 
-    def test_daemonized_testbed_integration(self):
+    def ptest_daemonized_testbed_integration(self):
         exp_desc, desc, app, node1, node2, iface1, iface2 = self.make_test_experiment()
         
         desc.set_attribute_value(DC.DEPLOYMENT_MODE, DC.MODE_DAEMON)
@@ -180,7 +180,7 @@ class ExecuteTestCase(unittest.TestCase):
         controller.stop()
         controller.shutdown()
 
-    def test_daemonized_all_integration(self):
+    def ptest_daemonized_all_integration(self):
         exp_desc, desc, app, node1, node2, iface1, iface2 = self.make_test_experiment()
         
         desc.set_attribute_value(DC.DEPLOYMENT_MODE, DC.MODE_DAEMON)
@@ -232,7 +232,7 @@ class ExecuteTestCase(unittest.TestCase):
         controller.stop()
         controller.shutdown()
 
-    def test_daemonized_all_integration_recovery(self):
+    def ptest_daemonized_all_integration_recovery(self):
         exp_desc, desc, app, node1, node2, iface1, iface2 = self.make_test_experiment()
         
         desc.set_attribute_value(DC.DEPLOYMENT_MODE, DC.MODE_DAEMON)
@@ -282,7 +282,7 @@ class ExecuteTestCase(unittest.TestCase):
         controller.stop()
         controller.shutdown()
 
-    def test_reference_expressions(self):
+    def ptest_reference_expressions(self):
         exp_desc, desc, app, node1, node2, iface1, iface2 = self.make_test_experiment()
         
         iface1.set_attribute_value("label", "some")
@@ -312,7 +312,7 @@ class ExecuteTestCase(unittest.TestCase):
         controller.stop()
         controller.shutdown()
 
-    def test_testbed_reference_expressions(self):
+    def ptest_testbed_reference_expressions(self):
         exp_desc, desc, app, node1, node2, iface1, iface2 = self.make_test_experiment()
         
         iface1.set_attribute_value("label", "some")
@@ -347,7 +347,7 @@ class ExecuteTestCase(unittest.TestCase):
         controller.stop()
         controller.shutdown()
 
-    def test_ssh_daemonized_integration(self):
+    def ptest_ssh_daemonized_integration(self):
         exp_desc, desc, app, node1, node2, iface1, iface2 = self.make_test_experiment()
         env = test_util.test_environment()
         
@@ -391,7 +391,7 @@ class ExecuteTestCase(unittest.TestCase):
         desc.set_attribute_value(DC.DEPLOYMENT_MODE, DC.MODE_DAEMON)
         desc.set_attribute_value(DC.ROOT_DIRECTORY, self.root_dir)
         desc.set_attribute_value(DC.DEPLOYMENT_ENVIRONMENT_SETUP, 
-            "export PYTHONPATH=%r:%r:$PYTHONPATH "
+            "export PYTHONP TH=%r:%r:$PYTHONPATH "
             "export NEPI_TESTBEDS='mock:mock mock2:mock2' " % (
                 os.path.dirname(os.path.dirname(mock.__file__)),
                 os.path.dirname(os.path.dirname(mock2.__file__)),))
@@ -407,7 +407,7 @@ class ExecuteTestCase(unittest.TestCase):
                 os.path.dirname(os.path.dirname(mock.__file__)),
                 os.path.dirname(os.path.dirname(mock2.__file__)),))
        
-        exp_suite = proxy.create_experiment_suite(xml, access_config)
+        exp_suite = proxy.create_experiment_suite(xml, access_config, repetitions = 4)
         exp_suite.start()
         while not exp_suite.is_finished:
             time.sleep(0.5)