xref: /linux/tools/testing/selftests/net/run_afpackettests (revision c2f4954c2d3fc4f77b46c67585e17a58df4ba8e4)
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3
4# Kselftest framework requirement - SKIP code is 4.
5ksft_skip=4
6
7if [ $(id -u) != 0 ]; then
8	echo $msg must be run as root >&2
9	exit $ksft_skip
10fi
11
12ret=0
13echo "--------------------"
14echo "running psock_fanout test"
15echo "--------------------"
16./in_netns.sh ./psock_fanout
17if [ $? -ne 0 ]; then
18	echo "[FAIL]"
19	ret=1
20else
21	echo "[PASS]"
22fi
23
24echo "--------------------"
25echo "running psock_tpacket test"
26echo "--------------------"
27if [ -f /proc/kallsyms ]; then
28	./in_netns.sh ./psock_tpacket
29	if [ $? -ne 0 ]; then
30		echo "[FAIL]"
31		ret=1
32	else
33		echo "[PASS]"
34	fi
35else
36	echo "[SKIP] CONFIG_KALLSYMS not enabled"
37fi
38
39echo "--------------------"
40echo "running txring_overwrite test"
41echo "--------------------"
42./in_netns.sh ./txring_overwrite
43if [ $? -ne 0 ]; then
44	echo "[FAIL]"
45	ret=1
46else
47	echo "[PASS]"
48fi
49exit $ret
50