Skip to content

Commit

Permalink
Need a better approach...
Browse files Browse the repository at this point in the history
In case this is timing related. I need an approach where I can confirm
the previous action before initiating the next action.
  • Loading branch information
gcla committed Sep 10, 2020
1 parent 2c52c9d commit 291e18b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions scripts/simple-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,39 +98,39 @@ wait_for_load() {

echo UI test 1
# Load a pcap, quit
{ wait_for_load ; echo q ; echo ; } | in_tty $TS -r "${PCAP}" > /dev/null
{ wait_for_load ; sleep 0.5s ; echo q ; sleep 0.5s ; echo ; } | in_tty $TS -r "${PCAP}" > /dev/null

echo UI test 2
# Run with stdout not a tty, but disable the pass-thru to tshark
{ wait_for_load ; echo q ; echo ; } | in_tty "$TS -r "${PCAP}" --pass-thru=false | cat" > /dev/null
{ wait_for_load ; sleep 0.5s ; echo q ; sleep 0.5s ; echo ; } | in_tty "$TS -r "${PCAP}" --pass-thru=false | cat" > /dev/null

echo UI test 3
# Load a pcap, very rudimentary scrape for an IP, quit
{ wait_for_load ; echo q ; echo ; } | in_tty "$TS -r "${PCAP}"" | grep -a 192.168.44.123 > /dev/null
{ wait_for_load ; sleep 0.5s ; echo q ; sleep 0.5s ; echo ; } | in_tty "$TS -r "${PCAP}"" | grep -a 192.168.44.123 > /dev/null

# Ensure -r flag isn't needed
{ wait_for_load ; echo q ; echo ; } | in_tty "$TS "${PCAP}"" | grep -a 192.168.44.123 > /dev/null
{ wait_for_load ; sleep 0.5s ; echo q ; sleep 0.5s ; echo ; } | in_tty "$TS "${PCAP}"" | grep -a 192.168.44.123 > /dev/null

echo UI test 4
# Load a pcap from stdin
{ wait_for_load ; echo q ; echo ; } | in_tty "cat "${PCAP}" | TERM=xterm $TS -i -" > /dev/null
{ wait_for_load ; echo q ; echo ; } | in_tty "cat "${PCAP}" | TERM=xterm $TS -r -" > /dev/null
{ wait_for_load ; echo q ; echo ; } | in_tty "cat "${PCAP}" | TERM=xterm $TS" > /dev/null
{ wait_for_load ; sleep 0.5s ; echo q ; sleep 0.5s ; echo ; } | in_tty "cat "${PCAP}" | TERM=xterm $TS -i -" > /dev/null
{ wait_for_load ; sleep 0.5s ; echo q ; sleep 0.5s ; echo ; } | in_tty "cat "${PCAP}" | TERM=xterm $TS -r -" > /dev/null
{ wait_for_load ; sleep 0.5s ; echo q ; sleep 0.5s ; echo ; } | in_tty "cat "${PCAP}" | TERM=xterm $TS" > /dev/null

echo UI test 5
# Display filter at end of command line
{ wait_for_load ; echo q ; echo ; } | in_tty "$TS -r scripts/pcaps/telnet-cooked.pcap \'frame.number == 2\'" | grep -a "Frame 2: 74 bytes" > /dev/null
{ wait_for_load ; sleep 0.5s ; echo q ; sleep 0.5s ; echo ; } | in_tty "$TS -r scripts/pcaps/telnet-cooked.pcap \'frame.number == 2\'" | grep -a "Frame 2: 74 bytes" > /dev/null

echo UI test 6
mkfifo "${FIFO}"
cat "${PCAP}" > "${FIFO}" &
{ wait_for_load ; echo q ; echo ; } | in_tty "$TS -r "${FIFO}"" > /dev/null
{ wait_for_load ; sleep 0.5s ; echo q ; sleep 0.5s ; echo ; } | in_tty "$TS -r "${FIFO}"" > /dev/null
wait
cat "${PCAP}" > "${FIFO}" &
{ wait_for_load ; echo q ; echo ; } | in_tty "$TS -i "${FIFO}"" > /dev/null
{ wait_for_load ; sleep 0.5s ; echo q ; sleep 0.5s ; echo ; } | in_tty "$TS -i "${FIFO}"" > /dev/null
wait
cat "${PCAP}" > "${FIFO}" &
{ wait_for_load ; echo q ; echo ; } | in_tty "$TS "${FIFO}"" > /dev/null
{ wait_for_load ; sleep 0.5s ; echo q ; sleep 0.5s ; echo ; } | in_tty "$TS "${FIFO}"" > /dev/null
#{ sleep 5s ; echo q ; echo ; } | in_tty "$TS "${FIFO}" \'frame.number == 2\'" | grep -a "Frame 2: 74 bytes" > /dev/null
wait

Expand Down

0 comments on commit 291e18b

Please sign in to comment.