summaryrefslogtreecommitdiffstats
path: root/src/logicalfile/test
diff options
context:
space:
mode:
authorJan Synacek <jsynacek@redhat.com>2013-10-09 13:38:05 +0200
committerJan Synacek <jsynacek@redhat.com>2013-10-09 14:27:45 +0200
commitb7e528d124479cbbac636279a10abb527c987fe2 (patch)
treea2dea8fe43a6318754d7cadc64d2ff0eb65236bc /src/logicalfile/test
parent703ebe4493b59397f30bc2ee124c0d9c76be57f5 (diff)
downloadopenlmi-providers-b7e528d124479cbbac636279a10abb527c987fe2.tar.gz
openlmi-providers-b7e528d124479cbbac636279a10abb527c987fe2.tar.xz
openlmi-providers-b7e528d124479cbbac636279a10abb527c987fe2.zip
logicalfile: more intrinsic methods for LMI_RootDirectory
Add EnumerateInstances() and GetInstance().
Diffstat (limited to 'src/logicalfile/test')
-rw-r--r--src/logicalfile/test/test_basic.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/logicalfile/test/test_basic.py b/src/logicalfile/test/test_basic.py
index 72e1f33..f682b33 100644
--- a/src/logicalfile/test/test_basic.py
+++ b/src/logicalfile/test/test_basic.py
@@ -390,6 +390,33 @@ class TestLogicalFile(LogicalFileTestBase):
self.assertEquals(len(assocs), 1)
self.assertEquals(assocs[0]['PartComponent']['Name'], '/')
+ ### EnumerateInstances and GetInstance
+ insts = self.wbemconnection.EnumerateInstances(assoc_class)
+ self.assertEquals(len(insts), 1)
+ system = insts[0]['GroupComponent']
+ rootdir = insts[0]['PartComponent']
+ self.assertEquals(system['CreationClassName'], self.SYSTEM_CLASS_NAME)
+ self.assertEquals(system['Name'], self.SYSTEM_NAME)
+ self.assertEquals(rootdir['CSCreationClassName'], self.SYSTEM_CLASS_NAME)
+ self.assertEquals(rootdir['CSName'], self.SYSTEM_NAME)
+ self.assertEquals(rootdir['Name'], '/')
+
+ inst_cop = pywbem.CIMInstanceName(classname=assoc_class,
+ namespace='root/cimv2',
+ keybindings={
+ 'GroupComponent':system,
+ 'PartComponent':rootdir
+ })
+ inst = self.wbemconnection.GetInstance(inst_cop)
+ self.assertTrue(inst is not None)
+ system = inst['GroupComponent']
+ rootdir = inst['PartComponent']
+ self.assertEquals(system['CreationClassName'], self.SYSTEM_CLASS_NAME)
+ self.assertEquals(system['Name'], self.SYSTEM_NAME)
+ self.assertEquals(rootdir['CSCreationClassName'], self.SYSTEM_CLASS_NAME)
+ self.assertEquals(rootdir['CSName'], self.SYSTEM_NAME)
+ self.assertEquals(rootdir['Name'], '/')
+
def test_mkdir(self):
def mkdir(path):
cop = self.cop.copy()