diff --git a/tests/spread/core24-suites/patchelf/classic-patchelf/snap/snapcraft.yaml b/tests/spread/core24-suites/patchelf/classic-patchelf/snap/snapcraft.yaml index 217800886e..0991e3ba4d 100644 --- a/tests/spread/core24-suites/patchelf/classic-patchelf/snap/snapcraft.yaml +++ b/tests/spread/core24-suites/patchelf/classic-patchelf/snap/snapcraft.yaml @@ -29,7 +29,7 @@ parts: - libcurl4-openssl-dev - patchelf override-build: | - snapcraftctl build + craftctl default mv $CRAFT_PART_INSTALL/bin/hello-classic $CRAFT_PART_INSTALL/bin/hello-classic-existing-rpath patchelf --force-rpath --set-rpath "\$ORIGIN/../fake-lib" $CRAFT_PART_INSTALL/bin/hello-classic-existing-rpath hello-no-patchelf: @@ -39,5 +39,5 @@ parts: - gcc - libcurl4-openssl-dev override-build: | - snapcraftctl build + craftctl default mv $CRAFT_PART_INSTALL/bin/hello-classic $CRAFT_PART_INSTALL/bin/hello-classic-no-patchelf diff --git a/tests/spread/core24-suites/patchelf/classic-patchelf/task.yaml b/tests/spread/core24-suites/patchelf/classic-patchelf/task.yaml index 9eecdf4d36..588b9292fe 100644 --- a/tests/spread/core24-suites/patchelf/classic-patchelf/task.yaml +++ b/tests/spread/core24-suites/patchelf/classic-patchelf/task.yaml @@ -9,32 +9,24 @@ prepare: | apt-mark auto patchelf dpkg-dev restore: | - snapcraft clean + snapcraft clean --destructive-mode rm -f ./*.snap - #shellcheck source=tests/spread/tools/snapcraft-yaml.sh - . "$TOOLS_DIR/snapcraft-yaml.sh" - restore_yaml "snap/snapcraft.yaml" - execute: | - #shellcheck source=tests/spread/tools/snapcraft-yaml.sh - . "$TOOLS_DIR/snapcraft-yaml.sh" - base="$(get_base)" - - snapcraft prime + snapcraft prime --destructive-mode arch_triplet="$(dpkg-architecture -q DEB_HOST_MULTIARCH)" # Account for /usr merge. - RPATH_MATCH="^/snap/$base/current/lib/$arch_triplet" - RPATH_ORIGIN_MATCH="^\\\$ORIGIN/../fake-lib:/snap/$base/current/lib/$arch_triplet" + RPATH_MATCH="^/snap/core24/current/lib/$arch_triplet" + RPATH_ORIGIN_MATCH="^\\\$ORIGIN/../fake-lib:/snap/core24/current/lib/$arch_triplet" # Verify typical binary. - patchelf --print-interpreter prime/bin/hello-classic | MATCH "^/snap/$base/current/lib.*ld.*.so.*" + patchelf --print-interpreter prime/bin/hello-classic | MATCH "^/snap/core24/current/lib.*ld.*.so.*" patchelf --print-rpath prime/bin/hello-classic | MATCH "${RPATH_MATCH}" # Verify binary w/ existing rpath. - patchelf --print-interpreter prime/bin/hello-classic-existing-rpath | MATCH "^/snap/$base/current/lib.*ld.*.so.*" + patchelf --print-interpreter prime/bin/hello-classic-existing-rpath | MATCH "^/snap/core24/current/lib.*ld.*.so.*" patchelf --print-rpath prime/bin/hello-classic-existing-rpath | MATCH "${RPATH_ORIGIN_MATCH}" # Verify untouched no-patchelf. diff --git a/tests/spread/core24-suites/patchelf/strict-patchelf/snap/snapcraft.yaml b/tests/spread/core24-suites/patchelf/strict-patchelf/snap/snapcraft.yaml index 76c46a603b..f8cd613d26 100644 --- a/tests/spread/core24-suites/patchelf/strict-patchelf/snap/snapcraft.yaml +++ b/tests/spread/core24-suites/patchelf/strict-patchelf/snap/snapcraft.yaml @@ -26,7 +26,7 @@ parts: build-attributes: - enable-patchelf override-build: | - snapcraftctl build + craftctl default mv $CRAFT_PART_INSTALL/bin/hello-strict $CRAFT_PART_INSTALL/bin/hello-strict-existing-rpath patchelf --force-rpath --set-rpath "\$ORIGIN/../fake-lib" $CRAFT_PART_INSTALL/bin/hello-strict-existing-rpath hello-enable-patchelf: @@ -38,5 +38,5 @@ parts: build-attributes: - enable-patchelf override-build: | - snapcraftctl build + craftctl default mv $CRAFT_PART_INSTALL/bin/hello-strict $CRAFT_PART_INSTALL/bin/hello-strict-enable-patchelf diff --git a/tests/spread/core24-suites/patchelf/strict-patchelf/task.yaml b/tests/spread/core24-suites/patchelf/strict-patchelf/task.yaml index a23e6c7ce5..4bc74dceec 100644 --- a/tests/spread/core24-suites/patchelf/strict-patchelf/task.yaml +++ b/tests/spread/core24-suites/patchelf/strict-patchelf/task.yaml @@ -5,7 +5,7 @@ prepare: | apt-mark auto patchelf dpkg-dev restore: | - snapcraft clean + snapcraft clean --destructive-mode rm -f ./*.snap #shellcheck source=tests/spread/tools/snapcraft-yaml.sh @@ -13,7 +13,7 @@ restore: | restore_yaml "snap/snapcraft.yaml" execute: | - snapcraft prime + snapcraft prime --destructive-mode arch_triplet="$(dpkg-architecture -q DEB_HOST_MULTIARCH)" @@ -26,14 +26,14 @@ execute: | fi # Account for /usr merge. - RPATH_MATCH="^/snap/$base/current/lib/$arch_triplet" - RPATH_ORIGIN_MATCH="^\\\$ORIGIN/../fake-lib:/snap/$base/current/lib/$arch_triplet" + RPATH_MATCH="^/snap/core24/current/lib/$arch_triplet" + RPATH_ORIGIN_MATCH="^\\\$ORIGIN/../fake-lib:/snap/core24/current/lib/$arch_triplet" # Verify binary rpath patching with existing rpath - patchelf --print-interpreter prime/bin/hello-strict-existing-rpath | MATCH "^/snap/$base/current/lib.*ld.*.so.*" + patchelf --print-interpreter prime/bin/hello-strict-existing-rpath | MATCH "^/snap/core24/current/lib.*ld.*.so.*" patchelf --print-rpath prime/bin/hello-strict-existing-rpath | MATCH "${RPATH_ORIGIN_MATCH}" # Verify binary rpath patching without existing rpath - patchelf --print-interpreter prime/bin/hello-strict-enable-patchelf | MATCH "^/snap/$base/current/lib.*ld.*.so.*" + patchelf --print-interpreter prime/bin/hello-strict-enable-patchelf | MATCH "^/snap/core24/current/lib.*ld.*.so.*" patchelf --print-rpath prime/bin/hello-strict-enable-patchelf | MATCH "${RPATH_MATCH}"