Age | Commit message (Collapse) | Author | Files | Lines |
|
This changes the following:
* Assignment has lower precedence than resource expressions
* Local defaults are supported in resource instantiation expressions
* A Resource body may have a new expression AttributesOperation that
must evaluate to a hash.
* Stricter validation of resource titles
* Changes to TreeModelDumper wrt how BlockExpression is rendered (to
improve debugging output). As a consequence many tests needed
adjustments.
* Tests that previously passed have been modified because of stricter
validation.
This also includes maintenance. Removing dead code/fixing stale comments
and documentation.
|
|
|
|
jpartlow/maint/master/remove-extra-settings-clear-from-specs
Maint/master/remove extra settings clear from specs
|
|
I believe most of these predated our clearing the settings before each
test in the central puppet/test/test_helper.rb. And since we then set
some base settings (such as :environment_timeout) in the test_helper,
the effect of a secondary clear in the test itself is to wipe out the
baseline setup test_helper just laid down.
In particular this is a problem with environment_timeout, as it leads to
tests which end up creating environments, getting them cached with the
default 180s timeout, which can leak to subsequent tests and create
unpleasant spec order issues.
|
|
Because of the order Travis runs specs, some environment caching issues
were found that caused some specs to fail because they made the
assumption that the production environment wasn't already in the cache.
Thus, they relied on changing Puppet[:modulepath] to have an effect.
The fix is to override the environments for these two
specs and return an environment we know has the expected module path.
|
|
(PUP-2891) Treat override of class as an error.
|
|
* pr/2819:
(maint) Remove biff setting and related code
(PUP-2858) Remove evaluator setting
(PUP-2858) Remove duplicated testing (evaluator = 'current')
(PUP-2858) Refactor binder to use ne evaluator
(PUP-2858) Remove the 3_1 checker and its factory
(PUP-2858) Refactor EvaluatingParser::Transitional to EvaluatingParser
(PUP-2858) Remove use of Puppet[:evaluator] from the code base
(PUP-2858) Deprecate the use of Puppet[:environment] == current
(PUP-2858) Remove e_parser adapter support
Conflicts:
spec/integration/node/environment_spec.rb
Closes #2819
|
|
An attempt to collect classes led to an error message that said
that 'class' is not a known resource type (in a way that can be
misinterpreted).
This commit make the error message specific, and clear.
|
|
Mark failing specs as pending on windows and ruby 2 x64
|
|
Previously, the test was expecting a failed logon to raise an error
whose message contained:
unknown user name or bad password.
This is correct in 2008r2 and earlier, but it appears Windows 2012
changed the error message to be:
The user name or password is incorrect.
This commit updates the test to not be sensitive to the message
text. Instead we verify that the exception contains the correct Win32
error code (ERROR_LOGON_FAILURE).
|
|
This test had a flaw in it before where if the collection was not even
done, the test would still pass. In order to check that collection
applies to realized resources the resources need to be changed. This
adds an override so that we can see the effect of the collection
expression on realized resources.
|
|
(PUP-500) Add additional tests cases
|
|
This makes an attempt to override a class parameter issue an
error from the runtime layer rather than expecting the underlying
3x implementation to do it when the left expression does not
result in a resource, or a resource that has 'class' as resource type.
|
|
(PUP-2532) Correct lookup of default parameters
|
|
The lookup of resource parameters via the type e.g. Notify[id][message]
performed the lookup in the calling scope, not the resource's closure
scope which resulted in parameter default values were being seen from
the perspective of the caller (they may be very different).
This corrects the lookup to use the resource's closure scope.
|
|
This makes the ability to load all .pp files under a manifest dir
recursively conditional to parser == future. (It will become the
standard in Puppet 4.0). This is done to avoid slurping in lots of files
in case users kept other files around in a subdirectory in the belief
that they would not be loaded. Thus making it harder to upgrade.
This also adds a test that runs for future parser.
|
|
Test cases added that test that the current implementation does
not regress from its current behavior.
Regular resources are collected. Collection with override can be
done multiple times. Changing and amedning values work for
regular resources as well as virtual.
|
|
There was a test (environment_spec) that ran an extra time
with the hybrid parser = future, evaluator = current which results
in the same tests running twice. (This because the future evaluator
is enforced when runing with future parser).
|
|
* pr/2829:
(PUP-391) Ruby 2 exception type changed to EISDIR
(PUP-391) Fix Rdoc 4+ specs on Windows Ruby 2 x64
(PUP-391) Use FFI.errno instead of GetLastError
(PUP-391) Remove unused file19windows.rb variable
(PUP-391) Fix INVALID_FILE_ATTRIBUTES on x64
|
|
zaphod42/issue/master/pup-500-define-collection-semantics
(PUP-500) Increase coverage of collection queries
|
|
- File.open now raises EISDIR when a path is a directory, prior to
verifying permissions in Ruby 2. Files continue to return EACCESS.
|
|
Previously, the nagios spec test was using Ruby's File.chmod to set the
initial file mode, but checking the mode using Puppet's filesystem layer.
This commit ensures we use the filesystem layer when setting the initial
mode.
|
|
(PUP-1177) make sure ssh_known_hosts is not created with mode 0600
|
|
The +> form of collection hadn't been covered in any test cases that I
could find. This adds some coverage.
|
|
The tags and array handling of collection queries is "special". This
adds some test coverage around that behavior.
|
|
The virtual resource collection uses the comparator for include?, but a
previous commit changed the signature. This wasn't caught until the
acceptance tests ran because it turns out that the collection tests were
not being run against the future parser.
This fixes the problem by passing the scope that is available for
collection to the method. It also removes two of the acceptance tests in
favor of adding a new integration test and running the collection tests
with the future parser.
|
|
(PUP-392) Remove sys-admin gem
|
|
In order to generate ssh_authorized_key resource for purging, the user
type needs its own parsing logic for ssh_authorized_keys files, as it
cannot directly emply a provider of ssh_authorized_key. This was originally
implemented in a rather half-assed way and worked only for keys without
spaces in the comment string (which Puppet uses as the resource title).
To fix this, unify the parsing logic by using the same regular expression
with which the ssh_authorized_key provider extracts the respective fields
from the keyfiles.
|
|
- Some existing tests were using Sys::Admin.get_login to get the
current username. Implement this same functionality in
Puppet::Util::Windows::ADSI::User.current_user_name by making
Win32 API call directly instead of relying on sys/admin. Note that
unlike GetComputerNameW, GetUserNameW returns a length
including the trailing NULL.
- Further, replace calls to Sys::Admin::get_user(name).sid and
Sys::Admin::get_group(name).sid with their respective equivalents in
the ADSI classes, namely ADSI::User.new(name).sid and
ADSI::Group.new(name).sid. Note that Sys::Admin returned a string
while ADSI returns a SID object which must be converted to a string.
- To support retrieving the ADSI Group sid, add a new class member
and method identical to the one on ADSI User.
|
|
Adding a --cfacter setting that will replace the facter implementation
with the native facter implementation if the following conditions are
met:
* cfacter is installed
* the version of cfacter is at least 0.2.0 (not yet released).
* facter has not evaluated any facts by the time the setting is set.
To accomplish this last point, certain default setting values needed to
be delay-evaluated as they relied on facts. Therefore a :default
for a setting now accepts a Proc and calls the Proc only once when the
default value is needed.
|
|
- Somehow there were still some remaining constants referencing
Windows:: which is part of windows-pr gem. Most are already
defined locally as of the code being ported to FFI. Ensure that we
use our internal constant definitions rather than those from gem:
Puppet::Util::Windows::AccessControlEntry::CONTAINER_INHERIT_ACE
Puppet::Util::Windows::AccessControlEntry::OBJECT_INHERIT_ACE
Puppet::Util::Windows::AccessControlEntry::INHERIT_ONLY_ACE
Puppet::Util::Windows::File::STANDARD_RIGHTS_ALL
Puppet::Util::Windows::File::SPECIFIC_RIGHTS_ALL
Puppet::Util::Windows::File::FILE_ALL_ACCESS
Puppet::Util::Windows::File::FILE_GENERIC_READ
Puppet::Util::Windows::File::FILE_GENERIC_EXECUTE
- Add new constants to Puppet::Util::Windows::Error
ERROR_FILE_NOT_FOUND
ERROR_ACCESS_DENIED
|
|
(maint) spec: allow expectations of resources from compiled manifests
|
|
|
|
Previously, when executing specs on Windows the following warning would be
displayed:
warning: already initialized constant FILE
This commit updates the spec test so it doesn't define a top level constant
|
|
Iristyle/ticket/master/PUP-839-FFI-Windows-Security
(PUP-839) FFI Puppet::Util::Windows::Security
|
|
zaphod42/issue/master/pup-1299-magic-array-parameters
(PUP-1299) Stop stripping arrays in future parser
|
|
Resource values that were arrays used to be converted to a single value
iff the array only had one element. This created a lot of confusion for
type and provider authors when the value they would set in a manifest
would not be the value they would get in the type. The conversion causes
large amounts of code that would check for values that aren't arrays and
convert them to arrays in various places. There were also often tests
that would be written directly against providers that would then not
catch errors in real use because the author was unaware, or just forgot,
that the array conversion would happen.
Under the future parser this is no longer done. The old behavior,
however, won't issue a deprecation warning because there isn't anything
that can be done about it from a user's perspective. The most likely
outcome from this change is that some manifests may stop working because
a value just happened to be a single-valued array that was on a
parameter that is not supposed to take an array. In such cases the error
would have been masked previously, but now will be uncovered.
|
|
The future parser needs to be as close as possible to what will be the
default in Puppet 4. By making the node inheritance a warning instead of
an error, it makes it so that Puppet 4 will be significantly different
from puppet 3 with --parser future. This changes it so that both Puppet
4 and Puppet 3 with parser future will disallow node inheritance. The
error message is retained, which should provide good guidance whenever a
user does encounter this.
This change leaves all of the tests for node inheritance only working on
the --parser current. In addition an acceptance test that simply checked
variable scoping with an ENC has been converted to an integration test
along with all of the other tests about variable scope.
|
|
- SID methods can really standalone on their own, and
should for the sake of sanity / code maintenance. Adjust all
callsites (including specs) accordingly.
- Make SID methods into static module_functions since they're
already stateless
|
|
- Don't rely on the mixin constants from Windows::Security, share
Puppet::Util::Windows::AccessControlEntry constants
|
|
- Remove windows-pr file class mixin for Windows::File and implement
CreateFileW in Security.
- Note that open_file overlaps with create_file in file.rb
- Add FFI GetFileAttributes and SetFileAttributes to File module
- Move all file attribute related calls out of the Security module and
into the File module, including get_attributes, add_attributes,
remove_attributes and set_attributes. Add corresponding deprecation
notices.
- Add a top level FILE alias for Puppet::Util::Windows::File and
use that to make calls to the APIs / constants in File.
- File must be included prior to Security to use these constants.
|
|
(PUP-2738) Ensure block in user.password_is?
|
|
This ensures that a block is given by password_is? when calling
logon_user even though it doesn't need to do anything with it. We went this
route because it made more sense to require a block for this call versus
checking if a block was given in the logon_user method. If you call
logon_user without passing a block you cannot take the next step to later do
something as that user. So it would be a misleading if we allowed it without
requiring a block.
|
|
(PUP-2787) Rename Object Type to Any
|
|
This renames the top most type in the type system to Any from
the name Object. This is done because the word Object carries
connotations of "Object Oriented Programming" that simply adds confusion
about how puppet works.
This commit is basically a rename refactoring.
|
|
* ticket/master/PUP-2738-FFI-Memory-Issues:
(PUP-2738) Windows::File use FFI::Pointer helper
(PUP-2738) Move CloseHandle -> FFI::WIN32
(PUP-2738) Windows utils appropriate return values
(PUP-2738) Use block form of FFI::MemoryPointer
(PUP-2738) Puppet::Util::Windows::Process FFI clean
(PUP-2738) Puppet::Util::Windows::File FFI cleanup
(PUP-2738) open_symlink should wide_string once
(PUP-2738) Puppet::Util::Windows::User refactor
(PUP-2738) FFI from_string_to_wide_string block
(PUP-2738) FFI::Pointer#read_win32_local_pointer
|
|
- Existing uses of FFI::MemoryPointer rely on Ruby GC to perform
non-deterministic memory cleanup. In an effort to reduce memory
consumption, use the block form of FFI::MemoryPointer to call free
on pointers as soon as they're no longer needed.
- Ensure that we don't use non-local return's anywhere, due to their
potential dangerous / unexpected behavior. When inside blocks,
store off return values in a separate variable to be returned
outside the block. When values are only used inside yields, and the
corresponding unmanaged memory has been freed, return nil outside
the block.
|
|
This makes a deprecation warning being logged whenever a
node is instantiated with a parent in 3x, and a warning is issued
during validation of the source text when future parser is used.
The intent is to remove the support for node inheritance in
Puppet 4.0.0.
|
|
(PUP-514) Add support for optionally typed parameters.
|
|
Object is now the top class and so there is no need to use
Optional[Object] everywhere. This removes the type factory method
optional_object and replaces all occurrances with just object. It also
updates all of the uses of Optional[Object] to use just Object.
|