test: Shellcheck - move rule SC2162 to exception list

read without -r will mangle backslashes

Change-Id: I9eb59dce40c0bfb59d865319992b419d512dc41b
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471885
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Pawel Kaminski 2019-10-21 06:14:41 -04:00 committed by Jim Harris
parent 933d990e23
commit c9c576912d
5 changed files with 5 additions and 6 deletions

View File

@ -243,8 +243,7 @@ if hash shellcheck 2>/dev/null; then
SHCK_EXCLUDE="SC1083,SC2002,\
SC2010,SC2012,SC2016,SC2034,SC2045,SC2046,SC2068,SC2086,SC2089,SC2090,\
SC2097,SC2098,SC2119,SC2120,SC2128,\
SC2129,SC2140,SC2142,SC2143,SC2154,SC2155,\
SC2162"
SC2129,SC2140,SC2142,SC2143,SC2154,SC2155"
# SPDK fails some error checks which have been deprecated in later versions of shellcheck.
# We will not try to fix these error checks, but instead just leave the error types here
# so that we can still run with older versions of shellcheck.

View File

@ -12,7 +12,7 @@ function at_ftl_exit() {
PCI_WHITELIST="$device" PCI_BLACKLIST="" DRIVER_OVERRIDE="$ocssd_original_dirver" ./scripts/setup.sh
}
read device _ <<< "$OCSSD_PCI_DEVICES"
read -r device _ <<< "$OCSSD_PCI_DEVICES"
if [[ -z "$device" ]]; then
echo "OCSSD device list is empty."

View File

@ -62,7 +62,7 @@ function tgt_check_notifications() {
local event_line event ev_type ev_ctx
local rc=""
while read event_line; do
while read -r event_line; do
# remove ID
event="${event_line%:*}"

View File

@ -32,7 +32,7 @@ function vhosttestinit()
if [[ ! -f $VM_IMAGE ]]; then
echo "VM image not found at $VM_IMAGE"
echo "Download to $HOME? [yn]"
read download
read -r download
if [ "$download" = "y" ]; then
curl https://dqtibwqq6s6ux.cloudfront.net/download/test_resources/vhost_vm_image.tar.gz | tar xz -C $HOME
fi

View File

@ -206,7 +206,7 @@ for vm_num in $used_vms; do
done
if $dry_run; then
read -p "Enter to kill evething" xx
read -r -p "Enter to kill evething" xx
sleep 3
at_app_exit
exit 0