From: Ovidiu Mircescu Date: Mon, 29 Jun 2020 14:17:27 +0000 (+0200) Subject: Tests for workload manager. X-Git-Tag: V9_6_0a1~7^2~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a104009badc908a6418d39ce5deeb96d427438ea;p=modules%2Fyacs.git Tests for workload manager. --- diff --git a/src/yacsloader/samples/wlm_2foreach.xml b/src/yacsloader/samples/wlm_2foreach.xml index 02b1b2078..65f5e8c8f 100644 --- a/src/yacsloader/samples/wlm_2foreach.xml +++ b/src/yacsloader/samples/wlm_2foreach.xml @@ -33,13 +33,13 @@ - + - + @@ -49,7 +49,6 @@ vals = [ i for i in range(40)] nbbranches = len(vals) t0=time.time() ]]> - @@ -59,7 +58,6 @@ t0=time.time() tf=time.time() r=int(tf-t0) ]]> - @@ -92,19 +90,19 @@ time.sleep(1) Begin vals - ForEach2 SmplsCollection + ForEach1 SmplsCollection Begin vals - ForEach1 SmplsCollection + ForEach2 SmplsCollection Begin nbbranches - ForEach1 nbBranches + ForEach2 nbBranches Begin nbbranches - ForEach2 nbBranches + ForEach1 nbBranches ForEach1 evalSamples @@ -115,18 +113,18 @@ time.sleep(1) ForEach2.PyScript7 v - ForEach2nbBranches + ForEach1nbBranches 1 - ForEach1nbBranches + ForEach2nbBranches 1 - - + - - + + + diff --git a/src/yacsloader/samples/wlm_2foreach_with_cache.xml b/src/yacsloader/samples/wlm_2foreach_with_cache.xml index 653489c2f..bfdd21a17 100644 --- a/src/yacsloader/samples/wlm_2foreach_with_cache.xml +++ b/src/yacsloader/samples/wlm_2foreach_with_cache.xml @@ -33,14 +33,14 @@ - + - + @@ -98,7 +98,6 @@ if s_expected != s2: #print(r1) #print(r2) ]]> - @@ -163,11 +162,11 @@ time.sleep(1) Begin nbbranches - ForEach2 nbBranches + ForEach1 nbBranches Begin nbbranches - ForEach1 nbBranches + ForEach2 nbBranches ForEach1 evalSamples @@ -193,11 +192,11 @@ time.sleep(1) ForEach2nbBranches 1 - - + + diff --git a/src/yacsloader/samples/wlm_8nodes.xml b/src/yacsloader/samples/wlm_8nodes.xml new file mode 100644 index 000000000..7dfaca767 --- /dev/null +++ b/src/yacsloader/samples/wlm_8nodes.xml @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Begin End + Begin n1 + Begin n2 + Begin n3 + Begin n4 + Begin n5 + Begin n6 + Begin n7 + Begin n8 + n1 End + n2 End + n3 End + n4 End + n5 End + n6 End + n7 End + n8 End + + Begin t0 + End t0 + + + Begin time_to_sleep + n1 time_to_sleep + + + Begin time_to_sleep + n2 time_to_sleep + + + Begin time_to_sleep + End time_to_sleep + + + Begin time_to_sleep + n5 time_to_sleep + + + Begin time_to_sleep + n4 time_to_sleep + + + Begin time_to_sleep + n3 time_to_sleep + + + Begin time_to_sleep + n6 time_to_sleep + + + Begin time_to_sleep + n8 time_to_sleep + + + Begin time_to_sleep + n7 time_to_sleep + + + n1 container_name + End n1 + + + n2 container_name + End n2 + + + n3 container_name + End n3 + + + n4 container_name + End n4 + + + n5 container_name + End n5 + + + n6 container_name + End n6 + + + n7 container_name + End n7 + + + n8 container_name + End n8 + + + + + + + + + + + + + diff --git a/src/yacsloader_swig/Test/testWorkloadManager.py b/src/yacsloader_swig/Test/testWorkloadManager.py index 41dd51483..de066a28d 100755 --- a/src/yacsloader_swig/Test/testWorkloadManager.py +++ b/src/yacsloader_swig/Test/testWorkloadManager.py @@ -51,6 +51,10 @@ class TestEdit(unittest.TestCase): #resource_definition = resourceManager.GetResourceDefinition("localhost") #self.assertEqual(resource_definition.nb_node, 16) + def tearDown(self): + cm = salome.lcc.getContainerManager() + cm.ShutdownContainers() + def test1(self): """ Two parallel foreach-s with different containers """ @@ -82,6 +86,16 @@ class TestEdit(unittest.TestCase): # We need some delay to add to the 16s. self.assertTrue(execution_time < 20) + def test3(self): + """ Launch 8 independent nodes in parallel. + """ + proc = self.l.load("samples/wlm_8nodes.xml") + self.e.RunW(proc,0) + ok = proc.getChildByName("End").getOutputPort("ok") + if not ok : + err_message = proc.getChildByName("End").getOutputPort("err_message") + self.fail(err_message) + if __name__ == '__main__': dir_test = tempfile.mkdtemp(suffix=".yacstest") file_test = os.path.join(dir_test,"UnitTestsResult")