Files
snapd/tests/main/remove-errors/task.yaml
2020-10-22 08:57:37 -03:00

24 lines
640 B
YAML

summary: Check remove command errors
execute: |
#shellcheck source=tests/lib/names.sh
. "$TESTSLIB/names.sh"
BASE_SNAP=core
TARGET_SNAP=test-snapd-tools
if os.query is-core18; then
BASE_SNAP=core18
TARGET_SNAP=test-snapd-tools-core18
fi
echo "Given a base snap, $BASE_SNAP, is installed"
"$TESTSTOOLS"/snaps-state install-local "$TARGET_SNAP"
echo "Ensure the important snaps can not be removed"
for sn in $BASE_SNAP $kernel_name $gadget_name; do
if snap remove "$sn"; then
echo "It should not be possible to remove $sn"
exit 1
fi
done