Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
Remove expected nil when calling execute without install_options.
Add specs for install_options as a hash, array, or string.
|
|
The yum provider now supports install_options.
|
|
ffrank/ticket/master/PUP-1585-cron-duplication-with-target
(PUP-1585) and (PUP-1624) cron: handle the user and target properties better
|
|
(PUP-1041) nagios: parse empty parameter values in definitions
|
|
* pr/2403:
(PUP-1085) Add and fix pacman provider tests
(PUP-1085) Make Pacman provider group-aware
This closes GH-2403.
|
|
- Added a test for the installedgroups function
- Fixed behaviour of instances function
- Pointed a test for code that has moved at the new function
|
|
pup-1766 make systemd the defaultprovider for service on rhel7
|
|
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.
|
|
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.
|
|
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.
|
|
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.)
|
|
|
|
|
|
Fix/master/pup 1568 fix error reporting
|
|
(PUP-1510) Fixed forcelocal bug with ensure => absent
|
|
asked for
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
(PUP-789) refactor yumrepo into type and provider
|
|
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.
|
|
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.
|
|
Implemented the upgradeable and versionable features on the pkgin package provider so
that packages can use `latest` and version numbers in the ensure property.
|
|
* 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
|
|
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.
|
|
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.
|
|
To allow purging of unmanaged resources, they are now implicitly named.
The unit test must take that into account.
|
|
|
|
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)
|
|
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.
|
|
- 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>
|
|
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.
|
|
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.
|
|
In the refactoring within 000b8fef the success variables was
removed. So the error message shouldn't anymore use it.
|
|
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',
}
|
|
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.
|
|
|
|
Stub out the location of yaourt.
Fix spec that assumes pacman is executed when yaourt is installed.
|
|
This reverts commit cf4501c7a97c106994c2ef81756c2081f56feeef, reversing
changes made to fcf482aa85708fe20f38cd96d6d92fc58ee78cf6.
|
|
jpartlow/feature/master/pup-1448-validate-user-shell
(PUP-1448) Validates the user type shell property
|
|
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)
|
|
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.
|
|
- 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
|
|
|
|
This closes GH-2182
|
|
|
|
hlindberg/pup-716_short-lived-objects-in-filesystem
(PUP-716) short lived objects in filesystem
|