Skip to content

Commit

Permalink
add accept test
Browse files Browse the repository at this point in the history
  • Loading branch information
traylenator committed Apr 22, 2024
1 parent 0e20673 commit 421e3d1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion manifests/instance.pp
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@

# TODO: Rely on https://github.com/puppetlabs/puppetlabs-stdlib/pull/1425
# once available.
if $_template_params.any |$value| { $value.is_a(Deferred) } {
if $_template_params.any |$_key, $_value| { $_value.is_a(Deferred) } {
$_template_params_escaped = $_template_params.map | $_var , $_value | {
if $_value.is_a(Deferred) {
{ $_var => "<%= \$${_var} %>" }
Expand Down
23 changes: 23 additions & 0 deletions spec/acceptance/suites/default/redis_deferred_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# frozen_string_literal: true

require 'spec_helper_acceptance'

describe 'redis with deferred password' do
it 'configures and work with no errors' do
pp = <<-EOS
class { 'redis':
manage_repo => true,
redis_apt_repo => true,
port => 10001,
masterauth => Deferred('inline_epp',['<%= $pass %>\n',{'pass' => 'topsecret'}]),
}
EOS

apply_manifest(pp, catch_failures: true, debug: true)
apply_manifest(pp, catch_changes: true, debug: true)
end

describe command('redis-cli -p 10001 -a topsecret ping') do
its(:stdout) { is_expected.to match %r{PONG} }

Check failure on line 21 in spec/acceptance/suites/default/redis_deferred_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 8 - CentOS 9

redis with deferred password Command "redis-cli -p 10001 -a topsecret ping" stdout is expected to match /PONG/ Failure/Error: its(:stdout) { is_expected.to match %r{PONG} } expected "" to match /PONG/ Diff: @@ -1 +1 @@ -/PONG/ +""

Check failure on line 21 in spec/acceptance/suites/default/redis_deferred_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - CentOS 9

redis with deferred password Command "redis-cli -p 10001 -a topsecret ping" stdout is expected to match /PONG/ Failure/Error: its(:stdout) { is_expected.to match %r{PONG} } expected "" to match /PONG/ Diff: @@ -1 +1 @@ -/PONG/ +""

Check failure on line 21 in spec/acceptance/suites/default/redis_deferred_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 8 - AlmaLinux 9

redis with deferred password Command "redis-cli -p 10001 -a topsecret ping" stdout is expected to match /PONG/ Failure/Error: its(:stdout) { is_expected.to match %r{PONG} } expected "" to match /PONG/ Diff: @@ -1 +1 @@ -/PONG/ +""

Check failure on line 21 in spec/acceptance/suites/default/redis_deferred_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - AlmaLinux 9

redis with deferred password Command "redis-cli -p 10001 -a topsecret ping" stdout is expected to match /PONG/ Failure/Error: its(:stdout) { is_expected.to match %r{PONG} } expected "" to match /PONG/ Diff: @@ -1 +1 @@ -/PONG/ +""

Check failure on line 21 in spec/acceptance/suites/default/redis_deferred_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 8 - Rocky 9

redis with deferred password Command "redis-cli -p 10001 -a topsecret ping" stdout is expected to match /PONG/ Failure/Error: its(:stdout) { is_expected.to match %r{PONG} } expected "" to match /PONG/ Diff: @@ -1 +1 @@ -/PONG/ +""

Check failure on line 21 in spec/acceptance/suites/default/redis_deferred_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Rocky 9

redis with deferred password Command "redis-cli -p 10001 -a topsecret ping" stdout is expected to match /PONG/ Failure/Error: its(:stdout) { is_expected.to match %r{PONG} } expected "" to match /PONG/ Diff: @@ -1 +1 @@ -/PONG/ +""
end
end

0 comments on commit 421e3d1

Please sign in to comment.