summaryrefslogtreecommitdiff
path: root/spec/unit/provider
AgeCommit message (Collapse)AuthorFilesLines
2014-03-18(PUP-1751) Add service provider examples for Suse special casing.Peter Huene1-4/+18
Add spec examples for when a service is enabled, disabled, or non-existent on a Suse OS. Remove example that expected the '--check' flag for Suse, as it is no longer passed.
2014-03-17(PUP-748) Add specs for zypper install_options.Peter Huene1-15/+41
Remove expected nil when calling execute without install_options. Add specs for install_options as a hash, array, or string.
2014-03-14(PUP-1769) yum provider takes install_optionsJan Holčapek1-2/+3
The yum provider now supports install_options.
2014-03-13Merge pull request #2342 from ↵Charlie Sharpsteen1-0/+1
ffrank/ticket/master/PUP-1585-cron-duplication-with-target (PUP-1585) and (PUP-1624) cron: handle the user and target properties better
2014-03-12Merge pull request #2385 from ffrank/ticket/master/PUP-1041-nagios-parse-blankCharlie Sharpsteen1-0/+14
(PUP-1041) nagios: parse empty parameter values in definitions
2014-03-10Merge branch 'pr/2403'Peter Huene1-5/+25
* pr/2403: (PUP-1085) Add and fix pacman provider tests (PUP-1085) Make Pacman provider group-aware This closes GH-2403.
2014-03-10(PUP-1085) Add and fix pacman provider testsVincent Ambo1-5/+25
- Added a test for the installedgroups function - Fixed behaviour of instances function - Pointed a test for code that has moved at the new function
2014-03-05Merge pull request #2391 from kylog/issue/rhel7-systemd-defaultproviderJosh Partlow1-0/+12
pup-1766 make systemd the defaultprovider for service on rhel7
2014-03-03(PUP-1585) amend unit test to match corrected behaviorFelix Frank1-0/+1
Just a simple addition to the mock object used for some tests, because the crontab provider will now perform an additional property value lookup to find an on-disk resource.
2014-03-03(maint) Fix useradd spec when using ruby-shadow 2.3.3.Peter Huene1-11/+10
The ruby-shadow gem inserted a new member into the PasswdEntry struct in 2.3.3. This caused a useradd provider spec to fail that was relying on a member that came after the newly inserted member. The failure only occurs when the ruby-shadow gem is installed. The fix is to populate the struct members by name rather than relying on the member order.
2014-02-28(PUP-876) Enable upstart service provider on RedhatAdrien Thebo1-0/+8
This commit allows the upstart service provider to function on Redhat systems. Redhat 6 included support for upstart and while it wasn't widely embraced it is available for use. The 'serial' and 'tty' services on Redhat 6 systems have instances which the service type/provider cannot handle, so we have to ignore them for the upstart provider to work out of the box.
2014-02-27(PUP-1041) nagios: parse empty parameter values in definitionsFelix Frank1-0/+14
This is a valid nagios defintion: define host { parents use linux-server } That's because an empty parents list has distinct semantics. There may be other variables that can take an empty value, possibly in conjunction with object inheritance. The naginator provider will not accept this definition, because the nagios config parser expects a value for each and every parameter. Fix this by adding an according rule to the grammar. Also, the lexer must be altered, because parameters and values are lexed differently and returned as distinct tokens. When encountering newline while scanning for a parameter value, the lexer must give up and reset its internal state. (Otherwise, it would not accept another parameter name or the end of the current definition block.)
2014-02-26(PUP-1564) add :uninstall_options feature to package rpm providerJoshua Hoblitt1-2/+47
2014-02-26(pup-1766) Set systemd as a default provider for the service type on rhel7Kylo Ginsberg1-0/+12
2014-02-26Merge pull request #2324 from duritong/fix/master/PUP-1568_fix_error_reportingJosh Cooper1-1/+15
Fix/master/pup 1568 fix error reporting
2014-02-25Merge pull request #2354 from jjulien/pup1510Kylo Ginsberg1-0/+7
(PUP-1510) Fixed forcelocal bug with ensure => absent
2014-02-21(maint) Remove a pending test which isn't pending on anything planned or ↵Kylo Ginsberg1-17/+0
asked for
2014-02-21(pup-1732) Remove the fixture and stub for what *not* to doKylo Ginsberg1-4/+1
2014-02-20(pup-1732) Report only services from systemdKylo Ginsberg1-4/+22
Prior to this change the systemd service provider would return all systemd-managed types (including sockets, devices, swap, etc). This produced a huge list of instances, many of which were not in fact services. This change simply adds the '--type service' option to the 'systemctl' invocation in .instances. It also updates the spec tests with fixtures for the old (without that option) and new (with that option) way of invoking 'systemctl'. I purposefully did not touch the existing fixture which is tied to a test which is pending on a what-to-do about failed services. If/when we tackle that, we may want to collapse some of these fixtures.
2014-02-18(PUP-897) Allow rpm package provider to query by virtual package name.Peter Huene2-5/+5
Some providers that inherit from the rpm provider, such as the yum provider, do a query after installing a package. If the package is specified by a virtual name, the yum provider installs the package successfully, but the base rpm provider implementation fails to query the installed package. This causes a confusing "could not find package" error even though the package was installed. Passing the '--whatprovides' option to rpm when performing a query instructs rpm to locate packages that provide the given virtual name. This enables child providers to install by virtual package name without errors.
2014-02-14(maint) fixup yumrepo provider to use fs abstractionAdrien Thebo1-73/+67
There were a few places where the filesystem abstraction was being ignored; this commit corrects those cases. This commit also refactors the associated tesets and simplifies #create for easier testing.
2014-02-13(maint) Fix yumrepo inifile spec to stub the correct methodPeter Huene1-1/+1
The spec stubs File::exist? which does not take into account the various implementations in Puppet::FileSystem. The spec should instead stub Puppet::FileSystem::exist so that it behaves consistently on all platforms.
2014-02-13Merge pull request #2086 from apenney/yumrepoAdrien Thebo1-0/+111
(PUP-789) refactor yumrepo into type and provider
2014-02-13(PUP-1510) Fixed forcelocal bug with ensure => absentJohn Julien1-0/+7
The forcelocal option was referencing a command that was not previously defined which was throwing an exception. The forcelocal feature does not need to use a special command to delete local users, only to add them. So the special logic for delete was removed and forcelocal now uses userdel to ensure absent on a user.
2014-02-13(maint) Fix pkgin package provider spec to ensure resource uses the pkgin ↵Peter Huene1-2/+3
provider. GH-2023 included a change that added a version onto the resource. However, since a provider was not declared, it used the system's default provider. Because of this, running the spec on a system with a default provider that doesn't supoprt the versionable feature would cause the spec to fail. The fix is to set the provider on the resource and move the ensured version to the particular test case.
2014-02-12(PUP-648) Implement upgradeable and versionable on the pkgin package providerJavier Palacios1-54/+55
Implemented the upgradeable and versionable features on the pkgin package provider so that packages can use `latest` and version numbers in the ensure property.
2014-02-11Merge branch 'pr/2024'Andrew Parker1-31/+27
* pr/2024: (PUP-649) Loosen checks for crontab provider (PUP-649) Use class instance variable (#3220) uniquify implicit record names (#3220) save overhead in cron type unit test and add cleanup (#3220) make the unit test "generating cron resources" match the new behaviour (#3220) fix a cron testing quirk with potential benefits for normale operation (#3220) make sure that generated cron resources belong to the correct user (#3220) crontab: allow purging unmanaged resources Closes GH-2024
2014-02-11(PUP-649) Loosen checks for crontab providerAndrew Parker1-31/+27
The tests for the crontab provider exhibited an order dependent failure. If the spec/integration/provider/cron tests were run before the spec/unit/provider/cron tests then the global counter that is used by the crontab provider would not be at the expected value. This isn't really a problem in practice, but the expectations in the tests were for a specific count. This updates the checks so that they are resilient to the exact numbers chosen.
2014-02-11(#3220) uniquify implicit record namesFelix Frank1-2/+2
Adds an numeric suffix to the artifical name that gets generated for unnamed records in crontabs. It will suppress naming collisions for cronjobs that use the exact same command string.
2014-02-11(#3220) make the unit test "generating cron resources" match the new behaviourFelix Frank1-2/+2
To allow purging of unmanaged resources, they are now implicitly named. The unit test must take that into account.
2014-02-10Ensure that section cannot accidently return nil.Ashley Penney1-2/+19
2014-02-07(PUP-789) Break yumrepo into a type/provider.Ashley Penney1-0/+94
This work strips out all of the provider code from the type, and creates a new ruby provider for yumrepo. While this code still uses inifile it's been rewritten to take advantage of the modernization of Puppet. It's now a little easier to understand and test. This covers: #8758, #9293, #22304 (projects.puppetlabs.com)
2014-02-05(maint) Unset the defaultprovider after caching itKylo Ginsberg1-0/+4
Prior to this change the defaultprovider for package was implicitly cached in both package_spec.rb and msi_spec.rb (just by checking it). This represented spec "leakage" which could result in downstream spec failures on subsequent tests which accessed defaultprovider. E.g. this sequence failed: be rspec spec/unit/provider/package/msi_spec.rb spec/unit/type/package_spec.rb This change clears the defaultprovider for package after caching it for both these two spec tests. However, there are a lot of uses of defaultprovider in spec tests, so we may want a more general solution.
2014-02-05(PUP-1559) Ensure ADSI Group SIDs may be looked upEthan J. Brown2-0/+2
- Previously, calling Puppet::Util::ADSI::Group.exists? for a well-known group SID would return false, because the WinNT:// style URI used to find the group would not examine / lookup the SID, but would instead create a broken Uri that the underlying OS could not understand - Now, the given group name is checked to see if it's a SID before the Uri is constructed, and a SID style Uri is created where appropriate Paired-with: Joshua Partlow <jpartlow@puppetlabs.com>
2014-02-05(PUP-1586) allow managing existing cronjobs without caring for commandFelix Frank1-0/+15
When the catalog contains a cron resource that does not specify a value for the command property, the transaction would fail with the cryptic error message 'no command, somehow' under certain conditions. This error is spurious. Generally, it's quite allowable to manage a subset of cron properties that does not include the command. Fixed by removing the devfail invocation. The command property is now handled just like the 'special' property.
2014-02-02Fix broken spec & wording of error message.Peter Meier1-2/+2
While working on 658f1237c1596a6f735b7b707130fc0897a1a113 I stumbled accross another messages that would say 'with error code false', which doesn't make a lot of sense. Also the plain 'expect raise_error' was masking another problem with tests. One should always only look for the exact expected error and not just general for any kind of error.
2014-02-02Fix PUP-1568 - no success variable anymorePeter Meier1-0/+14
In the refactoring within 000b8fef the success variables was removed. So the error message shouldn't anymore use it.
2014-01-28Revert "Merge branch 'pull-2137'"Adrien Thebo1-29/+2
This reverts commit a20b16bb70446d43c51340f72c821fc3a93c7cb6, reversing changes made to 00579976264da4b2b8492bb664291b9ba0d5987c. Unfortunately this change introduced a number of problems that need to be addressed before this code can be released. 1) The yum provider is always holdable The package type detects the ability to hold packages based on the presence of the #hold method. Even though there is a guarding clause around the `has_feature :holdable` in the provider it's bypassed when it fails since the provider defines the #hold method. This ties into: 2) Holding a package without the yum-plugin-versionlock raises errors Since the plugin isn't available but the provider looks like it's holdable, applying a resource like: package { 'bash': ensure => held, } results in a backtrace since `yum versionlock` returns 1, and a Puppet::ExecutionFailure is raised. 3) Held packages are not idempotent When the yum versionlock plugin is installed, the resulting resource is not idempotent because the ensure value is always being changed from $version to 'held': [root@localhost puppet]# puppet resource package bash ensure=held Notice: /Package[bash]/ensure: ensure changed '4.1.2-15.el6_4' to 'held' package { 'bash': ensure => '4.1.2-15.el6_4', } [root@localhost puppet]# puppet resource package bash ensure=held Notice: /Package[bash]/ensure: ensure changed '4.1.2-15.el6_4' to 'held' package { 'bash': ensure => '4.1.2-15.el6_4', }
2014-01-27(PUP-1318) Fixing expected parameters in service provider specs now that ↵Peter Huene6-68/+68
service output is no longer squelched by default. Redmine 565, a seven year old issue referenced in a comment in lib/puppet/provider/service/service.rb, is no longer applicable to `Puppet::Util::Execution#execute`. It was squelching service output because of a bug in ruby where `#read` on a pipe never returned when the spawned process is SIGTERM'd by one of its children. The current implementation of `Puppet::Util::Execution#execute` redirects to a temporary file instead of reading from a pipe. We should no longer be squelching service output so that users can easily diagnose service failures.
2014-01-27Merge branch 'pull-2137'Adrien Thebo1-2/+29
2014-01-22(PUP-1492) Fix pacman specs so that they pass when yaourt is installed.Peter Huene1-2/+11
Stub out the location of yaourt. Fix spec that assumes pacman is executed when yaourt is installed.
2014-01-17Revert "Merge branch 'ticket/master/18342-windows-file-setting-owner-group'"Iristyle2-2/+0
This reverts commit cf4501c7a97c106994c2ef81756c2081f56feeef, reversing changes made to fcf482aa85708fe20f38cd96d6d92fc58ee78cf6.
2014-01-17Merge pull request #2265 from ↵Josh Partlow1-4/+26
jpartlow/feature/master/pup-1448-validate-user-shell (PUP-1448) Validates the user type shell property
2014-01-17(PUP-1448) Validates the user type shell propertyAlejandro Ramirez1-4/+26
Adds the feature :manages_shell to the user type and asserts that providers manipulating the shell property must have this feature. The useradd provider is then patched to specifically check that the shell property is valid (file exists and is executable). Other providers which use shell (user/aix, user/directory_service, user/ldap, user/pw) have the :manages_shell feature added to ensure that they continue to function, but no additional validation is performed. Rebased to a more recent master from Alejandro Ramirez's PR https://github.com/puppetlabs/puppet/pull/1942 (Commits squashed)
2014-01-15(#23316) Update yum package provider support :holdableGavin Williams1-2/+29
This commit adds support for the `holdable` package feature to the yum package provider. If the yum versionlock plugin is available packages can specify an ensure value of 'held' and the yum provider will use the versionlock plugin to lock the version. This feature has the caveat that it can only be enabled at provider load time since provider features cannot be enabled based on a code block.
2014-01-14(PUP-266) Ensure ADSI Group SIDs may be looked upEthan J. Brown2-0/+2
- Previously, calling Puppet::Util::ADSI::Group.exists? for a well-known group SID would return false, because the WinNT:// style URI used to find the group would not examine / lookup the SID, but would instead create a broken Uri that the underlying OS could not understand - Now, the given group name is checked to see if it's a SID before the Uri is constructed, and a SID style Uri is created where appropriate
2014-01-13Merge remote-tracking branch 'upstream/stable'Kylo Ginsberg5-326/+163
2014-01-11Merge branch 'pull-2182'Adrien Thebo1-20/+16
This closes GH-2182
2014-01-11(PUP-1218) Add spec coverage for ssh_authorized_key ssh-ed25519Adrien Thebo1-20/+16
2014-01-08Merge pull request #2232 from ↵Josh Partlow16-84/+76
hlindberg/pup-716_short-lived-objects-in-filesystem (PUP-716) short lived objects in filesystem