diff mbox series

selftests: hsr: Extend the hsr_redbox.sh test to use fixed MAC addresses

Message ID 20240529142232.2625747-2-lukma@denx.de (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series selftests: hsr: Extend the hsr_redbox.sh test to use fixed MAC addresses | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/build_tools success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success net selftest script(s) already in Makefile
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 21 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-05-30--06-00 (tests: 1042)

Commit Message

Lukasz Majewski May 29, 2024, 2:22 p.m. UTC
Fixed MAC addresses help with debugging as last four bytes identify the
network namespace.

Moreover, it allows to mimic the real life setup with for example bridge
having the same MAC address on each port.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
 tools/testing/selftests/net/hsr/hsr_redbox.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

Comments

Hangbin Liu May 30, 2024, 1:34 a.m. UTC | #1
On Wed, May 29, 2024 at 04:22:32PM +0200, Lukasz Majewski wrote:
> Fixed MAC addresses help with debugging as last four bytes identify the
> network namespace.
> 
> Moreover, it allows to mimic the real life setup with for example bridge
> having the same MAC address on each port.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
>  tools/testing/selftests/net/hsr/hsr_redbox.sh | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/tools/testing/selftests/net/hsr/hsr_redbox.sh b/tools/testing/selftests/net/hsr/hsr_redbox.sh
> index 1f36785347c0..998103502d5d 100755
> --- a/tools/testing/selftests/net/hsr/hsr_redbox.sh
> +++ b/tools/testing/selftests/net/hsr/hsr_redbox.sh
> @@ -96,6 +96,21 @@ setup_hsr_interfaces()
>  	ip -n "${ns4}" link set ns4eth1 up
>  	ip -n "${ns5}" link set ns5eth1 up
>  
> +	ip -net "$ns1" link set address 00:11:22:00:01:01 dev ns1eth1
> +	ip -net "$ns1" link set address 00:11:22:00:01:02 dev ns1eth2
> +
> +	ip -net "$ns2" link set address 00:11:22:00:02:01 dev ns2eth1
> +	ip -net "$ns2" link set address 00:11:22:00:02:02 dev ns2eth2
> +	ip -net "$ns2" link set address 00:11:22:00:02:03 dev ns2eth3
> +
> +	ip -net "$ns3" link set address 00:11:22:00:03:11 dev ns3eth1
> +	ip -net "$ns3" link set address 00:11:22:00:03:11 dev ns3eth2
> +	ip -net "$ns3" link set address 00:11:22:00:03:11 dev ns3eth3
> +	ip -net "$ns3" link set address 00:11:22:00:03:11 dev ns3br1

The ns3's mac addresses are same, is it a copy-paste error?

BTW, please add the target tree for the patch, e.g.

[PATCH net-next]

Thanks
Hangbin
Lukasz Majewski June 3, 2024, 7:03 a.m. UTC | #2
Hi Hangbin,

> On Wed, May 29, 2024 at 04:22:32PM +0200, Lukasz Majewski wrote:
> > Fixed MAC addresses help with debugging as last four bytes identify
> > the network namespace.
> > 
> > Moreover, it allows to mimic the real life setup with for example
> > bridge having the same MAC address on each port.
> > 
> > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > ---
> >  tools/testing/selftests/net/hsr/hsr_redbox.sh | 15 +++++++++++++++
> >  1 file changed, 15 insertions(+)
> > 
> > diff --git a/tools/testing/selftests/net/hsr/hsr_redbox.sh
> > b/tools/testing/selftests/net/hsr/hsr_redbox.sh index
> > 1f36785347c0..998103502d5d 100755 ---
> > a/tools/testing/selftests/net/hsr/hsr_redbox.sh +++
> > b/tools/testing/selftests/net/hsr/hsr_redbox.sh @@ -96,6 +96,21 @@
> > setup_hsr_interfaces() ip -n "${ns4}" link set ns4eth1 up
> >  	ip -n "${ns5}" link set ns5eth1 up
> >  
> > +	ip -net "$ns1" link set address 00:11:22:00:01:01 dev
> > ns1eth1
> > +	ip -net "$ns1" link set address 00:11:22:00:01:02 dev
> > ns1eth2 +
> > +	ip -net "$ns2" link set address 00:11:22:00:02:01 dev
> > ns2eth1
> > +	ip -net "$ns2" link set address 00:11:22:00:02:02 dev
> > ns2eth2
> > +	ip -net "$ns2" link set address 00:11:22:00:02:03 dev
> > ns2eth3 +
> > +	ip -net "$ns3" link set address 00:11:22:00:03:11 dev
> > ns3eth1
> > +	ip -net "$ns3" link set address 00:11:22:00:03:11 dev
> > ns3eth2
> > +	ip -net "$ns3" link set address 00:11:22:00:03:11 dev
> > ns3eth3
> > +	ip -net "$ns3" link set address 00:11:22:00:03:11 dev
> > ns3br1  
> 
> The ns3's mac addresses are same, is it a copy-paste error?
> 

No, it is to mimic the switch behaviour.

> BTW, please add the target tree for the patch, e.g.
> 
> [PATCH net-next]

Ok.

> 
> Thanks
> Hangbin




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
Hangbin Liu June 3, 2024, 9:32 a.m. UTC | #3
On Wed, May 29, 2024 at 04:22:32PM +0200, Lukasz Majewski wrote:
> Fixed MAC addresses help with debugging as last four bytes identify the
> network namespace.
> 
> Moreover, it allows to mimic the real life setup with for example bridge
> having the same MAC address on each port.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
>  tools/testing/selftests/net/hsr/hsr_redbox.sh | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/tools/testing/selftests/net/hsr/hsr_redbox.sh b/tools/testing/selftests/net/hsr/hsr_redbox.sh
> index 1f36785347c0..998103502d5d 100755
> --- a/tools/testing/selftests/net/hsr/hsr_redbox.sh
> +++ b/tools/testing/selftests/net/hsr/hsr_redbox.sh
> @@ -96,6 +96,21 @@ setup_hsr_interfaces()
>  	ip -n "${ns4}" link set ns4eth1 up
>  	ip -n "${ns5}" link set ns5eth1 up
>  
> +	ip -net "$ns1" link set address 00:11:22:00:01:01 dev ns1eth1
> +	ip -net "$ns1" link set address 00:11:22:00:01:02 dev ns1eth2
> +
> +	ip -net "$ns2" link set address 00:11:22:00:02:01 dev ns2eth1
> +	ip -net "$ns2" link set address 00:11:22:00:02:02 dev ns2eth2
> +	ip -net "$ns2" link set address 00:11:22:00:02:03 dev ns2eth3
> +
> +	ip -net "$ns3" link set address 00:11:22:00:03:11 dev ns3eth1
> +	ip -net "$ns3" link set address 00:11:22:00:03:11 dev ns3eth2
> +	ip -net "$ns3" link set address 00:11:22:00:03:11 dev ns3eth3
> +	ip -net "$ns3" link set address 00:11:22:00:03:11 dev ns3br1
> +
> +	ip -net "$ns4" link set address 00:11:22:00:04:01 dev ns4eth1
> +	ip -net "$ns5" link set address 00:11:22:00:05:01 dev ns5eth1
> +
>  	ip -net "${ns1}" link add name hsr1 type hsr slave1 ns1eth1 slave2 ns1eth2 supervision 45 version ${HSRv} proto 0
>  	ip -net "${ns2}" link add name hsr2 type hsr slave1 ns2eth1 slave2 ns2eth2 interlink ns2eth3 supervision 45 version ${HSRv} proto 0
>  
> -- 
> 2.20.1
> 

Tested-by: Hangbin Liu <liuhangbin@gmail.com>
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/hsr/hsr_redbox.sh b/tools/testing/selftests/net/hsr/hsr_redbox.sh
index 1f36785347c0..998103502d5d 100755
--- a/tools/testing/selftests/net/hsr/hsr_redbox.sh
+++ b/tools/testing/selftests/net/hsr/hsr_redbox.sh
@@ -96,6 +96,21 @@  setup_hsr_interfaces()
 	ip -n "${ns4}" link set ns4eth1 up
 	ip -n "${ns5}" link set ns5eth1 up
 
+	ip -net "$ns1" link set address 00:11:22:00:01:01 dev ns1eth1
+	ip -net "$ns1" link set address 00:11:22:00:01:02 dev ns1eth2
+
+	ip -net "$ns2" link set address 00:11:22:00:02:01 dev ns2eth1
+	ip -net "$ns2" link set address 00:11:22:00:02:02 dev ns2eth2
+	ip -net "$ns2" link set address 00:11:22:00:02:03 dev ns2eth3
+
+	ip -net "$ns3" link set address 00:11:22:00:03:11 dev ns3eth1
+	ip -net "$ns3" link set address 00:11:22:00:03:11 dev ns3eth2
+	ip -net "$ns3" link set address 00:11:22:00:03:11 dev ns3eth3
+	ip -net "$ns3" link set address 00:11:22:00:03:11 dev ns3br1
+
+	ip -net "$ns4" link set address 00:11:22:00:04:01 dev ns4eth1
+	ip -net "$ns5" link set address 00:11:22:00:05:01 dev ns5eth1
+
 	ip -net "${ns1}" link add name hsr1 type hsr slave1 ns1eth1 slave2 ns1eth2 supervision 45 version ${HSRv} proto 0
 	ip -net "${ns2}" link add name hsr2 type hsr slave1 ns2eth1 slave2 ns2eth2 interlink ns2eth3 supervision 45 version ${HSRv} proto 0