mirror of
https://github.com/token2/snapd.git
synced 2026-03-13 11:15:47 -07:00
* Adding more details to tests - part 13 * Add more details * adding more tests * Update tests/main/debs/task.yaml Co-authored-by: Miguel Pires <miguelpires94@gmail.com> * Update tests/main/debug-sandbox/task.yaml Co-authored-by: Miguel Pires <miguelpires94@gmail.com> * Update tests/main/econnreset/task.yaml Co-authored-by: Miguel Pires <miguelpires94@gmail.com> * Update tests/main/enable-disable/task.yaml Co-authored-by: Miguel Pires <miguelpires94@gmail.com> * Update tests/main/health/task.yaml Co-authored-by: Miguel Pires <miguelpires94@gmail.com> * Update tests/main/snap-validate-enforce/task.yaml Co-authored-by: Miguel Pires <miguelpires94@gmail.com> * Update tests/main/snap-validate-with-store/task.yaml Co-authored-by: Miguel Pires <miguelpires94@gmail.com> * Update tests/main/enable-disable/task.yaml Co-authored-by: Miguel Pires <miguelpires94@gmail.com> * Update tests/main/debug-paths/task.yaml Co-authored-by: Miguel Pires <miguelpires94@gmail.com> * Update tests/main/default-tracks/task.yaml Co-authored-by: Miguel Pires <miguelpires94@gmail.com> * Update tests/main/enable-disable/task.yaml Co-authored-by: Miguel Pires <miguelpires94@gmail.com> --------- Co-authored-by: Miguel Pires <miguelpires94@gmail.com>
38 lines
1.0 KiB
YAML
38 lines
1.0 KiB
YAML
summary: Checks for snap exit codes
|
|
|
|
details: |
|
|
Snap command return different exit codes on error.
|
|
|
|
This test verifies the exit codes in the following scenarios:
|
|
1. snap command with unknown command return exit code 64
|
|
2. snap command with unknown flag return exit code 64
|
|
3. snap command with broken mksquashfs returns exit code 20
|
|
|
|
systems: [ubuntu-1*, ubuntu-2*]
|
|
|
|
execute: |
|
|
echo "snap command with unknown command return exit code 64"
|
|
set +e
|
|
snap unknown-command
|
|
RET=$?
|
|
set -e
|
|
test "$RET" -eq 64
|
|
|
|
echo "snap command with unknown flag return exit code 64"
|
|
set +e
|
|
snap pack --unknown-option
|
|
RET=$?
|
|
set -e
|
|
test "$RET" -eq 64
|
|
|
|
echo "snap command with broken mksquashfs returns exit code 20"
|
|
for b in /usr/bin/mksquashfs /snap/core/current/usr/bin/mksquashfs; do
|
|
mount -o bind /bin/false "$b"
|
|
tests.cleanup defer umount "$b"
|
|
done
|
|
set +e
|
|
snap pack "$TESTSLIB/snaps/test-snapd-sh"
|
|
RET=$?
|
|
set -e
|
|
test "$RET" -eq 20
|