Back to index

salome-kernel  6.5.0
Public Member Functions
testresourcemanager.TestResourceManager Class Reference

List of all members.

Public Member Functions

def setUp
def test0
def test1
def test2
def test3
def test4
def test5
def test6
def test7
def test8
def test10
def test11
def test12
def test13

Detailed Description

Test with CatalogResources.xml:
<!DOCTYPE ResourcesCatalog>
<resources>
 <machine hostname="m1" />
 <machine hostname="m2" />
 <machine hostname="m3" >
   <modules moduleName="tutu" />
 </machine>
 <machine hostname="m4" >
   <component name="sub" moduleName="tata" />
 </machine>
 <machine hostname="claui2c6" >
   <modules moduleName="toto" />
   <component name="add" moduleName="titi" />
 </machine>
</resources>

Definition at line 29 of file testresourcemanager.py.


Member Function Documentation

Definition at line 48 of file testresourcemanager.py.

00048 
00049   def setUp(self):
00050     pass

host required

Definition at line 51 of file testresourcemanager.py.

00051 
00052   def test0(self):
00053     """host required"""
00054     params=LifeCycleCORBA.ResourceParameters(hostname="m3")
00055     machineList=rm.GetFittingResources(params)
00056     self.assertEqual(machineList, ["m3"])

OS required

Definition at line 57 of file testresourcemanager.py.

00057 
00058   def test1(self):
00059     """OS required"""
00060     params=LifeCycleCORBA.ResourceParameters(OS="Linux")
00061     self.assertRaises(SALOME.SALOME_Exception,rm.GetFittingResources,params)

policy altcycl

Definition at line 103 of file testresourcemanager.py.

00103 
00104   def test10(self):
00105     """policy altcycl"""
00106     params=LifeCycleCORBA.ResourceParameters(componentList=["add","toto"])
00107     machineList=rm.GetFittingResources(params)
00108     self.assertEqual(rm.Find('altcycl',machineList), "claui2c6")
00109     self.assertEqual(rm.Find('altcycl',machineList), "m1")
00110     self.assertEqual(rm.Find('altcycl',machineList), "m2")
00111     self.assertEqual(rm.Find('altcycl',machineList), "claui2c6")
00112     self.assertEqual(rm.Find('altcycl',machineList), "m1")
00113     self.assertEqual(rm.Find('altcycl',machineList), "m2")

policy cycl

Definition at line 114 of file testresourcemanager.py.

00114 
00115   def test11(self):
00116     """policy cycl"""
00117     params=LifeCycleCORBA.ResourceParameters(componentList=["add","toto"])
00118     machineList=rm.GetFittingResources(params)
00119     self.assertEqual(rm.Find('cycl',machineList), "claui2c6")
00120     self.assertEqual(rm.Find('cycl',machineList), "m1")
00121     self.assertEqual(rm.Find('cycl',machineList), "m2")
00122     self.assertEqual(rm.Find('cycl',machineList), "claui2c6")
00123     self.assertEqual(rm.Find('cycl',machineList), "m1")
00124     self.assertEqual(rm.Find('cycl',machineList), "m2")

policy first

Definition at line 125 of file testresourcemanager.py.

00125 
00126   def test12(self):
00127     """policy first"""
00128     params=LifeCycleCORBA.ResourceParameters(componentList=["add","toto"])
00129     machineList=rm.GetFittingResources(params)
00130     self.assertEqual(rm.Find('first',machineList), "claui2c6")
00131     self.assertEqual(rm.Find('first',machineList), "claui2c6")

policy best

Definition at line 132 of file testresourcemanager.py.

00132 
00133   def test13(self):
00134     """policy best"""
00135     params=LifeCycleCORBA.ResourceParameters(componentList=["add","toto"])
00136     machineList=rm.GetFittingResources(params)
00137     self.assertEqual(rm.Find('best',machineList), "claui2c6")
00138     self.assertEqual(rm.Find('best',machineList), "m1")
00139     self.assertEqual(rm.Find('best',machineList), "m2")
00140     self.assertEqual(rm.Find('best',machineList), "claui2c6")
00141     self.assertEqual(rm.Find('best',machineList), "m1")
00142     self.assertEqual(rm.Find('best',machineList), "m2")

component add required

Definition at line 62 of file testresourcemanager.py.

00062 
00063   def test2(self):
00064     """component add required"""
00065     params=LifeCycleCORBA.ResourceParameters(componentList=["add"])
00066     machineList=rm.GetFittingResources(params)
00067     self.assertEqual(machineList, ['claui2c6', 'm1', 'm2'])

component tutu required

Definition at line 68 of file testresourcemanager.py.

00068 
00069   def test3(self):
00070     """component tutu required"""
00071     params=LifeCycleCORBA.ResourceParameters(componentList=["tutu"])
00072     machineList=rm.GetFittingResources(params)
00073     self.assertEqual(machineList, ['m1', 'm2', 'm3'])

component tata required

Definition at line 74 of file testresourcemanager.py.

00074 
00075   def test4(self):
00076     """component tata required"""
00077     params=LifeCycleCORBA.ResourceParameters(componentList=["tata"])
00078     machineList=rm.GetFittingResources(params)
00079     self.assertEqual(machineList, ['m1', 'm2'])

component titi required

Definition at line 80 of file testresourcemanager.py.

00080 
00081   def test5(self):
00082     """component titi required"""
00083     params=LifeCycleCORBA.ResourceParameters(componentList=["titi"])
00084     machineList=rm.GetFittingResources(params)
00085     self.assertEqual(machineList, ['m1', 'm2'])

component toto required

Definition at line 86 of file testresourcemanager.py.

00086 
00087   def test6(self):
00088     """component toto required"""
00089     params=LifeCycleCORBA.ResourceParameters(componentList=["toto"])
00090     machineList=rm.GetFittingResources(params)
00091     self.assertEqual(machineList, ['claui2c6', 'm1', 'm2'])

components add and toto required

Definition at line 92 of file testresourcemanager.py.

00092 
00093   def test7(self):
00094     """components add and toto required"""
00095     params=LifeCycleCORBA.ResourceParameters(componentList=["add","toto"])
00096     machineList=rm.GetFittingResources(params)
00097     self.assertEqual(machineList, ['claui2c6', 'm1', 'm2'])

components add and toto required

Definition at line 98 of file testresourcemanager.py.

00098 
00099   def test8(self):
00100     """components add and toto required"""
00101     machineDef=rm.GetResourceDefinition('claui2c6')
00102     self.assertEqual(machineDef.componentList, ['toto', 'add'])


The documentation for this class was generated from the following file: