forked from theforeman/puppet-pulp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpulp_admin_spec.rb
108 lines (90 loc) · 3.62 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'].merge(:concat_basedir => '/tmp', :mongodb_version => '2.4.14', :root_home => '/root')
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
should contain_file('/etc/pulp/admin/admin.conf').
with_content(/^\[server\]$/).
with_content(/^host: foo.example.com$/).
with_content(/^port: 443$/).
with_content(/^api_prefix: \/pulp\/api$/).
with_content(/^verify_ssl: true$/).
with_content(/^ca_path: \/etc\/pki\/tls\/certs\/ca-bundle.crt$/).
with_content(/^upload_chunk_size: 1048576$/).
with_content(/^\[client\]$/).
with_content(/^role: admin$/).
with_content(/^\[filesystem\]$/).
with_content(/^extensions_dir: \/usr\/lib\/pulp\/admin\/extensions$/).
with_content(/^id_cert_dir: ~\/.pulp$/).
with_content(/^id_cert_filename: user-cert.pem$/).
with_content(/^upload_working_dir: ~\/.pulp\/uploads$/).
with_content(/^\[logging\]$/).
with_content(/^filename: ~\/.pulp\/admin.log$/).
with_content(/^call_log_filename: ~\/.pulp\/server_calls.log$/).
with_content(/^\[output\]$/).
with_content(/^poll_frequency_in_seconds: 1$/).
with_content(/^enable_color: true$/).
with_content(/^wrap_to_terminal: false$/).
with_content(/^wrap_width: 80$/).
with_ensure('file')
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
should contain_file('/etc/pulp/admin/conf.d/puppet.conf').
with_content(/^\[puppet\]$/).
with_content(/^upload_working_dir = ~\/.pulp\/puppet-uploads$/).
with_content(/^upload_chunk_size = 1048576$/).
with_ensure('file')
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