Debian Codegraph @

spec/acceptance/suites/default/redis_adminstration_spec.rb

raw
1 # frozen_string_literal: true
2
3 require 'spec_helper_acceptance'
4
5 RSpec::Matchers.define_negated_matcher :execute_without_warning, :execute_with_warning
6
7 # systcl settings are untestable in docker
8 describe 'redis::administration', unless: default['hypervisor'] =~ %r{docker} do
9 def execute_with_warning
10 have_attributes(stderr: %r{WARNING})
11 end
12
13 include_examples 'an idempotent resource' do
14 let(:manifest) { 'include redis, redis::administration' }
15 end
16
17 specify do
18 expect(file('/proc/sys/vm/overcommit_memory')).
19 to have_attributes(content: "1\n")
20 end
21
22 specify do
23 expect(file('/proc/sys/net/core/somaxconn')).
24 to have_attributes(content: "65535\n")
25 end
26
27 specify do
28 expect(command('timeout 1s redis-server --port 7777 --loglevel verbose')).
29 to execute_without_warning.
30 and have_attributes(exit_status: 124)
31 end
32 end