66 let ( :facts ) { facts }
77
88 context 'without parameters' do
9- let ( :pre_condition ) do
10- <<-PUPPET
11- include foreman_proxy
12- class { 'foreman_proxy::plugin::pulp':
13- enabled => false,
14- pulpnode_enabled => false,
15- pulpcore_enabled => false,
16- }
17- PUPPET
18- end
19-
209 it { is_expected . to compile . with_all_deps }
2110 it { is_expected . to contain_package ( 'katello-debug' ) }
2211 it { is_expected . to contain_class ( 'foreman_proxy_content::pub_dir' ) }
@@ -29,18 +18,6 @@ class { 'foreman_proxy::plugin::pulp':
2918 }
3019 end
3120
32- let ( :pre_condition ) do
33- <<-PUPPET
34- include foreman_proxy
35- class { 'foreman_proxy::plugin::pulp':
36- enabled => false,
37- pulpnode_enabled => false,
38- pulpcore_enabled => true,
39- pulpcore_mirror => false,
40- }
41- PUPPET
42- end
43-
4421 it { is_expected . to compile . with_all_deps }
4522 it { is_expected . to contain_class ( 'foreman_proxy_content::pub_dir' ) }
4623 it do
@@ -50,38 +27,6 @@ class { 'foreman_proxy::plugin::pulp':
5027 . that_comes_before ( 'Class[foreman_proxy::plugin::pulp]' )
5128 end
5229
53- context 'as mirror' do
54- let ( :pre_condition ) do
55- <<-PUPPET
56- include foreman_proxy
57- class { 'foreman_proxy::plugin::pulp':
58- enabled => false,
59- pulpnode_enabled => false,
60- pulpcore_enabled => true,
61- pulpcore_mirror => true,
62- }
63- PUPPET
64- end
65-
66- it { is_expected . to compile . with_all_deps }
67- it { is_expected . to contain_class ( 'foreman_proxy_content::pub_dir' ) }
68- it do
69- is_expected . to contain_class ( 'pulpcore' )
70- . with ( apache_http_vhost : true )
71- . with ( apache_https_vhost : true )
72- . that_comes_before ( 'Class[foreman_proxy::plugin::pulp]' )
73- end
74- it do
75- is_expected . to contain_class ( 'foreman_proxy_content::reverse_proxy' )
76- . with ( path : '/' )
77- . with ( port : 8443 )
78- end
79- it do
80- is_expected . to contain_pulpcore__apache__fragment ( 'gpg_key_proxy' )
81- . with_https_content ( %r{ProxyPass /katello/api/v2/repositories/ https://foo\. example\. com/katello/api/v2/repositories/} )
82- end
83- end
84-
8530 context 'with external postgres' do
8631 let ( :params ) do
8732 super ( ) . merge (
@@ -133,6 +78,34 @@ class { 'foreman_proxy::plugin::pulp':
13378 end
13479 end
13580
81+ context 'as mirror' do
82+ let ( :pre_condition ) do
83+ <<-PUPPET
84+ class { 'foreman_proxy_content':
85+ pulpcore_mirror => true,
86+ }
87+ PUPPET
88+ end
89+
90+ it { is_expected . to compile . with_all_deps }
91+ it { is_expected . to contain_class ( 'foreman_proxy_content::pub_dir' ) }
92+ it do
93+ is_expected . to contain_class ( 'pulpcore' )
94+ . with ( apache_http_vhost : true )
95+ . with ( apache_https_vhost : true )
96+ . that_comes_before ( 'Class[foreman_proxy::plugin::pulp]' )
97+ end
98+ it do
99+ is_expected . to contain_class ( 'foreman_proxy_content::reverse_proxy' )
100+ . with ( path : '/' )
101+ . with ( port : 8443 )
102+ end
103+ it do
104+ is_expected . to contain_pulpcore__apache__fragment ( 'gpg_key_proxy' )
105+ . with_https_content ( %r{ProxyPass /katello/api/v2/repositories/ https://foo\. example\. com/katello/api/v2/repositories/} )
106+ end
107+ end
108+
136109 context 'with puppet' do
137110 let ( :params ) do
138111 {
@@ -147,13 +120,6 @@ class { 'puppet':
147120 server => true,
148121 server_foreman => true,
149122 }
150- include foreman_proxy
151- class { 'foreman_proxy::plugin::pulp':
152- enabled => false,
153- pulpnode_enabled => false,
154- pulpcore_enabled => false,
155- pulpcore_mirror => false,
156- }
157123 PUPPET
158124 end
159125
@@ -165,18 +131,6 @@ class { 'foreman_proxy::plugin::pulp':
165131 end
166132
167133 describe 'with puppet server disabled' do
168- let ( :pre_condition ) do
169- <<-PUPPET
170- include foreman_proxy
171- class { 'foreman_proxy::plugin::pulp':
172- enabled => false,
173- pulpnode_enabled => false,
174- pulpcore_enabled => false,
175- pulpcore_mirror => false,
176- }
177- PUPPET
178- end
179-
180134 it { is_expected . to compile . with_all_deps }
181135 it { is_expected . not_to contain_class ( 'certs::puppet' ) }
182136 end
0 commit comments