diff --git a/Gemfile b/Gemfile index 0a7542d09..e4ed0cd65 100644 --- a/Gemfile +++ b/Gemfile @@ -26,7 +26,7 @@ group :development, :unit_tests do gem 'mocha', '< 1.2.0' gem 'rspec-puppet-facts' gem 'simplecov' - gem 'parallel_tests' + gem 'parallel_tests', '2.9.0' if RUBY_VERSION < '2.0.0' gem 'rubocop', '0.41.2' if RUBY_VERSION < '2.0.0' gem 'rubocop' if RUBY_VERSION >= '2.0.0' gem 'rubocop-rspec', '~> 1.6' if RUBY_VERSION >= '2.3.0' diff --git a/spec/aliases/ipv4_spec.rb b/spec/aliases/ipv4_spec.rb index e767b45b8..f9022a411 100644 --- a/spec/aliases/ipv4_spec.rb +++ b/spec/aliases/ipv4_spec.rb @@ -20,6 +20,8 @@ 'nope', '77', '4.4.4', + '9999.9999.9999.9999', + '192.168.256.1', '2001:0db8:85a3:0000:0000:8a2e:0370:73342001:0db8:85a3:0000:0000:8a2e:0370:7334' ].each do |value| describe value.inspect do diff --git a/types/compat/ipv4.pp b/types/compat/ipv4.pp index 1d72ebd09..c0ddbfed9 100644 --- a/types/compat/ipv4.pp +++ b/types/compat/ipv4.pp @@ -1,2 +1,2 @@ # Emulate the validate_ipv4_address and is_ipv4_address functions -type Stdlib::Compat::Ipv4 = Pattern[/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/] +type Stdlib::Compat::Ipv4 = Pattern[/^(([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d))[.]?){4}$/]