summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fixed openlmi-mof-register not to crash when CIMOM is down.Jan Safranek2013-12-182-12/+307
| | | | | | | | | | /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-172-2/+22
| | | | | | 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.
* power: Rewrite description of PowerStatesSupported propertyRadek Novacek2013-12-171-1/+22
| | | | | | | | | CIM_PowerManagementCapabilities class has the description decorator poorly written from formatting point of view. There are missing newlines, spaces, etc. This commit rewrites the doc and cleans it up. It also removes non-implemented items from the PowerStatesSupported valuemap.
* Hardware: added DiskDriveSoftwareIdentity providerPeter Schiffer2013-12-175-0/+282
| | | | | 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.
* Hardware: honour command return code in run_command() functionPeter Schiffer2013-12-103-7/+14
|
* Software: Tests reorganization and fixes.Robin Hack2013-12-103-1/+145
|
* Hardware: added association class DiskDriveSystemDevicePeter Schiffer2013-12-062-0/+296
| | | | | New provider: * LMI_DiskDriveSystemDeviceProvider
* doc: service indication exampleVitezslav Crhonek2013-12-052-2/+33
|
* Hardware: added association class DiskDriveRealizesPeter Schiffer2013-12-032-0/+300
| | | | | New provider: * LMI_DiskDriveRealizes
* Define OpenLMI 1.0.0Stephen Gallagher2013-12-031-8/+53
| | | | Set strict version dependencies for the meta-package
* account: Initialize NULL the group array to prevent bad memory accessTomas Bzatek2013-12-031-1/+2
| | | | | | | | | Found by clang analysis: Error: PW.BRANCH_PAST_INITIALIZATION: openlmi-providers-0.4.1_75_gf47c906/src/account/LMI_AccountProvider.c:324: branch_past_initialization: transfer of control bypasses initialization of: openlmi-providers-0.4.1_75_gf47c906/src/account/LMI_AccountProvider.c:324: caretline: ^ openlmi-providers-0.4.1_75_gf47c906/src/account/LMI_AccountProvider.c:324: name_at_decl_position: variable "groups" (declared at line 328)
* account: Fall back to /etc/passwd if /etc/shadow returns NULL passwordTomas Bzatek2013-12-031-4/+10
| | | | | | | | | | | | In certain cases password may be stored in /etc/passwd directly and we need to tell libuser where to pull the password from. This patch automatically falls back to /etc/passwd if there's no password found in /etc/shadow. In case password retrieval fails in both cases, the UserPassword and UserPasswordEncoding LMI_Account properties are left unset. Based on a patch by Klaus Kämpf <kkaempf@suse.de> https://bugzilla.redhat.com/show_bug.cgi?id=1031334
* Hardware: Created DiskDrive providerPeter Schiffer2013-12-038-14/+582
| | | | | | | New provider: * LMI_DiskDriveProvider Also, added missing config init to disk providers.
* Service: Support indications on instance property modification.Vitezslav Crhonek2013-12-025-3/+368
|
* indmanager: Fix condvar destroyingTomas Bzatek2013-12-021-1/+1
| | | | Blame me, commit 52cdb2a9c497
* software: minor test enhancementsMichal Minar2013-12-027-8/+29
| | | | | | | | | | | Added one test to SoftwareIdentityFileCheck.Invoke() method testing correct error code. Renamed testing package pkg1 to pkg2 in misc repository to match its comment. Rendering function CIMInstanceNames should behave nicely for objects of another type and return their text representation.
* software: raise proper error when repository not foundMichal Minar2013-12-021-17/+20
| | | | | | | | CIM_ERR_NOT_FOUND shall be raised when objectpath of invoked method does not refer to existing repository. CIM_ERR_FAILED was raised instead which is unhelpful. Resolves: rhbz#1036291
* software: another fix to associator generationMichal Minar2013-11-301-3/+4
| | | | | | | | This fix repairs previous patch trying to speed up generating of software identities associated with software collection through LMI_MemberOfSoftwareCollection. Resolves: rhbz#1035328
* software: fixed InstanceID of installation serviceMichal Minar2013-11-291-1/+1
| | | | | | LMI_SoftwareInstallationService passed incorrect value in InstanceID property. Value should contain the whole class name, not shortened version.
* software: added test for installation service associationMichal Minar2013-11-291-0/+350
| | | | | This patch adds test modul for LMI_InstallationServiceAffectsElement association class.
* software: fixed service associators generatorMichal Minar2013-11-291-2/+10
| | | | | | | | | | | LMI_SoftwareInstallationServiceAffectsElement association class generated just the newest available packages. With this patch, all available packages are generated. When generating associators of installation service ComputerSystem instance was omitted. This patch adds it to generated items. Resolves: rhbz#1034698
* software: rewritten testsMichal Minar2013-11-2919-1740/+3404
| | | | | | Software tests now create custom testing repositories and packages. This makes them more robust and efficient (nothing needs to be downloaded).
* account: Free private indication data after indications are stoppedTomas Bzatek2013-11-282-6/+10
| | | | | ...to prevent race of the watcher thread still using data that has been freed just a moment ago.
* software: fixed and speeded up another associator callMichal Minar2013-11-271-2/+57
| | | | | | | | | | Associators generator of LMI_MemberOfSoftwareCollection is broken. It adds Collection property to genereted instance names of LMI_SoftwareIdentity. Moreover its very slow if instances are requested. This patch removes superfluous key property and adds optimizations reducing its execution time to seconds. Resolves: rhbz#1035328
* software: fixed and speeded up associator callMichal Minar2013-11-271-2/+56
| | | | | | | | | | Associators generator of LMI_SoftwareIdentityServiceAffectsElement is broken. It generates only CIM_ComputerSystem, not any LMI_SoftwareIdentity instance. And if it did, it would be too slow (tens of minutes). This patch allows software identities to be generated and adds optimizations reducing its execution time to seconds. Resolves: rhbz#1034698
* Fixed unlocking mutex before return.Jan Safranek2013-11-261-0/+1
| | | | As pointed out by scanbot :).
* indicationmgr: fixed deadlock when re-starting the namager thread.Jan Safranek2013-11-261-25/+10
| | | | | | | | | | | | | When the indication manager thread was stopped, it destroys its mutex and creates new one. If pthread_mutex_destroy() fails because the mutex is locked, the new mutex is not created -> the old one is used, but it's already locked -> deadlock. So let's make sure the thread does not hold the mutex when destroying the thread. Rewrite of indication manager thread is needed to have the manage() function interruptible when waiting for events, e.g. using a pipe and select(), this pthread_cancel leads to memory leaks.
* software: fixed enumeration of service affected elementsMichal Minar2013-11-261-3/+2
| | | | | | | Enumeration of LMI_SoftwareInstallationServiceAffectsElement did not work. Provider would hang indefinitely. Resolves: rhbz#1034615
* openlmi-mof-register: parse '#pragma include' in mof files and copy all ↵Jan Safranek2013-11-251-1/+19
| | | | | | included mofs to cache. /usr/bin/mofcomp from pywbem is used for the parsing.