Changed: adapt runtime tests to rootltess support

This commit is contained in:
Daniel Del Rio Figueira 2021-03-11 18:49:36 +01:00
parent 77cbc65941
commit adee1543b3
No known key found for this signature in database
GPG Key ID: DCB25219AF061D1B
1 changed files with 8 additions and 8 deletions

View File

@ -24,7 +24,7 @@ describe 'passbolt_api service' do
sleep 1
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(
'Env' => [
"DATASOURCES_DEFAULT_HOST=#{@mysql.json['NetworkSettings']['IPAddress']}",
@ -48,7 +48,7 @@ describe 'passbolt_api service' do
let(:passbolt_host) { @container.json['NetworkSettings']['IPAddress'] }
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
it 'is running supervised' do
@ -67,12 +67,12 @@ describe 'passbolt_api service' do
expect(service('nginx')).to be_running.under('supervisor')
end
it 'is listening on port 80' do
expect(@container.json['Config']['ExposedPorts']).to have_key('80/tcp')
it "is listening on port #{$http_port}" do
expect(@container.json['Config']['ExposedPorts']).to have_key("#{$http_port}/tcp")
end
it 'is listening on port 443' do
expect(@container.json['Config']['ExposedPorts']).to have_key('443/tcp')
it "is listening on port #{$https_port}" do
expect(@container.json['Config']['ExposedPorts']).to have_key("#{$https_port}/tcp")
end
end
@ -90,13 +90,13 @@ describe 'passbolt_api service' do
end
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
expect(command("#{curl} | grep 'X-Powered-By: PHP'").stdout).to be_empty
end
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