18c2ecf20Sopenharmony_ci#!/bin/sh
28c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ciif [ $(id -u) != 0 ]; then
58c2ecf20Sopenharmony_ci	echo $msg must be run as root >&2
68c2ecf20Sopenharmony_ci	exit 0
78c2ecf20Sopenharmony_cifi
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ciret=0
108c2ecf20Sopenharmony_ciecho "--------------------"
118c2ecf20Sopenharmony_ciecho "running psock_fanout test"
128c2ecf20Sopenharmony_ciecho "--------------------"
138c2ecf20Sopenharmony_ci./in_netns.sh ./psock_fanout
148c2ecf20Sopenharmony_ciif [ $? -ne 0 ]; then
158c2ecf20Sopenharmony_ci	echo "[FAIL]"
168c2ecf20Sopenharmony_ci	ret=1
178c2ecf20Sopenharmony_cielse
188c2ecf20Sopenharmony_ci	echo "[PASS]"
198c2ecf20Sopenharmony_cifi
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ciecho "--------------------"
228c2ecf20Sopenharmony_ciecho "running psock_tpacket test"
238c2ecf20Sopenharmony_ciecho "--------------------"
248c2ecf20Sopenharmony_ciif [ -f /proc/kallsyms ]; then
258c2ecf20Sopenharmony_ci	./in_netns.sh ./psock_tpacket
268c2ecf20Sopenharmony_ci	if [ $? -ne 0 ]; then
278c2ecf20Sopenharmony_ci		echo "[FAIL]"
288c2ecf20Sopenharmony_ci		ret=1
298c2ecf20Sopenharmony_ci	else
308c2ecf20Sopenharmony_ci		echo "[PASS]"
318c2ecf20Sopenharmony_ci	fi
328c2ecf20Sopenharmony_cielse
338c2ecf20Sopenharmony_ci	echo "[SKIP] CONFIG_KALLSYMS not enabled"
348c2ecf20Sopenharmony_cifi
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ciecho "--------------------"
378c2ecf20Sopenharmony_ciecho "running txring_overwrite test"
388c2ecf20Sopenharmony_ciecho "--------------------"
398c2ecf20Sopenharmony_ci./in_netns.sh ./txring_overwrite
408c2ecf20Sopenharmony_ciif [ $? -ne 0 ]; then
418c2ecf20Sopenharmony_ci	echo "[FAIL]"
428c2ecf20Sopenharmony_ci	ret=1
438c2ecf20Sopenharmony_cielse
448c2ecf20Sopenharmony_ci	echo "[PASS]"
458c2ecf20Sopenharmony_cifi
468c2ecf20Sopenharmony_ciexit $ret
47