]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: cleanup after testcase_12_resolvectl2
authorNick Rosbrook <enr0n@ubuntu.com>
Wed, 23 Oct 2024 20:31:00 +0000 (16:31 -0400)
committerNick Rosbrook <enr0n@ubuntu.com>
Tue, 28 Jan 2025 13:49:49 +0000 (08:49 -0500)
test/units/TEST-75-RESOLVED.sh

index fd07fd898a226851717a45487ad744bef2f67699..25ab02a938396148d4f9a6a0f3878b8bb013643c 100755 (executable)
@@ -936,6 +936,15 @@ testcase_11_nft() {
 
 # Test resolvectl show-server-state
 testcase_12_resolvectl2() {
+    # Cleanup
+    # shellcheck disable=SC2317
+    cleanup() {
+        rm -f /run/systemd/resolved.conf.d/reload.conf
+        systemctl reload systemd-resolved.service
+    }
+
+    trap cleanup RETURN
+
     run resolvectl show-server-state
     grep -qF "10.0.0.1" "$RUN_OUT"
     grep -qF "Interface" "$RUN_OUT"