Add full epoll_pwait

This commit is contained in:
Weijie Liu
2024-05-16 19:05:32 +08:00
committed by Tate, Hongliang Tian
parent 9484d35730
commit 07caaa5b3f
9 changed files with 327 additions and 25 deletions

View File

@ -11,5 +11,6 @@ cd ${SCRIPT_DIR}
./ext2.sh
./process.sh
./network.sh
./test_epoll_pwait.sh
echo "All regression tests passed."

View File

@ -0,0 +1,31 @@
#!/bin/sh
# SPDX-License-Identifier: MPL-2.0
set -e
EPOLLTEST_DIR=/regression/epoll
cd ${EPOLLTEST_DIR}
echo "Start epoll_pwait test......"
# Step 2: Run epoll_pwait in the background
./epoll_pwait &
EPOLL_PID=$!
echo "epoll_pwait PID: $EPOLL_PID"
# Step 3: Wait for 1 seconds to let epoll_pwait initialize and block SIGUSR1
sleep 1
# Step 4: Send SIGUSR1 to epoll_pwait
kill -USR1 $EPOLL_PID
echo "Sent SIGUSR1 to PID $EPOLL_PID"
# Optional: Wait a bit more to see the output if the process is still running
sleep 3
# You can also wait till the subprocess epoll_pwait completely finishes
# wait $EPOLL_PID
echo "Test completed."