From a8dee6d1b9b75a1d023ed3adbea41fff1b37e5be Mon Sep 17 00:00:00 2001 From: Maciej Wawryk Date: Wed, 16 Oct 2019 09:13:42 +0200 Subject: [PATCH] test: Shellcheck - correct rule: Useless echo? Correct shellcheck rule SC2116: Useless echo? Instead of 'cmd $(echo foo)', just use 'cmd foo'. Signed-off-by: Maciej Wawryk Change-Id: I940eb1ec72ba00ecb89ca770300f5d37e90e8a86 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471452 Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Jim Harris --- scripts/check_format.sh | 2 +- test/json_config/json_config.sh | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/check_format.sh b/scripts/check_format.sh index df4c265f8..71ae445d7 100755 --- a/scripts/check_format.sh +++ b/scripts/check_format.sh @@ -242,7 +242,7 @@ if hash shellcheck 2>/dev/null; then # This SHCK_EXCLUDE list is out "to do" and we work to fix all of this errors. SHCK_EXCLUDE="SC1083,SC2002,SC2004,\ SC2010,SC2012,SC2016,SC2034,SC2045,SC2046,SC2068,SC2086,SC2089,SC2090,\ -SC2097,SC2098,SC2115,SC2116,SC2119,SC2120,SC2121,SC2124,SC2126,SC2128,\ +SC2097,SC2098,SC2115,SC2119,SC2120,SC2121,SC2124,SC2126,SC2128,\ SC2129,SC2140,SC2142,SC2143,SC2148,SC2152,SC2153,SC2154,SC2155,\ SC2162,SC2164,SC2165,SC2166,SC2167,\ SC2230" diff --git a/test/json_config/json_config.sh b/test/json_config/json_config.sh index 9728b6669..6c12cd57c 100755 --- a/test/json_config/json_config.sh +++ b/test/json_config/json_config.sh @@ -45,13 +45,11 @@ function tgt_check_notification_types() { timing_enter $FUNCNAME local ret=0 - local enabled_types=" - bdev_register - bdev_unregister - " + local enabled_types="bdev_register + bdev_unregister " get_types=$(tgt_rpc notify_get_types | jq -r '.[]') - if [ "$(echo $enabled_types)" != "$(echo $get_types)" ]; then + if [ $enabled_types != $get_types ]; then echo "ERROR: expected types:" $enabled_types ", but got:" $get_types ret=1 fi