From 6decadbebff5dd8fd091c27c63dff6c9d941c826 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Mon, 31 Aug 2026 23:47:56 +0200 Subject: [PATCH] test: silence SC2329 for indirectly invoked cleanup() functions shellcheck 0.10+ reports SC2329 ("This function is never invoked") for the per-testcase cleanup() functions in TEST-75-RESOLVED.sh, which are only invoked indirectly via trap. The existing SC2317 markers don't cover it, and inserting a new testcase shuffles which definitions the heuristic fires on, making pre-existing findings show up as new in differential CI runs. Extend the markers to SC2317,SC2329, matching what testcase_dot_strict_per_link_verify() in this file and other test units already do. --- test/units/TEST-75-RESOLVED.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/test/units/TEST-75-RESOLVED.sh b/test/units/TEST-75-RESOLVED.sh index cffda49dd9..017397baf1 100755 --- a/test/units/TEST-75-RESOLVED.sh +++ b/test/units/TEST-75-RESOLVED.sh @@ -232,7 +232,7 @@ manual_testcase_01_resolvectl() { ip link add hoge.foo type dummy # Cleanup - # shellcheck disable=SC2317 + # shellcheck disable=SC2317,SC2329 cleanup() { ip link del hoge ip link del hoge.foo @@ -349,6 +349,7 @@ manual_testcase_02_mdns_llmnr() { ip link add hoge.foo type dummy # Cleanup + # shellcheck disable=SC2317,SC2329 cleanup() { rm -f /run/systemd/resolved.conf.d/90-mdns-llmnr.conf ip link del hoge @@ -938,7 +939,7 @@ testcase_08_resolved() { testcase_09_resolvectl_showcache() { # Cleanup - # shellcheck disable=SC2317 + # shellcheck disable=SC2317,SC2329 cleanup() { rm -f /run/systemd/resolved.conf.d/90-resolved.conf rm -f /run/systemd/network/10-dns2.netdev @@ -1000,7 +1001,7 @@ testcase_10_resolvectl_json() { local status_json # Cleanup - # shellcheck disable=SC2317 + # shellcheck disable=SC2317,SC2329 cleanup() { rm -f /run/systemd/resolved.conf.d/90-fallback.conf systemctl reload systemd-resolved.service @@ -1171,7 +1172,7 @@ testcase_11_nft() { # Test resolvectl show-server-state testcase_12_resolvectl2() { # Cleanup - # shellcheck disable=SC2317 + # shellcheck disable=SC2317,SC2329 cleanup() { rm -f /run/systemd/resolved.conf.d/90-reload.conf systemctl reload systemd-resolved.service @@ -1273,7 +1274,7 @@ testcase_13_varlink_subscribe_dns_configuration() { fi # Cleanup - # shellcheck disable=SC2317 + # shellcheck disable=SC2317,SC2329 cleanup() { echo "===== io.systemd.Resolve.Monitor.SubscribeDNSConfiguration output: =====" cat "$tmpfile" @@ -1350,7 +1351,7 @@ testcase_13_varlink_subscribe_dns_configuration() { # Test RefuseRecordTypes testcase_14_refuse_record_types() { - # shellcheck disable=SC2317 + # shellcheck disable=SC2317,SC2329 cleanup() { rm -f /run/systemd/resolved.conf.d/90-refuserecords.conf restart_resolved @@ -1512,7 +1513,7 @@ testcase_14_refuse_record_types() { # Test systemd-networkd-wait-online interactions with systemd-resolved testcase_15_wait_online_dns() { # Cleanup - # shellcheck disable=SC2317 + # shellcheck disable=SC2317,SC2329 cleanup() { echo "===== journalctl -u $unit =====" journalctl -b --no-pager --no-hostname --full -u "$unit"