Age | Commit message (Collapse) | Author | Files | Lines |
|
Added tests for checking that default_manifest behaves properly when
given $environment. Also when restrict_environment_manifest is true with
a non-relative default_manifest.
This commit also fixed the hook on the :default_manifest setting to
validate that $environment was not present when setting the value.
|
|
A new call to self.resource_type in Puppet::Resource#initialize can cause
the loading of type code as a side effect. This interfered with the mocking
for the test
Puppet::Settings::FileSetting when being converted to a resource
should manage existent files even if 'create_files' is not enabled
Add a stubs call to one of the uncritical expectations so that
additional calls are not considered as spurious.
|
|
This reverts commit cf4501c7a97c106994c2ef81756c2081f56feeef, reversing
changes made to fcf482aa85708fe20f38cd96d6d92fc58ee78cf6.
|
|
- Previously, Puppet would ignore the configuration in defaults.rb for
setting a group / owner on a given file or directory -- even when
the Windows machine was running with administrative permissions
- Since Windows now has the capability of properly setting a group
and owner, allow Windows to manage these permissions when
appropriate
- The existing Puppet::Settings::FileSettings::Service class
depends on looking up the appropriate default service accounts
for use in a number of locations. To fall in line with this usage
pattern, "Administrators" is set as the default owner and
the "Service" group S-1-5-6 is set as the default group. This
special OS managed group includes all accounts with the logon
as a service token privilege.
|
|
|
|
- All previous File and FileTest calls to exist? or exists? go through
the new FileSystem::File abstraction so that the implementation can
later be swapped for a Windows specific one to support symlinks
|
|
- The usage of Dir.getwd in tests has been simplified to
File.expand_path to properly handle mixed case CWD
- util_spec.rb ensures 'FOO' Env var cleared before test starts
- Windows SID checks should be performed as a regex match to
properly handle all accounts starting with S-1-5-*, which denotes
accounts with an identifier authority of SECURITY_NT_AUTHORITY
instead of hardcoding S-1-5-32-544, the Administrators group
|
|
The previous attempt to enable in-memory sqlite3 database testing for
the spec tests in 58e1c23 is insufficient because the
Puppet[:dblocation] setting is a type of FileSetting which munges values
using File.expand_path. This is a problem because the path expansion
caused the database to be written to the filesystem rather than memory,
as intended.
This patch addresses the problem by adding a special case for all file
settings. The munge operation is a no-op if the special value of
':memory:' is passed.
|
|
The previous tests were not very careful about making sure that they
were going to be going down the right branches to test the path that
they wanted. This makes some of the branch selection more explicit so
make the tests a bit more robust to change.
|
|
The previous behavior for managing the group of a file meant that if the
group didn't exist puppet errored when trying to set permissions. This
changes the behavior to check for the existance of the group and in the
case of the group not existing (and we don't expect it to be created
because `:mkusers` is false) then the group is not managed.
There were several alternatives that were possible:
* use the primary group of the "root" user
* use the primary group of the `:owner` for the file
Neither of these were compellingly better alternatives, since this
should only be happening when puppet hasn't been fully configured on the
system.
|
|
The previous behavior allowed the group parameter to be set to root, but
it still selected the configured "service" group. This is contrary to
what is done for the owner parameter and seems to have been an
accidental behavior.
This commit brings this portion of the group handling in line with user.
|
|
The error message for the group parameter had gotten out of sync with
what the allowed values actually were. This updates the message to
include all of the allowed values.
|
|
The previous error message for an invalid owner looked like:
Error: Could not intialize global default settings: Internal error: The :owner setting for Where Puppet stores dynamic and growing data. The default for this setting is calculated specially, like `confdir`_.: vardir must be either 'root' or 'service', not 'gnats'
That message was not very clear as to what had just gone wrong because
it is providing far too much information. This commit changes the
message too:
Error: Could not intialize global default settings: The :owner parameter for the setting 'vardir' must be either 'root' or 'service', not 'gnats'
This applies to both the owner and group parameters.
|
|
Now that the behavior around selecting the right owner and group is
explicitly tested there is no need for the tests around the internal
method to determine whether to use a service user or not. This removes
those tests and fixes up the names of some of the replacement tests.
|
|
|
|
The previous tests for group behaviour of the file setting was not very
clear as to the logic it tried to implement. This changes the tests and
makes clear that the group behavior is a little odd in that if 'root' is
specified it still uses the service group.
|
|
The previous tests around the owner behavior for a file setting did very
little to test the logic around what actual owner will be used when.
This commit changes the tests to make them more clearly define the
behavior of the owner selection.
|
|
Without this patch Ruby 1.9 is still complaining loudly about trying to
parse the spec files. The previous attempt to clean up this problem in
edc3ddf works for Ruby 1.8 but not 1.9.
I'd prefer to remove the shebang lines entirely, but doing so will cause
encoding errors in Ruby 1.9. This patch strives for a happy middle
ground of convincing Ruby it is actually working with Ruby while not
confusing it to think it should exec() to rspec.
This patch is the result of the following command run against the source
tree:
find spec -type f -print0 | \
xargs -0 perl -pl -i -e 's,^\#\!\s?/(.*)rspec,\#! /usr/bin/env ruby,'
|
|
Without this patch some spec files are using `ruby -S rspec` and others
are using `rspec`.
We should standardize on a single form of the interpreter used for spec
files.
`ruby -S rspec` is the best choice because it correctly informs editors
such as Vim with Syntastic that the file is a Ruby file rather than an
Rspec file.
|
|
|