Skip to content

Commit

Permalink
moving basic status to its own test since not enabled by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
bishopbm1 committed May 23, 2022
1 parent 0434c62 commit 3d2defb
Showing 1 changed file with 34 additions and 30 deletions.
64 changes: 34 additions & 30 deletions spec/classes/profile/web_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,36 +149,6 @@
},
tag: ['st2', 'st2::backend', 'st2::backend::api'])
end
it do
let(:params) { { basicstatus_enabled: true } }
is_expected.to contain_nginx__resource__location('@basic_statusError')
.with(ensure: 'present',
server: 'ssl-st2webui',
ssl: true,
ssl_only: true,
index_files: [],
add_header: {
'Content-Type' => 'application/json always',
},
location_cfg_append: {
'return' => '503 \'{ "faultstring": "Nginx is unable to reach basic_status. Make sure service is running." }\'',
},
tag: ['st2', 'st2::backend', 'st2::backend::basicstatuserror'])
end
it do
let(:params) { { basicstatus_enabled: true } }
is_expected.to contain_nginx__resource__location('/basic_status/')
.with(ensure: 'present',
server: 'ssl-st2webui',
ssl: true,
ssl_only: true,
index_files: [],
location_cfg_append: {
'error_page' => '502 = @basic_statusError',
'stub_status' => 'on',
},
tag: ['st2', 'st2::backend', 'st2::backend::basic_status'])
end
it do
is_expected.to contain_nginx__resource__location('@streamError')
.with(ensure: 'present',
Expand Down Expand Up @@ -407,6 +377,40 @@
it { is_expected.to compile.with_all_deps }
it { is_expected.not_to contain_exec('generate ssl cert /etc/ssl/st2/st2.crt') }
end # context 'with ssl_cert_manage=false'

context 'with basicstatus_enabled=true' do
let(:params) { { basicstatus_enabled: true } }

it { is_expected.to compile.with_all_deps }
it do
is_expected.to contain_nginx__resource__location('@basic_statusError')
.with(ensure: 'present',
server: 'ssl-st2webui',
ssl: true,
ssl_only: true,
index_files: [],
add_header: {
'Content-Type' => 'application/json always',
},
location_cfg_append: {
'return' => '503 \'{ "faultstring": "Nginx is unable to reach basic_status. Make sure service is running." }\'',
},
tag: ['st2', 'st2::backend', 'st2::backend::basicstatuserror'])
end
it do
is_expected.to contain_nginx__resource__location('/basic_status/')
.with(ensure: 'present',
server: 'ssl-st2webui',
ssl: true,
ssl_only: true,
index_files: [],
location_cfg_append: {
'error_page' => '502 = @basic_statusError',
'stub_status' => 'on',
},
tag: ['st2', 'st2::backend', 'st2::backend::basic_status'])
end
end # context 'basicstatus_enabled=true'
end # context 'on #{os}'
end # on_supported_os(all_os)
end # describe 'st2::profile::server'

0 comments on commit 3d2defb

Please sign in to comment.