]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: don't leak local variable to outer scopes
authorFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 27 Jan 2022 21:50:58 +0000 (22:50 +0100)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 27 Jan 2022 21:50:58 +0000 (22:50 +0100)
test/TEST-64-UDEV-STORAGE/test.sh

index 0f26eaafebaa8be196bbddef4595885009fcaf04..04632952d002b9a7b12363394517439c14587a3c 100755 (executable)
@@ -166,6 +166,7 @@ testcase_megasas2_basic() {
         return 77
     fi
 
+    local i
     local qemu_opts=(
         "-device megasas-gen2,id=scsi0"
         "-device megasas-gen2,id=scsi1"
@@ -192,6 +193,9 @@ testcase_nvme_basic() {
         return 77
     fi
 
+    local i
+    local qemu_opts=()
+
     for i in {0..27}; do
         qemu_opts+=(
             "-device nvme,drive=nvme$i,serial=deadbeef$i,num_queues=8"
@@ -215,7 +219,7 @@ testcase_virtio_scsi_identically_named_partitions() {
     # and attach them to a virtio-scsi controller
     local qemu_opts=("-device virtio-scsi-pci,id=scsi0,num_queues=4")
     local diskpath="${TESTDIR:?}/namedpart0.img"
-    local lodev qemu_timeout
+    local lodev qemu_timeout
 
     dd if=/dev/zero of="$diskpath" bs=1M count=18
     lodev="$(losetup --show -f -P "$diskpath")"
@@ -325,7 +329,7 @@ testcase_lvm_basic() {
     fi
 
     local qemu_opts=("-device ahci,id=ahci0")
-    local diskpath
+    local diskpath i
 
     # Attach 4 SATA disks to the VM (and set their model and serial fields
     # to something predictable, so we can refer to them later)