mirror of
https://github.com/containers/netavark.git
synced 2026-02-05 06:45:56 +01:00
Makes testing with different drivers easier. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
23 lines
418 B
Bash
Executable File
23 lines
418 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Netavark binary
|
|
NETAVARK=${NETAVARK:-./bin/netavark}
|
|
|
|
trap cleanup EXIT
|
|
|
|
function cleanup() {
|
|
kill -9 $netnspid
|
|
rm -rf $TMP_CONFIG
|
|
}
|
|
|
|
TMP_CONFIG=$(mktemp -d)
|
|
unshare -n sleep 100 &
|
|
netnspid=$!
|
|
|
|
# first arg is the fw driver
|
|
if [ -n "$1" ]; then
|
|
export NETAVARK_FW="$1"
|
|
fi
|
|
|
|
unshare -n perf stat $NETAVARK -f ./test/testfiles/simplebridge.json --config $TMP_CONFIG setup /proc/$netnspid/ns/net
|