diff --git a/tests/main/snap-run-devmode-classic/task.yaml b/tests/main/snap-run-devmode-classic/task.yaml index b569f565d4f..15c5ad666de 100644 --- a/tests/main/snap-run-devmode-classic/task.yaml +++ b/tests/main/snap-run-devmode-classic/task.yaml @@ -19,10 +19,6 @@ systems: # when the host has cgroupsv2 in it - ubuntu-16.04-* -# Start early as it takes a long time. -priority: 100 -kill-timeout: 60m - environment: # ensure that re-exec is on by default like it should be SNAP_REEXEC: "1" @@ -39,28 +35,12 @@ environment: BASE_NON_CORE_STRICT_SNAP: test-snapd-sh-core18 prepare: | - # much of what follows is copied from tests/main/snapd-snap - - apt-get autoremove -y lxd lxd-client - - # load the fuse kernel module before installing lxd - modprobe fuse - "$TESTSTOOLS"/lxd-state prepare-snap - - # install snapcraft snap - - snap install snapcraft --channel="${SNAPCRAFT_SNAP_CHANNEL}" --classic - tests.cleanup defer snap remove --purge snapcraft - - # shellcheck disable=SC2164 - pushd "${PROJECT_PATH}" - echo "Build the snap" - snap run snapcraft --verbosity debug --output snapd-from-branch.snap - # Save some disk - snap run snapcraft clean - popd + # Core snap is not modified for classic re-exec any more in this scenario + if tests.info is-snapd-pkg-repo; then + tests.exec skip-test "Core snap is not modified for classic re-exec any more in this scenario" && exit 0 + fi - mv "$PROJECT_PATH/snapd-from-branch.snap" "$PWD/snapd-from-branch.snap" + cp "$SNAPD_WORK_DIR"/snapd_snap/snapd_*.snap "$PWD/snapd-from-branch.snap" # now repack the core snap with this snapd snap snap download core --edge --basename=core-from-edge @@ -87,11 +67,11 @@ prepare: | rm -r "$coredir" rm -r "$snapddir" -restore: | - "$TESTSTOOLS"/lxd-state undo-mount-changes || true - execute: | + tests.exec is-skipped && exit 0 + if [ "$SNAP_TO_USE_FIRST" = "core" ]; then + # first install our core snap because we don't have the snapd snap on # the system yet, so we don't need to do any shenanigans snap install --dangerous core-from-branch.snap @@ -141,7 +121,6 @@ execute: | # we already had the core snap installed, so we need to purge things # and then install only the snapd snap to test this scenario - snap remove go snapcraft snap remove core18 apt remove --purge -y snapd apt install snapd -y @@ -187,7 +166,4 @@ execute: | # undo the purging apt install -y "$GOHOME"/snapd_*.deb - else - echo "unknown variant $SNAP_TO_USE_FIRST" - exit 1 fi diff --git a/tests/main/snapd-update-services/task.yaml b/tests/main/snapd-update-services/task.yaml index a66fe67181d..00af4cc4da3 100644 --- a/tests/main/snapd-update-services/task.yaml +++ b/tests/main/snapd-update-services/task.yaml @@ -21,17 +21,11 @@ prepare: | # Download current snapd edge snap download --edge snapd --basename=snapd_edge - # Repack it with currently built snapd - unpackdir=/tmp/snapd-update-services - unsquashfs -no-progress -d "${unpackdir}" snapd_edge.snap - dpkg-deb -x "${GOHOME}"/snapd_*.deb "${unpackdir}" - snap pack "${unpackdir}" --filename snapd_modified.snap - rm -rf "${unpackdir}" + # Get the snapd package built from the current branch + cp "$SNAPD_WORK_DIR"/snapd_snap/snapd_*.snap "$PWD/snapd_current.snap" restore: | rm -rf /tmp/snapd-update-services - rm -f snapd_edge.snap - rm -f snapd_modified.snap execute: | snap install --dangerous snapd_edge.snap @@ -69,7 +63,7 @@ execute: | done # Snapd update - snap install --dangerous snapd_modified.snap + snap install --dangerous snapd_current.snap # Check the service file has been updated systemctl is-active snap.test-snapd-service.test-snapd-service.service