1a6f68034SDavid S. Miller#!/bin/sh
2b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
3a6f68034SDavid S. Miller
4*7844ec21SPo-Hsu Lin# Kselftest framework requirement - SKIP code is 4.
5*7844ec21SPo-Hsu Linksft_skip=4
6*7844ec21SPo-Hsu Lin
7a6f68034SDavid S. Millerif [ $(id -u) != 0 ]; then
8a6f68034SDavid S. Miller	echo $msg must be run as root >&2
9*7844ec21SPo-Hsu Lin	exit $ksft_skip
10a6f68034SDavid S. Millerfi
11a6f68034SDavid S. Miller
128c03557cSPo-Hsu Linret=0
13a6f68034SDavid S. Millerecho "--------------------"
14a6f68034SDavid S. Millerecho "running psock_fanout test"
15a6f68034SDavid S. Millerecho "--------------------"
16cc30c93fSWillem de Bruijn./in_netns.sh ./psock_fanout
17a6f68034SDavid S. Millerif [ $? -ne 0 ]; then
18a6f68034SDavid S. Miller	echo "[FAIL]"
198c03557cSPo-Hsu Lin	ret=1
20a6f68034SDavid S. Millerelse
21a6f68034SDavid S. Miller	echo "[PASS]"
22a6f68034SDavid S. Millerfi
2323a95442SDaniel Borkmann
2423a95442SDaniel Borkmannecho "--------------------"
2523a95442SDaniel Borkmannecho "running psock_tpacket test"
2623a95442SDaniel Borkmannecho "--------------------"
27ff95bf28SPo-Hsu Linif [ -f /proc/kallsyms ]; then
28cc30c93fSWillem de Bruijn	./in_netns.sh ./psock_tpacket
2923a95442SDaniel Borkmann	if [ $? -ne 0 ]; then
3023a95442SDaniel Borkmann		echo "[FAIL]"
318c03557cSPo-Hsu Lin		ret=1
3223a95442SDaniel Borkmann	else
3323a95442SDaniel Borkmann		echo "[PASS]"
3423a95442SDaniel Borkmann	fi
35ff95bf28SPo-Hsu Linelse
36ff95bf28SPo-Hsu Lin	echo "[SKIP] CONFIG_KALLSYMS not enabled"
37ff95bf28SPo-Hsu Linfi
38358be656SWillem de Bruijn
39358be656SWillem de Bruijnecho "--------------------"
40358be656SWillem de Bruijnecho "running txring_overwrite test"
41358be656SWillem de Bruijnecho "--------------------"
42358be656SWillem de Bruijn./in_netns.sh ./txring_overwrite
43358be656SWillem de Bruijnif [ $? -ne 0 ]; then
44358be656SWillem de Bruijn	echo "[FAIL]"
458c03557cSPo-Hsu Lin	ret=1
46358be656SWillem de Bruijnelse
47358be656SWillem de Bruijn	echo "[PASS]"
48358be656SWillem de Bruijnfi
498c03557cSPo-Hsu Linexit $ret
50