1
0
mirror of https://github.com/containers/netavark.git synced 2026-02-05 06:45:56 +01:00
Files
netavark/perf-netavark.sh
Paul Holzinger 468f8854c8 perf-netavark: accept fw driver as argument
Makes testing with different drivers easier.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-01-10 18:53:31 +01:00

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