Skip to content

Commit

Permalink
PB-37351: fixed mounts in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dlen committed Dec 30, 2024
1 parent 6ad8042 commit 5a638a7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
23 changes: 13 additions & 10 deletions spec/docker_runtime_no_envs/runtime_no_envs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@
'Env' => [
"DATASOURCES_DEFAULT_HOST=#{@mysql.json['NetworkSettings']['IPAddress']}"
],
'Binds' => $binds.append(
"#{FIXTURES_PATH + '/passbolt.php'}:#{PASSBOLT_CONFIG_PATH + '/passbolt.php'}",
"#{FIXTURES_PATH + '/public-test.key'}:#{PASSBOLT_CONFIG_PATH + 'gpg/unsecure.key'}",
"#{FIXTURES_PATH + '/private-test.key'}:#{PASSBOLT_CONFIG_PATH + 'gpg/unsecure_private.key'}"
),
'HostConfig' => {
'Binds' => $binds.append(
"#{FIXTURES_PATH + '/passbolt.php'}:#{PASSBOLT_CONFIG_PATH + '/passbolt.php'}",
"#{FIXTURES_PATH + '/public-test.key'}:#{PASSBOLT_CONFIG_PATH + 'gpg/unsecure.key'}",
"#{FIXTURES_PATH + '/private-test.key'}:#{PASSBOLT_CONFIG_PATH + 'gpg/unsecure_private.key'}"
)
},

'Image' => @image.id
)

Expand All @@ -61,9 +64,7 @@
@container.kill
end

let(:passbolt_host) { @container.json['NetworkSettings']['IPAddress'] }
let(:uri) { '/install' }
let(:curl) { "curl -skL -H 'Host: passbolt.local' https://#{passbolt_host}:#{$https_port}/#{uri}" }
let(:passbolt_host) { @container.json['NetworkSettings']['IPAddress'] }

describe 'php service' do
it 'is running supervised' do
Expand Down Expand Up @@ -91,9 +92,11 @@
end
end

describe 'passbolt install' do
describe 'passbolt healthcheck' do
let(:uri) { '/healthcheck/status.json' }
let(:curl) { "curl -sk -o /dev/null -w '%{http_code}' -H 'Host: passbolt.local' https://#{passbolt_host}:#{$https_port}/#{uri}" }
it 'shows correctly' do
expect(command(curl).stdout).to match(/.*Passbolt is not configured yet!.*/)
expect(command(curl).stdout).to eq '200'
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@
'PASSBOLT_HEALTHCHECK_ERROR=true'
],
'Image' => @image.id,
'Binds' => $binds.append(
'HostConfig' => {
'Binds' => $binds.append(
"#{FIXTURES_PATH + '/passbolt-no-fingerprint.php'}:#{PASSBOLT_CONFIG_PATH + '/passbolt.php'}",
"#{FIXTURES_PATH + '/public-test.key'}:#{PASSBOLT_CONFIG_PATH + 'gpg/unsecure.key'}",
"#{FIXTURES_PATH + '/private-test.key'}:#{PASSBOLT_CONFIG_PATH + 'gpg/unsecure_private.key'}"
)
)
},
)

@container.start
Expand Down

0 comments on commit 5a638a7

Please sign in to comment.