From 8ce88c44b92bd9f9a436c38b51eb0741ebb5409b Mon Sep 17 00:00:00 2001 From: Sergio Schvezov Date: Thu, 21 Mar 2024 12:09:54 -0300 Subject: [PATCH] chore(spread): remove remove hook test for core24 This tests the removal of base instances on snapcraft removal itself, it has nothing to do with enabling core24 in snapcraft. Signed-off-by: Sergio Schvezov --- .../core24/remove-hook/snap/snapcraft.yaml | 13 ------ tests/spread/core24/remove-hook/task.yaml | 45 ------------------- 2 files changed, 58 deletions(-) delete mode 100644 tests/spread/core24/remove-hook/snap/snapcraft.yaml delete mode 100644 tests/spread/core24/remove-hook/task.yaml diff --git a/tests/spread/core24/remove-hook/snap/snapcraft.yaml b/tests/spread/core24/remove-hook/snap/snapcraft.yaml deleted file mode 100644 index f211188579..0000000000 --- a/tests/spread/core24/remove-hook/snap/snapcraft.yaml +++ /dev/null @@ -1,13 +0,0 @@ -name: remove-hook -base: core24 -build-base: devel -version: '1.0' -summary: 'remove-hook' -description: Verify remove hook works. -grade: devel -confinement: strict - -parts: - hello-world: - plugin: nil - source: . diff --git a/tests/spread/core24/remove-hook/task.yaml b/tests/spread/core24/remove-hook/task.yaml deleted file mode 100644 index 59078fa7fc..0000000000 --- a/tests/spread/core24/remove-hook/task.yaml +++ /dev/null @@ -1,45 +0,0 @@ -summary: Verify snapcraft remove hook deletes base images and instances - -restore: | - #shellcheck source=tests/spread/tools/snapcraft-yaml.sh - . "$TOOLS_DIR/snapcraft-yaml.sh" - restore_yaml "snap/snapcraft.yaml" - - # reinstall snapcraft - #shellcheck source=tests/spread/tools/snapcraft-yaml.sh - . "$TOOLS_DIR/prepare.sh" - install_snapcraft - -execute: | - unset SNAPCRAFT_BUILD_ENVIRONMENT - - # create a base instance by running snapcraft - snapcraft pull --use-lxd --verbosity=trace - - # verify base instance was created - instances="$(lxc list --project=snapcraft --format=csv --columns="n")" - if [[ ! " ${instances[*]} " =~ base-instance-snapcraft-.* ]]; then - echo "base instance was not created" - exit 1 - fi - - # previous version of snapcraft used base images, so manually create a base image - # to confirm it also gets deleted - lxc image copy --project=snapcraft craft-com.ubuntu.cloud-buildd:core24 local: --alias=snapshot-craft-com.ubuntu.cloud-buildd-core24-snapcraft-buildd-base-v0.0 - - # trigger the remove hook - snap remove snapcraft - - # confirm base instance was deleted - instances="$(lxc list --project=snapcraft --format=csv --columns="n")" - if [[ " ${instances[*]} " =~ base-instance-snapcraft-.* ]]; then - echo "base instance was not deleted by the remove hook" - exit 1 - fi - - # confirm base image was deleted - images="$(lxc image list --project=snapcraft --format=csv --columns=l)" - if [[ " ${images[*]} " =~ snapshot-.* ]]; then - echo "base image was not deleted by the remove hook" - exit 1 - fi