* [LTP] [PATCH 0/6] network: new tests for mpls over gre, gre6 and sit
@ 2018-10-29 13:03 Alexey Kodanev
2018-10-29 13:03 ` [LTP] [PATCH 1/6] network/virt: add support for sit tunnel Alexey Kodanev
` (6 more replies)
0 siblings, 7 replies; 15+ messages in thread
From: Alexey Kodanev @ 2018-10-29 13:03 UTC (permalink / raw)
To: ltp
Before using sit tunnels with MPLS, add stand-alone sit01 test.
It is done by the first two patches.
The rest of the patches add various MPLS tests:
* mpls01: functional test, creates/removes MPLS routes,
checks sysctl parameters.
* mpls02: MPLS over the default test network configuration
* mpls03/mpls04: MPLS over GRE and SIT.
Alexey Kodanev (6):
network/virt: add support for sit tunnel
network/sit01: new test for sit tunnel
network/mpls01: new test for mpls labels
network/mpls02: new test with lwtunnel
network/mpls03: add MPLS over GRE and GREv6
network/mpls04: new test with mpls over sit tunnel
runtest/net.features | 10 ++++
testcases/network/mpls/Makefile | 10 ++++
testcases/network/mpls/mpls01.sh | 70 ++++++++++++++++++++++++
testcases/network/mpls/mpls02.sh | 53 ++++++++++++++++++
testcases/network/mpls/mpls03.sh | 24 ++++++++
testcases/network/mpls/mpls04.sh | 19 +++++++
testcases/network/mpls/mpls_lib.sh | 105 ++++++++++++++++++++++++++++++++++++
testcases/network/virt/sit01.sh | 23 ++++++++
testcases/network/virt/virt_lib.sh | 8 +++-
9 files changed, 321 insertions(+), 1 deletions(-)
create mode 100644 testcases/network/mpls/Makefile
create mode 100755 testcases/network/mpls/mpls01.sh
create mode 100755 testcases/network/mpls/mpls02.sh
create mode 100755 testcases/network/mpls/mpls03.sh
create mode 100755 testcases/network/mpls/mpls04.sh
create mode 100755 testcases/network/mpls/mpls_lib.sh
create mode 100755 testcases/network/virt/sit01.sh
^ permalink raw reply [flat|nested] 15+ messages in thread
* [LTP] [PATCH 1/6] network/virt: add support for sit tunnel
2018-10-29 13:03 [LTP] [PATCH 0/6] network: new tests for mpls over gre, gre6 and sit Alexey Kodanev
@ 2018-10-29 13:03 ` Alexey Kodanev
2018-10-29 13:03 ` [LTP] [PATCH 2/6] network/sit01: new test " Alexey Kodanev
` (5 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: Alexey Kodanev @ 2018-10-29 13:03 UTC (permalink / raw)
To: ltp
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
testcases/network/virt/virt_lib.sh | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/testcases/network/virt/virt_lib.sh b/testcases/network/virt/virt_lib.sh
index de3aba6..c9fe80c 100644
--- a/testcases/network/virt/virt_lib.sh
+++ b/testcases/network/virt/virt_lib.sh
@@ -116,10 +116,13 @@ virt_add()
[ -z "$opt" ] && \
opt="remote $(tst_ipaddr rhost) dev $(tst_iface)"
;;
+ sit)
+ [ -z "$opt" ] && opt="remote $(tst_ipaddr rhost) local $(tst_ipaddr)"
+ ;;
esac
case $virt_type in
- vxlan|geneve)
+ vxlan|geneve|sit)
ip li add $vname type $virt_type $opt
;;
gre|ip6gre)
@@ -140,6 +143,9 @@ virt_add_rhost()
[ "$vxlan_dstport" -eq 1 ] && opt="$opt dstport 0"
tst_rhost_run -s -c "ip li add ltp_v0 type $virt_type $@ $opt"
;;
+ sit)
+ tst_rhost_run -s -c "ip link add ltp_v0 type $virt_type $@"
+ ;;
gre|ip6gre)
tst_rhost_run -s -c "ip -f inet$TST_IPV6 tu add ltp_v0 \
mode $virt_type $@"
--
1.7.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [LTP] [PATCH 2/6] network/sit01: new test for sit tunnel
2018-10-29 13:03 [LTP] [PATCH 0/6] network: new tests for mpls over gre, gre6 and sit Alexey Kodanev
2018-10-29 13:03 ` [LTP] [PATCH 1/6] network/virt: add support for sit tunnel Alexey Kodanev
@ 2018-10-29 13:03 ` Alexey Kodanev
2018-10-29 13:03 ` [LTP] [PATCH 3/6] network/mpls01: new test for mpls labels Alexey Kodanev
` (4 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: Alexey Kodanev @ 2018-10-29 13:03 UTC (permalink / raw)
To: ltp
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
runtest/net.features | 2 ++
testcases/network/virt/sit01.sh | 23 +++++++++++++++++++++++
2 files changed, 25 insertions(+), 0 deletions(-)
create mode 100755 testcases/network/virt/sit01.sh
diff --git a/runtest/net.features b/runtest/net.features
index eac1b2b..de49e76 100644
--- a/runtest/net.features
+++ b/runtest/net.features
@@ -58,3 +58,5 @@ dctcp_ipv6_01 dctcp01.sh -6
geneve01 geneve01.sh
geneve01_ipv6 geneve01.sh -6
+
+sit01 sit01.sh
diff --git a/testcases/network/virt/sit01.sh b/testcases/network/virt/sit01.sh
new file mode 100755
index 0000000..4ecc1f8
--- /dev/null
+++ b/testcases/network/virt/sit01.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Oracle and/or its affiliates.
+
+TST_NEEDS_TMPDIR=1
+TST_TESTFUNC=virt_netperf_msg_sizes
+TST_SETUP=do_setup
+TST_CLEANUP=virt_cleanup
+virt_type="sit"
+. virt_lib.sh
+
+do_setup()
+{
+ [ -n "$TST_IPV6" ] && tst_res TBROK "invalid option '-6' for sit tunnel"
+
+ virt_lib_setup
+
+ tst_res TINFO "test $virt_type"
+ virt_setup "local $(tst_ipaddr) remote $(tst_ipaddr rhost)" \
+ "local $(tst_ipaddr rhost) remote $(tst_ipaddr)"
+}
+
+tst_run
--
1.7.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [LTP] [PATCH 3/6] network/mpls01: new test for mpls labels
2018-10-29 13:03 [LTP] [PATCH 0/6] network: new tests for mpls over gre, gre6 and sit Alexey Kodanev
2018-10-29 13:03 ` [LTP] [PATCH 1/6] network/virt: add support for sit tunnel Alexey Kodanev
2018-10-29 13:03 ` [LTP] [PATCH 2/6] network/sit01: new test " Alexey Kodanev
@ 2018-10-29 13:03 ` Alexey Kodanev
2018-10-29 13:03 ` [LTP] [PATCH 4/6] network/mpls02: new test with lwtunnel Alexey Kodanev
` (3 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: Alexey Kodanev @ 2018-10-29 13:03 UTC (permalink / raw)
To: ltp
Checks basic functionality (adds/deletes routes), related sysctl parameters.
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
runtest/net.features | 2 +
testcases/network/mpls/Makefile | 10 +++++
testcases/network/mpls/mpls01.sh | 70 ++++++++++++++++++++++++++++++++++++++
3 files changed, 82 insertions(+), 0 deletions(-)
create mode 100644 testcases/network/mpls/Makefile
create mode 100755 testcases/network/mpls/mpls01.sh
diff --git a/runtest/net.features b/runtest/net.features
index de49e76..f858421 100644
--- a/runtest/net.features
+++ b/runtest/net.features
@@ -60,3 +60,5 @@ geneve01 geneve01.sh
geneve01_ipv6 geneve01.sh -6
sit01 sit01.sh
+
+mpls01 mpls01.sh
diff --git a/testcases/network/mpls/Makefile b/testcases/network/mpls/Makefile
new file mode 100644
index 0000000..3a54269
--- /dev/null
+++ b/testcases/network/mpls/Makefile
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved.
+
+top_srcdir ?= ../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+INSTALL_TARGETS := *.sh
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/network/mpls/mpls01.sh b/testcases/network/mpls/mpls01.sh
new file mode 100755
index 0000000..c7788b5
--- /dev/null
+++ b/testcases/network/mpls/mpls01.sh
@@ -0,0 +1,70 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved.
+
+TST_SETUP="setup"
+TST_TESTFUNC="test"
+TST_CLEANUP="cleanup"
+TST_CNT=3
+TST_MIN_KVER="4.1"
+TST_NEEDS_TMPDIR=1
+TST_NEEDS_ROOT=1
+TST_NEEDS_DRIVERS="mpls_router"
+TST_NEEDS_CMDS="sysctl modprobe"
+
+. tst_net.sh
+
+cleanup()
+{
+ ip -f mpls route flush dev lo > /dev/null 2>&1
+ ip -f mpls route flush dev $(tst_iface) > /dev/null 2>&1
+}
+
+setup()
+{
+ ROD modprobe mpls_router
+}
+
+test1()
+{
+ ROD sysctl -q net.mpls.platform_labels=0xfffff
+ ROD ip -f mpls route add 0xffffe dev lo
+ ROD ip -f mpls route show \> /dev/null
+ ROD ip -f mpls route del 0xffffe dev lo
+ tst_res TPASS "added label 0xffffe to lo dev"
+}
+
+test2()
+{
+ ROD sysctl -q net.mpls.platform_labels=0xffffe
+ ip -f mpls route add 0xffffe dev lo > /dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ tst_res TFAIL "can add label that is >= platform_labels"
+ return
+ fi
+
+ tst_res TPASS "can't add label >= platform_lables"
+}
+
+test3()
+{
+ local start=16
+ local end=$((start + NS_TIMES))
+
+ ROD sysctl -q net.mpls.platform_labels=$((end + 1))
+ tst_res TINFO "creating mpls routes with labels from $start..$end"
+ for l in $(seq $start $end); do
+ ROD ip -f mpls route add $l dev $(tst_iface)
+ done
+
+ tst_res TINFO "listing created routes"
+ ROD ip -f mpls route show \> /dev/null
+
+ tst_res TINFO "removing the routes"
+ for l in $(seq $start $end); do
+ ROD ip -f mpls route del $l dev $(tst_iface)
+ done
+ tst_res TPASS "created and removed mpls routes"
+}
+
+tst_run
--
1.7.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [LTP] [PATCH 4/6] network/mpls02: new test with lwtunnel
2018-10-29 13:03 [LTP] [PATCH 0/6] network: new tests for mpls over gre, gre6 and sit Alexey Kodanev
` (2 preceding siblings ...)
2018-10-29 13:03 ` [LTP] [PATCH 3/6] network/mpls01: new test for mpls labels Alexey Kodanev
@ 2018-10-29 13:03 ` Alexey Kodanev
2018-11-02 20:02 ` Petr Vorel
2018-10-29 13:03 ` [LTP] [PATCH 5/6] network/mpls03: add MPLS over GRE and GREv6 Alexey Kodanev
` (2 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Alexey Kodanev @ 2018-10-29 13:03 UTC (permalink / raw)
To: ltp
Setup MPLS encapsulation over the default test network setup,
use ICMP, UDP and TCP inner protocols.
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
runtest/net.features | 2 +
testcases/network/mpls/mpls02.sh | 53 ++++++++++++++++++++++++++++++++++++
testcases/network/mpls/mpls_lib.sh | 46 +++++++++++++++++++++++++++++++
3 files changed, 101 insertions(+), 0 deletions(-)
create mode 100755 testcases/network/mpls/mpls02.sh
create mode 100755 testcases/network/mpls/mpls_lib.sh
diff --git a/runtest/net.features b/runtest/net.features
index f858421..29d5092 100644
--- a/runtest/net.features
+++ b/runtest/net.features
@@ -62,3 +62,5 @@ geneve01_ipv6 geneve01.sh -6
sit01 sit01.sh
mpls01 mpls01.sh
+mpls02 mpls02.sh
+mpls02_ipv6 mpls02.sh -6
diff --git a/testcases/network/mpls/mpls02.sh b/testcases/network/mpls/mpls02.sh
new file mode 100755
index 0000000..745a414
--- /dev/null
+++ b/testcases/network/mpls/mpls02.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved.
+
+TST_SETUP="setup"
+TST_TESTFUNC="do_test"
+TST_CLEANUP="cleanup"
+
+. mpls_lib.sh
+
+cleanup()
+{
+ ip route del $ip_rmt/$mask > /dev/null 2>&1
+ tst_rhost_run -c "ip route del $ip_loc/$mask" > /dev/null
+
+ [ -n "$ip_loc" ] && ip addr del $ip_loc/$mask dev lo > /dev/null 2>&1
+ [ -n "$ip_rmt" ] && tst_rhost_run -c "ip addr del $ip_rmt/$mask dev lo" > \
+ /dev/null 2>&1
+
+ mpls_cleanup
+}
+
+setup()
+{
+ mpls_setup 61
+
+ ip_loc=$(tst_ipaddr_un)
+ ip_rmt=$(tst_ipaddr_un rhost)
+ [ -n "$TST_IPV6" ] && mask=128 || mask=32
+
+ ROD ip addr add $ip_loc/$mask dev lo
+ ROD ip route add $ip_rmt/$mask encap mpls 50 via inet$TST_IPV6 $(tst_ipaddr rhost)
+ ROD ip -f mpls route add 60 dev lo
+
+ tst_rhost_run -s -c "ip addr add $ip_rmt/$mask dev lo"
+ tst_rhost_run -s -c "ip route add $ip_loc/$mask encap mpls 60 via inet$TST_IPV6 $(tst_ipaddr)"
+ tst_rhost_run -s -c "ip -f mpls route add 50 dev lo"
+}
+
+do_test()
+{
+ local type=$2
+ local max_size=10000
+
+ if [ "$type" = "icmp" ]; then
+ tst_ping $ip_loc $ip_rmt 10 100 1000 2000 $max_size
+ else
+ tst_netload -S $ip_loc -H $ip_rmt -T $type -n 10 -N 10
+ tst_netload -S $ip_loc -H $ip_rmt -T $type -A $max_size
+ fi
+}
+
+tst_run
diff --git a/testcases/network/mpls/mpls_lib.sh b/testcases/network/mpls/mpls_lib.sh
new file mode 100755
index 0000000..87aec5c
--- /dev/null
+++ b/testcases/network/mpls/mpls_lib.sh
@@ -0,0 +1,46 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved.
+
+TST_MIN_KVER="4.3"
+TST_NEEDS_TMPDIR=1
+TST_NEEDS_ROOT=1
+TST_NEEDS_DRIVERS="mpls_router mpls_iptunnel"
+TST_NEEDS_CMDS="sysctl modprobe"
+TST_TEST_DATA="icmp tcp udp"
+
+. tst_net.sh
+
+mpls_cleanup()
+{
+ local flush_dev="ip -f mpls route flush dev"
+
+ $flush_dev lo > /dev/null 2>&1
+ tst_rhost_run -c "$flush_dev lo" > /dev/null
+
+ [ -n $rpf_loc ] && sysctl -q net.ipv4.conf.all.rp_filter=$rpf_loc
+ [ -n $rpf_rmt ] && tst_rhost_run -s -c "sysctl -q net.ipv4.conf.all.rp_filter=$rpf_rmt"
+}
+
+mpls_setup()
+{
+ local label="$1"
+
+ ROD modprobe mpls_router
+ ROD modprobe mpls_iptunnel
+ ROD modprobe mpls_gso
+ ROD sysctl -q net.mpls.conf.$(tst_iface).input=1
+ ROD sysctl -q net.mpls.conf.lo.input=1
+ ROD sysctl -q net.mpls.platform_labels=$label
+ rpf_loc="$(sysctl -n net.ipv4.conf.all.rp_filter)"
+ ROD sysctl -q net.ipv4.conf.all.rp_filter=2
+
+ tst_rhost_run -s -c "modprobe mpls_router"
+ tst_rhost_run -s -c "modprobe mpls_iptunnel"
+ tst_rhost_run -s -c "modprobe mpls_gso"
+ tst_rhost_run -s -c "sysctl -q net.mpls.conf.$(tst_iface rhost).input=1"
+ tst_rhost_run -s -c "sysctl -q net.mpls.conf.lo.input=1"
+ tst_rhost_run -s -c "sysctl -q net.mpls.platform_labels=$label"
+ rpf_rmt="$(tst_rhost_run -c 'sysctl -n net.ipv4.conf.all.rp_filter')"
+ tst_rhost_run -s -c "sysctl -q net.ipv4.conf.all.rp_filter=2"
+}
--
1.7.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [LTP] [PATCH 5/6] network/mpls03: add MPLS over GRE and GREv6
2018-10-29 13:03 [LTP] [PATCH 0/6] network: new tests for mpls over gre, gre6 and sit Alexey Kodanev
` (3 preceding siblings ...)
2018-10-29 13:03 ` [LTP] [PATCH 4/6] network/mpls02: new test with lwtunnel Alexey Kodanev
@ 2018-10-29 13:03 ` Alexey Kodanev
2018-11-02 20:13 ` Petr Vorel
2018-10-29 13:03 ` [LTP] [PATCH 6/6] network/mpls04: new test with mpls over sit tunnel Alexey Kodanev
2018-11-02 20:15 ` [LTP] [PATCH 0/6] network: new tests for mpls over gre, gre6 and sit Petr Vorel
6 siblings, 1 reply; 15+ messages in thread
From: Alexey Kodanev @ 2018-10-29 13:03 UTC (permalink / raw)
To: ltp
Note, support for GREv6 was added in Linux 4.19.
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
runtest/net.features | 3 ++
testcases/network/mpls/mpls03.sh | 24 ++++++++++++++
testcases/network/mpls/mpls_lib.sh | 59 ++++++++++++++++++++++++++++++++++++
3 files changed, 86 insertions(+), 0 deletions(-)
create mode 100755 testcases/network/mpls/mpls03.sh
diff --git a/runtest/net.features b/runtest/net.features
index 29d5092..6076e2a 100644
--- a/runtest/net.features
+++ b/runtest/net.features
@@ -64,3 +64,6 @@ sit01 sit01.sh
mpls01 mpls01.sh
mpls02 mpls02.sh
mpls02_ipv6 mpls02.sh -6
+mpls03 mpls03.sh
+mpls03_ipv6 mpls03.sh -6
+
diff --git a/testcases/network/mpls/mpls03.sh b/testcases/network/mpls/mpls03.sh
new file mode 100755
index 0000000..0db6dbf
--- /dev/null
+++ b/testcases/network/mpls/mpls03.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved.
+
+TST_SETUP="setup"
+TST_TESTFUNC="mpls_virt_test"
+TST_CLEANUP="mpls_virt_cleanup"
+
+. virt_lib.sh
+. mpls_lib.sh
+
+setup()
+{
+ virt_type="gre"
+ if [ -n "$TST_IPV6" ]; then
+ tst_kvcmp -lt "4.19" && \
+ tst_brk TCONF "mpls + ip6gre requires kernel 4.19+"
+ virt_type="ip6gre"
+ fi
+
+ mpls_virt_setup
+}
+
+tst_run
diff --git a/testcases/network/mpls/mpls_lib.sh b/testcases/network/mpls/mpls_lib.sh
index 87aec5c..36c2335 100755
--- a/testcases/network/mpls/mpls_lib.sh
+++ b/testcases/network/mpls/mpls_lib.sh
@@ -22,6 +22,17 @@ mpls_cleanup()
[ -n $rpf_rmt ] && tst_rhost_run -s -c "sysctl -q net.ipv4.conf.all.rp_filter=$rpf_rmt"
}
+mpls_virt_cleanup()
+{
+ ip route del $ip_virt_remote/32 dev ltp_v0 > /dev/null 2>&1
+ ip route del $ip6_virt_remote/128 dev ltp_v0 > /dev/null 2>&1
+ tst_rhost_run -c "ip route del $ip_virt_local/32 dev ltp_v0" > /dev/null
+ tst_rhost_run -c "ip route del $ip6_virt_local/128 dev ltp_v0" > /dev/null
+
+ virt_cleanup
+ mpls_cleanup
+}
+
mpls_setup()
{
local label="$1"
@@ -44,3 +55,51 @@ mpls_setup()
rpf_rmt="$(tst_rhost_run -c 'sysctl -n net.ipv4.conf.all.rp_filter')"
tst_rhost_run -s -c "sysctl -q net.ipv4.conf.all.rp_filter=2"
}
+
+mpls_setup_tnl()
+{
+ local ip_loc="$1"
+ local ip_rmt="$2"
+ local label="$3"
+ local mask
+
+ echo "$ip_loc" | grep -q ':' && mask=128 || mask=32
+
+ ROD ip route add $ip_rmt/$mask encap mpls $label dev ltp_v0
+ ROD ip -f mpls route add $((label + 1)) dev lo
+
+ tst_rhost_run -s -c "ip route add $ip_loc/$mask encap mpls $((label + 1)) dev ltp_v0"
+ tst_rhost_run -s -c "ip -f mpls route add $label dev lo"
+}
+mpls_virt_setup()
+{
+ mpls_setup 62
+
+ virt_lib_setup
+
+ tst_res TINFO "test $virt_type with MPLS"
+ virt_setup "local $(tst_ipaddr) remote $(tst_ipaddr rhost) dev $(tst_iface)" \
+ "local $(tst_ipaddr rhost) remote $(tst_ipaddr) dev $(tst_iface rhost)"
+
+ mpls_setup_tnl $ip_virt_local $ip_virt_remote 60
+ mpls_setup_tnl $ip6_virt_local $ip6_virt_remote 50
+
+ ROD sysctl -q net.mpls.conf.ltp_v0.input=1
+ tst_rhost_run -s -c "sysctl -q net.mpls.conf.ltp_v0.input=1"
+}
+
+mpls_virt_test()
+{
+ local type=$2
+ local max_size=10000
+
+ if [ "$type" = "icmp" ]; then
+ tst_ping $ip_virt_local $ip_virt_remote 10 100 1000 2000 $max_size
+ tst_ping $ip6_virt_local $ip6_virt_remote 10 100 1000 2000 $max_size
+ else
+ tst_netload -S $ip_virt_local -H $ip_virt_remote -T $type -n 10 -N 10
+ tst_netload -S $ip6_virt_local -H $ip6_virt_remote -T $type -n 10 -N 10
+ tst_netload -S $ip_virt_local -H $ip_virt_remote -T $type -A $max_size
+ tst_netload -S $ip6_virt_local -H $ip6_virt_remote -T $type -A $max_size
+ fi
+}
--
1.7.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [LTP] [PATCH 6/6] network/mpls04: new test with mpls over sit tunnel
2018-10-29 13:03 [LTP] [PATCH 0/6] network: new tests for mpls over gre, gre6 and sit Alexey Kodanev
` (4 preceding siblings ...)
2018-10-29 13:03 ` [LTP] [PATCH 5/6] network/mpls03: add MPLS over GRE and GREv6 Alexey Kodanev
@ 2018-10-29 13:03 ` Alexey Kodanev
2018-11-02 20:15 ` [LTP] [PATCH 0/6] network: new tests for mpls over gre, gre6 and sit Petr Vorel
6 siblings, 0 replies; 15+ messages in thread
From: Alexey Kodanev @ 2018-10-29 13:03 UTC (permalink / raw)
To: ltp
The same as in mpls03 but with sit tunnel.
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
runtest/net.features | 1 +
testcases/network/mpls/mpls04.sh | 19 +++++++++++++++++++
2 files changed, 20 insertions(+), 0 deletions(-)
create mode 100755 testcases/network/mpls/mpls04.sh
diff --git a/runtest/net.features b/runtest/net.features
index 6076e2a..b37104b 100644
--- a/runtest/net.features
+++ b/runtest/net.features
@@ -66,4 +66,5 @@ mpls02 mpls02.sh
mpls02_ipv6 mpls02.sh -6
mpls03 mpls03.sh
mpls03_ipv6 mpls03.sh -6
+mpls04 mpls04.sh
diff --git a/testcases/network/mpls/mpls04.sh b/testcases/network/mpls/mpls04.sh
new file mode 100755
index 0000000..639a13e
--- /dev/null
+++ b/testcases/network/mpls/mpls04.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved.
+
+TST_SETUP="setup"
+TST_TESTFUNC="mpls_virt_test"
+TST_CLEANUP="mpls_virt_cleanup"
+
+. virt_lib.sh
+. mpls_lib.sh
+
+setup()
+{
+ virt_type="sit"
+
+ mpls_virt_setup
+}
+
+tst_run
--
1.7.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [LTP] [PATCH 4/6] network/mpls02: new test with lwtunnel
2018-10-29 13:03 ` [LTP] [PATCH 4/6] network/mpls02: new test with lwtunnel Alexey Kodanev
@ 2018-11-02 20:02 ` Petr Vorel
2018-11-06 15:30 ` Alexey Kodanev
0 siblings, 1 reply; 15+ messages in thread
From: Petr Vorel @ 2018-11-02 20:02 UTC (permalink / raw)
To: ltp
Hi,
> Setup MPLS encapsulation over the default test network setup,
> use ICMP, UDP and TCP inner protocols.
> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
> ---
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Just some minor things bellow.
> +TST_MIN_KVER="4.3"
> +TST_NEEDS_TMPDIR=1
> +TST_NEEDS_ROOT=1
> +TST_NEEDS_DRIVERS="mpls_router mpls_iptunnel"
Here is missing mpls_gso
...
> +mpls_setup()
> +{
> + local label="$1"
> +
> + ROD modprobe mpls_router
> + ROD modprobe mpls_iptunnel
> + ROD modprobe mpls_gso
Maybe just?
ROD modprobe mpls_gso $TST_NEEDS_DRIVERS
> + ROD sysctl -q net.mpls.conf.$(tst_iface).input=1
> + ROD sysctl -q net.mpls.conf.lo.input=1
This one can be set with tst_set_sysctl, as it's the same for both lhost and
rhost.
> + ROD sysctl -q net.mpls.platform_labels=$label
The same is for this one ...
> + rpf_loc="$(sysctl -n net.ipv4.conf.all.rp_filter)"
> + ROD sysctl -q net.ipv4.conf.all.rp_filter=2
... and this one.
> + tst_rhost_run -s -c "modprobe mpls_router"
> + tst_rhost_run -s -c "modprobe mpls_iptunnel"
> + tst_rhost_run -s -c "modprobe mpls_gso"
tst_rhost_run -s -c "modprobe $TST_NEEDS_DRIVERS"
> + tst_rhost_run -s -c "sysctl -q net.mpls.conf.$(tst_iface rhost).input=1"
> + tst_rhost_run -s -c "sysctl -q net.mpls.conf.lo.input=1"
> + tst_rhost_run -s -c "sysctl -q net.mpls.platform_labels=$label"
> + rpf_rmt="$(tst_rhost_run -c 'sysctl -n net.ipv4.conf.all.rp_filter')"
> + tst_rhost_run -s -c "sysctl -q net.ipv4.conf.all.rp_filter=2"
> +}
Kind regards,
Petr
^ permalink raw reply [flat|nested] 15+ messages in thread
* [LTP] [PATCH 5/6] network/mpls03: add MPLS over GRE and GREv6
2018-10-29 13:03 ` [LTP] [PATCH 5/6] network/mpls03: add MPLS over GRE and GREv6 Alexey Kodanev
@ 2018-11-02 20:13 ` Petr Vorel
0 siblings, 0 replies; 15+ messages in thread
From: Petr Vorel @ 2018-11-02 20:13 UTC (permalink / raw)
To: ltp
Hi Alexey,
> Note, support for GREv6 was added in Linux 4.19.
> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Acked-by: Petr Vorel <pvorel@suse.cz>
Just one more tst_set_sysctl:
> +mpls_virt_setup()
> +{
...
> + ROD sysctl -q net.mpls.conf.ltp_v0.input=1
> + tst_rhost_run -s -c "sysctl -q net.mpls.conf.ltp_v0.input=1"
tst_set_sysctl net.mpls.conf.ltp_v0.input 1 safe
Kind regards,
Petr
^ permalink raw reply [flat|nested] 15+ messages in thread
* [LTP] [PATCH 0/6] network: new tests for mpls over gre, gre6 and sit
2018-10-29 13:03 [LTP] [PATCH 0/6] network: new tests for mpls over gre, gre6 and sit Alexey Kodanev
` (5 preceding siblings ...)
2018-10-29 13:03 ` [LTP] [PATCH 6/6] network/mpls04: new test with mpls over sit tunnel Alexey Kodanev
@ 2018-11-02 20:15 ` Petr Vorel
2018-11-13 15:11 ` Alexey Kodanev
6 siblings, 1 reply; 15+ messages in thread
From: Petr Vorel @ 2018-11-02 20:15 UTC (permalink / raw)
To: ltp
Hi Alexey,
> Before using sit tunnels with MPLS, add stand-alone sit01 test.
> It is done by the first two patches.
> The rest of the patches add various MPLS tests:
> * mpls01: functional test, creates/removes MPLS routes,
> checks sysctl parameters.
> * mpls02: MPLS over the default test network configuration
> * mpls03/mpls04: MPLS over GRE and SIT.
> Alexey Kodanev (6):
> network/virt: add support for sit tunnel
> network/sit01: new test for sit tunnel
> network/mpls01: new test for mpls labels
> network/mpls02: new test with lwtunnel
> network/mpls03: add MPLS over GRE and GREv6
> network/mpls04: new test with mpls over sit tunnel
Thanks for patches, LGTM.
Acked-by: Petr Vorel <pvorel@suse.cz>
I've sent some minor issues to 4/6 and 5/6.
Kind regards,
Petr
^ permalink raw reply [flat|nested] 15+ messages in thread
* [LTP] [PATCH 4/6] network/mpls02: new test with lwtunnel
2018-11-02 20:02 ` Petr Vorel
@ 2018-11-06 15:30 ` Alexey Kodanev
2018-11-07 17:36 ` Petr Vorel
0 siblings, 1 reply; 15+ messages in thread
From: Alexey Kodanev @ 2018-11-06 15:30 UTC (permalink / raw)
To: ltp
Hi Petr,
On 11/02/2018 11:02 PM, Petr Vorel wrote:
> Hi,
>
>> Setup MPLS encapsulation over the default test network setup,
>> use ICMP, UDP and TCP inner protocols.
>
>> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
>> ---
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
> Just some minor things bellow.
>
>> +TST_MIN_KVER="4.3"
>> +TST_NEEDS_TMPDIR=1
>> +TST_NEEDS_ROOT=1
>> +TST_NEEDS_DRIVERS="mpls_router mpls_iptunnel"
> Here is missing mpls_gso
>
Right.
> ...
>> +mpls_setup()
>> +{
>> + local label="$1"
>> +
>> + ROD modprobe mpls_router
>> + ROD modprobe mpls_iptunnel
>> + ROD modprobe mpls_gso
> Maybe just?
> ROD modprobe mpls_gso $TST_NEEDS_DRIVERS
OK, and it will need the '-a' option.
>
>> + ROD sysctl -q net.mpls.conf.$(tst_iface).input=1
>> + ROD sysctl -q net.mpls.conf.lo.input=1
> This one can be set with tst_set_sysctl, as it's the same for both lhost and
> rhost.
>> + ROD sysctl -q net.mpls.platform_labels=$label
> The same is for this one ...
>> + rpf_loc="$(sysctl -n net.ipv4.conf.all.rp_filter)"
>> + ROD sysctl -q net.ipv4.conf.all.rp_filter=2
> ... and this one.
>
Indeed, I almost forgot that we have such a function helper in
the library, thanks!
>> + tst_rhost_run -s -c "modprobe mpls_router"
>> + tst_rhost_run -s -c "modprobe mpls_iptunnel"
>> + tst_rhost_run -s -c "modprobe mpls_gso"
> tst_rhost_run -s -c "modprobe $TST_NEEDS_DRIVERS"
>
>> + tst_rhost_run -s -c "sysctl -q net.mpls.conf.$(tst_iface rhost).input=1"
>> + tst_rhost_run -s -c "sysctl -q net.mpls.conf.lo.input=1"
>> + tst_rhost_run -s -c "sysctl -q net.mpls.platform_labels=$label"
>> + rpf_rmt="$(tst_rhost_run -c 'sysctl -n net.ipv4.conf.all.rp_filter')"
>> + tst_rhost_run -s -c "sysctl -q net.ipv4.conf.all.rp_filter=2"
>> +}
>
>
> Kind regards,
> Petr
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [LTP] [PATCH 4/6] network/mpls02: new test with lwtunnel
2018-11-06 15:30 ` Alexey Kodanev
@ 2018-11-07 17:36 ` Petr Vorel
2018-11-08 12:34 ` Alexey Kodanev
0 siblings, 1 reply; 15+ messages in thread
From: Petr Vorel @ 2018-11-07 17:36 UTC (permalink / raw)
To: ltp
Hi Alexey,
> >> + ROD modprobe mpls_router
> >> + ROD modprobe mpls_iptunnel
> >> + ROD modprobe mpls_gso
> > Maybe just?
> > ROD modprobe mpls_gso $TST_NEEDS_DRIVERS
> OK, and it will need the '-a' option.
I wonder if we want to have a simple helper in tst_net.sh for loading modules on
both sides, similar to tst_set_sysctl and tst_net_driver (from my pull request):
tst_net_driver()
{
ROD modprobe -a $@
tst_rhost_run -c "modprobe -a $@"
}
Kind regards,
Petr
^ permalink raw reply [flat|nested] 15+ messages in thread
* [LTP] [PATCH 4/6] network/mpls02: new test with lwtunnel
2018-11-07 17:36 ` Petr Vorel
@ 2018-11-08 12:34 ` Alexey Kodanev
2018-11-08 14:01 ` Petr Vorel
0 siblings, 1 reply; 15+ messages in thread
From: Alexey Kodanev @ 2018-11-08 12:34 UTC (permalink / raw)
To: ltp
Hi Petr,
On 11/07/2018 08:36 PM, Petr Vorel wrote:
> Hi Alexey,
>
>>>> + ROD modprobe mpls_router
>>>> + ROD modprobe mpls_iptunnel
>>>> + ROD modprobe mpls_gso
>>> Maybe just?
>>> ROD modprobe mpls_gso $TST_NEEDS_DRIVERS
>
>> OK, and it will need the '-a' option.
> I wonder if we want to have a simple helper in tst_net.sh for loading modules on
> both sides, similar to tst_set_sysctl and tst_net_driver (from my pull request):
>
> tst_net_driver()
> {
> ROD modprobe -a $@
> tst_rhost_run -c "modprobe -a $@"
> }
>
Sure or even more generic, for any commands?
^ permalink raw reply [flat|nested] 15+ messages in thread
* [LTP] [PATCH 4/6] network/mpls02: new test with lwtunnel
2018-11-08 12:34 ` Alexey Kodanev
@ 2018-11-08 14:01 ` Petr Vorel
0 siblings, 0 replies; 15+ messages in thread
From: Petr Vorel @ 2018-11-08 14:01 UTC (permalink / raw)
To: ltp
Hi Alexey,
> > I wonder if we want to have a simple helper in tst_net.sh for loading modules on
> > both sides, similar to tst_set_sysctl and tst_net_driver (from my pull request):
> > tst_net_driver()
> > {
> > ROD modprobe -a $@
> > tst_rhost_run -c "modprobe -a $@"
> > }
> Sure or even more generic, for any commands?
Added here:
https://patchwork.ozlabs.org/patch/994893/
Kind regards,
Petr
^ permalink raw reply [flat|nested] 15+ messages in thread
* [LTP] [PATCH 0/6] network: new tests for mpls over gre, gre6 and sit
2018-11-02 20:15 ` [LTP] [PATCH 0/6] network: new tests for mpls over gre, gre6 and sit Petr Vorel
@ 2018-11-13 15:11 ` Alexey Kodanev
0 siblings, 0 replies; 15+ messages in thread
From: Alexey Kodanev @ 2018-11-13 15:11 UTC (permalink / raw)
To: ltp
On 11/02/2018 11:15 PM, Petr Vorel wrote:
> Hi Alexey,
>
>> Before using sit tunnels with MPLS, add stand-alone sit01 test.
>> It is done by the first two patches.
>
>> The rest of the patches add various MPLS tests:
>> * mpls01: functional test, creates/removes MPLS routes,
>> checks sysctl parameters.
>> * mpls02: MPLS over the default test network configuration
>> * mpls03/mpls04: MPLS over GRE and SIT.
>
>> Alexey Kodanev (6):
>> network/virt: add support for sit tunnel
>> network/sit01: new test for sit tunnel
>> network/mpls01: new test for mpls labels
>> network/mpls02: new test with lwtunnel
>> network/mpls03: add MPLS over GRE and GREv6
>> network/mpls04: new test with mpls over sit tunnel
>
> Thanks for patches, LGTM.
> Acked-by: Petr Vorel <pvorel@suse.cz>
>
> I've sent some minor issues to 4/6 and 5/6.
>
All fixed, thanks for review Petr! Applied.
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2018-11-13 15:11 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-29 13:03 [LTP] [PATCH 0/6] network: new tests for mpls over gre, gre6 and sit Alexey Kodanev
2018-10-29 13:03 ` [LTP] [PATCH 1/6] network/virt: add support for sit tunnel Alexey Kodanev
2018-10-29 13:03 ` [LTP] [PATCH 2/6] network/sit01: new test " Alexey Kodanev
2018-10-29 13:03 ` [LTP] [PATCH 3/6] network/mpls01: new test for mpls labels Alexey Kodanev
2018-10-29 13:03 ` [LTP] [PATCH 4/6] network/mpls02: new test with lwtunnel Alexey Kodanev
2018-11-02 20:02 ` Petr Vorel
2018-11-06 15:30 ` Alexey Kodanev
2018-11-07 17:36 ` Petr Vorel
2018-11-08 12:34 ` Alexey Kodanev
2018-11-08 14:01 ` Petr Vorel
2018-10-29 13:03 ` [LTP] [PATCH 5/6] network/mpls03: add MPLS over GRE and GREv6 Alexey Kodanev
2018-11-02 20:13 ` Petr Vorel
2018-10-29 13:03 ` [LTP] [PATCH 6/6] network/mpls04: new test with mpls over sit tunnel Alexey Kodanev
2018-11-02 20:15 ` [LTP] [PATCH 0/6] network: new tests for mpls over gre, gre6 and sit Petr Vorel
2018-11-13 15:11 ` Alexey Kodanev
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.