]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: (lsfd) delete "largefile" flag in the output before the comparison
authorMasatake YAMATO <yamato@redhat.com>
Fri, 4 Feb 2022 17:40:10 +0000 (02:40 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Fri, 4 Feb 2022 17:50:41 +0000 (02:50 +0900)
The original code didn't considered that syscalls opening a directory
on mips64 GNU/Linux took O_LARGEFILE flag. This misconsideration made
the mkfds-directory test FAILED as reported in
https://github.com/util-linux/util-linux/issues/1511#issuecomment-1029968595.

Reported-by: Anatoly Pugachev <matorola@gmail.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
tests/ts/lsfd/mkfds-directory

index 93b302523a56235a7ed207b20e2223f9de29d8db..cae5f2ab23f911a2c75bbb95de7ed1ec90ffd1ed 100755 (executable)
@@ -25,6 +25,7 @@ ts_check_test_command "$TS_HELPER_MKFDS"
 
 ts_check_prog "stat"
 ts_check_prog "id"
+ts_check_prog "sed"
 
 ts_cd "$TS_OUTDIR"
 
@@ -36,7 +37,16 @@ EXPR=
     coproc MKFDS { "$TS_HELPER_MKFDS" directory $FD; }
     if read -u ${MKFDS[0]} PID; then
        EXPR='(PID == '"${PID}"') and (FD == '"$FD"')'
-       ${TS_CMD_LSFD} -n -o ASSOC,MODE,TYPE,FLAGS,NAME -Q "${EXPR}"
+       ${TS_CMD_LSFD} -n -o ASSOC,MODE,TYPE,FLAGS,NAME -Q "${EXPR}" | {
+           #
+           # Normalize the output:
+           #
+           # See https://github.com/util-linux/util-linux/issues/1511#issuecomment-1029968595
+           # It seems that syscalls opening a directory on mips64 GNU/Linux take the
+           # O_LARGEFILE flag.
+           #
+           sed -e 's/largefile,\|,largefile//'
+       }
        echo 'ASSOC,MODE,TYPE,FLAGS,NAME': $?
 
        LSFD_PID=$(${TS_CMD_LSFD} --raw -n -o PID -Q "${EXPR}")