Skip to content

Commit

Permalink
tests: (lsfd) extend the mkfds-socketpair case to test ENDPOINTS with…
Browse files Browse the repository at this point in the history
… SOCK.SHUTDOWN info

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
  • Loading branch information
masatake committed Oct 9, 2023
1 parent 3f3da32 commit b0dbcec
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
3 rw- SOCK sockfs 1,test_mkfds,4r-
4 rw- SOCK sockfs 1,test_mkfds,3-w
ASSOC,MODE,STTYPE,SOURCE,ENDPOINTS: 0
23 changes: 23 additions & 0 deletions tests/ts/lsfd/mkfds-socketpair
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,30 @@ mkfds_socketpair_stream_shutdown_state()
ts_finalize_subtest
}

mkfds_socketpair_stream_endpoint_halfclose()
{
ts_init_subtest "STREAM-ENDPOINT-halfclose"
if [ "$QEMU_USER" == "1" ]; then
ts_skip_subtest "running under qemu-user emulation"
return
fi
{
coproc MKFDS { "$TS_HELPER_MKFDS" socketpair $FD0 $FD1 socktype=STREAM halfclose=1; }
if read -u ${MKFDS[0]} PID; then
EXPR='(FD == '"$FD0"') or (FD == '"$FD1"')'
${TS_CMD_LSFD} -p "${PID}" -n -o ASSOC,MODE,STTYPE,SOURCE,ENDPOINTS -Q "${EXPR}" | sed -e "s/${PID}/1/g"
echo 'ASSOC,MODE,STTYPE,SOURCE,ENDPOINTS': ${PIPESTATUS[0]}

echo DONE >&"${MKFDS[1]}"
fi
} > "$TS_OUTPUT" 2>&1

wait ${MKFDS_PID}
ts_finalize_subtest
}

mkfds_socketpair_stream_endpoint
mkfds_socketpair_stream_shutdown_state
mkfds_socketpair_stream_endpoint_halfclose

ts_finalize

0 comments on commit b0dbcec

Please sign in to comment.