Changed: adapt image test to add rootless support
This commit is contained in:
parent
adee1543b3
commit
91f6d74410
|
|
@ -11,7 +11,7 @@ describe 'Dockerfile' do
|
||||||
'PASSBOLT_GPG_KEYRING' => '/var/lib/passbolt/.gnupg'
|
'PASSBOLT_GPG_KEYRING' => '/var/lib/passbolt/.gnupg'
|
||||||
}
|
}
|
||||||
|
|
||||||
@image = Docker::Image.build_from_dir(ROOT_DOCKERFILES, { 'dockerfile' => 'debian/Dockerfile' })
|
@image = Docker::Image.build_from_dir(ROOT_DOCKERFILES, { 'dockerfile' => $dockerfile })
|
||||||
set :docker_image, @image.id
|
set :docker_image, @image.id
|
||||||
set :docker_container_create_options, { 'Cmd' => '/bin/sh' }
|
set :docker_container_create_options, { 'Cmd' => '/bin/sh' }
|
||||||
end
|
end
|
||||||
|
|
@ -28,7 +28,7 @@ describe 'Dockerfile' do
|
||||||
let(:passbolt_tmp) { '/var/lib/passbolt/tmp' }
|
let(:passbolt_tmp) { '/var/lib/passbolt/tmp' }
|
||||||
let(:passbolt_image) { "#{passbolt_home}/webroot/img/public" }
|
let(:passbolt_image) { "#{passbolt_home}/webroot/img/public" }
|
||||||
let(:passbolt_owner) { 'www-data' }
|
let(:passbolt_owner) { 'www-data' }
|
||||||
let(:exposed_ports) { [ '80', '443' ] }
|
let(:exposed_ports) { [ $http_port, $https_port ] }
|
||||||
let(:php_extensions) { [
|
let(:php_extensions) { [
|
||||||
'gd', 'intl', 'json', 'mysqlnd', 'xsl', 'phar',
|
'gd', 'intl', 'json', 'mysqlnd', 'xsl', 'phar',
|
||||||
'posix', 'xml', 'zlib', 'ctype', 'pdo', 'gnupg', 'pdo_mysql'
|
'posix', 'xml', 'zlib', 'ctype', 'pdo', 'gnupg', 'pdo_mysql'
|
||||||
|
|
@ -55,6 +55,10 @@ describe 'Dockerfile' do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe file($cron_service) do
|
||||||
|
it { should exist and be_executable }
|
||||||
|
end
|
||||||
|
|
||||||
describe 'wait-for' do
|
describe 'wait-for' do
|
||||||
it 'is installed' do
|
it 'is installed' do
|
||||||
expect(file(wait_for)).to exist and be_executable
|
expect(file(wait_for)).to exist and be_executable
|
||||||
|
|
@ -99,7 +103,7 @@ describe 'Dockerfile' do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'has the correct permissions' do
|
it 'has the correct permissions' do
|
||||||
expect(file(nginx_conf)).to be_owned_by 'root'
|
expect(file(nginx_conf)).to be_owned_by $root_user
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -109,16 +113,12 @@ describe 'Dockerfile' do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'has the correct permissions' do
|
it 'has the correct permissions' do
|
||||||
expect(file(site_conf)).to be_owned_by 'root'
|
expect(file(site_conf)).to be_owned_by $root_user
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'points to the correct root folder' do
|
it 'points to the correct root folder' do
|
||||||
expect(file(site_conf).content).to match "root #{passbolt_home}/webroot"
|
expect(file(site_conf).content).to match "root #{passbolt_home}/webroot"
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'has server tokens off' do
|
|
||||||
expect(file(nginx_conf).content).to match(/^\s+server_tokens off;/)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'ports exposed' do
|
describe 'ports exposed' do
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue