2aacef
From fa44b8d1e6b0d5e0ef4dfcb01e26e7907068bfa3 Mon Sep 17 00:00:00 2001
2aacef
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
2aacef
Date: Wed, 7 Dec 2022 09:52:35 +0100
2aacef
Subject: [PATCH] TEST-65: use [[ -v ]] more
2aacef
2aacef
It's a bashism, but we use other bash features anyway, and it's cleaner
2aacef
and much less verbose.
2aacef
2aacef
(cherry picked from commit 1f9caf28cafbec89b93b8e6b641d387ac5acdd24)
2aacef
2aacef
Related: #2138081
2aacef
---
2aacef
 test/units/testsuite-64.sh | 10 +++++-----
2aacef
 1 file changed, 5 insertions(+), 5 deletions(-)
2aacef
2aacef
diff --git a/test/units/testsuite-64.sh b/test/units/testsuite-64.sh
2aacef
index 7673036335..fd1ad7c041 100755
2aacef
--- a/test/units/testsuite-64.sh
2aacef
+++ b/test/units/testsuite-64.sh
2aacef
@@ -192,7 +192,7 @@ testcase_nvme_subsystem() {
2aacef
 testcase_virtio_scsi_identically_named_partitions() {
2aacef
     local num
2aacef
 
2aacef
-    if [[ -n "${ASAN_OPTIONS:-}" ]] || [[ "$(systemd-detect-virt -v)" == "qemu" ]]; then
2aacef
+    if [[ -v ASAN_OPTIONS || "$(systemd-detect-virt -v)" == "qemu" ]]; then
2aacef
         num=$((4 * 4))
2aacef
     else
2aacef
         num=$((16 * 8))
2aacef
@@ -305,7 +305,7 @@ testcase_simultaneous_events() {
2aacef
     local -a devices symlinks
2aacef
     local -A running
2aacef
 
2aacef
-    if [[ -n "${ASAN_OPTIONS:-}" ]] || [[ "$(systemd-detect-virt -v)" == "qemu" ]]; then
2aacef
+    if [[ -v ASAN_OPTIONS || "$(systemd-detect-virt -v)" == "qemu" ]]; then
2aacef
         num_part=2
2aacef
         iterations=10
2aacef
         timeout=240
2aacef
@@ -400,7 +400,7 @@ testcase_lvm_basic() {
2aacef
         /dev/disk/by-id/ata-foobar_deadbeeflvm{0..3}
2aacef
     )
2aacef
 
2aacef
-    if [[ -n "${ASAN_OPTIONS:-}" ]] || [[ "$(systemd-detect-virt -v)" == "qemu" ]]; then
2aacef
+    if [[ -v ASAN_OPTIONS || "$(systemd-detect-virt -v)" == "qemu" ]]; then
2aacef
         timeout=180
2aacef
     else
2aacef
         timeout=30
2aacef
@@ -453,7 +453,7 @@ testcase_lvm_basic() {
2aacef
     helper_check_device_units
2aacef
 
2aacef
     # Same as above, but now with more "stress"
2aacef
-    if [[ -n "${ASAN_OPTIONS:-}" ]] || [[ "$(systemd-detect-virt -v)" == "qemu" ]]; then
2aacef
+    if [[ -v ASAN_OPTIONS || "$(systemd-detect-virt -v)" == "qemu" ]]; then
2aacef
         iterations=10
2aacef
     else
2aacef
         iterations=50
2aacef
@@ -478,7 +478,7 @@ testcase_lvm_basic() {
2aacef
     helper_check_device_units
2aacef
 
2aacef
     # Create & remove LVs in a loop, i.e. with more "stress"
2aacef
-    if [[ -n "${ASAN_OPTIONS:-}" ]]; then
2aacef
+    if [[ -v ASAN_OPTIONS ]]; then
2aacef
         iterations=8
2aacef
         partitions=16
2aacef
     elif [[ "$(systemd-detect-virt -v)" == "qemu" ]]; then