summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Hardware: added DiskDriveSAPAvailableForElementProviderPeter Schiffer2014-01-101-0/+279
| | | | | New provider: * LMI_DiskDriveSAPAvailableForElement
* logicalfile: don't automatically fill FSName and FSCreationClassNameJan Synacek2014-01-106-38/+53
| | | | | Set there properties on output, meaning when GetInstance() is invoked, only when they are empty. Otherwise leave them unchanged.
* software: SoftwareIdentityFileCheck test fixesMichal Minar2014-01-091-0/+3
| | | | | Under some environments umask may be set to 0077 which caused unexpected results in tests. File mode checks did not pass.
* logicalfile: replace thread-unsafe functionsJan Synacek2014-01-092-83/+100
| | | | | | | Some functions, such as readdir() and dirname(), are not thread-safe. Use equivalent glib functions. trac: #173
* Use re-entrant version of strerror() for thread safetyTomas Bzatek2014-01-0911-36/+60
|
* Hardware: added ATAProtocolEndpointProviderPeter Schiffer2014-01-092-0/+245
| | | | | New Provider: * LMI_ATAProtocolEndpoint
* tests: ensure the use of exceptions is well definedMichal Minar2014-01-084-7/+12
| | | | | | | | | | | | | | | Some tests expect that exceptions won't be thrown out of LMIShell's functions. Others prefers them and enable them globally. This causes problems when running under nosetests all provider tests at once. Tests that modified enablement of exception throws globally caused others to fail. This patch makes sure that each TestCase has defined use of exceptions. Default state is to have them disabled. If a TestCase prefers having them enabled, just one variable needs to be overriden in its body: class AccountBase(lmibase.LmiTestCase): USE_EXCEPTIONS = True
* tests: Add missing import.Jan Safranek2014-01-081-0/+1
|
* indmanager: Properly bump soname versionTomas Bzatek2014-01-071-2/+2
| | | | | The previous commit b915ee1ef9a4ebe bumped minor version number instead of major one that is more suitable for symbol hiding case.
* service: Port tests to lmishell baseTomas Bzatek2014-01-071-35/+23
|
* software: fixed possible deadlock in session managerMichal Minar2014-01-061-10/+20
| | | | | | * peak() method used to lock wrong mutex, which could cause a deadlock. * pop_reply() method could block if non-blocking access had been requested.
* software: test improvementsMichal Minar2014-01-069-24/+45
| | | | | | | | | | * Suppress warnings when removing testing packages that may have been modified by finished test. Whe some installed file were missing, rpm produced ugly warnings and errors. * Set LC_ALL=C when running yum and parsing its output. Otherwise numbers get localized, which confuses the parser. * Allow to run tests from another directory. * Minor cleanups and docstrings corrections.
* journald: Port tests to lmishell baseTomas Bzatek2014-01-034-75/+88
|
* account: Port tests to lmishell baseTomas Bzatek2014-01-036-112/+126
|
* Port indication test base to lmishellTomas Bzatek2014-01-031-0/+81
| | | | | Historically indication tests have been using pywbem machinery, which is now obsolete as lmishell gained proper indication support recently.
* account: Code cleanupTomas Bzatek2013-12-201-10/+1
| | | | Unused variable, unused assignment.
* indmanager: Properly free diff list dataTomas Bzatek2013-12-201-0/+2
|
* indmanager: Bump soname versionTomas Bzatek2013-12-201-2/+2
| | | | | | The commit c98f09a865f1b made some exported symbols hidden which can be considered an ABI break. Let's bump the library soname version to indicate a stable ABI for now.
* indmanager: Code annotation cleanupTomas Bzatek2013-12-201-22/+32
| | | | | | - annotate functions that are supposed to be called with mutex held - mark functions static if not exported public - remove unused declarations
* indmanager: Properly detach the manage thread from CIMOMTomas Bzatek2013-12-201-20/+41
| | | | | | | | | Accomplished that by registering a pthread cleanup handler that gets called on thread cancellation as well as on normal exit. A minor code shuffle had to be done since the cleanup handlers are macros in fact and no control flow commands (return, continue) should be called within.
* Let the test write to stderr.Jan Safranek2013-12-191-3/+3
| | | | | Our test framework logs stderr and stdout separately and it's hard to match them together.
* Hardware: added DiskDriveElementSoftwareIdentity associationPeter Schiffer2013-12-191-0/+274
| | | | | New provider: * LMI_DiskDriveElementSoftwareIdentity
* software: fixed tests behaviour under nosetestsMichal Minar2013-12-191-13/+13
| | | | | | | | | | | | Test cases under nosetests did not behave well. The part of class setup method was not called due to faulty checking of test case instantiation. It caused not-testing repositories to be enabled during running all but first test. This patch ensures that all not-testing repositories are disabled during subsequents test runs. If anyhing is missing upon intialization, testing database is recreated.
* software: test fixesMichal Minar2013-12-192-2/+9
| | | | | | | | | | * Restore repository, after the test run, only if it was previously enabled. * yum-config-manager, which is used to get information about reporitories, shortens lines on its output when too long. Therefor repository name can not be checked for exact match against data in LMI_SoftwareIdentityResource if it is too long.
* software: added test for SoftwareInstallationServiceMichal Minar2013-12-191-0/+20
| | | | | It checks, that error description is retrievable when the asynchronous job fails to execute.
* Do not skip LMI_MountedFileSystem during tests.Jan Safranek2013-12-181-1/+0
| | | | It was skipped just for debugging purposes.
* Fixed openlmi-mof-register not to crash when CIMOM is down.Jan Safranek2013-12-181-0/+303
| | | | | | | | | | /usr/bin/mofcomp requires that Pegasus runs at the time the script is executed. Therefore we could not register any MOF files into database if Pegasus was down. To fix this, openlmi-mof-register now does not depend on mofcomp and contains its own MOF parser to parse just '#pragma include' directives, comments and string literals.
* indmanager: Rework thread cancellation againTomas Bzatek2013-12-182-3/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The approach introduced in commit 381f4038a6a was on a good way however turned out the pthread_cancel() actually queues a cancellation request since we're using deferred cancellation mode and continues the code flow until a function that is a cancellation point is called. We unlocked the mutex before joining the thread which led to mutex acquisition by the thread and then cancelling on a syscall, leaving the mutex locked forever. Having cancellation and join with mutex held was not a solution as it would make the thread waiting for mutex leading to deadlock. Instead, this patch introduces a private flag that will indicate the thread should cancel itself. Two scenarios are possible: - the thread is doing unlocked stuff, typically waiting for events using syscalls that are cancellation points. In this case the pthread_cancel() will take effect immediately, breaking the syscall and quitting the thread. We're still in unlocked state. - the thread is holding the lock, in that case the im_stop_ind() will wait until that work is finished. It's better to leave the manage thread finish its job, it's mostly CMPI stuff and breaking in the middle would leak some memory. Once the main thread acquires the mutex, it cancels the thread, sets a private flag and unlocks again. While waiting for thread join is finished, the thread picks up the lock again as it was waiting for it and as a first thing it will check the private flag and quits gracefully, unlocking the mutex. As a side effect, the pthread cancellation machinery has no chance to kick in as there was no cancellation point on the way.
* Add test to call all EnumerateInstance{s,Names}, GetInstance, Associators ↵Jan Safranek2013-12-171-0/+174
| | | | | | | | | | | | | and References. This simple test calls EnumerateInstances and EnumerateInstanceNames on all LMI_* classes and then calls GetInstance, AssociatorNames, Associators, ReferenceNames and References on all instances. It does not check actual content of returned names and instances, it just checks that the above calls do not crash and are consistent (e.g. EnumerateInstanceNames returns the same set as EnumerateInstances).
* python: install test utilities in new subpackageMichal Minar2013-12-171-1/+1
| | | | | | Added openlmi-python-test subpackage with contents taken from src/python/lmi/test. This allows for testing code charing among verious openlmi* git repositories.
* power: Always init provider when startingRadek Novacek2013-12-172-6/+33
| | | | | | Power provider didn't call power_ref to init itself when enumerating some "static" objects like LMI_HostedPowerManagementService. But it has to be called because of obtaining hostname from ComputerSystem instance.
* Hardware: added DiskDriveSoftwareIdentity providerPeter Schiffer2013-12-174-0/+248
| | | | | New provider: * LMI_DiskDriveSoftwareIdentity
* software: test fixes and improvementsMichal Minar2013-12-173-11/+11
| | | | | | | | Fixed package installation tests that did not ensure that particular package is uninstalled before test begins. Speeded up test set up phase for TestSoftwareIdentityFileChecks and TestSoftwareIdentityChecks.
* software: fixed creation of Error instanceMichal Minar2013-12-177-17/+19
| | | | | | | Environment needs to be propagated to factory function of CIMError when error occurs while handling asynchronous job. Resolves: rhbz#1043243
* software: fix tests for rhel7Michal Minar2013-12-171-3/+28
| | | | | Packages with empty source tarballs failed to build on rhel7. Added empty readmes to previously empty packages to fix it.
* software: make the checksum type retrieval more robustMichal Minar2013-12-172-5/+67
| | | | | | | | | | | In some rare cases, digest algorithm is not set in rpm packages (happens on rhel7). Try to deduce it from hash digest stored for installed files and fallback to some sane default. In case it's not set, package use md5 digest algorithm for its files. Provider failed to generate it correctly. The Checksum was doubled. Resolves: rhbz#1032590
* software: bugfix in property checking of identity file checksMichal Minar2013-12-171-1/+1
| | | | | | | | get_target_operating_system returns a tuple which can not be equal to integer. Due to this error, GetInstance() call failed on on LMI_SoftwareIdentityFileCheck objects on rhel7. Resolves: rhbz#1032590
* logicalfile: correctly fill FSCreationClassName and FSNameJan Synacek2013-12-177-49/+87
| | | | | | | | | | | Files residing on nodevice or remote filesystems now correctly set these properties. FSCreationClassName is set to "LMI_TransientFileSystem" and FSName is set to "PATH=<path to file>". This behavior is consistent with how storage providers set those properties. To check for filesystem, the provider uses udev and checks for ID_FS_UUID_ENC and DEVNAME fields. If these are not found, filesystem is then considered nodevice or remote. Additional test for files on transient filesystems has been added.
* logicalfile: simplify get_fsname_from_stat()Jan Synacek2013-12-161-4/+1
|
* software: added missing module related to job handlingMichal Minar2013-12-151-0/+343
| | | | | | This should belong in commit 2b22e29 that reworked job handling. Resolves: rhbz#1039018
* software: fixed tests for rhel7Michal Minar2013-12-131-1/+2
| | | | | $RPM_BUILD_DIR is not created before %install phase on rhel7. It needs to be done explicitly.
* software: added tests for software installation serviceMichal Minar2013-12-121-1/+171
| | | | Test installation, removal and updating of rpm packages.
* software: improved association testMichal Minar2013-12-121-5/+23
| | | | | Assert that InstallDate is filled properly for available packages that are installed.
* software: test improvementsMichal Minar2013-12-127-78/+156
| | | | | Speeded up test initialization and cleanup. Use as few calls to subprocesses as possible.
* software: added another QA testsMichal Minar2013-12-123-0/+401
| | | | | | This is a collective work of Jan Grec and Michal Minar. Added tests for LMI_SoftwareInstallationService. Added tests for software provider as a whole.
* software: redone job handlingMichal Minar2013-12-125-526/+445
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a serious flaw in previous object model. JobManager was a thread spawned from inside of separated YumWorker process. Meanwhile IndicationManager was spawned in provider process which is correct otherwise it coult not send indications through broker. The problem is that JobManager needs to create indications and access IndicationManager. But they were in different processes. JobManager worked with static data duplicated from provider process when the worker process has been forked. Therefor all subscriptions and indication enablement made after the worker processed has been created did not affect jobmanager. For some unknown reasons this could also cause a segfault to worker process when creating indications that were sent to provider process. This patch shuffles classes a bit: * JobManager is spawned as a thread in provider process by YumDB. * JObManager spawns its own SessionManager that is a wrapper for YumWorker process * SessionManager is a thread running in provider's process. It manages worker process and ensures that yum database is locked when there is an active session. * YumWorker does not spawn any other process. It processes jobs one by one. Resolves: #1039018
* software: correctly recognize installed from availableMichal Minar2013-12-123-11/+38
| | | | | | | | | When available packages were searched, they were all treated as not installed. Yum uses two different classes to represent installed and available packages and the same package may instantiated from both of them. Resolves: #1039025
* Hardware: register SNIA profile with LMI_DiskDrive providerPeter Schiffer2013-12-121-0/+25
|
* Realmd: increase the D-Bus messages timeoutTomas Smetana2013-12-121-5/+10
| | | | | | | | | This patch increases the timeout for all the D-Bus message send calls to DBUS_TIMEOUT_INFINITE. This means we wait for Realmd to finish the join/leave operations: it is hard to predict how long can those take and the default D-Bus timeout may not be enough. When the enrollment takes more than what's the D-Bus default timeout, the provider reports (false) failure even when the oprations succeeds.
* Hardware: use lsblk as primary source for disksPeter Schiffer2013-12-107-176/+122
| | | | | | | | This patch makes lsblk primary source for information about disks instead of smartctl. This change was needed because in virtual environment some disks might be recognized by smartctl while others not, and in this case, some disks would be missing in LMI classes. With lsblk, all disks are always listed. Smartctl is used as source of additional information if avaiable.