summaryrefslogtreecommitdiff
path: root/spec/integration
AgeCommit message (Collapse)AuthorFilesLines
2014-10-16(PUP-3201) Stop using :undef for parameters in 4xAndrew Parker1-0/+36
The :undef symbol was still leaking all over the place internally. This caused type inference to sometimes end up with Runtime[ruby, Symbol]. By using nil instead of :undef, everything can be much more straightforward. Once the code removal for puppet 4 comes into play even more oddities around how resource parameters are handled can be performed.
2014-10-15Merge pull request #3164 from ↵Kylo Ginsberg1-1/+22
ffrank/ticket/3.7.x/PUP-3357-purge-unnamed-ssh-keys (PUP-3357) purge unnamed ssh keys
2014-10-15(PUP-3357) integration test for purging of unnamed ssh authorized keysFelix Frank1-1/+22
Add an integration test with an ssh keyfile in which two keys have no name and make sure that both are successfully purged.
2014-10-10(PUP-3201) Treat :undef as PNilTypeAndrew Parker1-0/+20
For PUP-2857 :undef was changed from being a PNilType to a PRuntimeType. This stopped the undef literal in the language from being able to be assigned to Optional parameters. However, this only happened when the undef was the default expression for the parameter.
2014-10-02(maint) Remove duplicate file handling codeAndrew Parker1-31/+12
The tests had their own way of creating files and directories for testing. All of these different ways of creating files and directories already existed in PuppetSpec::Files. This unifies them.
2014-10-01(maint) reduce repitition in Application::Apply integration specFelix Frank1-25/+12
2014-10-01(PUP-3258) node exec indirector: default to environment, not its nameFelix Frank1-0/+38
Nodes can be classified through a local executable that prints YAML with a node specification. This is enabled through the node_terminus=exec option. Since PUP-2519, this setting would break `puppet apply`. Trying to apply any manifest would lead to Puppet applying the default environment's site manifest instead. The reason for this is that the node terminus will include the current environment's name in the node lookup result. This in turn makes Puppet look up the environment per name. This is not the desired behavior, because Application::Apply performs the lookup and further operations with a localized environment that overrides the site manifest. Solved by including the current environment object in the returned node object instead of its name.
2014-09-10(PUP-3162) Expand expected config_versionJosh Cooper1-1/+1
Previously the test failed on windows, because we were expecting the environment config_version to return on POSIX path. But on Windows it is expanded based on the current drive. Paired-with: Josh Partlow <joshua.partlow@puppetlabs.com>
2014-09-10Merge pull request #3065 from ↵Henrik Lindberg3-17/+165
jpartlow/issue/stable/pup-3162-whitelist-environment-interpolation (PUP-3162) Issue/stable/pup 3162 whitelist environment interpolation
2014-09-09(maint) Generate unique account namesJosh Cooper1-2/+2
Previously, the windows security_spec could fail if the same test was executed in parallel, since the test assumed the account didn't exist. This commit makes the names unique. The maximum length for local user and groups accounts in 2003 is 20 and 256 characters[1], respectively, and we remain below that limit in both cases. [1] http://technet.microsoft.com/en-us/library/cc783323.aspx
2014-09-09(PUP-3222) Rescue StandardError instead of non-existent exceptionJosh Cooper1-0/+48
Previously, the windows service provider rescued exceptions of type Win32::Service::Error. However, FFI-based versions of win32-service (v0.8.x) no longer raise that type of error. Instead they raise SystemCallError. So previously, if puppet failed to manage a service, e.g. service didn't exist, puppet would try to rescue the exception specifying a class that was not defined: puppet resource service foo ensure=stopped Error: /Service[foo]: Could not evaluate: uninitialized constant Win32::Service::Error This regression was introduced as part of PUP-1283 when we migrated from win32-service version 0.7.x to 0.8.x. This commit modifies the various provider methods to more broadly rescue StandardErrors and updates the spec tests to handle the negative cases. Paired-with: Ethan J Brown <ethan@puppetlabs.com>
2014-09-09(PUP-3162) Switch to a whitelist for $environment interpolationJosh Partlow3-34/+54
Previous commit blacklisted a small set of settings from having $environment interpolated. After some discussion, we decided to broaden this to a whitelist, and the only setting we can currently think of needing $environment interpolation when using directory environments is config_version. We also decided to not halt startup for default_manifest with $environment in it, as these errors are difficult to read with the current error reporting from a rack master. So the validation for default_manifest is removed.
2014-09-08(PUP-3162) Prevent $environment interpolation in directory environmentsJosh Partlow1-0/+129
There are a few settings for which interpolation of $environment does not make sense when using directory environments. * default_manifest -> defines either the relative path to manifests within a directory environment, or an absolute path to manifests to be used by all directory environments. It is currently a configuration error to set $environment within default_manifest. * basemodulepath -> conceptually, this is intended for supplemental modules required for all environments, and should not vary by environment. * environmentpath -> this is the base path defining what directory environments can be found. Interpolating $environment within it makes no sense. Additionally, both environmentpath and basemodulepath are required by the environment loaders during initialization. They will interpolate relative to a specified environment if you interogate config, but in a running master instance, will have interpolated to the default environment regardless of the current environment being processed for a catalog, for instance. A last case, irregardless of type of environment, is the pathological case of attempting to interpolate $environment within environment. This, unsurprisingly, causes a stack overflow. This patch adjusts the Puppet::Settings interpolation code so that $environment is not interpolated within any of these four settings when using directory environments (so, when the environmentpath has been set).* So assuming a confdir=/etc/puppet, basemodulepath=$confdir/modules/$environment will be interpolated as '/etc/puppet/modules/$environment' and a warning will be logged. *Currently setting $environment in default_manifest will error out when puppet loads as a setting validation error, and this behavior will never be reached.
2014-09-08(maint) Remove unused constant from default_manifest_specJosh Partlow1-1/+0
2014-09-02(maint) Namespace constant declaration in specs to prevent warningsJosh Partlow1-2/+4
Add module namespacing to two specs declaring an FS constant (for convenience) so that we don't receive warnings about the duplicate declaration.
2014-08-30Merge pull request #3032 from ↵Henrik Lindberg2-0/+298
jpartlow/feature/master/pup-3069-add-defaultmanifest Feature/master/pup 3069 add defaultmanifest
2014-08-29(PUP-3069) Test both future and current parser with default_manifestJosh Partlow1-170/+186
Previously the environments/default_manifest_spec.rb was only running with the current parser. This runs the set of tests for both the future and current parser cases.
2014-08-29Merge pull request #3024 from ↵Josh Partlow1-43/+87
hlindberg/PUP-3117_resource-expression-splat-rocket-alt (PUP-3117) Complete the Resource Expression implementation
2014-08-29(PUP-3069) Change restrict_environment_manifest nameJosh Partlow2-10/+10
After discussion with Nick Fagerlund and Henrik Lindberg, changing restrict_environment_manifest setting to disable_per_environment_manifest to more clearly reflect what the setting does.
2014-08-29(PUP-3069) Add an integration spec for default_manifestJosh Partlow1-0/+256
This adds integration testing of the new default_manifest and restrict_environment_manifest settings. It tests all the way from Puppet initialization from actual puppet.conf files and environment/manifest files through catalog compilation, simulating Puppet master activity. Since these settings are purely server-side constructs, in that they do not impact the agent beyond the contents of the final catalog the agent receives, I believe this is sufficient to validate them.
2014-08-29(PUP-3069) Add spec test for new default optionsBritt Gresham1-0/+26
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.
2014-08-27(PUP-3117) Complete the implementation of resource expressionHenrik Lindberg1-42/+44
This completes the implenentation of the Resource Expression. * The LHS must now be a QualifiedName (i.e. file, notify), or a QualifiedReference (i.e. File, Notify), or an access expression with a left QualifiedReference (i.e. Resource[file]), or literal 'class' * The result of the LHS must be a CatalogEntry type, and it may not be detailed to title level. * The * => syntax can be used to to unfold a hash. It may be used once per titled resource body. Attribute names must be unique across the attributes set with name => expr, and those set with * => hash.
2014-08-27(PUP-2349) Specify mode as an octal string consistently in spec manifest ↵Kylo Ginsberg3-6/+6
snippets In the puppet 4.0 parser, the file resource's mode property will be required to be a string containing an octal (or symbolic) representation of mode. For consistency then, this commit changes all cases where mode was specified as a Numeric to be a string containing an octal representation of mode (always prefaced with a 0, again for clarity and consistency).
2014-08-26(PUP-3117) Add tests for combination of default / hashHenrik Lindberg1-1/+23
2014-08-26(PUP-3117) Allow multiple *=> in the same body and error on duplicateHenrik Lindberg1-10/+30
This fixes a problem in the grammar that made it impossible to have more than one *=> per body. This commit also adds a check for duplicate entries in the resulting hash with the final set of parameter to value mapping.
2014-08-19(PUP-2889) Eventlog specs pending Windows 2003Ethan J. Brown1-0/+4
- win32-eventlog gem upgraded from 0.5.3 to 0.6.1 as part of https://github.com/puppetlabs/puppet/commit/ac8d4e257f69beaf87489b2e2a57f8aaab512edc - win32-eventlog gem 0.6.1 doesn't yet include the patch necessary to properly load it on 2003 from: https://github.com/djberg96/win32-eventlog/commit/4692e2a67ae8dc794981928d6e6488b775a6689a - Therefore, mark these eventlog tests as pending on 2003 until the 0.6.2 gem ships and the Gemfile can be updated - These guards will be removed as part of PUP-3061
2014-08-18(maint) Improve two test by checking they have no effect on catalog.Henrik Lindberg1-2/+2
It is now possible by checking if the result of a "produce" had no effect on the catalog by comparing against an empty array.
2014-08-18(maint) Express language tests in puppet languageAndrew Parker2-53/+51
This changes the tests of the puppet language, which should become part of the language specification's example and test suite, to be entirely expressed in the puppet language. This removes any dependency on ruby! Well, any dependency on ruby for specifying the language tests.
2014-08-18(PUP-3054) Ensure that inherits are absoluteAndrew Parker2-1/+38
PUP-121 was supposed to make all references to classes and resource types absolute, but it looks like it missed a spot. The class referenced in an inherits clause was not being looked up in an absolute manner, which caused it to find the wrong parent class in certain cases. This changes the future parser so that inherited classes are always absolute names.
2014-08-18(maint) Extract language specification toolsAndrew Parker2-41/+3
The resource_expressions_spec contained a useful way of writing language specification tests. This extracts those out so that they can be reused in other places.
2014-08-18(maint) Cleanup commentAndrew Parker1-1/+1
The comment had trailing whitespace and a comma. It makes more sense without either.
2014-08-14Merge pull request #2970 from kylog/joshcooper-ticket/master/PUP-2907Kylo Ginsberg1-14/+0
ticket/master/pup 2907
2014-08-12Merge pull request #2958 from zaphod42/issue/master/pup-2972-remove-plussignmentHenrik Lindberg2-104/+25
(PUP-2972) Remove += and -=
2014-08-12(PUP-2972) Improve error message for += and -=Andrew Parker1-2/+2
The previous error message was very abrupt and didn't provide any kind of guidance for the user. The new message for += and -= let's them know that it is *no longer* supported and has a link to where they can get more information.
2014-08-11(PUP-2972) Remove += and -=Andrew Parker2-104/+25
Previously the future parser supported += and -=. += was very similar to the same operator that is in the current parser, but with a few differences to make it consistent with the rest of the language. The += operator no longer performed string concatenation and instead acted like $a = $a + $b. The -= operator was added to complete the set of operators available. However, many people have been confused by these operators (even as they exist in the current parser): * It looks like mutation, but the language does not have mutation * It looks like += from other languages, but doesn't behave like them * Shadowing a variable is something that needs to be explicit, otherwise it becomes confusing. This removes += and -= from the future parser. They are still parsed, but the validation step will issue errors if they are encountered.
2014-08-11(PUP-3001) Revert future parser change removing dynamic scoped defaultsHenrik Lindberg1-2/+2
This reverts the change in PUP-867 by (again) calling the same 3x logic for looking up defaults. The implementation of PUP-867 also added tests, and one of those are now changed to reflect the changed behavior.
2014-08-07(PUP-2946) Ensure #compare_stream uses binary stringsAdrien Thebo1-0/+21
In Ruby commit 2142287c `FileUtils.compare_stream` was optimized to produce fewer objects while comparing streams by predeclaring a pair of strings and reusing them for each iteration of the comparison. However, this change exposes some inconsistency in how ruby handles IO#read vs StringIO#read. When IO#read is passed a length and string, it will copy the read data into the string, but will convert the encoding from the expected ASCII-8BIT into the encoding of the string regardless of if the file was opened as a binary file. However, when StringIO#read is passed a length and string it will convert the passed string to the expected ASCII-8BIT. Because of this it's impossible to use `FileUtils.compare_stream` to compare a binary file and StringIO instance. To resolve this issue, this commit adds a custom compare_stream method which sets the encoding of the strings to always be ASCII-8BIT on Ruby 1.9+.
2014-08-07(maint) Move methods for creating downloaders to factoryJosh Cooper1-14/+0
Previously, the plugin_handler module was responsible for creating downloaders and evaluating them. Since all of this happens within a single method it is hard to test that the downloaders are created with the correct set of properties. For example, we `ignore` source permissions when downloading plugins, but we `use` source permissions when downloading external facts, since those often contain scripts, which must be executable. This commit moves the logic for creating the downloaders to a factory and updates the tests accordingly. As part of this change, the PluginHandler module is changed to a class and is no longer mixed into the Configurer.
2014-08-05Revert "Merge branch 'pull-2938'"Adrien Thebo1-24/+0
This reverts commit 1a428b92c900e84d9faa5d0aaa1a32f3c0b1d42b, reversing changes made to cb26e23706b76e44544c14f4c921885f17dccbb3.
2014-08-05Revert "(maint) Use public API when testing binary file #save"Adrien Thebo1-5/+18
This reverts commit 133c0b8009a48eef77d68c0bd8d5f79c930dab50.
2014-08-05(maint) Use public API when testing binary file #saveAdrien Thebo1-18/+5
2014-08-05(maint) Use rspec :if to constrain describe blockAdrien Thebo1-19/+17
2014-08-05(PUP-2946) File2 with #compare_stream from 1.9.3Maksym Melnychok1-0/+26
FileUtils.compare_stream in Ruby 2 is broken when comparing binary file stream with StringIO stream of different encoding. This change reverts FileUtils.compare_stream to stdlib v1.9.3 implementation.
2014-08-01(PUP-2898) Fix errors on ruby 1.8.7Andrew Parker1-6/+4
Ruby 1.8.7 doesn't allow trailing commas in parameter lists. This problem was present in the resource_expressions_spec file and is removed by this commit. Ruby 1.8.7 doesn't have an empty? method for Symbol. This changes the evaluator_impl to compare against the EMPTY_STRING constant instead, which does work on 1.8 and 1.9.
2014-08-01(PUP-501) Check all of the features togetherAndrew Parker1-0/+3
This adds a combined example of most of the features being used together: title expressions, type expressions, splatted parameters, exported resource, and resource reference.
2014-08-01(PUP-501) Check virtual and exported resourcesAndrew Parker1-9/+28
This adds checks for the specification's assertions that virutal and exported resources are not in the produced catalog, but are available for later operations (realization) and reference (reading a parameter value). This cannot check that the exported resources are made available to catalog processors, since that is implementation dependent. In order to check this the compile_to_catalog method needed to be changed to filter out expoerted resources, just like the catalog indirection does. This required a change to the create_resources test.
2014-08-01(PUP-501) Check that empty titles creates no resourcesAndrew Parker1-0/+3
When a title array is empty, there are no resources created.
2014-08-01(PUP-2898) Don't allow empty string titlesHailee Kenney1-3/+2
Prior to this commit, empty string titles did not cause an error. However according to the specifications, a string should have a minimum length of one. With this commit, the parser will now raise an issue when an empty string title is given.
2014-08-01(PUP-2898) Fix error in *=> implementationAndrew Parker1-6/+4
The implementation for *=> looks to have been a copy-paste from the => implementation, however the expression attribute on AttributesOperation is just `expr` and not `value_expr`.
2014-08-01(PUP-501) Test resource expression evaluationJosh Partlow1-0/+262
This adds tests around the behavior of the current and the future evaluator's resource instantiation expressions. There are many cases in the current system where the tests are commented out because there isn't any consistent behavior.