diff --git a/spec/classes/redis_sentinel_spec.rb b/spec/classes/redis_sentinel_spec.rb index f906e4d..6de3aa4 100644 --- a/spec/classes/redis_sentinel_spec.rb +++ b/spec/classes/redis_sentinel_spec.rb @@ -1,115 +1,118 @@ require 'spec_helper' describe 'redis::sentinel' do on_supported_os.each do |os, facts| context "on #{os}" do let(:facts) { facts } let(:config_file_orig) do case facts[:osfamily] when 'Archlinux' '/etc/redis/redis-sentinel.conf.puppet' when 'Debian' '/etc/redis/redis-sentinel.conf.puppet' when 'Suse' '/etc/redis/redis-sentinel.conf.puppet' when 'FreeBSD' '/usr/local/etc/redis-sentinel.conf.puppet' when 'RedHat' '/etc/redis-sentinel.conf.puppet' end end let(:pidfile) do if facts[:operatingsystem] == 'Ubuntu' facts[:operatingsystemmajrelease] == '16.04' ? '/var/run/redis/redis-sentinel.pid' : '/var/run/sentinel/redis-sentinel.pid' elsif facts[:operatingsystem] == 'Debian' facts[:operatingsystemmajrelease] == '9' ? '/var/run/redis/redis-sentinel.pid' : '/run/sentinel/redis-sentinel.pid' else '/var/run/redis/redis-sentinel.pid' end end describe 'without parameters' do let(:expected_content) do < bind <%= @sentinel_bind %> <% end -%> port <%= @sentinel_port %> dir <%= @working_dir %> daemonize <%= @daemonize ? 'yes' : 'no' %> pidfile <%= @pid_file %> -protected-mode <%= @protected_mode ? 'yes' : 'no' %> +protected-mode <%= @protected_mode ? 'yes' : 'no' %> sentinel monitor <%= @master_name %> <%= @redis_host %> <%= @redis_port %> <%= @quorum %> sentinel down-after-milliseconds <%= @master_name %> <%= @down_after %> sentinel parallel-syncs <%= @master_name %> <%= @parallel_sync %> sentinel failover-timeout <%= @master_name %> <%= @failover_timeout %> <% if @auth_pass -%> sentinel auth-pass <%= @master_name %> <%= @auth_pass %> <% end -%> <% if @notification_script -%> sentinel notification-script <%= @master_name %> <%= @notification_script %> <% end -%> <% if @client_reconfig_script -%> sentinel client-reconfig-script <%= @master_name %> <%= @client_reconfig_script %> <% end -%> loglevel <%= @log_level %> logfile <%= @log_file %>