summaryrefslogtreecommitdiff
path: root/spec/integration
AgeCommit message (Collapse)AuthorFilesLines
2014-08-01(PUP-2898) Add 4x style resource expressionsHenrik Lindberg1-2/+3
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.
2014-07-29(maint) make lmhosts disabled spec msg friendlierEthan J. Brown1-1/+1
2014-07-24Merge pull request #2909 from ↵Peter Huene7-22/+0
jpartlow/maint/master/remove-extra-settings-clear-from-specs Maint/master/remove extra settings clear from specs
2014-07-24(maint) Remove unnecessary Puppet.settings.clear calls from specsJosh Partlow7-22/+0
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.
2014-07-24(maint) Fix spec order issue for Travis CI.Peter Huene1-6/+6
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.
2014-07-14Merge pull request #2845 from hlindberg/PUP-2891_override-class-parameters-errorJosh Partlow1-0/+8
(PUP-2891) Treat override of class as an error.
2014-07-08Merge branch 'pr/2819'Andrew Parker1-17/+0
* 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
2014-07-08(PUP-2902) Change error message when attempting to collect classes.Henrik Lindberg1-1/+1
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.
2014-07-07Merge pull request #2846 from joshcooper/maint/master/ruby2-conditional-pendingJosh Cooper1-4/+23
Mark failing specs as pending on windows and ruby 2 x64
2014-07-07(maint) Error message is different under Windows 2012r2Josh Cooper1-4/+23
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).
2014-07-07(maint) Fix test to check desired functionalityAndrew Parker1-2/+2
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.
2014-07-07Merge pull request #2841 from hlindberg/PUP-500_additional-collection-testsAndrew Parker1-0/+76
(PUP-500) Add additional tests cases
2014-07-07(PUP-2891) Treat override of class as an error.Henrik Lindberg1-0/+8
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.
2014-07-07Merge pull request #2844 from hlindberg/PUP-2532_defaults-wrong-perspectiveAndrew Parker1-0/+19
(PUP-2532) Correct lookup of default parameters
2014-07-07(PUP-2532) Correct lookup of default parametersHenrik Lindberg1-0/+19
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.
2014-07-05(PUP-2711) Make recursive manifest parsing conditional to future parserHenrik Lindberg1-0/+33
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.
2014-07-05(PUP-500) Add additional tests casesHenrik Lindberg1-0/+76
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.
2014-07-03(PUP-2858) Remove duplicated testing (evaluator = 'current')Henrik Lindberg1-7/+0
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).
2014-07-03Merge branch 'pr/2829'Josh Cooper1-1/+3
* 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
2014-07-03Merge pull request #2836 from ↵Henrik Lindberg1-3/+59
zaphod42/issue/master/pup-500-define-collection-semantics (PUP-500) Increase coverage of collection queries
2014-07-03(PUP-391) Ruby 2 exception type changed to EISDIREthan J. Brown1-1/+3
- File.open now raises EISDIR when a path is a directory, prior to verifying permissions in Ruby 2. Files continue to return EACCESS.
2014-07-02(PUP-1177) Use Puppet::FileSystem.chmodJosh Cooper1-5/+4
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.
2014-07-02Merge pull request #2756 from ffrank/ticket/master/PUP-1177-sshkey-mode-600Adrien Thebo2-11/+25
(PUP-1177) make sure ssh_known_hosts is not created with mode 0600
2014-07-01(PUP-500) Add coverage for +> on collectionAndrew Parker1-3/+23
The +> form of collection hadn't been covered in any test cases that I could find. This adds some coverage.
2014-07-01(PUP-500) Increase coverage of collection queriesAndrew Parker1-0/+36
The tags and array handling of collection queries is "special". This adds some test coverage around that behavior.
2014-07-01(PUP-1811) Fix collection use of include?Andrew Parker1-76/+103
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.
2014-06-30Merge pull request #2787 from Iristyle/ticket/master/PUP-392-validate-gemsRob Reynolds2-4/+4
(PUP-392) Remove sys-admin gem
2014-06-30(PUP-2737) use the general regex to match ssh_authorized_keys for purgingFelix Frank1-1/+6
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.
2014-06-30(PUP-392) FFI ADSI GetComputerName /Add Group SIDEthan J. Brown2-4/+4
- 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.
2014-06-26(PUP-2104) Add cfacter setting to enable cfacter implementation.Peter Huene1-1/+1
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.
2014-06-26(PUP-2521) Don't use windows-pr constantsEthan J. Brown2-10/+11
- 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
2014-06-25Merge pull request #2754 from ffrank/maint/compiler-spec-catch-resource-errorsAndrew Parker1-148/+137
(maint) spec: allow expectations of resources from compiled manifests
2014-06-24(maint) use compiler in crontab integration specFelix Frank1-148/+137
2014-06-23(maint) Eliminate duplicate constant warningJosh Cooper1-20/+19
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
2014-06-23Merge pull request #2776 from ↵Rob Reynolds2-28/+30
Iristyle/ticket/master/PUP-839-FFI-Windows-Security (PUP-839) FFI Puppet::Util::Windows::Security
2014-06-23Merge pull request #2791 from ↵Henrik Lindberg1-1/+10
zaphod42/issue/master/pup-1299-magic-array-parameters (PUP-1299) Stop stripping arrays in future parser
2014-06-19(PUP-1299) Stop stripping arrays in future parserAndrew Parker1-1/+10
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.
2014-06-19(PUP-2557) Error on node inheritanceAndrew Parker2-82/+94
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.
2014-06-19(PUP-839) Remove SID mixin from SecurityEthan J. Brown2-6/+6
- 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
2014-06-19(PUP-839) Share AccessControlEntry constantsEthan J. Brown1-4/+4
- Don't rely on the mixin constants from Windows::Security, share Puppet::Util::Windows::AccessControlEntry constants
2014-06-19(PUP-839) FFI Util::Windows::Security / ::FileEthan J. Brown1-18/+20
- 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.
2014-06-19Merge pull request #2782 from ferventcoder/ticket/master/PUP-2738-fixesJosh Cooper1-0/+7
(PUP-2738) Ensure block in user.password_is?
2014-06-19(PUP-2738) Ensure block in user.password_is?Rob Reynolds1-0/+7
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.
2014-06-18Merge pull request #2780 from hlindberg/PUP-2787_rename-Object-AnyAndrew Parker1-1/+1
(PUP-2787) Rename Object Type to Any
2014-06-19(PUP-2787) Rename Object Type to AnyHenrik Lindberg1-1/+1
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.
2014-06-18Merge branch 'ticket/master/PUP-2738-FFI-Memory-Issues'Rob Reynolds1-3/+4
* 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
2014-06-18(PUP-2738) Use block form of FFI::MemoryPointerEthan J. Brown1-3/+4
- 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.
2014-06-13(PUP-2557) Add deprecation of node inheritanceHenrik Lindberg1-18/+37
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.
2014-06-13Merge pull request #2763 from zaphod42/feature/master/pup-514-typed-parametersHenrik Lindberg2-2/+289
(PUP-514) Add support for optionally typed parameters.
2014-06-12(maint) Remove optional_objectAndrew Parker1-1/+1
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.