From 978bb43af2f34af19a3f2870a5510e41149d446f Mon Sep 17 00:00:00 2001 From: Jian Yu Date: Thu, 3 Aug 2023 23:57:17 -0700 Subject: [PATCH] LU-17009 tests: fix runtests to read file name with backslash If a file in /etc dir has a name with backslash, then runtests will fail because the read command considers the backslash as an escape character. This patch fixes the issue by adding "-r" option to read. Lustre-change: https://review.whamcloud.com/51847 Lustre-commit: TBD (from 14044bdfe5fa600bd2c2339032ae8bb54e24b5fb) Test-Parameters: trivial testlist=runtests Change-Id: Iab912ba9708f5b64e6bb8d8adc266ff23ed32de5 Signed-off-by: Jian Yu Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/51869 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Sarah Liu Reviewed-by: Andreas Dilger --- lustre/tests/runtests | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lustre/tests/runtests b/lustre/tests/runtests index 6e03d59..60461c7 100755 --- a/lustre/tests/runtests +++ b/lustre/tests/runtests @@ -79,7 +79,7 @@ test_1() { log "comparing $COUNT newly copied files at $(date)" - cat $findfiles | tr "\0" "\n" | ( rc=0; while read f; do + cat $findfiles | tr "\0" "\n" | ( rc=0; while read -r f; do diff -q "$f" "$dst/$f" || rc=18 done [ "$rc" = 0 ] || error_exit "old and new files are different: rc=$rc" ) @@ -90,7 +90,7 @@ test_1() { setupall || error "setupall failed" log "comparing $COUNT previously copied files" - cat $findfiles | tr "\0" "\n" | ( rc=0; while read f; do + cat $findfiles | tr "\0" "\n" | ( rc=0; while read -r f; do diff -q "$f" "$dst/$f" || rc=22 done [ "$rc" = 0 ] || error_exit "old and new files are different: rc=$rc" ) -- 1.8.3.1