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 <zeha@debian.org>
Reported-by: Anatoly Pugachev <matorola@gmail.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
# 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