netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] selftests/bonding: add a test for bonding lladdr target
@ 2022-09-15  9:42 Hangbin Liu
  2022-09-15 14:09 ` Jonathan Toppins
  0 siblings, 1 reply; 4+ messages in thread
From: Hangbin Liu @ 2022-09-15  9:42 UTC (permalink / raw)
  To: netdev
  Cc: Jay Vosburgh, David S . Miller, Jakub Kicinski, Jonathan Toppins,
	Paolo Abeni, David Ahern, Hangbin Liu

This is a regression test for commit 592335a4164c ("bonding: accept
unsolicited NA message") and commit b7f14132bf58 ("bonding: use unspecified
address if no available link local address"). When the bond interface
up and no available link local address, unspecified address(::) is used to
send the NS message. The unsolicited NA message should also be accepted
for validation.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 .../selftests/drivers/net/bonding/Makefile    |  1 +
 .../drivers/net/bonding/bond-lladdr-target.sh | 65 +++++++++++++++++++
 2 files changed, 66 insertions(+)
 create mode 100755 tools/testing/selftests/drivers/net/bonding/bond-lladdr-target.sh

diff --git a/tools/testing/selftests/drivers/net/bonding/Makefile b/tools/testing/selftests/drivers/net/bonding/Makefile
index ab6c54b12098..d209f7a98b6c 100644
--- a/tools/testing/selftests/drivers/net/bonding/Makefile
+++ b/tools/testing/selftests/drivers/net/bonding/Makefile
@@ -2,5 +2,6 @@
 # Makefile for net selftests
 
 TEST_PROGS := bond-break-lacpdu-tx.sh
+TEST_PROGS += bond-lladdr-target.sh
 
 include ../../../lib.mk
diff --git a/tools/testing/selftests/drivers/net/bonding/bond-lladdr-target.sh b/tools/testing/selftests/drivers/net/bonding/bond-lladdr-target.sh
new file mode 100755
index 000000000000..89af402fabbe
--- /dev/null
+++ b/tools/testing/selftests/drivers/net/bonding/bond-lladdr-target.sh
@@ -0,0 +1,65 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+
+# Regression Test:
+#   Verify bond interface could up when set IPv6 link local address target.
+#
+#  +----------------+
+#  |      br0       |
+#  |       |        |    sw
+#  | veth0   veth1  |
+#  +---+-------+----+
+#      |       |
+#  +---+-------+----+
+#  | veth0   veth1  |
+#  |       |        |    host
+#  |     bond0      |
+#  +----------------+
+#
+# We use veths instead of physical interfaces
+sw="sw-$(mktemp -u XXXXXX)"
+host="ns-$(mktemp -u XXXXXX)"
+
+cleanup()
+{
+	ip netns del $sw
+	ip netns del $host
+}
+
+trap cleanup 0 1 2
+
+ip netns add $sw
+ip netns add $host
+
+ip -n $host link add veth0 type veth peer name veth0 netns $sw
+ip -n $host link add veth1 type veth peer name veth1 netns $sw
+
+ip -n $sw link add br0 type bridge
+ip -n $sw link set br0 up
+sw_lladdr=$(ip -n $sw addr show br0 | awk '/fe80/{print $2}' | cut -d'/' -f1)
+# sleep some time to make sure bridge lladdr pass DAD
+sleep 2
+
+ip -n $host link add bond0 type bond mode 1 ns_ip6_target ${sw_lladdr} \
+	arp_validate 3 arp_interval 1000
+# add a lladdr for bond to make sure there is a route to target
+ip -n $host addr add fe80::beef/64 dev bond0
+ip -n $host link set bond0 up
+ip -n $host link set veth0 master bond0
+ip -n $host link set veth1 master bond0
+
+ip -n $sw link set veth0 master br0
+ip -n $sw link set veth1 master br0
+ip -n $sw link set veth0 up
+ip -n $sw link set veth1 up
+
+sleep 5
+
+rc=0
+if ip -n $host link show bond0 | grep -q LOWER_UP; then
+	echo "PASS"
+else
+	echo "FAIL"
+	rc=1
+fi
+exit $rc
-- 
2.37.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] selftests/bonding: add a test for bonding lladdr target
  2022-09-15  9:42 [PATCH net] selftests/bonding: add a test for bonding lladdr target Hangbin Liu
@ 2022-09-15 14:09 ` Jonathan Toppins
  2022-09-16  1:39   ` Hangbin Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Toppins @ 2022-09-15 14:09 UTC (permalink / raw)
  To: Hangbin Liu, netdev
  Cc: Jay Vosburgh, David S . Miller, Jakub Kicinski, Paolo Abeni, David Ahern

On 9/15/22 05:42, Hangbin Liu wrote:
> This is a regression test for commit 592335a4164c ("bonding: accept
> unsolicited NA message") and commit b7f14132bf58 ("bonding: use unspecified
> address if no available link local address"). When the bond interface
> up and no available link local address, unspecified address(::) is used to
> send the NS message. The unsolicited NA message should also be accepted
> for validation.
> 
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Acked-by: Jonathan Toppins <jtoppins@redhat.com>

> ---
>   .../selftests/drivers/net/bonding/Makefile    |  1 +
>   .../drivers/net/bonding/bond-lladdr-target.sh | 65 +++++++++++++++++++
>   2 files changed, 66 insertions(+)
>   create mode 100755 tools/testing/selftests/drivers/net/bonding/bond-lladdr-target.sh
> 
> diff --git a/tools/testing/selftests/drivers/net/bonding/Makefile b/tools/testing/selftests/drivers/net/bonding/Makefile
> index ab6c54b12098..d209f7a98b6c 100644
> --- a/tools/testing/selftests/drivers/net/bonding/Makefile
> +++ b/tools/testing/selftests/drivers/net/bonding/Makefile
> @@ -2,5 +2,6 @@
>   # Makefile for net selftests
>   
>   TEST_PROGS := bond-break-lacpdu-tx.sh
> +TEST_PROGS += bond-lladdr-target.sh
>   
>   include ../../../lib.mk
> diff --git a/tools/testing/selftests/drivers/net/bonding/bond-lladdr-target.sh b/tools/testing/selftests/drivers/net/bonding/bond-lladdr-target.sh
> new file mode 100755
> index 000000000000..89af402fabbe
> --- /dev/null
> +++ b/tools/testing/selftests/drivers/net/bonding/bond-lladdr-target.sh
> @@ -0,0 +1,65 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +
> +# Regression Test:
> +#   Verify bond interface could up when set IPv6 link local address target.
> +#
> +#  +----------------+
> +#  |      br0       |
> +#  |       |        |    sw
> +#  | veth0   veth1  |
> +#  +---+-------+----+
> +#      |       |
> +#  +---+-------+----+
> +#  | veth0   veth1  |
> +#  |       |        |    host
> +#  |     bond0      |
> +#  +----------------+
> +#
> +# We use veths instead of physical interfaces
> +sw="sw-$(mktemp -u XXXXXX)"
> +host="ns-$(mktemp -u XXXXXX)"
> +
> +cleanup()
> +{
> +	ip netns del $sw
> +	ip netns del $host
> +}
> +
> +trap cleanup 0 1 2
> +
> +ip netns add $sw
> +ip netns add $host
> +
> +ip -n $host link add veth0 type veth peer name veth0 netns $sw
> +ip -n $host link add veth1 type veth peer name veth1 netns $sw
> +
> +ip -n $sw link add br0 type bridge
> +ip -n $sw link set br0 up
> +sw_lladdr=$(ip -n $sw addr show br0 | awk '/fe80/{print $2}' | cut -d'/' -f1)
> +# sleep some time to make sure bridge lladdr pass DAD
> +sleep 2
> +
> +ip -n $host link add bond0 type bond mode 1 ns_ip6_target ${sw_lladdr} \
> +	arp_validate 3 arp_interval 1000
> +# add a lladdr for bond to make sure there is a route to target
> +ip -n $host addr add fe80::beef/64 dev bond0
> +ip -n $host link set bond0 up
> +ip -n $host link set veth0 master bond0
> +ip -n $host link set veth1 master bond0
> +
> +ip -n $sw link set veth0 master br0
> +ip -n $sw link set veth1 master br0
> +ip -n $sw link set veth0 up
> +ip -n $sw link set veth1 up
> +
> +sleep 5
> +
> +rc=0
> +if ip -n $host link show bond0 | grep -q LOWER_UP; then
> +	echo "PASS"
> +else
> +	echo "FAIL"
> +	rc=1
> +fi
> +exit $rc


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] selftests/bonding: add a test for bonding lladdr target
  2022-09-15 14:09 ` Jonathan Toppins
@ 2022-09-16  1:39   ` Hangbin Liu
  2022-09-20 15:55     ` Jakub Kicinski
  0 siblings, 1 reply; 4+ messages in thread
From: Hangbin Liu @ 2022-09-16  1:39 UTC (permalink / raw)
  To: netdev
  Cc: Jay Vosburgh, David S . Miller, Jakub Kicinski, Paolo Abeni,
	David Ahern, Jonathan Toppins

On Thu, Sep 15, 2022 at 10:09:05AM -0400, Jonathan Toppins wrote:
> On 9/15/22 05:42, Hangbin Liu wrote:
> > This is a regression test for commit 592335a4164c ("bonding: accept
> > unsolicited NA message") and commit b7f14132bf58 ("bonding: use unspecified
> > address if no available link local address"). When the bond interface
> > up and no available link local address, unspecified address(::) is used to
> > send the NS message. The unsolicited NA message should also be accepted
> > for validation.
> > 
> > Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> Acked-by: Jonathan Toppins <jtoppins@redhat.com>

Hi David, Jakub, Paolo,

I saw the patch checking failed[1] as there is no fixes tag.

I post the patch to net tree as the testing commits are in net tree. I'm
not sure if this patch should go net-next? Any suggestion?

[1] https://patchwork.kernel.org/project/netdevbpf/patch/20220915094202.335636-1-liuhangbin@gmail.com/

Thanks
Hangbin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] selftests/bonding: add a test for bonding lladdr target
  2022-09-16  1:39   ` Hangbin Liu
@ 2022-09-20 15:55     ` Jakub Kicinski
  0 siblings, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2022-09-20 15:55 UTC (permalink / raw)
  To: Hangbin Liu
  Cc: netdev, Jay Vosburgh, David S . Miller, Paolo Abeni, David Ahern,
	Jonathan Toppins

On Fri, 16 Sep 2022 09:39:09 +0800 Hangbin Liu wrote:
> Hi David, Jakub, Paolo,
> 
> I saw the patch checking failed[1] as there is no fixes tag.
> 
> I post the patch to net tree as the testing commits are in net tree. I'm
> not sure if this patch should go net-next? Any suggestion?

Sorry about the delay in responding. There are corner cases the
patchwork check does not take into account so feel free to ignore
it unless maintainers bring it up as well.

For selftest I don't feel like we have enough experience deciding
so either net or net-next is fine by me. Since the new patch targets
net-next I'll take that one :)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-09-20 15:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-15  9:42 [PATCH net] selftests/bonding: add a test for bonding lladdr target Hangbin Liu
2022-09-15 14:09 ` Jonathan Toppins
2022-09-16  1:39   ` Hangbin Liu
2022-09-20 15:55     ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).