]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: Add missing test cleanup for the last sysext test
authorKai Lueke <kailuke@microsoft.com>
Tue, 28 Oct 2025 15:08:42 +0000 (00:08 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 6 Nov 2025 21:26:42 +0000 (21:26 +0000)
The last sysext test leaked things into new tests added later,
uncovered by any new tests leftover check.
Remove the mutable folder state through a trap as done in other tests.

(cherry picked from commit 6649562924f361edca98ce3d015bd7dcda97b076)

test/units/TEST-50-DISSECT.sysext.sh

index 3c8c7de8c1ce634ae0336f857aec877d63d78a20..2fa2951b61275b3389017a58c7a8a0896491cbd0 100755 (executable)
@@ -1064,10 +1064,13 @@ extension_verify_after_unmerge "$fake_root" "$hierarchy" -h
 fake_root=${roots_dir:+"$roots_dir/mutable-directory-with-invalid-permissions"}
 hierarchy=/opt
 extension_data_dir="$fake_root/var/lib/extensions.mutable$hierarchy"
+extension_data_dir_usr="$fake_root/var/lib/extensions.mutable/usr"
 
 prepare_root "$fake_root" "$hierarchy"
 prepare_extension_image "$fake_root" "$hierarchy"
 prepare_extension_mutable_dir "$extension_data_dir"
+prepend_trap "rm -rf ${extension_data_dir@Q}"
+prepend_trap "rm -rf ${extension_data_dir_usr@Q}"
 prepare_hierarchy "$fake_root" "$hierarchy"
 
 old_mode=$(stat --format '%#a' "$fake_root$hierarchy")