From 64d0c173cd26a5b12ddc44ee2405d01e3ae852c8 Mon Sep 17 00:00:00 2001 From: Maciej Wawryk Date: Wed, 16 Oct 2019 07:55:45 +0200 Subject: [PATCH] test: Shellcheck - correct rule: Use a ( subshell ) to avoid having to cd back Correct shellcheck rule SC2103: Use a ( subshell ) to avoid having to cd back. Signed-off-by: Maciej Wawryk Change-Id: I474e11f5753c3482c7924548ab7c0183d4ac419d Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471437 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto --- scripts/check_format.sh | 2 +- test/blobstore/blobstore.sh | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/check_format.sh b/scripts/check_format.sh index 2bb1a08a59..df4c265f88 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,SC2103,SC2115,SC2116,SC2119,SC2120,SC2121,SC2124,SC2126,SC2128,\ +SC2097,SC2098,SC2115,SC2116,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/blobstore/blobstore.sh b/test/blobstore/blobstore.sh index 5137101e9e..3afb731945 100755 --- a/test/blobstore/blobstore.sh +++ b/test/blobstore/blobstore.sh @@ -18,9 +18,8 @@ $rootdir/scripts/gen_nvme.sh > $testdir/blobcli.conf # generate random data file for import/export diff dd if=/dev/urandom of=$testdir/test.pattern bs=1M count=1 -cd $testdir -$rootdir/examples/blob/cli/blobcli -c $testdir/blobcli.conf -b Nvme0n1 -T $testdir/test.bs > $testdir/btest.out -cd - +(cd $testdir && +$rootdir/examples/blob/cli/blobcli -c $testdir/blobcli.conf -b Nvme0n1 -T $testdir/test.bs > $testdir/btest.out) # the tool leaves some trailing whitespaces that we need to strip out sed -i 's/[[:space:]]*$//' $testdir/btest.out