rp=LifeCycleCORBA.ResourceParameters(policy="best",componentList=["PYHELLO"])
p=LifeCycleCORBA.ContainerParameters(container_name="MyContainer",mode="start",resource_params=rp)
co=cm.GiveContainer( p )
- self.assertEqual(co._get_name(), "/Containers/claui2c6/MyContainer")
+ host1=co.getHostName()
+ name1="/Containers/%s/MyContainer" % host1
+ self.assertEqual(co._get_name(), name1)
co=cm.GiveContainer( p )
- self.assertEqual(co._get_name(), "/Containers/clt10br/MyContainer")
+ host2=co.getHostName()
+ name2="/Containers/%s/MyContainer" % host2
+ 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)
co=cm.GiveContainer( p )
- self.assertEqual(co._get_name(), "/Containers/claui2c6/MyContainer")
+ host1=co.getHostName()
+ name1="/Containers/%s/MyContainer" % host1
+ self.assertEqual(co._get_name(), name1)
co=cm.GiveContainer( p )
- self.assertEqual(co._get_name(), "/Containers/clt10br/MyContainer")
+ host2=co.getHostName()
+ name2="/Containers/%s/MyContainer" % host2
+ 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)
co=cm.GiveContainer( p )
- self.assertEqual(co._get_name(), "/Containers/claui2c6/MyContainer")
+ host1=co.getHostName()
+ name1="/Containers/%s/MyContainer" % host1
+ self.assertEqual(co._get_name(), name1)
co=cm.GiveContainer( p )
- self.assertEqual(co._get_name(), "/Containers/clt10br/MyContainer")
+ host2=co.getHostName()
+ name2="/Containers/%s/MyContainer" % host2
+ self.assertEqual(co._get_name(), name2)
if __name__ == '__main__':
self.assertRaises(SALOME.SALOME_Exception,rm.GetFittingResources,params)
def test2(self):
- """component add required"""
+ """component add required.
+ If a resource doesn't have any module or component defined in the catalog,
+ it means that it has every module and component and it fits for any request.
+ """
params=LifeCycleCORBA.ResourceParameters(componentList=["add"])
machineList=rm.GetFittingResources(params)
- self.assertEqual(machineList, ['claui2c6', 'm1', 'm2'])
+ self.assertEqual(machineList, ['claui2c6', 'localhost', 'm1', 'm2'])
def test3(self):
"""component tutu required"""
params=LifeCycleCORBA.ResourceParameters(componentList=["tutu"])
machineList=rm.GetFittingResources(params)
- self.assertEqual(machineList, ['m1', 'm2', 'm3'])
+ self.assertEqual(machineList, ['localhost', 'm1', 'm2', 'm3'])
def test4(self):
"""component tata required"""
params=LifeCycleCORBA.ResourceParameters(componentList=["tata"])
machineList=rm.GetFittingResources(params)
- self.assertEqual(machineList, ['m1', 'm2'])
+ self.assertEqual(machineList, ['localhost', 'm1', 'm2'])
def test5(self):
"""component titi required"""
params=LifeCycleCORBA.ResourceParameters(componentList=["titi"])
machineList=rm.GetFittingResources(params)
- self.assertEqual(machineList, ['m1', 'm2'])
+ self.assertEqual(machineList, ['localhost', 'm1', 'm2'])
def test6(self):
"""component toto required"""
params=LifeCycleCORBA.ResourceParameters(componentList=["toto"])
machineList=rm.GetFittingResources(params)
- self.assertEqual(machineList, ['claui2c6', 'm1', 'm2'])
+ self.assertEqual(machineList, ['claui2c6', 'localhost', 'm1', 'm2'])
def test7(self):
"""components add and toto required"""
params=LifeCycleCORBA.ResourceParameters(componentList=["add","toto"])
machineList=rm.GetFittingResources(params)
- self.assertEqual(machineList, ['claui2c6', 'm1', 'm2'])
+ self.assertEqual(machineList, ['claui2c6', 'localhost', 'm1', 'm2'])
def test8(self):
"""components add and toto required"""
params=LifeCycleCORBA.ResourceParameters(componentList=["add","toto"])
machineList=rm.GetFittingResources(params)
self.assertEqual(rm.Find('altcycl',machineList), "claui2c6")
+ self.assertEqual(rm.Find('altcycl',machineList), "localhost")
self.assertEqual(rm.Find('altcycl',machineList), "m1")
self.assertEqual(rm.Find('altcycl',machineList), "m2")
self.assertEqual(rm.Find('altcycl',machineList), "claui2c6")
+ self.assertEqual(rm.Find('altcycl',machineList), "localhost")
self.assertEqual(rm.Find('altcycl',machineList), "m1")
self.assertEqual(rm.Find('altcycl',machineList), "m2")
params=LifeCycleCORBA.ResourceParameters(componentList=["add","toto"])
machineList=rm.GetFittingResources(params)
self.assertEqual(rm.Find('cycl',machineList), "claui2c6")
+ self.assertEqual(rm.Find('cycl',machineList), "localhost")
self.assertEqual(rm.Find('cycl',machineList), "m1")
self.assertEqual(rm.Find('cycl',machineList), "m2")
self.assertEqual(rm.Find('cycl',machineList), "claui2c6")
+ self.assertEqual(rm.Find('cycl',machineList), "localhost")
self.assertEqual(rm.Find('cycl',machineList), "m1")
self.assertEqual(rm.Find('cycl',machineList), "m2")
params=LifeCycleCORBA.ResourceParameters(componentList=["add","toto"])
machineList=rm.GetFittingResources(params)
self.assertEqual(rm.Find('best',machineList), "claui2c6")
+ self.assertEqual(rm.Find('best',machineList), "localhost")
self.assertEqual(rm.Find('best',machineList), "m1")
self.assertEqual(rm.Find('best',machineList), "m2")
self.assertEqual(rm.Find('best',machineList), "claui2c6")
+ self.assertEqual(rm.Find('best',machineList), "localhost")
self.assertEqual(rm.Find('best',machineList), "m1")
self.assertEqual(rm.Find('best',machineList), "m2")