# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+import os
import unittest
import salome
import Engines
</resources>
"""
def setUp(self):
+ self.container_name = "MyContainer-%s"%(os.getpid())
pass
def test0(self):
""""""
rp=LifeCycleCORBA.ResourceParameters(policy="best",componentList=["PYHELLO"])
- p=LifeCycleCORBA.ContainerParameters(container_name="MyContainer",mode="start",resource_params=rp)
+ p=LifeCycleCORBA.ContainerParameters(container_name=self.container_name,mode="start",resource_params=rp)
co=cm.GiveContainer( p )
- self.assertEqual(co._get_name(), "/Containers/claui2c6/MyContainer")
+ host1=co.getHostName()
+ name1="/Containers/%s/%s" % (host1,self.container_name)
+ self.assertEqual(co._get_name(), name1)
co=cm.GiveContainer( p )
- self.assertEqual(co._get_name(), "/Containers/clt10br/MyContainer")
+ host2=co.getHostName()
+ name2="/Containers/%s/%s" % (host2,self.container_name)
+ self.assertEqual(co._get_name(), name2)
def test1(self):
""""""
rp=LifeCycleCORBA.ResourceParameters(policy="best",componentList=["PYHELLO"])
- p=LifeCycleCORBA.ContainerParameters(container_name="MyContainer",mode="get",resource_params=rp)
+ p=LifeCycleCORBA.ContainerParameters(container_name=self.container_name,mode="get",resource_params=rp)
co=cm.GiveContainer( p )
- self.assertEqual(co._get_name(), "/Containers/claui2c6/MyContainer")
+ host1=co.getHostName()
+ name1="/Containers/%s/%s" % (host1,self.container_name)
+ self.assertEqual(co._get_name(), name1)
co=cm.GiveContainer( p )
- self.assertEqual(co._get_name(), "/Containers/clt10br/MyContainer")
+ host2=co.getHostName()
+ name2="/Containers/%s/%s" % (host2,self.container_name)
+ self.assertEqual(co._get_name(), name2)
def test2(self):
""""""
rp=LifeCycleCORBA.ResourceParameters(policy="best",componentList=["PYHELLO"])
- p=LifeCycleCORBA.ContainerParameters(container_name="MyContainer",mode="getorstart",resource_params=rp)
+ p=LifeCycleCORBA.ContainerParameters(container_name=self.container_name,mode="getorstart",resource_params=rp)
co=cm.GiveContainer( p )
- self.assertEqual(co._get_name(), "/Containers/claui2c6/MyContainer")
+ host1=co.getHostName()
+ name1="/Containers/%s/%s" % (host1,self.container_name)
+ self.assertEqual(co._get_name(), name1)
co=cm.GiveContainer( p )
- self.assertEqual(co._get_name(), "/Containers/clt10br/MyContainer")
+ host2=co.getHostName()
+ name2="/Containers/%s/%s" % (host2,self.container_name)
+ self.assertEqual(co._get_name(), name2)
if __name__ == '__main__':
- suite = unittest.TestLoader().loadTestsFromTestCase(TestContainerManager)
- unittest.TextTestRunner().run(suite)
-
+ #suite = unittest.TestLoader().loadTestsFromTestCase(TestContainerManager)
+ #unittest.TextTestRunner().run(suite)
+ unittest.main()