Fix openldap_password function to avoid errors with latest Puppet 7 #328
Annotations
5 errors
spec/functions/openldap_password_spec.rb#L13
openldap_password generates SSHA password with only a secret
Failure/Error: is_expected.to run.with_params('foo').and_return('{SSHA}3RXLE64s+3ytIRdJYu9eoU8O/alhYmNkZWZnaA==')
expected openldap_password("foo") to have returned "{SSHA}3RXLE64s+3ytIRdJYu9eoU8O/alhYmNkZWZnaA==" instead of raising RSpec::Mocks::MockExpectationError(#<#<Class:0x000055f30e1493d8>:0x000055f30e1422e0 @closure_scope=nil, @loader=(DependencyLoader 'openldap private' [(ModuleLoader::FileBased 'stdlib' 'stdlib') ,(ModuleLoader::FileBased 'augeas_core' 'augeas_core') ,(ModuleLoader::FileBased 'augeasproviders_core' 'augeasproviders_core') ,(ModuleLoader::FileBased 'augeasproviders_shellvar' 'augeasproviders_shellvar') ,(ModuleLoader::FileBased 'systemd' 'systemd') ,(ModuleLoader::FileBased 'epel' 'epel') ,(ModuleLoader::FileBased 'provision' 'provision') ,(ModuleLoader::FileBased 'yumrepo_core' 'yumrepo_core') ,(ModuleLoader::FileBased 'openldap' 'openldap') ,(ModuleLoader::FileBased 'puppet_agent' 'puppet_agent') ,(ModuleLoader::FileBased 'facts' 'facts')])> received :call_function with unexpected arguments
expected: (:fqdn_rand_string, 8)
got: ("fqdn_rand_string", 8)
Please stub a default value first if message might be received with other args as well.
)
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.12.1/lib/rspec/support.rb:108:in `block in <module:Support>'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.12.1/lib/rspec/support.rb:117:in `notify_failure'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/error_generator.rb:348:in `notify'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/error_generator.rb:332:in `__raise'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/error_generator.rb:60:in `raise_missing_default_stub_error'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/proxy.rb:237:in `raise_missing_default_stub_error'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/proxy.rb:221:in `message_received'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/proxy.rb:361:in `message_received'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/method_double.rb:98:in `proxy_method_invoked'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/method_double.rb:74:in `block (2 levels) in define_proxy_method'
/home/runner/work/puppet-openldap/puppet-openldap/spec/fixtures/modules/openldap/lib/puppet/functions/openldap_password.rb:38:in `generate_password'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/dispatch.rb:60:in `invoke'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/dispatcher.rb:47:in `block in dispatch'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/dispatcher.rb:46:in `catch'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/dispatcher.rb:46:in `dispatch'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/function.rb:43:in `block in call'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/function.rb:42:in `catch'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/function.rb:42:in `call'
/h
|
spec/functions/openldap_password_spec.rb#L20
openldap_password when given a secret and a scheme generates CRYPT password
Failure/Error: is_expected.to run.with_params('foo', 'CRYPT').and_return('{CRYPT}abQ9KY.KfrYrc')
expected openldap_password("foo", "CRYPT") to have returned "{CRYPT}abQ9KY.KfrYrc" instead of raising RSpec::Mocks::MockExpectationError(#<#<Class:0x000055f30dac0868>:0x000055f30dab8370 @closure_scope=nil, @loader=(DependencyLoader 'openldap private' [(ModuleLoader::FileBased 'stdlib' 'stdlib') ,(ModuleLoader::FileBased 'augeas_core' 'augeas_core') ,(ModuleLoader::FileBased 'augeasproviders_core' 'augeasproviders_core') ,(ModuleLoader::FileBased 'augeasproviders_shellvar' 'augeasproviders_shellvar') ,(ModuleLoader::FileBased 'systemd' 'systemd') ,(ModuleLoader::FileBased 'epel' 'epel') ,(ModuleLoader::FileBased 'provision' 'provision') ,(ModuleLoader::FileBased 'yumrepo_core' 'yumrepo_core') ,(ModuleLoader::FileBased 'openldap' 'openldap') ,(ModuleLoader::FileBased 'puppet_agent' 'puppet_agent') ,(ModuleLoader::FileBased 'facts' 'facts')])> received :call_function with unexpected arguments
expected: (:fqdn_rand_string, 2)
got: ("fqdn_rand_string", 2)
Please stub a default value first if message might be received with other args as well.
)
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.12.1/lib/rspec/support.rb:108:in `block in <module:Support>'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.12.1/lib/rspec/support.rb:117:in `notify_failure'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/error_generator.rb:348:in `notify'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/error_generator.rb:332:in `__raise'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/error_generator.rb:60:in `raise_missing_default_stub_error'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/proxy.rb:237:in `raise_missing_default_stub_error'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/proxy.rb:221:in `message_received'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/proxy.rb:361:in `message_received'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/method_double.rb:98:in `proxy_method_invoked'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/method_double.rb:74:in `block (2 levels) in define_proxy_method'
/home/runner/work/puppet-openldap/puppet-openldap/spec/fixtures/modules/openldap/lib/puppet/functions/openldap_password.rb:29:in `generate_password'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/dispatch.rb:60:in `invoke'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/dispatcher.rb:47:in `block in dispatch'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/dispatcher.rb:46:in `catch'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/dispatcher.rb:46:in `dispatch'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/function.rb:43:in `block in call'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/function.rb:42:in `catch'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/function.rb:42:in `call'
/home/runner/work/pup
|
spec/functions/openldap_password_spec.rb#L30
openldap_password when given a secret and a scheme generates SMD5 password
Failure/Error: is_expected.to run.with_params('foo', 'SMD5').and_return('{SMD5}NAYSvQYSIRYBLCM8U6MUc2FiY2RlZmdo')
expected openldap_password("foo", "SMD5") to have returned "{SMD5}NAYSvQYSIRYBLCM8U6MUc2FiY2RlZmdo" instead of raising RSpec::Mocks::MockExpectationError(#<#<Class:0x000055f30d52b330>:0x000055f30d527fa0 @closure_scope=nil, @loader=(DependencyLoader 'openldap private' [(ModuleLoader::FileBased 'stdlib' 'stdlib') ,(ModuleLoader::FileBased 'augeas_core' 'augeas_core') ,(ModuleLoader::FileBased 'augeasproviders_core' 'augeasproviders_core') ,(ModuleLoader::FileBased 'augeasproviders_shellvar' 'augeasproviders_shellvar') ,(ModuleLoader::FileBased 'systemd' 'systemd') ,(ModuleLoader::FileBased 'epel' 'epel') ,(ModuleLoader::FileBased 'provision' 'provision') ,(ModuleLoader::FileBased 'yumrepo_core' 'yumrepo_core') ,(ModuleLoader::FileBased 'openldap' 'openldap') ,(ModuleLoader::FileBased 'puppet_agent' 'puppet_agent') ,(ModuleLoader::FileBased 'facts' 'facts')])> received :call_function with unexpected arguments
expected: (:fqdn_rand_string, 8)
got: ("fqdn_rand_string", 8)
Please stub a default value first if message might be received with other args as well.
)
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.12.1/lib/rspec/support.rb:108:in `block in <module:Support>'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.12.1/lib/rspec/support.rb:117:in `notify_failure'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/error_generator.rb:348:in `notify'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/error_generator.rb:332:in `__raise'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/error_generator.rb:60:in `raise_missing_default_stub_error'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/proxy.rb:237:in `raise_missing_default_stub_error'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/proxy.rb:221:in `message_received'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/proxy.rb:361:in `message_received'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/method_double.rb:98:in `proxy_method_invoked'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/method_double.rb:74:in `block (2 levels) in define_proxy_method'
/home/runner/work/puppet-openldap/puppet-openldap/spec/fixtures/modules/openldap/lib/puppet/functions/openldap_password.rb:34:in `generate_password'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/dispatch.rb:60:in `invoke'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/dispatcher.rb:47:in `block in dispatch'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/dispatcher.rb:46:in `catch'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/dispatcher.rb:46:in `dispatch'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/function.rb:43:in `block in call'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/function.rb:42:in `catch'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/function.rb:42:
|
spec/functions/openldap_password_spec.rb#L36
openldap_password when given a secret and a scheme generates SSHA password
Failure/Error: is_expected.to run.with_params('foo', 'SSHA').and_return('{SSHA}3RXLE64s+3ytIRdJYu9eoU8O/alhYmNkZWZnaA==')
expected openldap_password("foo", "SSHA") to have returned "{SSHA}3RXLE64s+3ytIRdJYu9eoU8O/alhYmNkZWZnaA==" instead of raising RSpec::Mocks::MockExpectationError(#<#<Class:0x000055f30d96bf30>:0x000055f30d967c28 @closure_scope=nil, @loader=(DependencyLoader 'openldap private' [(ModuleLoader::FileBased 'stdlib' 'stdlib') ,(ModuleLoader::FileBased 'augeas_core' 'augeas_core') ,(ModuleLoader::FileBased 'augeasproviders_core' 'augeasproviders_core') ,(ModuleLoader::FileBased 'augeasproviders_shellvar' 'augeasproviders_shellvar') ,(ModuleLoader::FileBased 'systemd' 'systemd') ,(ModuleLoader::FileBased 'epel' 'epel') ,(ModuleLoader::FileBased 'provision' 'provision') ,(ModuleLoader::FileBased 'yumrepo_core' 'yumrepo_core') ,(ModuleLoader::FileBased 'openldap' 'openldap') ,(ModuleLoader::FileBased 'puppet_agent' 'puppet_agent') ,(ModuleLoader::FileBased 'facts' 'facts')])> received :call_function with unexpected arguments
expected: (:fqdn_rand_string, 8)
got: ("fqdn_rand_string", 8)
Please stub a default value first if message might be received with other args as well.
)
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.12.1/lib/rspec/support.rb:108:in `block in <module:Support>'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.12.1/lib/rspec/support.rb:117:in `notify_failure'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/error_generator.rb:348:in `notify'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/error_generator.rb:332:in `__raise'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/error_generator.rb:60:in `raise_missing_default_stub_error'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/proxy.rb:237:in `raise_missing_default_stub_error'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/proxy.rb:221:in `message_received'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/proxy.rb:361:in `message_received'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/method_double.rb:98:in `proxy_method_invoked'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/method_double.rb:74:in `block (2 levels) in define_proxy_method'
/home/runner/work/puppet-openldap/puppet-openldap/spec/fixtures/modules/openldap/lib/puppet/functions/openldap_password.rb:38:in `generate_password'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/dispatch.rb:60:in `invoke'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/dispatcher.rb:47:in `block in dispatch'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/dispatcher.rb:46:in `catch'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/dispatcher.rb:46:in `dispatch'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/function.rb:43:in `block in call'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions/function.rb:42:in `catch'
/home/runner/work/puppet-openldap/puppet-openldap/vendor/bundle/ruby/2.7.0/gems/puppet-7.27.0/lib/puppet/pops/functions
|
|
The logs for this run have expired and are no longer available.
Loading