Codebase list nsntrace / 514c2287-c95b-4813-a2d4-83c6690101cb/upstream tests / check_namespaced.sh
514c2287-c95b-4813-a2d4-83c6690101cb/upstream

Tree @514c2287-c95b-4813-a2d4-83c6690101cb/upstream (Download .tar.gz)

check_namespaced.sh @514c2287-c95b-4813-a2d4-83c6690101cb/upstreamraw · history · blame

#!/bin/sh

packets=99
filter="udp port 1337"

# start sending packages non-namespaced
 ./udp_send 1337 -1 &

# stop the non-namespaced udp_send on exit
pidof_udp_send=$(pidof udp_send)
trap 'kill "$pidof_udp_send"' EXIT

# make sure we only capture the packets from the namespaced version
sudo ../src/nsntrace -d lo -f "$filter" ./udp_send 1337 "$packets" | grep "$packets packets" || {
    echo "Did not capture $packets packets!"
    exit 1
}

exit 0