On Linux >= 6.9, pidfds are from pidfs instead of anonymous inode.
Thus:
STTYPE is REG on Linux >= 6.9, UNKN on Linux < 6.9.
KNAME is pidfd:[inode number] on Linux >= 6.9, anon_inode:[pidfd] on
Linux < 6.9.
And ainode_class test cannot work on Linux >= 6.9, just skip this sub
test if STTYPE is REG.
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
-3 anon_inode:[pidfd] pid=1 comm= nspid=1
+3 [KNAME] pid=1 comm= nspid=1
pidfd:ASSOC,KNAME,NAME: 0
-3 UNKN pidfd
+3 [STTYPE] pidfd
pidfd:ASSOC,STTYPE,TYPE: 0
-3 UNKN anon_inodefs pid=1 comm=systemd nspid=1 systemd 1
+3 [STTYPE] [SOURCE] pid=1 comm=systemd nspid=1 systemd 1
ASSOC,STTYPE,SOURCE,NAME,PIDFD.COMM,PIDFD.PID: 0
fi
wait "${MKFDS_PID}"
} > "$TS_OUTPUT" 2>&1
+
if [ "$C-$?" == "pidfd-$TS_EXIT_NOTSUPP" ]; then
ts_skip_subtest "pidfd_open(2) is not available"
continue
fi
+
+ STTYPE="$(head -n1 "$TS_OUTPUT" | awk '{print $2}')"
+ if [ "$C-$STTYPE" == "pidfd-REG" ]; then
+ ts_skip_subtest "pidfd is from pidfs instead of anon inode"
+ continue
+ fi
+
ts_finalize_subtest
done
fi
} > "$TS_OUTPUT" 2>&1
wait "${MKFDS_PID}"
+
if [ "$C-$?" == "pidfd-$TS_EXIT_NOTSUPP" ]; then
ts_skip_subtest "pidfd_open(2) is not available"
continue
fi
+
+ case $C in
+ pidfd)
+ sed -i -E 's/(pidfd|anon_inode):\[[a-zA-Z]+\]/[KNAME]/' "$TS_OUTPUT"
+ esac
+
ts_finalize_subtest
done
fi
wait "${MKFDS_PID}"
} > "$TS_OUTPUT" 2>&1
+
if [ "$C-$?" == "pidfd-$TS_EXIT_NOTSUPP" ]; then
ts_skip_subtest "pidfd_open(2) is not available"
continue
fi
+
+ case $C in
+ pidfd)
+ sed -i -E 's/UNKN|REG/[STTYPE]/' "$TS_OUTPUT"
+ esac
+
ts_finalize_subtest
done
fi
wait ${MKFDS_PID}
} > $TS_OUTPUT 2>&1
+
if [ "$?" == "$TS_EXIT_NOTSUPP" ]; then
ts_skip "pidfd_open(2) is not available"
fi
+sed -i -E -e 's/UNKN|REG/[STTYPE]/' -e 's/pidfs|anon_inodefs/[SOURCE]/' \
+ $TS_OUTPUT
+
ts_finalize