Changed: adapt runtime_no_envs tests to rootless image

This commit is contained in:
Daniel Del Rio Figueira 2021-03-12 09:25:37 +01:00
parent 91f6d74410
commit d3fd5b2d37
No known key found for this signature in database
GPG Key ID: DCB25219AF061D1B
1 changed files with 6 additions and 6 deletions

View File

@ -24,7 +24,7 @@ describe 'passbolt_api service' do
sleep 1 sleep 1
end end
@image = Docker::Image.build_from_dir(ROOT_DOCKERFILES, { 'dockerfile' => 'debian/Dockerfile' }) @image = Docker::Image.build_from_dir(ROOT_DOCKERFILES, { 'dockerfile' => $dockerfile })
@container = Docker::Container.create( @container = Docker::Container.create(
'Env' => [ 'Env' => [
@ -47,7 +47,7 @@ describe 'passbolt_api service' do
let(:passbolt_host) { @container.json['NetworkSettings']['IPAddress'] } let(:passbolt_host) { @container.json['NetworkSettings']['IPAddress'] }
let(:uri) { "/healthcheck/status.json" } let(:uri) { "/healthcheck/status.json" }
let(:curl) { "curl -sk -o /dev/null -w '%{http_code}' -H 'Host: passbolt.local' https://#{passbolt_host}/#{uri}" } let(:curl) { "curl -sk -o /dev/null -w '%{http_code}' -H 'Host: passbolt.local' https://#{passbolt_host}:#{$https_port}/#{uri}" }
describe 'php service' do describe 'php service' do
it 'is running supervised' do it 'is running supervised' do
@ -67,11 +67,11 @@ describe 'passbolt_api service' do
end end
it 'is listening on port 80' do it 'is listening on port 80' do
expect(@container.json['Config']['ExposedPorts']).to have_key('80/tcp') expect(@container.json['Config']['ExposedPorts']).to have_key("#{$http_port}/tcp")
end end
it 'is listening on port 443' do it 'is listening on port 443' do
expect(@container.json['Config']['ExposedPorts']).to have_key('443/tcp') expect(@container.json['Config']['ExposedPorts']).to have_key("#{$https_port}/tcp")
end end
end end
@ -89,13 +89,13 @@ describe 'passbolt_api service' do
end end
describe 'hide information' do describe 'hide information' do
let(:curl) { "curl -Isk -H 'Host: passbolt.local' https://#{passbolt_host}/" } let(:curl) { "curl -Isk -H 'Host: passbolt.local' https://#{passbolt_host}:#{$https_port}/" }
it 'hides php version' do it 'hides php version' do
expect(command("#{curl} | grep 'X-Powered-By: PHP'").stdout).to be_empty expect(command("#{curl} | grep 'X-Powered-By: PHP'").stdout).to be_empty
end end
it 'hides nginx version' do it 'hides nginx version' do
expect(command("#{curl} | grep 'server:'").stdout.strip).to match(/^server:\s+nginx$/) expect(command("#{curl} | grep 'server:'").stdout.strip).to match(/^server:\s+nginx.*$/)
end end
end end