-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add is-ready check on the default files tests Add a check the entrypoint is not still running (slightly different case to the ready file that gets added on first boot)
- Loading branch information
1 parent
b42872e
commit 046c306
Showing
5 changed files
with
263 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Spec tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
run_test_suite: | ||
name: Run test suite | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Earthly | ||
uses: earthly/actions-setup@v1 | ||
with: | ||
version: 0.8.14 | ||
|
||
- name: Run tests | ||
run: | | ||
earthly -P ./test+test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,101 +1,210 @@ | ||
require 'spec_helper' | ||
|
||
describe file('/etc/php/8.3') do | ||
it { should exist } | ||
it { should be_directory } | ||
describe "Default file checks" do | ||
before(:all) do | ||
system('/usr/local/bin/is-ready --check-entrypoint --check-tasks --wait --timeout 60 -v') or raise "is-ready failed" | ||
end | ||
|
||
describe file('/etc/php/8.3') do | ||
it { should exist } | ||
it { should be_directory } | ||
end | ||
|
||
describe file('/usr/local/share/deskpro/container-var-reference.json') do | ||
it { should exist } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
its(:content_as_json) { should_not be_empty } | ||
end | ||
|
||
describe file('/usr/local/share/deskpro/container-public-var-list') do | ||
it { should exist } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
end | ||
|
||
describe file('/usr/local/share/deskpro/container-private-var-list') do | ||
it { should exist } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
end | ||
|
||
describe file('/usr/local/share/deskpro/container-setenv-var-list') do | ||
it { should exist } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
end | ||
|
||
describe file('/usr/local/share/deskpro/container-var-list') do | ||
it { should exist } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
end | ||
|
||
describe file('/usr/local/share/deskpro/phpinfo.php') do | ||
it { should exist } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
end | ||
|
||
describe file('/var/log/nginx') do | ||
it { should be_directory } | ||
it { should be_owned_by 'nginx' } | ||
it { should be_grouped_into 'adm' } | ||
|
||
it { should be_readable.by('owner') } | ||
it { should be_readable.by('group') } | ||
it { should be_writable.by('owner') } | ||
it { should_not be_writable.by('others') } | ||
end | ||
|
||
describe file('/var/log/php') do | ||
it { should be_directory } | ||
it { should be_owned_by 'dp_app' } | ||
it { should be_grouped_into 'adm' } | ||
|
||
it { should be_readable.by('owner') } | ||
it { should be_readable.by('group') } | ||
it { should be_writable.by('owner') } | ||
it { should_not be_writable.by('others') } | ||
end | ||
|
||
describe file('/var/log/deskpro') do | ||
it { should be_directory } | ||
it { should be_owned_by 'dp_app' } | ||
it { should be_grouped_into 'adm' } | ||
|
||
it { should be_readable.by('owner') } | ||
it { should be_readable.by('group') } | ||
it { should be_writable.by('owner') } | ||
it { should_not be_writable.by('others') } | ||
end | ||
|
||
describe file('/var/lib/vector') do | ||
it { should be_directory } | ||
it { should be_owned_by 'vector' } | ||
it { should be_grouped_into 'adm' } | ||
|
||
it { should be_readable.by('owner') } | ||
it { should be_readable.by('group') } | ||
it { should be_writable.by('owner') } | ||
it { should_not be_writable.by('others') } | ||
end | ||
|
||
describe file('/srv/deskpro/INSTANCE_DATA') do | ||
it { should be_directory } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
it { should_not be_writable.by('others') } | ||
end | ||
|
||
describe file('/srv/deskpro/INSTANCE_DATA/deskpro-config.d') do | ||
it { should be_directory } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
it { should_not be_writable.by('others') } | ||
end | ||
|
||
describe file('/srv/deskpro/services/messenger-api/.env') do | ||
it { should exist } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
end | ||
|
||
describe file('/usr/local/share/deskpro/container-var-reference.json') do | ||
it { should exist } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
its(:content_as_json) { should_not be_empty } | ||
end | ||
|
||
describe file('/usr/local/share/deskpro/container-public-var-list') do | ||
it { should exist } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
end | ||
|
||
describe file('/usr/local/share/deskpro/container-private-var-list') do | ||
it { should exist } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
end | ||
|
||
describe file('/usr/local/share/deskpro/container-setenv-var-list') do | ||
it { should exist } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
end | ||
|
||
describe file('/usr/local/share/deskpro/container-var-list') do | ||
it { should exist } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
end | ||
|
||
describe file('/usr/local/share/deskpro/phpinfo.php') do | ||
it { should exist } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
end | ||
|
||
describe file('/var/log/nginx') do | ||
it { should be_directory } | ||
it { should be_owned_by 'nginx' } | ||
it { should be_grouped_into 'adm' } | ||
|
||
it { should be_readable.by('owner') } | ||
it { should be_readable.by('group') } | ||
it { should be_writable.by('owner') } | ||
it { should_not be_writable.by('others') } | ||
end | ||
|
||
describe file('/var/log/php') do | ||
it { should be_directory } | ||
it { should be_owned_by 'dp_app' } | ||
it { should be_grouped_into 'adm' } | ||
|
||
it { should be_readable.by('owner') } | ||
it { should be_readable.by('group') } | ||
it { should be_writable.by('owner') } | ||
it { should_not be_writable.by('others') } | ||
end | ||
|
||
describe file('/var/log/deskpro') do | ||
it { should be_directory } | ||
it { should be_owned_by 'dp_app' } | ||
it { should be_grouped_into 'adm' } | ||
|
||
it { should be_readable.by('owner') } | ||
it { should be_readable.by('group') } | ||
it { should be_writable.by('owner') } | ||
it { should_not be_writable.by('others') } | ||
end | ||
|
||
describe file('/var/lib/vector') do | ||
it { should be_directory } | ||
it { should be_owned_by 'vector' } | ||
it { should be_grouped_into 'adm' } | ||
|
||
it { should be_readable.by('owner') } | ||
it { should be_readable.by('group') } | ||
it { should be_writable.by('owner') } | ||
it { should_not be_writable.by('others') } | ||
end | ||
|
||
describe file('/srv/deskpro/INSTANCE_DATA') do | ||
it { should be_directory } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
it { should_not be_writable.by('others') } | ||
end | ||
|
||
describe file('/srv/deskpro/INSTANCE_DATA/deskpro-config.d') do | ||
it { should be_directory } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
it { should_not be_writable.by('others') } | ||
end | ||
end | ||
|
||
describe file('/usr/local/share/deskpro/container-var-reference.json') do | ||
it { should exist } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
its(:content_as_json) { should_not be_empty } | ||
end | ||
|
||
describe file('/usr/local/share/deskpro/container-public-var-list') do | ||
it { should exist } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
end | ||
|
||
describe file('/usr/local/share/deskpro/container-private-var-list') do | ||
it { should exist } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
end | ||
|
||
describe file('/usr/local/share/deskpro/container-setenv-var-list') do | ||
it { should exist } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
end | ||
|
||
describe file('/usr/local/share/deskpro/container-var-list') do | ||
it { should exist } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
end | ||
|
||
describe file('/usr/local/share/deskpro/phpinfo.php') do | ||
it { should exist } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
end | ||
|
||
describe file('/var/log/nginx') do | ||
it { should be_directory } | ||
it { should be_owned_by 'nginx' } | ||
it { should be_grouped_into 'adm' } | ||
|
||
it { should be_readable.by('owner') } | ||
it { should be_readable.by('group') } | ||
it { should be_writable.by('owner') } | ||
it { should_not be_writable.by('others') } | ||
end | ||
|
||
describe file('/var/log/php') do | ||
it { should be_directory } | ||
it { should be_owned_by 'dp_app' } | ||
it { should be_grouped_into 'adm' } | ||
|
||
it { should be_readable.by('owner') } | ||
it { should be_readable.by('group') } | ||
it { should be_writable.by('owner') } | ||
it { should_not be_writable.by('others') } | ||
end | ||
|
||
describe file('/var/log/deskpro') do | ||
it { should be_directory } | ||
it { should be_owned_by 'dp_app' } | ||
it { should be_grouped_into 'adm' } | ||
|
||
it { should be_readable.by('owner') } | ||
it { should be_readable.by('group') } | ||
it { should be_writable.by('owner') } | ||
it { should_not be_writable.by('others') } | ||
end | ||
|
||
describe file('/var/lib/vector') do | ||
it { should be_directory } | ||
it { should be_owned_by 'vector' } | ||
it { should be_grouped_into 'adm' } | ||
|
||
it { should be_readable.by('owner') } | ||
it { should be_readable.by('group') } | ||
it { should be_writable.by('owner') } | ||
it { should_not be_writable.by('others') } | ||
end | ||
|
||
describe file('/srv/deskpro/INSTANCE_DATA') do | ||
it { should be_directory } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
it { should_not be_writable.by('others') } | ||
end | ||
|
||
describe file('/srv/deskpro/INSTANCE_DATA/deskpro-config.d') do | ||
it { should be_directory } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
it { should_not be_writable.by('others') } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.