| 1 |
# frozen_string_literal: true |
| 2 |
|
| 3 |
require 'spec_helper_acceptance' |
| 4 |
|
| 5 |
describe 'redis with deferred password' do |
| 6 |
include_examples 'an idempotent resource' do |
| 7 |
let(:manifest) do |
| 8 |
<<-PUPPET |
| 9 |
class { 'redis': |
| 10 |
manage_repo => true, |
| 11 |
redis_apt_repo => true, |
| 12 |
port => 10001, |
| 13 |
requirepass => Deferred('inline_epp',['<%= $pass %>',{'pass' => 'topsecret'}]), |
| 14 |
} |
| 15 |
PUPPET |
| 16 |
end |
| 17 |
end |
| 18 |
|
| 19 |
describe command('redis-cli -p 10001 -a topsecret ping') do |
| 20 |
its(:exit_status) { is_expected.to eq 0 } |
| 21 |
its(:stdout) { is_expected.to match %r{PONG} } |
| 22 |
end |
| 23 |
|
| 24 |
describe command('redis-cli -p 10001 -a nonsense ping') do |
| 25 |
its(:stdout) { is_expected.not_to match %r{PONG} } |
| 26 |
end |
| 27 |
end |