]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
in session_attached mode synchronize local NS with content of salome.[cm,rm,esm,dsm]
authorAnthony Geay <anthony.geay@edf.fr>
Thu, 2 Sep 2021 06:51:53 +0000 (08:51 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Thu, 2 Sep 2021 06:51:53 +0000 (08:51 +0200)
src/KERNEL_PY/__init__.py
src/Launcher/Test/TestSSLAttached.py

index d6820e89c589fd380f6979396afa80cfaa02eb6d..79dede59998b7ecd8869bae140025d41b2244544 100644 (file)
@@ -262,11 +262,21 @@ def salome_init_without_session_attached(path=None, embedded=False):
     import KernelBasis
     nsAbroad = orb.string_to_object( KernelBasis.getIOROfEmbeddedNS() )
     import SALOME
-    cm = orb.string_to_object( nsAbroad.Resolve("/ContainerManager").decode() )
-    rm = orb.string_to_object( nsAbroad.Resolve("/ResourcesManager").decode() )
+    CM_NAME_IN_NS = "/ContainerManager"
+    cm = orb.string_to_object( nsAbroad.Resolve(CM_NAME_IN_NS).decode() )
+    naming_service.Register(cm,CM_NAME_IN_NS)
+    RM_NAME_IN_NS = "/ResourcesManager"
+    rm = orb.string_to_object( nsAbroad.Resolve(RM_NAME_IN_NS).decode() )
+    naming_service.Register(rm,RM_NAME_IN_NS)
+    #
+    DSM_NAME_IN_NS = "/DataServerManager"
     lcc = StandAloneLifecyle(cm,rm)
-    dsm = orb.string_to_object( nsAbroad.Resolve("/DataServerManager").decode() )
-    esm = orb.string_to_object( nsAbroad.Resolve("/ExternalServers").decode() )
+    dsm = orb.string_to_object( nsAbroad.Resolve(DSM_NAME_IN_NS).decode() )
+    naming_service.Register(dsm,DSM_NAME_IN_NS)
+    #
+    ESM_NAME_IN_NS = "/ExternalServers"
+    esm = orb.string_to_object( nsAbroad.Resolve(ESM_NAME_IN_NS).decode() )
+    naming_service.Register(esm,ESM_NAME_IN_NS)
 
 def salome_init_with_session(path=None, embedded=False):
     """
index 69fbbe8ba8673d4b7c0924f5ea4142746d05b83d..86cabad6c2e28a25ae8969b2978c53dcb26fac76 100644 (file)
@@ -61,7 +61,12 @@ pyscript.execute([],pickle.dumps(([],{})))
 cm_to_test = orb.object_to_string(pickle.loads(pyscript.execute(["the_cm"],pickle.dumps(([],{}))))[0])
 if cm_to_test!=ref_cm:
     raise AssertionError("The ContainerManager of salome_init launched in SALOME_Container_No_NS_Serv is not those in current process !")
-del pyscript,ref_cm,cm_to_test
+pyscriptt = cont_prov.createPyScriptNode("testCM2","""import salome\nsalome.salome_init()\nthe_cm=salome.naming_service.Resolve("/ContainerManager")""")
+pyscriptt.execute([],pickle.dumps(([],{})))
+cm_to_testt = orb.object_to_string(pickle.loads(pyscriptt.execute(["the_cm"],pickle.dumps(([],{}))))[0])
+if cm_to_testt!=ref_cm:
+    raise AssertionError("The ContainerManager of salome_init launched in SALOME_Container_No_NS_Serv is not those in current process !")
+del pyscript,pyscriptt,ref_cm,cm_to_test,cm_to_testt
 
 # Testing for RM
 ref_rm = orb.object_to_string(salome.lcc.getResourcesManager())
@@ -70,7 +75,12 @@ pyscript4.execute([],pickle.dumps(([],{})))
 rm_to_test = orb.object_to_string(pickle.loads(pyscript4.execute(["the_rm"],pickle.dumps(([],{}))))[0])
 if rm_to_test!=ref_rm:
     raise AssertionError("The ResourcesManager of salome_init launched in SALOME_Container_No_NS_Serv is not those in current process !")
-del pyscript4,ref_rm,rm_to_test
+pyscript44 = cont_prov.createPyScriptNode("testRM2","""import salome\nsalome.salome_init()\nthe_rm=salome.naming_service.Resolve("/ResourcesManager")""")
+pyscript44.execute([],pickle.dumps(([],{})))
+rm_to_testt = orb.object_to_string(pickle.loads(pyscript44.execute(["the_rm"],pickle.dumps(([],{}))))[0])
+if rm_to_testt!=ref_rm:
+    raise AssertionError("The ResourcesManager of salome_init launched in SALOME_Container_No_NS_Serv is not those in current process !")
+del pyscript4,pyscript44,ref_rm,rm_to_test,rm_to_testt
 
 # Testing for DSM
 ref_dsm = orb.object_to_string(salome.dsm)
@@ -78,7 +88,11 @@ pyscript2 = cont_prov.createPyScriptNode("testDSM","""import salome\nsalome.salo
 dsm_to_test = orb.object_to_string(pickle.loads(pyscript2.execute(["the_dsm"],pickle.dumps(([],{}))))[0])
 if dsm_to_test!=ref_dsm:
     raise AssertionError("The DataServerManager of salome_init launched in SALOME_Container_No_NS_Serv is not those in current process !")
-del pyscript2,ref_dsm,dsm_to_test
+pyscript22 = cont_prov.createPyScriptNode("testDSM","""import salome\nsalome.salome_init()\nthe_dsm=salome.naming_service.Resolve("/DataServerManager")""")
+dsm_to_test_2 = orb.object_to_string(pickle.loads(pyscript22.execute(["the_dsm"],pickle.dumps(([],{}))))[0])
+if dsm_to_test_2!=ref_dsm:
+    raise AssertionError("The DataServerManager of salome_init launched in SALOME_Container_No_NS_Serv is not those in current process !")
+del pyscript2,pyscript22,ref_dsm,dsm_to_test,dsm_to_test_2
 
 # Testing for ESM
 ref_esm = orb.object_to_string(salome.esm)
@@ -86,7 +100,11 @@ pyscript3 = cont_prov.createPyScriptNode("testESM","""import salome\nsalome.salo
 esm_to_test = orb.object_to_string(pickle.loads(pyscript3.execute(["the_esm"],pickle.dumps(([],{}))))[0])
 if esm_to_test!=ref_esm:
     raise AssertionError("The ExternalServerLauncher of salome_init launched in SALOME_Container_No_NS_Serv is not those in current process !")
-del pyscript3,ref_esm,esm_to_test
+pyscript33 = cont_prov.createPyScriptNode("testDSM","""import salome\nsalome.salome_init()\nthe_esm=salome.naming_service.Resolve("/ExternalServers")""")
+esm_to_test_2 = orb.object_to_string(pickle.loads(pyscript33.execute(["the_esm"],pickle.dumps(([],{}))))[0])
+if esm_to_test_2!=ref_esm:
+    raise AssertionError("The ExternalServerLauncher of salome_init launched in SALOME_Container_No_NS_Serv is not those in current process !")
+del pyscript3,pyscript33,ref_esm,esm_to_test,esm_to_test_2
 
 # End of test
 cont_prov.Shutdown()