summaryrefslogtreecommitdiff
path: root/spec/unit/provider
AgeCommit message (Collapse)AuthorFilesLines
2014-05-22(PUP-2544) Util::ADSI -> Util::Windows::ADSIEthan J. Brown2-27/+27
- Move Windows ADSI code out of puppet/util and into puppet/util/windows - Update namespace from Puppet::Util::ADSI to Puppet::Util::Windows::ADSI - Add module / class definitions for ADSI to util/windows.rb to prevent tests from blowing up on non-Windows - Moving Puppet.features.microsoft_windows? checks to top of user and group provider tests for ADSI - Update all dependent code, remove unnecessary references
2014-05-20Merge remote-tracking branch 'upstream/stable'Josh Cooper2-29/+59
* upstream/stable: (PUP-2182) Fix yum and zypper providers virtual_package feature.
2014-05-19(PUP-2182) Fix yum and zypper providers virtual_package feature.Peter Huene2-29/+59
The yum and zypper package providers were installing virtual packages even when allow_virtual was default or set to false. For yum, the fix is to do a "yum list" command before doing an installation whenever allow_virtual is not true. The list command will fail on virtual package names. This will prevent the package from being installed as expected and is only performed if a version is not ensured, since virtual packages cannot be installed by version. For zypper, the fix is to pass the --name option to zypper if not allowing virtual packages and a version string was not ensured.
2014-05-14(PUP-2182) Add virtual_packages feature to package type.Peter Huene3-3/+14
In 3.5.x, the yum package provider changed to accept virtual package names (packages that provide other package names). That change in behavior caused some undesirable side-effects. As we did not give users fair warning that this behavior was changing, we have decided to change the yum provider back to only accepting "real" package names by default. To keep the support for virtual package names, a "virtual_packages" feature has been implemented on the package type and supported on the yum package provider. The feature adds the "allow_virtual" parameter that controls whether or not virtual package names will be allowed for install/uninstall. For now, the default value for this parameter will be false to restore the previous behavior. However, a deprecation warning will be issued to let users know that the default will eventually be changed to true. Users can prevent the deprecation warning by explicitly setting the parameter to either true or false.
2014-05-14Merge pull request #2640 from peterhuene/pup/2182Adrien Thebo3-3/+14
(PUP-2182) Add virtual_packages feature to package type.
2014-05-14Merge pull request #2563 from jasperla/openbsd/uninstallAdrien Thebo1-3/+19
(PUP-2311) OpenBSD uninstall broken when multiple uninstall_options give
2014-05-12(PUP-2182) Add virtual_packages feature to package type.Peter Huene3-3/+14
In 3.5.x, the yum package provider changed to accept virtual package names (packages that provide other package names). That change in behavior caused some undesirable side-effects. As we did not give users fair warning that this behavior was changing, we have decided to change the yum provider back to only accepting "real" package names by default. To keep the support for virtual package names, a "virtual_packages" feature has been implemented on the package type and supported on the yum package provider. The feature adds the "allow_virtual" parameter that controls whether or not virtual package names will be allowed for install/uninstall. For now, the default value for this parameter will be false to restore the previous behavior. However, a deprecation warning will be issued to let users know that the default will eventually be changed to true. Users can prevent the deprecation warning by explicitly setting the parameter to either true or false.
2014-05-05(PUP-1069) Implement feature :upgradeable for OpenBSD package provider.Jasper Lievisse Adriaanse1-6/+46
2014-05-04(PUP-2311) OpenBSD uninstall broken when multiple uninstall_options givenJasper Lievisse Adriaanse1-3/+19
2014-05-01Merge branch 'pull-2455'Adrien Thebo1-0/+10
2014-04-30(PUP-2014) Make gem provider match on a single gem namervalente1-0/+10
Currently the gem provider will match gemname$, for example with bundler this will return quite a long list of anything ending with bundler. When a match returns a longer list, it will actually connect and try to pull the latest gem again, thus increasing the WAN usage and rubygems.org usage when not necessary. The proposed fix adds a ^ in front of the name var to ensure it begins with the gemname.
2014-04-30Merge pull request #2560 from ↵Josh Cooper1-70/+145
adrienthebo/issue/master/pup-1060-yum-package-enablerepo PUP-1060 respect enablerepo and disablerepo when ensuring latest on yum packages
2014-04-30Merge branch 'stable'Rob Reynolds1-15/+171
2014-04-28(pup-1932) Don't report static servicesKylo Ginsberg1-1/+0
The initial fix for pup-1932 inadvertently included 'static' services, which are services which can't be enabled/disabled. Since such services aren't manageable, it doesn't make sense to include them in instances, so this commit removes them.
2014-04-21(PUP-1060) Respect yum enable and disable repo flagsAdrien Thebo1-16/+100
When a package resource is ensured => latest, the specific version available will depend on what yum repositories are enabled and disabled. Commit a4abf13d3 added the ability to pass arbitrary options to install and update commands which allowed users to specify the --enablerepo and --disablerepo options, but these flags would not be respected when the latest package version was used. This meant that the latest version found and the version that could be installed with the --enablerepo and --disablerepo flags might differ, causing all sorts of bad things to happen. This commit resolves this issue by making the version query aware of these flags. When a package checks for the latest version available, it passes all repositories enabled and disabled to the update query. Whenever an update query is made for the first time with a combination of repositories that output is stored, so that only query for a given combination of repositories is made. Unfortunately, this change still relies on yumhelper to do the actual querying. In the long run it would be good to use `yum check-update` instead of the complex helper script so that we can actually test and verify the code responsible for querying packages.
2014-04-21(PUP-1060) Don't fetch latest versions at prefetchAdrien Thebo1-76/+67
In the previous implementation of yum .prefetch, package providers were loaded and then the yumhelper.py script was used to determine the latest versions available for all installed packages. While this worked for simple cases, trying to support multiple combinations of enablerepo and disablerepo flags makes this grossly more complex. In addition this information is not needed at prefetch time, and testing the behavior in prefetch gets messy. This commit extracts the latest version query from the prefetch method. It moves the logic to a method that does the actual querying and lazily loads that data to keep the same run speeds. When multiple combinations of enablerepo and disablerepo are added this information can be loaded in the same fashion.
2014-04-18Merge branch 'pull-2495'Adrien Thebo1-22/+129
2014-04-18(PUP-2143) Implement :enableable for OpenBSD service providerZach Leslie1-22/+129
Before now, Puppet has been unable to enable services on OpenBSD. This work implements a flags property that is manages the content of the rc.conf.local file, used by OpenBSD to define service runtime options and enable services. The flags property may also be used by other platforms, such as FreeBSD.
2014-04-14Merge pull request #2507 from ↵Adrien Thebo1-9/+6
kylog/issue/pup-1932/systemd-reports-transient-services (PUP-1932) Restrict systemd provider to manage file-based services
2014-04-11(maint) refactor find_conf_value to use PhysicalFileAdrien Thebo1-0/+41
2014-04-11(PUP-2218) Use /etc/yum.conf for yumrepo default locationAdrien Thebo1-15/+130
2014-04-10Merge branch 'stable'Josh Partlow1-23/+71
* stable: (packaging) Update PUPPETVERSION to 3.5.1-rc1 (maint) Raise error when parsing duplicate INI section (maint) Yumrepo boolean values are case insensitive. (PUP-2178) Map INI name to yumrepo descr (PUP-2181) Delete ini file entries on absent property (PUP-2179) Replace Puppet::Util::IniConfig::File (PUP-2179) Implement simple INI file collection (PUP-2179) implement storing for single INI files (PUP-2179) Implement INI single file formatting (PUP-2179) Extract standalone INI file class (PUP-2179) Add test coverage for IniConfig::Section (maint) Don't strip whitespace from yumrepo keys (PUP-2162) support yumrepo baseurl/gpgkey multiple values (PUP-2150) allow yumrepo params to be set absent (PUP-2613) Comprehensively test all yumrepo params
2014-04-10(PUP-2178) Map INI name to yumrepo descrAdrien Thebo1-5/+4
The yumrepo type uses 'name' as the namevar, while yum configuration uses 'name' as the repository description. Because of this mismatch the yumrepo type has a descr field that we need to explicitly map to the 'name' INI property. This commit adds the necessary mapping of that field.
2014-04-09(PUP-2181) Delete ini file entries on absent propertyAdrien Thebo1-23/+72
2014-04-02(maint) Consolidate redundant join_options implementations.Peter Huene4-9/+9
Moving the implementation of join_options into the base package provider. This gives a consistent behavior between all package providers that support install_options.
2014-04-02(PUP-772) Fix apt package provider spec for install_options.Peter Huene1-68/+75
Fixing the apt package provider spec so that the resource isn't entirely mocked and returning 'asdf' for every property. Modeling the spec after the yum package provider spec to accomplish that. Adding install_option example that tests for hash.
2014-04-02(PUP-772) Fix apt provider install_optionsMatthew Barr1-0/+7
Fix apt package provider install options to support hash in addition to arrays and strings. This makes it consistent with other package providers. Add spec examples to test install options.
2014-03-28(maint) Fix typo in test nameKylo Ginsberg1-1/+1
2014-03-28(pup-2048) Implement augeas show_diff parameterKylo Ginsberg1-1/+41
2014-03-27Merge remote-tracking branch 'upstream/stable'Josh Partlow2-10/+30
* upstream/stable: (PUP-1937) Revert changes to with_version (PUP-2039) Fix rpm package provider usage of --whatprovides.
2014-03-26Merge pull request #2331 from ticket/master/PUP-1587-catch-empty-cron-entriesCharlie Sharpsteen1-0/+15
(PUP-1587) crontab: make sure that invalid crontabs aren't written out (PUP-1586) remove obsolete unit test (PUP-1586) allow managing existing cronjobs without caring for command Signed-off-by: Charlie Sharpsteen <Charlie Sharpsteen chuck@puppetlabs.com>
2014-03-26Merge pull request #2469 from zaphod42/feature/master/pup-2033-augeas-show-diffAdrien Thebo1-9/+16
(PUP-2033) Use loglevel for diff output
2014-03-26(PUP-2039) Fix rpm package provider usage of --whatprovides.Peter Huene2-10/+30
The fix for PUP-897 (commit ecb761e24a) introduced always passing --whatprovides to rpm when querying for packages. This breaks querying for packages that have architectures specified, e.g. 'vim-enhanced.x86_64'. The proper way to do this is to first query without --whatprovides and see if rpm finds a package by the given name. If rpm fails to find a package, fallback to using --whatprovides to support querying for virtual package names.
2014-03-26(PUP-1332) Add instantiated upstart services to exclude listMatthaus Owens1-1/+1
Previously puppet would fail when trying to list all services because some services require parameters for status queries to succeed. These include idmapd-mounting and startpar-bridge. This commit adds those services to the exclude list so that they are ignored when querying upstart for their status.
2014-03-25(PUP-2033) Use loglevel for diff outputAndrew Parker1-1/+2
This brings the same changes made to the file type for PUP-1846 to the augeas provider's diffing logic. If a loglevel is specified on the resource then the diff will be logged at that level. If it is left off, then the diff will be logged at the notice level.
2014-03-25(maint) Improve tests to check actual loggingAndrew Parker1-9/+15
The previous tests didn't actually make sure that the diff was logged. This adds that coverage as well as checking that the log is at the correct level.
2014-03-24(maint) Update gem provider spec for recent change.Peter Huene1-2/+2
The spec had an example which was expecting a nil install_options by checking the 6th element in an array. With the change to not append the install_options unless specified, the example was passing but the functionality no longer matched the example. Changing the example to ensure 5 elements were passed to execute instead of the previous 6.
2014-03-21Merge remote-tracking branch 'upstream/stable'Andrew Parker1-4/+45
* upstream/stable: (PUP-2017) Change TupleType size to mean total number of entries (PUP-1944) Fix issue with manifest being a directory when initializing (PUP-1210) Provide clear guidance on OSX passwords (PUP-1210) Error if missing password info on OSX 10.8
2014-03-20(PUP-1210) Error if missing password info on OSX 10.8Andrew Parker1-4/+45
When managing passwords on OSX versions >= 10.8 the password needs to hashed using PBKDF2. PBKDF2 uses a salt and a number of iterations, which the puppet user type supports (specifically for this), and are critical parts of the password storage. Many users seem to have been tripped up by this change (since no other systems that are managed do this, including older versions of OSX) and created user accounts that were unable to be logged into. This causes the provider to fail on >= 10.8 if any one or two of the salt, iterations, or password are missing. This should provide better guidance and error messages for users in this situation.
2014-03-20(maint) Fix usage of remove_instance_variable for 1.8.7.Peter Huene1-2/+2
The previous commit used remove_instance_variable for fixing a spec ordering issue. This method is private on 1.8.7. The fix is to instead just set the variable to nil, as it has the same effect in this case.
2014-03-20(maint) Fix directoryservice spec order issue.Peter Huene1-0/+10
The directoryservice provider caches some information such as OS version and groups. If a spec runs before the directoryservice spec that causes information to be cached, expected stubs in the directoryservice spec will not be invoked. The fix is to remove the instance variables that are caching the information on the examples that are expecting that nothing is already cached.
2014-03-20Merge branch 'pr/2429'Peter Huene1-0/+15
* pr/2429: (PUP-620) Add spec examples for yum install_options. (PUP-620) Limit gem install_options to install only. (PUP-620) Add install_options to gem provider This closes GH-2429.
2014-03-20(PUP-620) Add spec examples for yum install_options.Peter Souter1-0/+15
Checks nil install_options. Checks plain values and hash key-pairs.
2014-03-19Merge pull request #2441 from peterhuene/pr/2067Peter Huene1-15/+41
(PUP-748) Fix the zypper package provider support for install_options.
2014-03-19Merge pull request #2447 from peterhuene/pup/1751Peter Huene1-4/+18
(PUP-1751) Fix service provider on Suse to handle boot services.
2014-03-19Merge branch 'pr/2414'Josh Cooper1-38/+58
* pr/2414: (PUP-1769) Don't pass nil through to provider command (Maint) Convert test to use real resource objects (PUP-1769) Update yum specs with install_options (PUP-1769) Use join_options command (PUP-1769) Changing the has_feature to a one-liner (PUP-1769) yum provider takes install_options Closes GH-2414
2014-03-19(PUP-1769) Don't pass nil through to provider commandJosh Cooper1-3/+3
Previously, if `install_options` was not specified, then we would pass a nil value through to the `yum` command. While this would work, we don't document that nil's are acceptable arguments. This commit ensures we only pass in non-nil `install_options`.
2014-03-19(Maint) Convert test to use real resource objectsJosh Cooper1-42/+53
Use real yum package resource objects
2014-03-19(PUP-1769) Update yum specs with install_optionsPeter Souter1-5/+13
Specs now take into consideration the install_options parameter, with both singletons and key-value pairs.
2014-03-18(PUP-1932) Restrict systemd provider to manage file-based servicesKylo Ginsberg1-9/+6
Prior to this commit, the systemd provider returned in-memory services. This had a couple odd consequences, e.g. with 'puppet resource service': 1) short-lived services would come and go, though they are not actually managed directly 2) disabled and stopped services wouldn't be reported at all This commit changes the systemd provider to return file-backed services.