Debian Codegraph @

spec/acceptance/suites/dnfmodule/redis_spec.rb

raw
1 # frozen_string_literal: true
2
3 require 'spec_helper_acceptance'
4
5 describe 'redis', if: %w[centos redhat].include?(os[:family]) && os[:release].to_i == 8 do
6 redis_name = 'redis'
7
8 it 'runs successfully' do
9 pp = <<-PUPPET
10 class { 'redis':
11 dnf_module_stream => '6',
12 package_ensure => 'latest',
13 }
14 PUPPET
15
16 # Apply twice to ensure no errors the second time.
17 apply_manifest(pp, catch_failures: true)
18 apply_manifest(pp, catch_changes: true)
19 end
20
21 describe package(redis_name) do
22 it { is_expected.to be_installed }
23 end
24
25 describe service(redis_name) do
26 it { is_expected.to be_running }
27 end
28
29 context 'redis should respond to ping command' do
30 describe command('redis-cli ping') do
31 its(:stdout) { is_expected.to match %r{PONG} }
32 end
33 end
34
35 describe command('redis-server -v') do
36 its(:stdout) { is_expected.to match %r{v=6.+} }
37 end
38 end