summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* 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-061-0/+286
| | | | | New provider: * LMI_DiskDriveSystemDeviceProvider
* Hardware: added association class DiskDriveRealizesPeter Schiffer2013-12-031-0/+290
| | | | | New provider: * LMI_DiskDriveRealizes
* 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-037-14/+530
| | | | | | | New provider: * LMI_DiskDriveProvider Also, added missing config init to disk providers.
* Service: Support indications on instance property modification.Vitezslav Crhonek2013-12-024-3/+361
|
* 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
* indmanager: Fix reverse boolean checkTomas Bzatek2013-11-221-2/+2
|
* indmanager: Add forgotten returnTomas Bzatek2013-11-221-0/+1
| | | | Reading the code, it seems there's something missing...
* account: Fix some memory leaksTomas Bzatek2013-11-213-1/+6
| | | | GValue memory management is tricky...
* indmanager: Forcefully recreate mutexes on indication stopTomas Bzatek2013-11-212-14/+29
| | | | | | | | | | | Creating mutexes with the PTHREAD_MUTEX_ERRORCHECK attribute proved to be a wrong way. It turned out locking was not working properly as any attempt to lock already locked mutex failed with a return value that we didn't check. The only reason we were using this special attribute was to prevent crash on forcefully unlocking mutex in an unknown state. That didn't work either as long as EPERM was returned when trying to unlock the mutex that has been locked from other thread... that was forcefully canceled. That only led to deadlocks fortunately hard to hit, unfortunately equally hard to debug.
* Plug some memory leaksTomas Bzatek2013-11-211-1/+4
|
* Hardware: register SNIA profile with LMI_DiskPhysicalPackage providerPeter Schiffer2013-11-201-0/+25
|
* software: fixed verification of device filesMichal Minar2013-11-202-3/+8
| | | | | Rpm database stores raw device number that needs to be compared with st_rdev attribute of stat object, not the st_dev one.
* software: fixed handling of invalid requestMichal Minar2013-11-201-1/+1
| | | | | | | | Due to a failure in handling request for instance of LMI_SoftwareIdentityFileCheck representing non-existent file, a CIM_ERR_FAILED was delivered to client instead of CIM_ERR_NOT_FOUND. Resolves: rhbz#1032502
* Hardware: Added LMI_DiskPhysicalPackageContainer associationPeter Schiffer2013-11-203-4/+298
| | | | | | | Added LMI_DiskPhysicalPackageContainer association between LMI_DiskPhysicalPackage and LMI_Chassis. Also, added default values for disk manufacturer and model.
* indmanager: Fix allowed classes testTomas Bzatek2013-11-191-1/+1
| | | | A small copy-paste error from commit cb1ffc827
* indmanager: Do initial poll for newly added filtersTomas Bzatek2013-11-191-47/+52
| | | | | | | | | | | | | Indications are often started on CIMOM startup if there are some registered persistently (or failed their cleanup). This will start several indication managers as needed. When a new filter is registered, it needs initial values for polling mode. This is normally done on manage thread iteration but in this case, when indication manager is already running, it doesn't get filled and any change event will go unnoticed since we don't have anything to compare new values against. This change will immediately fill actual values for newly added filters in case indications have been already started.
* software: do not allow infinite resurrectionsMichal Minar2013-11-191-9/+28
| | | | | | | | | | Some jobs may not be completable on some machines. With current algorithm, in case of worker process failure, the terminated process is resurrected and job is restarted. This patch takes into account the number of resurrections done during processing of single job. If this number exceeds some limit, job is thrown away and exception is raised. Resolves: rhbz#1031132
* software: really do unlockMichal Minar2013-11-191-0/+1
| | | | | | | | Cached YumBase instance may keep some objects with active connection to files in yum package database. We need to clean them when unlocking database in order to allow other processes to operate. Resolves: rhbz#1028535
* software: fixed package filteringMichal Minar2013-11-191-1/+1
| | | | | | | When searching for package with a partial name match, other filtering properties were ignored. Resolves: rhbz#1030999
* software: allow tilde presence in package versionKlaus Kämpf2013-11-191-4/+4
| | | | | | | | OpenSUSE distribution uses tilde character (~) in version of their packages a lot. This patch allows to parse such packages. Resolves: bz#1031345 Reported-by: Klaus Kämpf <kkaempf@suse.de>
* software: reload file configuration when changedMichal Minar2013-11-191-3/+2
| | | | | | | Until now repository configuration was reloaded only at the provider start and when the request related to repositories came. Resolves: rhbz#1030831
* logicalfile: LMI_DirectoryContainsFileProvider.c crash if called with a ↵Klaus Kämpf2013-11-191-1/+4
| | | | non-directory
* Format string hardeningRadek Novacek2013-11-192-2/+2
| | | | Fix some potential errors in the string formatting.
* realmd: remove unused function octetstring_parseRadek Novacek2013-11-191-38/+0
| | | | | This function was not used and contained some potential issues so it's better to get rid of it.