-
Notifications
You must be signed in to change notification settings - Fork 562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
overlord/snapstate: do a minimal sanity check on containers #4464
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
91b4232
overlord/snapstate: do a minimal sanity check on containers
chipaca 09d0b43
address review feedback, and tweak spread tests (and improve the vali…
chipaca 9652b83
tests: add a spread test for cotainer validation
chipaca 3328b78
add tests for symlinks, and fix stat of symlinks in squashfs
chipaca 4305dcb
Merge remote-tracking branch 'upstream/master' into snap-permission-s…
chipaca 2f7a8ea
deal with git not dealing with permissions
chipaca File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
Empty file.
Empty file.
Empty file.
1 change: 1 addition & 0 deletions
1
tests/lib/snaps/test-snapd-validate-container-failures/hell/bar
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 @@ | ||
foo -> baz -> qux |
1 change: 1 addition & 0 deletions
1
tests/lib/snaps/test-snapd-validate-container-failures/hell/bar -> baz
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 @@ | ||
foo -> qux |
1 change: 1 addition & 0 deletions
1
tests/lib/snaps/test-snapd-validate-container-failures/hell/bar -> baz -> qux
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 @@ | ||
foo |
1 change: 1 addition & 0 deletions
1
tests/lib/snaps/test-snapd-validate-container-failures/hell/bar -> qux
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 @@ | ||
foo -> baz |
1 change: 1 addition & 0 deletions
1
tests/lib/snaps/test-snapd-validate-container-failures/hell/baz
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 @@ | ||
foo -> bar -> qux |
1 change: 1 addition & 0 deletions
1
tests/lib/snaps/test-snapd-validate-container-failures/hell/baz -> qux
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 @@ | ||
foo -> bar |
1 change: 1 addition & 0 deletions
1
tests/lib/snaps/test-snapd-validate-container-failures/hell/foo
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 @@ | ||
bar -> baz -> qux |
1 change: 1 addition & 0 deletions
1
tests/lib/snaps/test-snapd-validate-container-failures/hell/foo -> bar
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 @@ | ||
baz -> qux |
1 change: 1 addition & 0 deletions
1
tests/lib/snaps/test-snapd-validate-container-failures/hell/foo -> bar -> baz
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 @@ | ||
qux |
1 change: 1 addition & 0 deletions
1
tests/lib/snaps/test-snapd-validate-container-failures/hell/foo -> bar -> qux
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 @@ | ||
baz |
1 change: 1 addition & 0 deletions
1
tests/lib/snaps/test-snapd-validate-container-failures/hell/foo -> baz
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 @@ | ||
bar -> qux |
1 change: 1 addition & 0 deletions
1
tests/lib/snaps/test-snapd-validate-container-failures/hell/foo -> baz -> qux
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 @@ | ||
bar |
1 change: 1 addition & 0 deletions
1
tests/lib/snaps/test-snapd-validate-container-failures/hell/foo -> qux
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 @@ | ||
bar -> baz |
1 change: 1 addition & 0 deletions
1
tests/lib/snaps/test-snapd-validate-container-failures/hell/qux
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 @@ | ||
foo -> bar -> baz |
Empty file.
11 changes: 11 additions & 0 deletions
11
tests/lib/snaps/test-snapd-validate-container-failures/meta/snap.yaml
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,11 @@ | ||
name: test-snapd-validate-container-failures | ||
version: "1" | ||
apps: | ||
foo: | ||
command: bin/foo | ||
completer: comp.sh | ||
stop-command: bin/wat | ||
bard: | ||
command: bin/bar --daemon | ||
daemon: simple | ||
stop-command: bin/stahp |
Empty file.
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,22 @@ | ||
summary: check the container validator logs on error | ||
|
||
environment: | ||
SNAP: test-snapd-validate-container-failures | ||
|
||
execute: | | ||
echo "Snap refuses to install" | ||
snap try $TESTSLIB/snaps/$SNAP 2>error.log && exit 1 || true | ||
echo "The error tells you to ask the dev" | ||
tr -s "\n " " " < error.log | MATCH 'contact developer' | ||
|
||
# give things time to reach the journal | ||
sleep 1 | ||
|
||
echo "And the journal counts the ways" | ||
journalctl -u snapd | grep check_snap > journal.log | ||
MATCH '"comp.sh" should be world-readable' < journal.log | ||
MATCH '"bin/bar" should be executable' < journal.log | ||
MATCH '"bin/foo" should be world-readable and -executable' < journal.log | ||
MATCH '"meta/unreadable" should be world-readable' < journal.log | ||
MATCH '"meta/hooks/what" should be executable' < journal.log | ||
MATCH '"bin/stahp" does not exist' < journal.log |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(nitpick) you could write a
for i in $(seq 120); do if jounralctl -u snapd | grep check_snap; then break; fi; sleep 0.2; done
here but probably not worth it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha, I see this was already removed.