]> 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)
committerKai Lueke <kailuke@microsoft.com>
Tue, 4 Nov 2025 13:10:18 +0000 (22:10 +0900)
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.

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

index 097e62df80fe7664380f09e69cb642f75336cec1..f8472f5d3012fe1c591bee25cb3ade3861ea967f 100755 (executable)
@@ -1130,10 +1130,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")