-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathadmin_spec.rb
69 lines (62 loc) · 2.13 KB
/
admin_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
require 'spec_helper'
describe 'pulpcore::admin' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts }
let(:title) { 'help' }
context 'with a fixed pulp_settings and user' do
let(:params) do
{
pulp_settings: '/etc/pulpcore/settings.py',
user: 'pulpcore',
working_dir: '/var/lib/pulp'
}
end
context 'default parameters' do
it do
is_expected.to compile.with_all_deps
is_expected.to contain_exec('pulpcore-manager help')
.with_user('pulpcore')
.with_environment(['PULP_SETTINGS=/etc/pulpcore/settings.py'])
.with_refreshonly(false)
.with_unless(nil)
.with_cwd('/var/lib/pulp')
end
end
context 'default parameters' do
let(:params) do
super().merge(
command: 'migrate --noinput',
refreshonly: true,
unless: '/usr/bin/false',
)
end
it do
is_expected.to compile.with_all_deps
is_expected.to contain_exec('pulpcore-manager migrate --noinput')
.with_user('pulpcore')
.with_environment(['PULP_SETTINGS=/etc/pulpcore/settings.py'])
.with_refreshonly(true)
.with_unless('/usr/bin/false')
end
end
end
context 'with inheritance' do
let(:pre_condition) { 'include pulpcore' }
context 'default parameters' do
it do
is_expected.to compile.with_all_deps
is_expected.to contain_pulpcore__admin('help').with_pulp_settings('/etc/pulp/settings.py')
is_expected.to contain_concat('pulpcore settings')
is_expected.to contain_exec('pulpcore-manager help')
.with_user('pulp')
.with_environment(['PULP_SETTINGS=/etc/pulp/settings.py'])
.with_refreshonly(false)
.with_unless(nil)
.that_requires('Concat[pulpcore settings]')
end
end
end
end
end
end