Skip to content

Commit

Permalink
test: sleep 10s before run curl command
Browse files Browse the repository at this point in the history
  • Loading branch information
mozillazg committed May 2, 2024
1 parent 80b112b commit ba4ed8b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
7 changes: 5 additions & 2 deletions testdata/test_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ LNAME="/tmp/base.log"


function test_ptcpdump() {
timeout 20s ${CMD} -c 1 -i any --print -w "${FNAME}" \
'dst host 1.1.1.1 and tcp[tcpflags] = tcp-syn' 2>&1 | tee "${LNAME}" | (read _; curl -m 10 1.1.1.1 &>/dev/null || true)
timeout 30s ${CMD} -c 1 -i any --print -w "${FNAME}" \
'dst host 1.1.1.1 and tcp[tcpflags] = tcp-syn' 2>&1 | tee "${LNAME}" &
sleep 10
curl -m 10 1.1.1.1 &>/dev/null || true
wait

cat "${LNAME}"
cat "${LNAME}" | grep '/usr/bin/curl'
Expand Down
1 change: 0 additions & 1 deletion testdata/test_pid_filter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ function test_ptcpdump() {
timeout 30s ${CMD} -c 3 --pid $$ -f -i any --print -w "${FNAME}" 2>&1 | tee "${LNAME}" &
sleep 10
curl -m 10 1.1.1.1 &>/dev/null || true
echo $$
wait

cat "${LNAME}"
Expand Down
6 changes: 4 additions & 2 deletions testdata/test_pname_filter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ LNAME="/tmp/filter_by_pname.log"


function test_ptcpdump() {
timeout 20s ${CMD} -c 3 --pname curl -f -i any \
--print -w "${FNAME}" 2>&1 | tee "${LNAME}" | (read _; curl -m 10 1.1.1.1 &>/dev/null || true)
timeout 30s ${CMD} -c 3 --pname curl -f -i any --print -w "${FNAME}" 2>&1 | tee "${LNAME}" &
sleep 10
curl -m 10 1.1.1.1 &>/dev/null || true
wait

cat "${LNAME}"
cat "${LNAME}" | grep '/usr/bin/curl'
Expand Down

0 comments on commit ba4ed8b

Please sign in to comment.