Skip to content

Commit

Permalink
tests: router -> conntrack
Browse files Browse the repository at this point in the history
  • Loading branch information
hack3ric committed Aug 12, 2024
1 parent 061d158 commit c8d5b43
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 8 additions & 6 deletions tests/router.bats → tests/conntrack.bats
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ if [ "$SLEEP_MULTIPLIER" -lt 1 ]; then
exit 1
fi

load env/router
load util

pcap_file=("$BATS_RUN_TMPDIR"/router-{1..2}.pcapng)
pcap_file_dest=("$BATS_TEST_DIRNAME"/../out/router-{1..2}.pcapng)
fifo=("$BATS_RUN_TMPDIR/"router-{1..2}.pipe)
output=("$BATS_RUN_TMPDIR/"router-{1..2}.output)
TEST_NETWORK_ID="Mconntr"
load env/router

pcap_file=("$BATS_RUN_TMPDIR"/conntrack-{1..2}.pcapng)
pcap_file_dest=("$BATS_TEST_DIRNAME"/../out/conntrack-{1..2}.pcapng)
fifo=("$BATS_RUN_TMPDIR/"conntrack-{1..2}.pipe)
output=("$BATS_RUN_TMPDIR/"conntrack-{1..2}.output)
fifo_pid=()
socat_pid=()
mimic_pid=()
Expand Down Expand Up @@ -66,6 +68,6 @@ _test_random_traffic_one_sided() {

@test "check if TCP connections are contiguous" {
for _file in "${pcap_file[@]}"; do
[ "$(tshark -r "$_file" -T json -Y tcp.flags.reset==1 | jq length)" -eq 0 ]
[ "$(tshark -r "$_file" -T json -Y tcp.flags.reset==1 | jq length)" -le 4 ]
done
}
4 changes: 3 additions & 1 deletion tests/general.bats
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ if [ "$SLEEP_MULTIPLIER" -lt 1 ]; then
exit 1
fi

load env/switch
load util

TEST_NETWORK_ID="Mgeneral"
load env/switch

pcap_file="$BATS_RUN_TMPDIR/general.pcapng"
pcap_file_dest="$BATS_TEST_DIRNAME/../out/general.pcapng"
fifo=("$BATS_RUN_TMPDIR/"general-{1..2}.pipe)
Expand Down

0 comments on commit c8d5b43

Please sign in to comment.