Lines Matching +full:local +full:- +full:pid
2 # SPDX-License-Identifier: GPL-2.0
7 # Kselftest framework requirement - SKIP code is 4.
10 # all tests in this script. Can be overridden with -t option
16 IP="ip -netns ns1"
19 PID=
23 local rc=$1
24 local expected=$2
25 local msg="$3"
27 if [ ${rc} -eq ${expected} ]; then
28 printf " TEST: %-60s [ OK ]\n" "${msg}"
33 printf " TEST: %-60s [FAIL]\n" "${msg}"
52 set -e
69 rm -rf $TMPFILE
70 [ -n "$PID" ] && kill $PID
78 local dev=$1
79 local ns=$2
80 local addr
82 [ -n "$ns" ] && ns="-netns $ns"
84 addr=$(ip -6 -br $ns addr show dev ${dev} | \
94 [ -z "$addr" ] && return 1
103 local a1=$1
104 local a2=$2
105 local mode
107 [[ $a1 =~ ^[0-9.]*$ ]] && mode=gre || mode=ip6gre
109 ip tunnel add gre1 mode $mode local $a1 remote $a2 dev veth0
111 $IP tunnel add gre1 mode $mode local $a2 remote $a1 dev veth0
117 local name=$1
118 local addr=$2
119 local proto=$3
123 $NS_EXEC socat - tcp${proto}-listen:$port,reuseaddr,fork >/dev/null &
124 PID=$!
125 while ! $NS_EXEC ss -ltn | grep -q $port; do ((i++)); sleep 0.01; done
127 cat $TMPFILE | timeout 1 socat -u STDIN TCP:$addr:$port
128 log_test $? 0 "$name - copy file w/ TSO"
130 ethtool -K veth0 tso off
132 cat $TMPFILE | timeout 1 socat -u STDIN TCP:$addr:$port
133 log_test $? 0 "$name - copy file w/ GSO"
135 ethtool -K veth0 tso on
137 kill $PID
138 PID=
143 local port=7777
155 ip -6 addr add 2001:db8:1::1/64 dev gre1 nodad
156 $IP -6 addr add 2001:db8:1::2/64 dev gre1 nodad
179 -t <test> Test(s) to run (default: all)
181 -p Pause on fail
182 -P Pause after each test before cleanup
183 -v verbose mode (show commands and output)
207 if [ "$(id -u)" -ne 0 ];then
212 if [ ! -x "$(command -v ip)" ]; then
217 if [ ! -x "$(command -v socat)" ]; then