summaryrefslogtreecommitdiff
path: root/perf-netavark.sh
blob: d247609b82d2e2def004e452b5c6865ff6726549 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/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