Changed: adapt runtime tests to rootltess support
This commit is contained in:
parent
77cbc65941
commit
adee1543b3
|
|
@ -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' => [
|
||||||
"DATASOURCES_DEFAULT_HOST=#{@mysql.json['NetworkSettings']['IPAddress']}",
|
"DATASOURCES_DEFAULT_HOST=#{@mysql.json['NetworkSettings']['IPAddress']}",
|
||||||
|
|
@ -48,7 +48,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,12 +67,12 @@ describe 'passbolt_api service' do
|
||||||
expect(service('nginx')).to be_running.under('supervisor')
|
expect(service('nginx')).to be_running.under('supervisor')
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'is listening on port 80' do
|
it "is listening on port #{$http_port}" 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 #{$https_port}" 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
|
||||||
|
|
||||||
|
|
@ -90,13 +90,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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue