naccyde / rpms / systemd

Forked from rpms/systemd a year ago
Clone
594167
From de9aa9da870f1f5fd1457dd70fd13c221e8b39b3 Mon Sep 17 00:00:00 2001
594167
From: Frantisek Sumsal <frantisek@sumsal.cz>
594167
Date: Fri, 17 Jun 2022 15:28:17 +0200
594167
Subject: [PATCH] test: fix a couple of issues found by shellcheck
594167
594167
(cherry picked from commit 72f0e89c0da3584d5d0a0124d791b02f0f04e769)
594167
594167
Related: #2087652
594167
---
594167
 test/units/testsuite-02.sh | 4 ++--
594167
 test/units/testsuite-38.sh | 8 ++++----
594167
 2 files changed, 6 insertions(+), 6 deletions(-)
594167
594167
diff --git a/test/units/testsuite-02.sh b/test/units/testsuite-02.sh
594167
index 54927a6377..8ebcc575ee 100755
594167
--- a/test/units/testsuite-02.sh
594167
+++ b/test/units/testsuite-02.sh
594167
@@ -61,7 +61,7 @@ for task in "${TEST_LIST[@]}"; do
594167
                 # Task has finished, report its result and drop it from the queue
594167
                 wait "${running[$key]}" && ec=0 || ec=$?
594167
                 report_result "$key" $ec
594167
-                unset running["$key"]
594167
+                unset "running[$key]"
594167
                 # Break from inner for loop and outer while loop to skip
594167
                 # the sleep below when we find a free slot in the queue
594167
                 break 2
594167
@@ -85,7 +85,7 @@ for key in "${!running[@]}"; do
594167
     echo "Waiting for test '$key' to finish"
594167
     wait ${running[$key]} && ec=0 || ec=$?
594167
     report_result "$key" $ec
594167
-    unset running["$key"]
594167
+    unset "running[$key]"
594167
 done
594167
 
594167
 set -x
594167
diff --git a/test/units/testsuite-38.sh b/test/units/testsuite-38.sh
594167
index 438990d1c5..c5f9bcc22c 100755
594167
--- a/test/units/testsuite-38.sh
594167
+++ b/test/units/testsuite-38.sh
594167
@@ -17,7 +17,7 @@ dbus_freeze() {
594167
     local name object_path suffix
594167
 
594167
     suffix="${1##*.}"
594167
-    name="${1%.$suffix}"
594167
+    name="${1%".$suffix"}"
594167
     object_path="/org/freedesktop/systemd1/unit/${name//-/_2d}_2e${suffix}"
594167
 
594167
     busctl call \
594167
@@ -31,7 +31,7 @@ dbus_thaw() {
594167
     local name object_path suffix
594167
 
594167
     suffix="${1##*.}"
594167
-    name="${1%.$suffix}"
594167
+    name="${1%".$suffix"}"
594167
     object_path="/org/freedesktop/systemd1/unit/${name//-/_2d}_2e${suffix}"
594167
 
594167
     busctl call \
594167
@@ -65,7 +65,7 @@ dbus_can_freeze() {
594167
     local name object_path suffix
594167
 
594167
     suffix="${1##*.}"
594167
-    name="${1%.$suffix}"
594167
+    name="${1%".$suffix"}"
594167
     object_path="/org/freedesktop/systemd1/unit/${name//-/_2d}_2e${suffix}"
594167
 
594167
     busctl get-property \
594167
@@ -79,7 +79,7 @@ check_freezer_state() {
594167
     local name object_path suffix
594167
 
594167
     suffix="${1##*.}"
594167
-    name="${1%.$suffix}"
594167
+    name="${1%".$suffix"}"
594167
     object_path="/org/freedesktop/systemd1/unit/${name//-/_2d}_2e${suffix}"
594167
 
594167
     for _ in {0..10}; do