Skip to content

Commit b84c2fa

Browse files
liuhangbindavem330
authored andcommitted
selftests/net: convert gre_gso.sh to run it in unique namespace
Here is the test result after conversion. # ./gre_gso.sh TEST: GREv6/v4 - copy file w/ TSO [ OK ] TEST: GREv6/v4 - copy file w/ GSO [ OK ] TEST: GREv6/v6 - copy file w/ TSO [ OK ] TEST: GREv6/v6 - copy file w/ GSO [ OK ] Tests passed: 4 Tests failed: 0 Acked-by: David Ahern <[email protected]> Signed-off-by: Hangbin Liu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6530b29 commit b84c2fa

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

tools/testing/selftests/net/gre_gso.sh

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,15 @@
22
# SPDX-License-Identifier: GPL-2.0
33

44
# This test is for checking GRE GSO.
5-
5+
source lib.sh
66
ret=0
7-
# Kselftest framework requirement - SKIP code is 4.
8-
ksft_skip=4
97

108
# all tests in this script. Can be overridden with -t option
119
TESTS="gre_gso"
1210

1311
VERBOSE=0
1412
PAUSE_ON_FAIL=no
1513
PAUSE=no
16-
IP="ip -netns ns1"
17-
NS_EXEC="ip netns exec ns1"
1814
TMPFILE=`mktemp`
1915
PID=
2016

@@ -50,13 +46,13 @@ log_test()
5046
setup()
5147
{
5248
set -e
53-
ip netns add ns1
54-
ip netns set ns1 auto
55-
$IP link set dev lo up
49+
setup_ns ns1
50+
IP="ip -netns $ns1"
51+
NS_EXEC="ip netns exec $ns1"
5652

5753
ip link add veth0 type veth peer name veth1
5854
ip link set veth0 up
59-
ip link set veth1 netns ns1
55+
ip link set veth1 netns $ns1
6056
$IP link set veth1 name veth0
6157
$IP link set veth0 up
6258

@@ -70,7 +66,7 @@ cleanup()
7066
[ -n "$PID" ] && kill $PID
7167
ip link del dev gre1 &> /dev/null
7268
ip link del dev veth0 &> /dev/null
73-
ip netns del ns1
69+
cleanup_ns $ns1
7470
}
7571

7672
get_linklocal()
@@ -145,7 +141,7 @@ gre6_gso_test()
145141
setup
146142

147143
a1=$(get_linklocal veth0)
148-
a2=$(get_linklocal veth0 ns1)
144+
a2=$(get_linklocal veth0 $ns1)
149145

150146
gre_create_tun $a1 $a2
151147

0 commit comments

Comments
 (0)