-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathpulp_admin_spec.rb
108 lines (90 loc) · 3.1 KB
/
pulp_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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
require 'spec_helper'
describe 'pulp::admin' do
context 'on RedHat' do
context 'install class without parameters' do
let :facts do
on_supported_os['redhat-7-x86_64']
end
it { should contain_class('pulp::admin::install') }
it { should contain_class('pulp::admin::config') }
it { should contain_class('pulp::admin::params') }
it { should contain_package('pulp-admin-client').with_ensure('installed') }
it 'should set admin.conf file' do
verify_exact_contents(catalogue, '/etc/pulp/admin/admin.conf', [
'[server]',
'host: foo.example.com',
'port: 443',
'api_prefix: /pulp/api',
'verify_ssl: true',
'ca_path: /etc/pki/tls/certs/ca-bundle.crt',
'upload_chunk_size: 1048576',
'[client]',
'role: admin',
'[filesystem]',
'extensions_dir: /usr/lib/pulp/admin/extensions',
'id_cert_dir: ~/.pulp',
'id_cert_filename: user-cert.pem',
'upload_working_dir: ~/.pulp/uploads',
'[logging]',
'filename: ~/.pulp/admin.log',
'call_log_filename: ~/.pulp/server_calls.log',
'[output]',
'poll_frequency_in_seconds: 1',
'enable_color: true',
'wrap_to_terminal: false',
'wrap_width: 80',
])
end
end
context 'install with puppet param' do
let(:params) do {
'enable_puppet' => true,
} end
it { should contain_package('pulp-puppet-admin-extensions').with_ensure('installed') }
it 'should set puppet.conf file' do
verify_exact_contents(catalogue, '/etc/pulp/admin/conf.d/puppet.conf', [
'[puppet]',
'upload_working_dir = ~/.pulp/puppet-uploads',
'upload_chunk_size = 1048576',
])
end
end
context 'install with docker param' do
let(:params) do {
'enable_docker' => true,
} end
it { should contain_package('pulp-docker-admin-extensions').with_ensure('installed') }
end
context 'install with nodes param' do
let(:params) do {
'enable_nodes' => true,
} end
it { should contain_package('pulp-nodes-admin-extensions').with_ensure('installed') }
end
context 'install with python param' do
let(:params) do {
'enable_python' => true,
} end
it { should contain_package('pulp-python-admin-extensions').with_ensure('installed') }
end
context 'install with rpm param' do
let(:params) do {
'enable_rpm' => true,
} end
it { should contain_package('pulp-rpm-admin-extensions').with_ensure('installed') }
end
context 'install with params' do
let(:params) do {
'host' => 'pulp.company.net',
'verify_ssl' => false,
} end
it 'should set the defaults file' do
should contain_file('/etc/pulp/admin/admin.conf').
with_content(/^\[server\]$/).
with_content(/^host: pulp.company.net$/).
with_content(/^verify_ssl: false$/).
with_ensure('file')
end
end
end
end