Age | Commit message (Collapse) | Author |
|
The fix for PUP-7371 adds the missing `Undef` into the error message
being tested in type aliases specs, fixing the following failure against
Puppet's master branch:
test::string rejects other values [] should fail to compile and raise an error matching /parameter 'value' expects a String/
Failure/Error: it { is_expected.to compile.and_raise_error(/parameter 'value' expects a String/) }
error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Class[Test::String]: parameter 'value' expects a value of type Undef or String, got Array at line 2:1 on node example
# ./spec/aliases/string_spec.rb:27:in `block (5 levels) in <top (required)>'
|
|
(MODULES-4528) Use versioncmp to check Puppet version for 4.10.x compat
|
|
|
|
`Puppet.version.to_f` on Puppet 4.10.0 will evaluate to `4.1`, causing
test and behavioural changes when conditionals check that the version is
equal or greater than versions such as `4.3`.
Version comparisons that are vulnerable to this have been changed to use
Puppet's versioncmp implementation, while most others only check for
for major version boundaries which is safe.
|
|
|
|
* Improves regex to catch some valid (but less
known) ipv6 strings, mostly those which are a mix
of ipv6 strings and embedded ipv4 numbers
* Regex inspired by the following:
* https://github.com/sindresorhus/ip-regex
* https://gist.github.com/cpetschnig/294476
* The original Dartware forum thread where
someone originally created this beast of a regex,
now lost except to archive.org
* Whilst we're here, we can add the more tricky
ipv6 strings to the existing functions to validate
* Luckily, the `ipaddr` native ruby library used
in the original functions already supports these
|
|
|
|
This also updates all ipv4 tests to use the same test data for better
comparability. Closes #676, #679
Fix-Originally-By: Nate Potter <nathaniel.potter@intel.com>
|
|
|
|
|
|
When validate_string is called via the Puppet 4 deprecation wrappers
from deprecation_gen (introduced in 970852d), `undef` is passed as `nil`
where it was previously passed as `''` from the Puppet 3-style function
API.
This change explicitly permits a `nil` value in validate_string, and
adds a test case to `is_string` which also accepts the same.
Fixes test failures in apt, concat etc:
Error while evaluating a Function Call, nil is not a string. It looks to be a NilClass at apt/manifests/source.pp:23:3 [..]
# ./spec/fixtures/modules/stdlib/lib/puppet/parser/functions/validate_string.rb:34:in `block (2 levels) in <module:Functions>'
# ./spec/fixtures/modules/stdlib/lib/puppet/parser/functions/validate_string.rb:32:in `each'
# ./spec/fixtures/modules/stdlib/lib/puppet/parser/functions/validate_string.rb:32:in `block in <module:Functions>'
# puppet-4.7.0/lib/puppet/parser/functions.rb:174:in `block (2 levels) in newfunction'
# puppet-4.7.0/lib/puppet/util/profiler/around_profiler.rb:58:in `profile'
# puppet-4.7.0/lib/puppet/util/profiler.rb:51:in `profile'
# puppet-4.7.0/lib/puppet/parser/functions.rb:167:in `block in newfunction'
# ./spec/fixtures/modules/stdlib/lib/puppet_x/puppetlabs/stdlib/deprecation_gen.rb:13:in `block (2 levels) in deprecation_gen'
|
|
|
|
|
|
|