From: Masatake YAMATO Date: Fri, 4 Feb 2022 17:18:14 +0000 (+0900) Subject: tests: (lsfd) refine the pattern for comparing the output of the commands X-Git-Tag: v2.38-rc2~49^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abd93fcecfbb1a1fac7032fac9d2903c5d2d3a38;p=thirdparty%2Futil-linux.git tests: (lsfd) refine the pattern for comparing the output of the commands When comparing the output of lsfd and findmnt commands, I passed just "$MNTID" to grep for filtering the output of findmnt. It was too relaxed. It should be "$MNTID\b"; a space after $MNTID was needed. https://github.com/util-linux/util-linux/issues/1511#issuecomment-1029968595 shows the output triggering the bug of the test case. Reported-by: Chris Hofstaedtler Reported-by: Anatoly Pugachev Signed-off-by: Masatake YAMATO --- diff --git a/tests/ts/lsfd/lsfd-functions.bash b/tests/ts/lsfd/lsfd-functions.bash index 05ae3e8f75..c46dc06301 100644 --- a/tests/ts/lsfd/lsfd-functions.bash +++ b/tests/ts/lsfd/lsfd-functions.bash @@ -41,7 +41,7 @@ function lsfd_compare_dev { # for a given device separately. # We can save the code for extracting the major part and minor part # if we use findmnt. - local FINDMNT_MNTID_DEV=$("${FINDMNT}" --raw -n -o ID,MAJ:MIN | grep "^${MNTID}") + local FINDMNT_MNTID_DEV=$("${FINDMNT}" --raw -n -o ID,MAJ:MIN | grep "^${MNTID}\b") echo 'FINDMNT[RUN]:' $? if [ "${MNTID} ${DEV}" == "${FINDMNT_MNTID_DEV}" ]; then echo 'DEV[STR]:' 0