-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: ensure snapd can be downloaded as a module (#11052)
LP#1948838: moved files that cause an issue during git module download to tar files in the corresponding folders Add spread test for validating snaps can be packed and installed (as well as `snap try`'d) with various circular symlinks.
- Loading branch information
Showing
23 changed files
with
45 additions
and
15 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
Empty file.
Empty file.
Binary file not shown.
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 +1,2 @@ | ||
cd "$SPREAD_PATH/$SPREAD_SUITE/data/twisted" | ||
tar -xvf $SPREAD_PATH/$SPREAD_SUITE/data/twisted/twisted.tar |
1 change: 0 additions & 1 deletion
1
tests/main/validate-container-failures/test-snapd-validate-container-failures/hell/bar
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
...s/main/validate-container-failures/test-snapd-validate-container-failures/hell/bar -> baz
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
...validate-container-failures/test-snapd-validate-container-failures/hell/bar -> baz -> qux
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
...s/main/validate-container-failures/test-snapd-validate-container-failures/hell/bar -> qux
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
tests/main/validate-container-failures/test-snapd-validate-container-failures/hell/baz
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
...s/main/validate-container-failures/test-snapd-validate-container-failures/hell/baz -> qux
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
tests/main/validate-container-failures/test-snapd-validate-container-failures/hell/foo
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
...s/main/validate-container-failures/test-snapd-validate-container-failures/hell/foo -> bar
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
...validate-container-failures/test-snapd-validate-container-failures/hell/foo -> bar -> baz
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
...validate-container-failures/test-snapd-validate-container-failures/hell/foo -> bar -> qux
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
...s/main/validate-container-failures/test-snapd-validate-container-failures/hell/foo -> baz
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
...validate-container-failures/test-snapd-validate-container-failures/hell/foo -> baz -> qux
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
...s/main/validate-container-failures/test-snapd-validate-container-failures/hell/foo -> qux
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
tests/main/validate-container-failures/test-snapd-validate-container-failures/hell/qux
This file was deleted.
Oops, something went wrong.
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,38 @@ | ||
summary: check the symlinks following the right track | ||
|
||
environment: | ||
SNAP: test-snapd-validate-container-happy | ||
|
||
prepare: | | ||
execute: | | ||
SNAP_MOUNT_DIR="$(os.paths snap-mount-dir)" | ||
# We shouldn't use relative symlinks in Github as they cannot be packed correctly. | ||
# So here let's test whether we can still pack such symlinks within a snap and use if needed. | ||
# First we "try" to unpack the snap structure and untar the symlinks | ||
# Then we pack the snap with these symlinks and then install | ||
# Finally we check to see if the symlinks actually support the intervined symlinks | ||
# Untar the symlinks | ||
tar -xvf "$SNAP"/hell/hell.tar -C "$SNAP"/hell | ||
snap try "$SNAP" | ||
# Check to see if the symlinks point to the right paths | ||
readlink "$SNAP_MOUNT_DIR"/"$SNAP"/current/hell/bar | MATCH "foo -> baz -> qux" | ||
readlink "$SNAP_MOUNT_DIR"/"$SNAP"/current/hell/baz | MATCH "foo -> bar -> qux" | ||
readlink "$SNAP_MOUNT_DIR"/"$SNAP"/current/hell/foo | MATCH "bar -> baz -> qux" | ||
readlink "$SNAP_MOUNT_DIR"/"$SNAP"/current/hell/qux | MATCH "foo -> bar -> baz" | ||
snap remove "$SNAP" | ||
# Create a new snap structure that includes the unpacked symlinks | ||
snap pack "$SNAP" | ||
snap install --dangerous test-snapd-validate-container-happy_1.0_all.snap | ||
tests.cleanup defer snap remove --purge test-snapd-validate-container-happy | ||
# Check to see if the symlinks retain their existing paths | ||
readlink "$SNAP_MOUNT_DIR"/"$SNAP"/current/hell/bar | MATCH "foo -> baz -> qux" | ||
readlink "$SNAP_MOUNT_DIR"/"$SNAP"/current/hell/baz | MATCH "foo -> bar -> qux" | ||
readlink "$SNAP_MOUNT_DIR"/"$SNAP"/current/hell/foo | MATCH "bar -> baz -> qux" | ||
readlink "$SNAP_MOUNT_DIR"/"$SNAP"/current/hell/qux | MATCH "foo -> bar -> baz" |
File renamed without changes.
Binary file added
BIN
+254 Bytes
tests/main/validate-container-happy/test-snapd-validate-container-happy/hell/hell.tar
Binary file not shown.
5 changes: 5 additions & 0 deletions
5
tests/main/validate-container-happy/test-snapd-validate-container-happy/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,5 @@ | ||
name: test-snapd-validate-container-happy | ||
version: 1.0 | ||
apps: | ||
validate-container: | ||
command: bin/validate-container |