summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/net/run_afpackettests
blob: a59cb6a3c4f53f0150c4a02f6059f3483ce1f3a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0

# Kselftest framework requirement - SKIP code is 4.
ksft_skip=4

if [ $(id -u) != 0 ]; then
	echo $msg must be run as root >&2
	exit $ksft_skip
fi

ret=0
echo "--------------------"
echo "running psock_fanout test"
echo "--------------------"
./in_netns.sh ./psock_fanout
if [ $? -ne 0 ]; then
	echo "[FAIL]"
	ret=1
else
	echo "[PASS]"
fi

echo "--------------------"
echo "running psock_tpacket test"
echo "--------------------"
if [ -f /proc/kallsyms ]; then
	./in_netns.sh ./psock_tpacket
	if [ $? -ne 0 ]; then
		echo "[FAIL]"
		ret=1
	else
		echo "[PASS]"
	fi
else
	echo "[SKIP] CONFIG_KALLSYMS not enabled"
fi

echo "--------------------"
echo "running txring_overwrite test"
echo "--------------------"
./in_netns.sh ./txring_overwrite
if [ $? -ne 0 ]; then
	echo "[FAIL]"
	ret=1
else
	echo "[PASS]"
fi
exit $ret