From 74068b042909f529d878daa6a3cd85eee7ca4f8c Mon Sep 17 00:00:00 2001 From: Michal Minar Date: Thu, 24 Oct 2013 08:56:28 +0200 Subject: tests: use shared base class in provider tests Done for: Account, Journald and LogicalFile --- src/account/test/TestAccount.py | 2 +- src/account/test/TestGroup.py | 2 +- src/account/test/TestIndications.py | 2 + src/account/test/TestService.py | 2 +- src/account/test/common.py | 186 ++--------------------------------- src/journald/test/TestIndications.py | 6 ++ src/journald/test/TestIterators.py | 4 + src/journald/test/TestWriting.py | 4 + src/journald/test/journald_common.py | 186 +---------------------------------- src/logicalfile/test/test_base.py | 15 +-- src/logicalfile/test/test_basic.py | 34 +++---- 11 files changed, 54 insertions(+), 389 deletions(-) diff --git a/src/account/test/TestAccount.py b/src/account/test/TestAccount.py index 53cb429..a66ef45 100644 --- a/src/account/test/TestAccount.py +++ b/src/account/test/TestAccount.py @@ -49,7 +49,7 @@ class TestAccount(AccountBase): # make sure the account will not exist clean_account(self.user_name) computer_system = self.wbemconnection.ExecQuery('WQL', - 'select * from PG_ComputerSystem')[0] + 'select * from %s' % self.system_cs_name)[0] lams = self.wbemconnection.ExecQuery('WQL', 'select * from LMI_AccountManagementService')[0] self.wbemconnection.InvokeMethod("CreateAccount", lams.path, diff --git a/src/account/test/TestGroup.py b/src/account/test/TestGroup.py index 1ad104d..d0bec65 100644 --- a/src/account/test/TestGroup.py +++ b/src/account/test/TestGroup.py @@ -47,7 +47,7 @@ class TestGroup(AccountBase): # make sure the group will not exist clean_group(self.group_name) computer_system = self.wbemconnection.ExecQuery('WQL', - 'select * from PG_ComputerSystem')[0] + 'select * from %s' % self.system_cs_name)[0] lams = self.wbemconnection.ExecQuery('WQL', 'select * from LMI_AccountManagementService')[0] self.wbemconnection.InvokeMethod("CreateGroup", lams.path, diff --git a/src/account/test/TestIndications.py b/src/account/test/TestIndications.py index 7b34b2e..5f74548 100644 --- a/src/account/test/TestIndications.py +++ b/src/account/test/TestIndications.py @@ -25,6 +25,8 @@ class TestIndications(AccountBase): """ Class for testing LMI_Account indications """ + NEEDS_INDICATIONS = True + def test_check_good_filter(self): """ Account: Test good indication filter diff --git a/src/account/test/TestService.py b/src/account/test/TestService.py index 3450ccf..1b34d69 100644 --- a/src/account/test/TestService.py +++ b/src/account/test/TestService.py @@ -34,7 +34,7 @@ class TestService(AccountBase): # make sure the account will not exist clean_account(self.user_name) computer_system = self.wbemconnection.ExecQuery('WQL', - 'select * from PG_ComputerSystem')[0] + 'select * from %s' % self.system_cs_name)[0] lams = self.wbemconnection.ExecQuery('WQL', 'select * from LMI_AccountManagementService')[0] diff --git a/src/account/test/common.py b/src/account/test/common.py index 57975be..8e1c20d 100644 --- a/src/account/test/common.py +++ b/src/account/test/common.py @@ -17,188 +17,22 @@ # # Authors: Roman Rakus # - -import pywbem -import os -import unittest -import Queue -import random -import BaseHTTPServer -import socket -import threading - """ -Base class for all tests +Base class and utilities for all OpenLMI Account tests. """ -class CIMListener(object): - """ CIM Listener - """ - class CIMHandler(BaseHTTPServer.BaseHTTPRequestHandler): - def do_POST(self): - data = self.rfile.read(int(self.headers['Content-Length'])) - tt = pywbem.parse_cim(pywbem.xml_to_tupletree(data)) - # Get the instance from CIM-XML, copied from - # http://sf.net/apps/mediawiki/pywbem/?title=Indications_Tutorial - insts = [x[1] for x in tt[2][2][0][2][2]] - for inst in insts: - self.callback(inst) - self.send_response(200) - self.end_headers() - - def log_message(self, format, *p): - # suppress log messages - pass - - def __init__(self, callback, http_port=5988): - self.address = ('', http_port) - self.CIMHandler.callback = callback - self.thread = None - self.server = None - - def start(self): - BaseHTTPServer.HTTPServer.allow_reuse_address = True - self.server = BaseHTTPServer.HTTPServer(self.address, self.CIMHandler) - self.thread = threading.Thread(target=self.server.serve_forever) - self.thread.start() - - def stop(self): - if self.server is not None: - self.server.shutdown() - self.server.socket.close() - if self.thread is not None: - self.thread.join() - - def running(self): - return self.thread is not None +import os +from lmi.test import base -class AccountBase(unittest.TestCase): +class AccountBase(base.LmiTestCase): """ - Base class for all LMI Account tests + Base class for all LMI Account tests. """ - def setUp(self): - """ - Connnect to server - """ - self.url = os.environ.get("LMI_CIMOM_URL", "https://localhost:5989") - self.username = os.environ.get("LMI_CIMOM_USERNAME", "root") - self.password = os.environ.get("LMI_CIMOM_PASSWORD", "") - self.user_name = os.environ.get("LMI_ACCOUNT_USER") - self.group_name = os.environ.get("LMI_ACCOUNT_GROUP") - self.wbemconnection = pywbem.WBEMConnection(self.url, - (self.username, self.password)) - - # for indications - self.indication_port = random.randint(12000, 13000) - self.indication_queue = Queue.Queue() - self.listener = CIMListener( - callback=self._process_indication, - http_port=self.indication_port) - - self.subscribed = {} - - def tearDown(self): - self.listener.stop() - if self.subscribed: - for name in self.subscribed.keys(): - self.unsubscribe(name) - - def get_indication(self, timeout): - """ Wait for an indication for given nr. of seconds and return it.""" - try: - indication = self.indication_queue.get(timeout=timeout) - except Queue.Empty: - raise AssertionError("Timeout when waiting for indicaiton") - self.indication_queue.task_done() - return indication - - def subscribe(self, filter_name, query=None, querylang="DMTF:CQL"): - """ - Create indication subscription for given filter name. - """ - namespace = "root/interop" - hostname = socket.gethostname() - - if query is not None: - # Create filter first - filterinst = pywbem.CIMInstance('CIM_IndicationFilter') - filterinst['CreationClassName'] = 'CIM_IndicationFilter' - filterinst['SystemCreationClassName'] = 'CIM_ComputerSystem' - filterinst['SystemName'] = hostname - filterinst['Name'] = filter_name - filterinst['Query'] = query - filterinst['QueryLanguage'] = querylang - filterinst['SourceNamespace'] = "root/cimv2"#namespace - cop = pywbem.CIMInstanceName('CIM_IndicationFilter') - cop.keybindings = { 'CreationClassName': 'CIM_IndicationFilter', - 'SystemClassName': 'CIM_ComputerSystem', - 'SystemName': hostname, - 'Name': filter_name - } - cop.namespace=namespace - filterinst.path = cop - indfilter = self.wbemconnection.CreateInstance(filterinst) - else: - # the filter is already created, assemble its name - indfilter = pywbem.CIMInstanceName( - classname="CIM_IndicationFilter", - namespace=namespace, - keybindings={ - 'CreationClassName': 'CIM_IndicationFilter', - 'SystemClassName': 'CIM_ComputerSystem', - 'SystemName': hostname, - 'Name': filter_name}) - - # create destination - destinst = pywbem.CIMInstance('CIM_ListenerDestinationCIMXML') - destinst['CreationClassName'] = 'CIM_ListenerDestinationCIMXML' - destinst['SystemCreationClassName'] = 'CIM_ComputerSystem' - destinst['SystemName'] = hostname - destinst['Name'] = filter_name - destinst['Destination'] = "http://localhost:%d" % (self.indication_port) - destinst['PersistenceType'] = pywbem.Uint16(3) # Transient - cop = pywbem.CIMInstanceName('CIM_ListenerDestinationCIMXML') - cop.keybindings = { 'CreationClassName':'CIM_ListenerDestinationCIMXML', - 'SystemClassName':'CIM_ComputerSystem', - 'SystemName':hostname, - 'Name':filter_name } - cop.namespace = namespace - destinst.path = cop - destname = self.wbemconnection.CreateInstance(destinst) - - # create the subscription - subinst = pywbem.CIMInstance('CIM_IndicationSubscription') - subinst['Filter'] = indfilter - subinst['Handler'] = destname - cop = pywbem.CIMInstanceName('CIM_IndicationSubscription') - cop.keybindings = { 'Filter': indfilter, - 'Handler': destname } - cop.namespace = namespace - subinst.path = cop - subscription = self.wbemconnection.CreateInstance(subinst) - - self.subscribed[filter_name] = [subscription, destname] - - # start listening - if not self.listener.running(): - self._start_listening() - return subscription - - def unsubscribe(self, filter_name): - """ - Unsubscribe fron given filter. - """ - _list = self.subscribed.pop(filter_name) - for instance in _list: - self.wbemconnection.DeleteInstance(instance) - - def _start_listening(self): - """ Start listening for incoming indications. """ - self.listener.start() - - def _process_indication(self, indication): - """ Callback to process one indication.""" - self.indication_queue.put(indication) + @classmethod + def setUpClass(cls): + base.LmiTestCase.setUpClass.im_func(cls) + cls.user_name = os.environ.get("LMI_ACCOUNT_USER") + cls.group_name = os.environ.get("LMI_ACCOUNT_GROUP") diff --git a/src/journald/test/TestIndications.py b/src/journald/test/TestIndications.py index 3b8dd0f..8964450 100644 --- a/src/journald/test/TestIndications.py +++ b/src/journald/test/TestIndications.py @@ -20,12 +20,15 @@ from journald_common import JournalBase import time import syslog +import unittest class TestIndications(JournalBase): """ Class for testing LMI_JournalMessageLog indications """ + NEEDS_INDICATIONS = True + def test_check_good_filter(self): """ Journal: Test good indication filter @@ -50,3 +53,6 @@ class TestIndications(JournalBase): self.assertTrue(indication["SourceInstance"] is not None) self.assertIn(syslog_msg, indication["SourceInstance"]["DataFormat"]) self.unsubscribe(filter_name); + +if __name__ == '__main__': + unittest.main() diff --git a/src/journald/test/TestIterators.py b/src/journald/test/TestIterators.py index 49eceef..fd90a12 100644 --- a/src/journald/test/TestIterators.py +++ b/src/journald/test/TestIterators.py @@ -19,6 +19,7 @@ from journald_common import JournalBase import pywbem +import unittest CIM_MESSAGELOG_ITERATOR_RESULT_SUCCESS = 0 CIM_MESSAGELOG_ITERATOR_RESULT_NOT_SUPPORTED = 1 @@ -157,3 +158,6 @@ class TestIterators(JournalBase): (retval, _) = self.wbemconnection.InvokeMethod(MethodName="CancelIteration", ObjectName=inst.path, IterationIdentifier=rfirst['IterationIdentifier']) self.assertEqual(retval, 0) + +if __name__ == '__main__': + unittest.main() diff --git a/src/journald/test/TestWriting.py b/src/journald/test/TestWriting.py index 6ac4af8..39891a5 100644 --- a/src/journald/test/TestWriting.py +++ b/src/journald/test/TestWriting.py @@ -20,6 +20,7 @@ from journald_common import JournalBase import time import pywbem +import unittest class TestWriting(JournalBase): """ @@ -41,3 +42,6 @@ class TestWriting(JournalBase): self.assertIsNotNone(iname.keybindings['RecordID']) self.assertIsNotNone(iname.keybindings['MessageTimestamp']) self.assertIn(new_msg, new_inst['DataFormat']) + +if __name__ == '__main__': + unittest.main() diff --git a/src/journald/test/journald_common.py b/src/journald/test/journald_common.py index f2d0942..d56c5e9 100644 --- a/src/journald/test/journald_common.py +++ b/src/journald/test/journald_common.py @@ -17,193 +17,15 @@ # Authors: Roman Rakus # Tomas Bzatek # - -import pywbem -import os -import unittest -import Queue -import random -import BaseHTTPServer -import socket -import threading - """ -Base class for all tests +Base class and utilities for Journald tests. """ -class CIMListener(object): - """ CIM Listener - """ - class CIMHandler(BaseHTTPServer.BaseHTTPRequestHandler): - def do_POST(self): - data = self.rfile.read(int(self.headers['Content-Length'])) - tt = pywbem.parse_cim(pywbem.xml_to_tupletree(data)) - # Get the instance from CIM-XML, copied from - # http://sf.net/apps/mediawiki/pywbem/?title=Indications_Tutorial - insts = [x[1] for x in tt[2][2][0][2][2]] - for inst in insts: - self.callback(inst) - self.send_response(200) - self.end_headers() - - def log_message(self, format, *p): - # suppress log messages - pass - - def __init__(self, callback, http_port=5988): - self.address = ('', http_port) - self.CIMHandler.callback = callback - self.thread = None - self.server = None - - def start(self): - BaseHTTPServer.HTTPServer.allow_reuse_address = True - self.server = BaseHTTPServer.HTTPServer(self.address, self.CIMHandler) - self.thread = threading.Thread(target=self.server.serve_forever) - self.thread.start() +from lmi.test import base - def stop(self): - if self.server is not None: - self.server.shutdown() - self.server.socket.close() - if self.thread is not None: - self.thread.join() - - def running(self): - return self.thread is not None - - -class JournalBase(unittest.TestCase): +class JournalBase(base.LmiTestCase): """ Base class for all LMI Journal tests """ - def setUp(self): - """ - Connnect to server - """ - self.url = os.environ.get("LMI_CIMOM_URL", "https://localhost:5989") - self.username = os.environ.get("LMI_CIMOM_USERNAME", "root") - self.password = os.environ.get("LMI_CIMOM_PASSWORD", "") - self.wbemconnection = pywbem.WBEMConnection(self.url, - (self.username, self.password)) - - # for indications - self.indication_port = random.randint(12000, 13000) - self.indication_queue = Queue.Queue() - self.listener = CIMListener( - callback=self._process_indication, - http_port=self.indication_port) - - self.subscribed = {} - - def tearDown(self): - self.listener.stop() - if self.subscribed: - for name in self.subscribed.keys(): - self.unsubscribe(name) - - def get_indication(self, timeout): - """ Wait for an indication for given nr. of seconds and return it.""" - try: - indication = self.indication_queue.get(timeout=timeout) - except Queue.Empty: - raise AssertionError("Timeout when waiting for indicaiton") - self.indication_queue.task_done() - return indication - - def subscribe(self, filter_name, query=None, querylang="DMTF:CQL"): - """ - Create indication subscription for given filter name. - """ - namespace = "root/interop" - hostname = socket.gethostname() - - if query is not None: - # Create filter first - filterinst = pywbem.CIMInstance('CIM_IndicationFilter') - filterinst['CreationClassName'] = 'CIM_IndicationFilter' - filterinst['SystemCreationClassName'] = 'CIM_ComputerSystem' - filterinst['SystemName'] = hostname - filterinst['Name'] = filter_name - filterinst['Query'] = query - filterinst['QueryLanguage'] = querylang - filterinst['SourceNamespace'] = "root/cimv2"#namespace - cop = pywbem.CIMInstanceName('CIM_IndicationFilter') - cop.keybindings = { 'CreationClassName': 'CIM_IndicationFilter', - 'SystemClassName': 'CIM_ComputerSystem', - 'SystemName': hostname, - 'Name': filter_name - } - cop.namespace=namespace - filterinst.path = cop - indfilter = self.wbemconnection.CreateInstance(filterinst) - else: - # the filter is already created, assemble its name - indfilter = pywbem.CIMInstanceName( - classname="CIM_IndicationFilter", - namespace=namespace, - keybindings={ - 'CreationClassName': 'CIM_IndicationFilter', - 'SystemClassName': 'CIM_ComputerSystem', - 'SystemName': hostname, - 'Name': filter_name}) - - # create destination - destinst = pywbem.CIMInstance('CIM_ListenerDestinationCIMXML') - destinst['CreationClassName'] = 'CIM_ListenerDestinationCIMXML' - destinst['SystemCreationClassName'] = 'CIM_ComputerSystem' - destinst['SystemName'] = hostname - destinst['Name'] = filter_name - destinst['Destination'] = "http://localhost:%d" % (self.indication_port) - destinst['PersistenceType'] = pywbem.Uint16(3) # Transient - cop = pywbem.CIMInstanceName('CIM_ListenerDestinationCIMXML') - cop.keybindings = { 'CreationClassName':'CIM_ListenerDestinationCIMXML', - 'SystemClassName':'CIM_ComputerSystem', - 'SystemName':hostname, - 'Name':filter_name } - cop.namespace = namespace - destinst.path = cop - destname = self.wbemconnection.CreateInstance(destinst) - - # create the subscription - subinst = pywbem.CIMInstance('CIM_IndicationSubscription') - subinst['Filter'] = indfilter - subinst['Handler'] = destname - cop = pywbem.CIMInstanceName('CIM_IndicationSubscription') - cop.keybindings = { 'Filter': indfilter, - 'Handler': destname } - cop.namespace = namespace - subinst.path = cop - subscription = self.wbemconnection.CreateInstance(subinst) - - self.subscribed[filter_name] = [subscription, destname] - - # start listening - if not self.listener.running(): - self._start_listening() - return subscription - - def unsubscribe(self, filter_name): - """ - Unsubscribe fron given filter. - """ - _list = self.subscribed.pop(filter_name) - for instance in _list: - self.wbemconnection.DeleteInstance(instance) - - def _start_listening(self): - """ Start listening for incoming indications. """ - self.listener.start() - - def _process_indication(self, indication): - """ Callback to process one indication.""" - self.indication_queue.put(indication) + pass - def assertRaisesCIM(self, cim_err_code, func, *args, **kwds): - """ - This test passes if given function called with supplied arguments - raises pywbem.CIMError with given cim error code. - """ - with self.assertRaises(pywbem.CIMError) as cm: - func(*args, **kwds) - self.assertEqual(cim_err_code, cm.exception.args[0]) diff --git a/src/logicalfile/test/test_base.py b/src/logicalfile/test/test_base.py index 3cd6531..0e94d53 100644 --- a/src/logicalfile/test/test_base.py +++ b/src/logicalfile/test/test_base.py @@ -16,27 +16,20 @@ # # Authors: Jan Synacek -import pywbem import os -import socket -import unittest import subprocess import pyudev -class LogicalFileTestBase(unittest.TestCase): +from lmi.test import base + +class LogicalFileTestBase(base.LmiTestCase): """ Base class for all LogicalFile tests. """ - SYSTEM_CLASS_NAME = "PG_ComputerSystem" - SYSTEM_NAME = socket.getfqdn() - @classmethod def setUpClass(cls): - cls.url = os.environ.get("LMI_CIMOM_URL", "https://localhost:5989") - cls.username = os.environ.get("LMI_CIMOM_USERNAME", "root") - cls.password = os.environ.get("LMI_CIMOM_PASSWORD", "") - cls.wbemconnection = pywbem.WBEMConnection(cls.url, (cls.username, cls.password)) + base.LmiTestCase.setUpClass.im_func(cls) cls.testdir = os.environ.get("LMI_LOGICALFILE_TESTDIR", "/var/tmp/logicalfile-tests") cls.selinux_enabled = True try: diff --git a/src/logicalfile/test/test_basic.py b/src/logicalfile/test/test_basic.py index e477dee..d813f1a 100644 --- a/src/logicalfile/test/test_basic.py +++ b/src/logicalfile/test/test_basic.py @@ -70,7 +70,7 @@ class TestLogicalFile(LogicalFileTestBase): self.cop = pywbem.CIMInstanceName(classname='LMI_UnixDirectory', namespace='root/cimv2', keybindings={ - 'CSCreationClassName':self.SYSTEM_CLASS_NAME, + 'CSCreationClassName':self.system_cs_name, 'CSName':self.SYSTEM_NAME, 'FSCreationClassName':'LMI_LocalFileSystem', 'FSName':self.fsname, @@ -154,7 +154,7 @@ class TestLogicalFile(LogicalFileTestBase): cop_file = pywbem.CIMInstanceName(classname=f['class'], namespace='root/cimv2', keybindings={ - 'CSCreationClassName':self.SYSTEM_CLASS_NAME, + 'CSCreationClassName':self.system_cs_name, 'CSName':self.SYSTEM_NAME, 'FSCreationClassName':'LMI_LocalFileSystem', 'FSName':self.fsname, @@ -180,7 +180,7 @@ class TestLogicalFile(LogicalFileTestBase): AssocClass=assoc_class, Role='PartComponent', ResultRole='GroupComponent', - ResultClass=self.SYSTEM_CLASS_NAME) + ResultClass=self.system_cs_name) self.assertEquals(assocs_file, []) ### References and ReferenceNames @@ -198,7 +198,7 @@ class TestLogicalFile(LogicalFileTestBase): cop_file = pywbem.CIMInstanceName(classname=f['class'], namespace='root/cimv2', keybindings={ - 'CSCreationClassName':self.SYSTEM_CLASS_NAME, + 'CSCreationClassName':self.system_cs_name, 'CSName':self.SYSTEM_NAME, 'FSCreationClassName':'LMI_LocalFileSystem', 'FSName':self.fsname, @@ -250,14 +250,14 @@ class TestLogicalFile(LogicalFileTestBase): AssocClass=assoc_class, Role='SystemElement', ResultRole='SameElement', - ResultClass=self.SYSTEM_CLASS_NAME) + ResultClass=self.system_cs_name) self.assertEquals(assocs_ident, []) ## SameElement - CIM_LogicalFile cop_ident = pywbem.CIMInstanceName(classname='LMI_UnixFile', namespace='root/cimv2', keybindings={ - 'CSCreationClassName':self.SYSTEM_CLASS_NAME, + 'CSCreationClassName':self.system_cs_name, 'CSName':self.SYSTEM_NAME, 'FSCreationClassName':'LMI_LocalFileSystem', 'FSName':self.fsname, @@ -283,7 +283,7 @@ class TestLogicalFile(LogicalFileTestBase): AssocClass=assoc_class, Role='SameElement', ResultRole='SystemElement', - ResultClass=self.SYSTEM_CLASS_NAME) + ResultClass=self.system_cs_name) self.assertEquals(assocs_ident, []) ### References and ReferenceNames @@ -308,7 +308,7 @@ class TestLogicalFile(LogicalFileTestBase): cop_ident = pywbem.CIMInstanceName(classname='LMI_UnixFile', namespace='root/cimv2', keybindings={ - 'CSCreationClassName':self.SYSTEM_CLASS_NAME, + 'CSCreationClassName':self.system_cs_name, 'CSName':self.SYSTEM_NAME, 'FSCreationClassName':'LMI_LocalFileSystem', 'FSName':self.fsname, @@ -332,10 +332,10 @@ class TestLogicalFile(LogicalFileTestBase): AssocClass=assoc_class, Role='PartComponent', ResultRole='GroupComponent', - ResultClass=self.SYSTEM_CLASS_NAME) + ResultClass=self.system_cs_name) self.assertEquals(len(assocs), 1) system = assocs[0] - self.assertEquals(system['CreationClassName'], self.SYSTEM_CLASS_NAME) + self.assertEquals(system['CreationClassName'], self.system_cs_name) self.assertEquals(system['Name'], self.SYSTEM_NAME) # wrong Role assocs = assoc_method(cop, AssocClass=assoc_class, Role='GroupComponent') @@ -372,7 +372,7 @@ class TestLogicalFile(LogicalFileTestBase): AssocClass=assoc_class, Role='GroupComponent', ResultRole='PartComponent', - ResultClass=self.SYSTEM_CLASS_NAME) + ResultClass=self.system_cs_name) self.assertEquals(assocs, []) @@ -382,7 +382,7 @@ class TestLogicalFile(LogicalFileTestBase): assocs = assoc_method(cop, ResultClass=assoc_class) self.assertEquals(len(assocs), 1) system = assocs[0]['GroupComponent'] - self.assertEquals(system['CreationClassName'], self.SYSTEM_CLASS_NAME) + self.assertEquals(system['CreationClassName'], self.system_cs_name) self.assertEquals(system['Name'], self.SYSTEM_NAME) ## GroupComponent - LMI_UnixDirectory @@ -395,9 +395,9 @@ class TestLogicalFile(LogicalFileTestBase): self.assertEquals(len(insts), 1) system = insts[0]['GroupComponent'] rootdir = insts[0]['PartComponent'] - self.assertEquals(system['CreationClassName'], self.SYSTEM_CLASS_NAME) + self.assertEquals(system['CreationClassName'], self.system_cs_name) self.assertEquals(system['Name'], self.SYSTEM_NAME) - self.assertEquals(rootdir['CSCreationClassName'], self.SYSTEM_CLASS_NAME) + self.assertEquals(rootdir['CSCreationClassName'], self.system_cs_name) self.assertEquals(rootdir['CSName'], self.SYSTEM_NAME) self.assertEquals(rootdir['Name'], '/') @@ -411,9 +411,9 @@ class TestLogicalFile(LogicalFileTestBase): self.assertTrue(inst is not None) system = inst['GroupComponent'] rootdir = inst['PartComponent'] - self.assertEquals(system['CreationClassName'], self.SYSTEM_CLASS_NAME) + self.assertEquals(system['CreationClassName'], self.system_cs_name) self.assertEquals(system['Name'], self.SYSTEM_NAME) - self.assertEquals(rootdir['CSCreationClassName'], self.SYSTEM_CLASS_NAME) + self.assertEquals(rootdir['CSCreationClassName'], self.system_cs_name) self.assertEquals(rootdir['CSName'], self.SYSTEM_NAME) self.assertEquals(rootdir['Name'], '/') @@ -463,7 +463,7 @@ class TestLogicalFile(LogicalFileTestBase): cop = pywbem.CIMInstanceName(classname=clsname, namespace='root/cimv2', keybindings={ - 'CSCreationClassName':self.SYSTEM_CLASS_NAME, + 'CSCreationClassName':self.system_cs_name, 'CSName':self.SYSTEM_NAME, 'FSCreationClassName':'', 'FSName':'', -- cgit