From f8f229ec78d11fad186959dcbef658bc7add167f Mon Sep 17 00:00:00 2001 From: Alina Quereilhac Date: Sun, 11 Sep 2011 13:12:20 +0200 Subject: [PATCH] ExperimentSuite still not working... --- src/nepi/core/execute.py | 9 ++++++--- src/nepi/util/proxy.py | 4 ++-- test/core/integration.py | 22 +++++++++++----------- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/nepi/core/execute.py b/src/nepi/core/execute.py index f7e293e3..b9b07739 100644 --- a/src/nepi/core/execute.py +++ b/src/nepi/core/execute.py @@ -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) diff --git a/src/nepi/util/proxy.py b/src/nepi/util/proxy.py index 69b5c4de..ac2f6867 100644 --- a/src/nepi/util/proxy.py +++ b/src/nepi/util/proxy.py @@ -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() diff --git a/test/core/integration.py b/test/core/integration.py index 2b0fba6f..55a0975b 100755 --- a/test/core/integration.py +++ b/test/core/integration.py @@ -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) -- 2.47.0