Skip to contentSkip to conversation

Add TST_NET_IPV{4,6}_ONLY and use on broken_ip

PATCH New Petr Vorel 2 participants 14 messages Jul 14, 2021 – Aug 3, 2021

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

cover Add TST_NET_IPV{4,6}_ONLY and use on broken_ip

Hi Alexey,

https://github.com/linux-test-project/ltp/issues/843

does it make sense to run it on IPv4 and broken_ip-totlen on IPv6? Both don't break but not in runtest file.

Kind regards,
Petr

Petr Vorel (2):
tst_net.sh: Add variable for supported protocol
broken_ip: TCONF when test run on unsupported protocol

 testcases/lib/tst_net.sh                              | 8 ++++++++
 testcases/lib/tst_test.sh                             | 2 +-
 testcases/network/stress/broken_ip/broken_ip-checksum | 3 ++-
 testcases/network/stress/broken_ip/broken_ip-fragment | 3 ++-
 testcases/network/stress/broken_ip/broken_ip-ihl      | 3 ++-
 testcases/network/stress/broken_ip/broken_ip-nexthdr  | 3 ++-
 testcases/network/stress/broken_ip/broken_ip-protcol  | 3 ++-
 7 files changed, 19 insertions(+), 6 deletions(-)
Signature · 1 line
2.32.0
author
#1 lore raw

PATCH 1/2 tst_net.sh: Add variable for supported protocol

via TST_NET_IPV{4,6}_ONLY variables.

---
 testcases/lib/tst_net.sh  | 8 ++++++++
 testcases/lib/tst_test.sh | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)
testcases/lib/tst_net.sh +8 -0
index 511fb7eb1..b90fd9dfa 100644
@@ -59,6 +59,14 @@ tst_net_remote_tmpdir()
 
 tst_net_setup()
 {
+	if [ "$TST_NET_IPV4_ONLY" = 1 -a $TST_IPVER = 6 ]; then
+		tst_brk TCONF "Test must be run on IPv4 only"
+	fi
+
+	if [ "$TST_NET_IPV6_ONLY" = 1 -a $TST_IPVER = 4 ]; then
+		tst_brk TCONF "Test must be run on IPv6 only"
+	fi
+
 	tst_net_remote_tmpdir
 	[ -n "$TST_SETUP_CALLER" ] && $TST_SETUP_CALLER
 
testcases/lib/tst_test.sh +1 -1
index c6aa2c487..6e64ef0ff 100644
@@ -577,7 +577,7 @@ tst_run()
 			IPV6|IPV6_FLAG|IPVER|TEST_DATA|TEST_DATA_IFS);;
 			RETRY_FUNC|RETRY_FN_EXP_BACKOFF|TIMEOUT);;
 			NET_DATAROOT|NET_MAX_PKT|NET_RHOST_RUN_DEBUG|NETLOAD_CLN_NUMBER);;
-			NET_SKIP_VARIABLE_INIT);;
+			NET_IPV4_ONLY|NET_IPV6_ONLY|NET_SKIP_VARIABLE_INIT);;
 			*) tst_res TWARN "Reserved variable TST_$_tst_i used!";;
 			esac
 		done
Signature · 1 line
2.32.0
author
#2 lore raw

PATCH 2/2 broken_ip: TCONF when test run on unsupported protocol

In reply to Petr Vorel

net_stress.broken_ip runtest file is correct, but some users try to run tests manually.

Fixes #843
---
 testcases/network/stress/broken_ip/broken_ip-checksum | 3 ++-
 testcases/network/stress/broken_ip/broken_ip-fragment | 3 ++-
 testcases/network/stress/broken_ip/broken_ip-ihl      | 3 ++-
 testcases/network/stress/broken_ip/broken_ip-nexthdr  | 3 ++-
 testcases/network/stress/broken_ip/broken_ip-protcol  | 3 ++-
 5 files changed, 10 insertions(+), 5 deletions(-)
testcases/network/stress/broken_ip/broken_ip-checksum +2 -1
index 78f00ce98..707ffcb29 100644
@@ -1,11 +1,12 @@
 #!/bin/sh
 # SPDX-License-Identifier: GPL-2.0-or-later
-# Copyright (c) 2019 Petr Vorel <[email protected]>
+# Copyright (c) 2019-2021 Petr Vorel <[email protected]>
 # Copyright (c) 2014-2017 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2006
 # Author: Mitsuru Chinen <[email protected]>
 
 TST_TESTFUNC="do_test"
+TST_NET_IPV4_ONLY=1
 . tst_net.sh
 
 do_test()
testcases/network/stress/broken_ip/broken_ip-fragment +2 -1
index 1f5e5f713..7356bb523 100644
@@ -1,11 +1,12 @@
 #!/bin/sh
 # SPDX-License-Identifier: GPL-2.0-or-later
-# Copyright (c) 2019 Petr Vorel <[email protected]>
+# Copyright (c) 2019-2021 Petr Vorel <[email protected]>
 # Copyright (c) 2014-2017 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2006
 # Author: Mitsuru Chinen <[email protected]>
 
 TST_TESTFUNC="do_test"
+TST_NET_IPV4_ONLY=1
 . tst_net.sh
 
 do_test()
testcases/network/stress/broken_ip/broken_ip-ihl +2 -1
index 9f2a42568..e5e41ee8e 100644
@@ -1,11 +1,12 @@
 #!/bin/sh
 # SPDX-License-Identifier: GPL-2.0-or-later
-# Copyright (c) 2019 Petr Vorel <[email protected]>
+# Copyright (c) 2019-2021 Petr Vorel <[email protected]>
 # Copyright (c) 2014-2017 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2006
 # Author: Mitsuru Chinen <[email protected]>
 
 TST_TESTFUNC="do_test"
+TST_NET_IPV4_ONLY=1
 . tst_net.sh
 
 do_test()
testcases/network/stress/broken_ip/broken_ip-nexthdr +2 -1
index 475b92b16..2ab0601ac 100644
@@ -1,11 +1,12 @@
 #!/bin/sh
 # SPDX-License-Identifier: GPL-2.0-or-later
-# Copyright (c) 2019 Petr Vorel <[email protected]>
+# Copyright (c) 2019-2021 Petr Vorel <[email protected]>
 # Copyright (c) 2014-2017 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2006
 # Author: Mitsuru Chinen <[email protected]>
 
 TST_TESTFUNC="do_test"
+TST_NET_IPV6_ONLY=1
 . tst_net.sh
 
 do_test()
testcases/network/stress/broken_ip/broken_ip-protcol +2 -1
index a91cdaaeb..9f9275f03 100644
@@ -1,11 +1,12 @@
 #!/bin/sh
 # SPDX-License-Identifier: GPL-2.0-or-later
-# Copyright (c) 2019 Petr Vorel <[email protected]>
+# Copyright (c) 2019-2021 Petr Vorel <[email protected]>
 # Copyright (c) 2014-2017 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2006
 # Author: Mitsuru Chinen <[email protected]>
 
 TST_TESTFUNC="do_test"
+TST_NET_IPV4_ONLY=1
 . tst_net.sh
 
 do_test()
Signature · 1 line
2.32.0
#3 lore raw

PATCH 2/2 broken_ip: TCONF when test run on unsupported protocol

Quoted 73 lines · Petr Vorel

net_stress.broken_ip runtest file is correct, but some users try to run tests manually.

Fixes #843
---
 testcases/network/stress/broken_ip/broken_ip-checksum | 3 ++-
 testcases/network/stress/broken_ip/broken_ip-fragment | 3 ++-
 testcases/network/stress/broken_ip/broken_ip-ihl      | 3 ++-
 testcases/network/stress/broken_ip/broken_ip-nexthdr  | 3 ++-
 testcases/network/stress/broken_ip/broken_ip-protcol  | 3 ++-
 5 files changed, 10 insertions(+), 5 deletions(-)
testcases/network/stress/broken_ip/broken_ip-checksum +2 -1
index 78f00ce98..707ffcb29 100644
@@ -1,11 +1,12 @@
 #!/bin/sh
 # SPDX-License-Identifier: GPL-2.0-or-later
-# Copyright (c) 2019 Petr Vorel <[email protected]>
+# Copyright (c) 2019-2021 Petr Vorel <[email protected]>
 # Copyright (c) 2014-2017 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2006
 # Author: Mitsuru Chinen <[email protected]>
 
 TST_TESTFUNC="do_test"
+TST_NET_IPV4_ONLY=1
 . tst_net.sh
 
 do_test()
testcases/network/stress/broken_ip/broken_ip-fragment +2 -1
index 1f5e5f713..7356bb523 100644
@@ -1,11 +1,12 @@
 #!/bin/sh
 # SPDX-License-Identifier: GPL-2.0-or-later
-# Copyright (c) 2019 Petr Vorel <[email protected]>
+# Copyright (c) 2019-2021 Petr Vorel <[email protected]>
 # Copyright (c) 2014-2017 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2006
 # Author: Mitsuru Chinen <[email protected]>
 
 TST_TESTFUNC="do_test"
+TST_NET_IPV4_ONLY=1
 . tst_net.sh
 
 do_test()
testcases/network/stress/broken_ip/broken_ip-ihl +2 -1
index 9f2a42568..e5e41ee8e 100644
@@ -1,11 +1,12 @@
 #!/bin/sh
 # SPDX-License-Identifier: GPL-2.0-or-later
-# Copyright (c) 2019 Petr Vorel <[email protected]>
+# Copyright (c) 2019-2021 Petr Vorel <[email protected]>
 # Copyright (c) 2014-2017 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2006
 # Author: Mitsuru Chinen <[email protected]>
 
 TST_TESTFUNC="do_test"
+TST_NET_IPV4_ONLY=1
 . tst_net.sh
 
 do_test()
testcases/network/stress/broken_ip/broken_ip-nexthdr +0 -0
index 475b92b16..2ab0601ac 100644

testcases/network/stress/broken_ip/broken_ip-nexthdr line 9

Quoted 10 lines
testcases/network/stress/broken_ip/broken_ip-nexthdr +2 -1
@@ -1,11 +1,12 @@
 #!/bin/sh
 # SPDX-License-Identifier: GPL-2.0-or-later
-# Copyright (c) 2019 Petr Vorel <[email protected]>
+# Copyright (c) 2019-2021 Petr Vorel <[email protected]>
 # Copyright (c) 2014-2017 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2006
 # Author: Mitsuru Chinen <[email protected]>
 
 TST_TESTFUNC="do_test"
+TST_NET_IPV6_ONLY=1

+TST_IPV6=6 won't work to fix #843?

Quoted 12 lines
testcases/network/stress/broken_ip/broken_ip-nexthdr +0 -0
 . tst_net.sh
 
 do_test()
testcases/network/stress/broken_ip/broken_ip-protcol +0 -1
index a91cdaaeb..9f9275f03 100644
@@ -1,11 +1,12 @@
 #!/bin/sh
 # SPDX-License-Identifier: GPL-2.0-or-later
-# Copyright (c) 2019 Petr Vorel <[email protected]>

testcases/network/stress/broken_ip/broken_ip-protcol line 12

Quoted 10 lines
testcases/network/stress/broken_ip/broken_ip-protcol +2 -0
+# Copyright (c) 2019-2021 Petr Vorel <[email protected]>
 # Copyright (c) 2014-2017 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2006
 # Author: Mitsuru Chinen <[email protected]>
 
 TST_TESTFUNC="do_test"
+TST_NET_IPV4_ONLY=1
 . tst_net.sh
 
 do_test()

The generic version looks fine:

author
#4 lore raw

PATCH 2/2 broken_ip: TCONF when test run on unsupported protocol

Hi Alexey,

...

Quoted 4 lines
Quoted 2 lines

TST_TESTFUNC="do_test"
+TST_NET_IPV6_ONLY=1

+TST_IPV6=6 won't work to fix #843?

Sure, it'd fix it. And TST_IPV6= for broken_ip-ihl. That's a simple way to fix it. But I thought having TST_NET_IPV{4,6}_ONLY=1 would be self descriptive + it could be later processed with docparse metadata documentation (I plan to implement docparse for shell).

So it's more a question whether we want to manifest this info.

Kind regards,
Petr

...

Quoted 9 lines
Quoted 5 lines

TST_TESTFUNC="do_test"
+TST_NET_IPV4_ONLY=1
. tst_net.sh

do_test()

The generic version looks fine:

author
#5 lore raw

PATCH 2/2 broken_ip: TCONF when test run on unsupported protocol

In reply to Alexey Kodanev

Hi Alexey,

Quoted 107 lines · Petr Vorel
Quoted 73 lines

net_stress.broken_ip runtest file is correct, but some users try to run tests manually.

Fixes #843
---
 testcases/network/stress/broken_ip/broken_ip-checksum | 3 ++-
 testcases/network/stress/broken_ip/broken_ip-fragment | 3 ++-
 testcases/network/stress/broken_ip/broken_ip-ihl      | 3 ++-
 testcases/network/stress/broken_ip/broken_ip-nexthdr  | 3 ++-
 testcases/network/stress/broken_ip/broken_ip-protcol  | 3 ++-
 5 files changed, 10 insertions(+), 5 deletions(-)
testcases/network/stress/broken_ip/broken_ip-checksum +2 -1
index 78f00ce98..707ffcb29 100644
@@ -1,11 +1,12 @@
 #!/bin/sh
 # SPDX-License-Identifier: GPL-2.0-or-later
-# Copyright (c) 2019 Petr Vorel <[email protected]>
+# Copyright (c) 2019-2021 Petr Vorel <[email protected]>
 # Copyright (c) 2014-2017 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2006
 # Author: Mitsuru Chinen <[email protected]>
 
 TST_TESTFUNC="do_test"
+TST_NET_IPV4_ONLY=1
 . tst_net.sh
 
 do_test()
testcases/network/stress/broken_ip/broken_ip-fragment +2 -1
index 1f5e5f713..7356bb523 100644
@@ -1,11 +1,12 @@
 #!/bin/sh
 # SPDX-License-Identifier: GPL-2.0-or-later
-# Copyright (c) 2019 Petr Vorel <[email protected]>
+# Copyright (c) 2019-2021 Petr Vorel <[email protected]>
 # Copyright (c) 2014-2017 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2006
 # Author: Mitsuru Chinen <[email protected]>
 
 TST_TESTFUNC="do_test"
+TST_NET_IPV4_ONLY=1
 . tst_net.sh
 
 do_test()
testcases/network/stress/broken_ip/broken_ip-ihl +2 -1
index 9f2a42568..e5e41ee8e 100644
@@ -1,11 +1,12 @@
 #!/bin/sh
 # SPDX-License-Identifier: GPL-2.0-or-later
-# Copyright (c) 2019 Petr Vorel <[email protected]>
+# Copyright (c) 2019-2021 Petr Vorel <[email protected]>
 # Copyright (c) 2014-2017 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2006
 # Author: Mitsuru Chinen <[email protected]>
 
 TST_TESTFUNC="do_test"
+TST_NET_IPV4_ONLY=1
 . tst_net.sh
 
 do_test()
testcases/network/stress/broken_ip/broken_ip-nexthdr +0 -0
index 475b92b16..2ab0601ac 100644

testcases/network/stress/broken_ip/broken_ip-nexthdr line 9

Quoted 10 lines
testcases/network/stress/broken_ip/broken_ip-nexthdr +2 -1
@@ -1,11 +1,12 @@
 #!/bin/sh
 # SPDX-License-Identifier: GPL-2.0-or-later
-# Copyright (c) 2019 Petr Vorel <[email protected]>
+# Copyright (c) 2019-2021 Petr Vorel <[email protected]>
 # Copyright (c) 2014-2017 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2006
 # Author: Mitsuru Chinen <[email protected]>
 
 TST_TESTFUNC="do_test"
+TST_NET_IPV6_ONLY=1

+TST_IPV6=6 won't work to fix #843?

Quoted 19 lines
testcases/network/stress/broken_ip/broken_ip-nexthdr +0 -0
 . tst_net.sh
 
 do_test()
testcases/network/stress/broken_ip/broken_ip-protcol +2 -1
index a91cdaaeb..9f9275f03 100644
@@ -1,11 +1,12 @@
 #!/bin/sh
 # SPDX-License-Identifier: GPL-2.0-or-later
-# Copyright (c) 2019 Petr Vorel <[email protected]>
+# Copyright (c) 2019-2021 Petr Vorel <[email protected]>
 # Copyright (c) 2014-2017 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2006
 # Author: Mitsuru Chinen <[email protected]>
 
 TST_TESTFUNC="do_test"
+TST_NET_IPV4_ONLY=1
 . tst_net.sh
Quoted 5 lines

testcases/network/stress/broken_ip/broken_ip-protcol line 11

Quoted 1 line
testcases/network/stress/broken_ip/broken_ip-protcol +0 -0
 do_test()

The generic version looks fine:

I didn't understand whether you'd prefer to add TST_IPV6=6 (or TST_IPV6=) where needed or accept this patchset. Both would work.

Kind regards,
Petr

#6 lore raw

PATCH 2/2 broken_ip: TCONF when test run on unsupported protocol

Hi Petr,

Quoted 8 lines · Petr Vorel

Hi Alexey,

Quoted 5 lines · Petr Vorel
Quoted 4 lines

net_stress.broken_ip runtest file is correct, but some users try to run tests manually.

Fixes #843

...

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

do_test()

The generic version looks fine:

I didn't understand whether you'd prefer to add TST_IPV6=6 (or TST_IPV6=) where needed or accept this patchset. Both would work.

I think for manual runs it is better to set TST_IPV6=6 in the test so it will run the test rather the require passing some options.

Quoted 3 lines

Kind regards,
Petr

author
#7 lore raw

PATCH 2/2 broken_ip: TCONF when test run on unsupported protocol

Quoted 15 lines

Hi Petr,

Quoted 7 lines · Petr Vorel

Hi Alexey,

Quoted 5 lines · Petr Vorel
Quoted 4 lines

net_stress.broken_ip runtest file is correct, but some users try to run tests manually.

Fixes #843

...

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

do_test()

The generic version looks fine:

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

I didn't understand whether you'd prefer to add TST_IPV6=6 (or TST_IPV6=) where needed or accept this patchset. Both would work.

I think for manual runs it is better to set TST_IPV6=6 in the test so it will run the test rather the require passing some options.

+1.

Kind regards,
Petr

Quoted 2 lines
Quoted 2 lines

Kind regards,
Petr

author
#8 lore raw

PATCH 2/2 broken_ip: TCONF when test run on unsupported protocol

In reply to Alexey Kodanev

Hi Alexey,

Quoted 15 lines

Hi Petr,

Quoted 7 lines · Petr Vorel

Hi Alexey,

Quoted 5 lines · Petr Vorel
Quoted 4 lines

net_stress.broken_ip runtest file is correct, but some users try to run tests manually.

Fixes #843

...

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

do_test()

The generic version looks fine:

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

I didn't understand whether you'd prefer to add TST_IPV6=6 (or TST_IPV6=) where needed or accept this patchset. Both would work.

I think for manual runs it is better to set TST_IPV6=6 in the test so it will run the test rather the require passing some options.

It looks like specifying TST_IPV6=6 is not enough, because tests are using $NS_ICMP_SENDER_DATA_MAXSIZE which is defined in tst_net.sh according to TST_IPV6. We can

1) overwrite NS_ICMP_SENDER_DATA_MAXSIZE="$NS_ICMPV6_SENDER_DATA_MAXSIZE"
2) check TST_IPV6 before running tst_net_parse_args and if set overwrite -6 flag

But both are quite ugly, thus unless you have better idea I merge this patchset.

Kind regards,
Petr

Quoted 2 lines
Quoted 2 lines

Kind regards,
Petr

#9 lore raw

PATCH 2/2 broken_ip: TCONF when test run on unsupported protocol

Hi Petr,

Quoted 24 lines · Petr Vorel

Hi Alexey,

Quoted 15 lines

Hi Petr,

Quoted 7 lines · Petr Vorel

Hi Alexey,

Quoted 5 lines · Petr Vorel
Quoted 4 lines

net_stress.broken_ip runtest file is correct, but some users try to run tests manually.

Fixes #843

...

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

do_test()

The generic version looks fine:

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

I didn't understand whether you'd prefer to add TST_IPV6=6 (or TST_IPV6=) where needed or accept this patchset. Both would work.

I think for manual runs it is better to set TST_IPV6=6 in the test so it will run the test rather the require passing some options.

Quoted 8 lines

It looks like specifying TST_IPV6=6 is not enough, because tests are using $NS_ICMP_SENDER_DATA_MAXSIZE which is defined in tst_net.sh according to TST_IPV6. We can

1) overwrite NS_ICMP_SENDER_DATA_MAXSIZE="$NS_ICMPV6_SENDER_DATA_MAXSIZE"
2) check TST_IPV6 before running tst_net_parse_args and if set overwrite -6 flag

But both are quite ugly, thus unless you have better idea I merge this patchset.

Are you sure that you are getting the wrong maxsize? if TST_IPV6=6 is set before the setup, in the test, why tst_net_setup() is setting the IPv4 value?

Quoted 8 lines

Kind regards,
Petr

Quoted 2 lines
Quoted 2 lines

Kind regards,
Petr

author
#10 lore raw

PATCH 2/2 broken_ip: TCONF when test run on unsupported protocol

Hi Alexey,

Quoted 33 lines

Hi Petr,

Quoted 30 lines · Petr Vorel

Hi Alexey,

Quoted 15 lines

Hi Petr,

Quoted 7 lines · Petr Vorel

Hi Alexey,

Quoted 5 lines · Petr Vorel
Quoted 4 lines

net_stress.broken_ip runtest file is correct, but some users try to run tests manually.

Fixes #843

...

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

do_test()

The generic version looks fine:

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

I didn't understand whether you'd prefer to add TST_IPV6=6 (or TST_IPV6=) where needed or accept this patchset. Both would work.

I think for manual runs it is better to set TST_IPV6=6 in the test so it will run the test rather the require passing some options.

It looks like specifying TST_IPV6=6 is not enough, because tests are using $NS_ICMP_SENDER_DATA_MAXSIZE which is defined in tst_net.sh according to TST_IPV6. We can

1) overwrite NS_ICMP_SENDER_DATA_MAXSIZE="$NS_ICMPV6_SENDER_DATA_MAXSIZE"
2) check TST_IPV6 before running tst_net_parse_args and if set overwrite -6 flag

Quoted 6 lines
Quoted 1 line

But both are quite ugly, thus unless you have better idea I merge this patchset.

Are you sure that you are getting the wrong maxsize? if TST_IPV6=6 is set before the setup, in the test, why tst_net_setup() is setting the IPv4 value?

The problem is actually in IPv6, ns-icmpv6_sender does not support -c. IPv6 only is only broken_ip-ihl tests, the other 4 are IPv4 only.
I tested variables after loading tst_net.sh, but that was later overwritten with getopt -6. But setting it in the test function works (you probably meant this). I still don't like having to specify 2 variables (yes both are needed), but it's not a big deal thus I'll merge this version.

Kind regards,
Petr

network/stress/broken_ip/broken_ip-checksum +4 -1
@@ -10,7 +10,10 @@ TST_TESTFUNC="do_test"
 
 do_test()
 {
-	tst_res TINFO "Sending ICMPv$TST_IPVER with wrong chksum field for $NS_DURATION sec"
+	TST_IPV6=
+	TST_IPVER=4
+
+	tst_res TINFO "Sending ICMPv4 with wrong chksum field for $NS_DURATION sec"
 	tst_icmp -t $NS_DURATION -s "0 100 500 1000 $NS_ICMP_SENDER_DATA_MAXSIZE" -c
 	tst_ping
 }
Quoted 5 lines
Quoted 5 lines

Kind regards,
Petr

Quoted 2 lines
Quoted 2 lines

Kind regards,
Petr

author
#11 lore raw

PATCH 2/2 broken_ip: TCONF when test run on unsupported protocol

Hi Alexey,

Quoted 4 lines
network/stress/broken_ip/broken_ip-checksum +0 -0
@@ -10,7 +10,10 @@ TST_TESTFUNC="do_test"
 

network/stress/broken_ip/broken_ip-checksum TST_TESTFUNC="do_test" · line 19

Quoted 10 lines
network/stress/broken_ip/broken_ip-checksum +4 -1
 do_test()
 {
-	tst_res TINFO "Sending ICMPv$TST_IPVER with wrong chksum field for $NS_DURATION sec"
+	TST_IPV6=
+	TST_IPVER=4
+
+	tst_res TINFO "Sending ICMPv4 with wrong chksum field for $NS_DURATION sec"
 	tst_icmp -t $NS_DURATION -s "0 100 500 1000 $NS_ICMP_SENDER_DATA_MAXSIZE" -c
 	tst_ping
 }

FYI merged commit which implements this.

Kind regards,
Petr

#12 lore raw

cover Add TST_NET_IPV{4, 6}_ONLY and use on broken_ip

In reply to Petr Vorel
Quoted 6 lines · Petr Vorel

Hi Alexey,

https://github.com/linux-test-project/ltp/issues/843

does it make sense to run it on IPv4 and broken_ip-totlen on IPv6? Both don't break but not in runtest file.

Hi Petr,

Yes it should work with the -L option, but these tests are the same (differs the descriptions for IPv4/IPv6):

broken_ip-totlen renamed from broken_ip-plen +1 -1
diff -u broken_ip-plen broken_ip-totlen
@@ -10,7 +10,7 @@
 
 do_test()
 {
-	tst_res TINFO "Sending ICMPv$TST_IPVER with wrong payload len for $NS_DURATION sec"
+	tst_res TINFO "Sending ICMPv$TST_IPVER with wrong total len field for $NS_DURATION sec"
 	tst_icmp -t $NS_DURATION -s "0 100 500 1000 $NS_ICMP_SENDER_DATA_MAXSIZE" -L
 	tst_ping
 }

So broken_ip-totlen should be just removed.

Quoted 17 lines

Kind regards,
Petr

Petr Vorel (2):
tst_net.sh: Add variable for supported protocol
broken_ip: TCONF when test run on unsupported protocol

 testcases/lib/tst_net.sh                              | 8 ++++++++
 testcases/lib/tst_test.sh                             | 2 +-
 testcases/network/stress/broken_ip/broken_ip-checksum | 3 ++-
 testcases/network/stress/broken_ip/broken_ip-fragment | 3 ++-
 testcases/network/stress/broken_ip/broken_ip-ihl      | 3 ++-
 testcases/network/stress/broken_ip/broken_ip-nexthdr  | 3 ++-
 testcases/network/stress/broken_ip/broken_ip-protcol  | 3 ++-
 7 files changed, 19 insertions(+), 6 deletions(-)
author
#13 lore raw

cover Add TST_NET_IPV{4, 6}_ONLY and use on broken_ip

Quoted 17 lines · Petr Vorel
Quoted 6 lines

Hi Alexey,

https://github.com/linux-test-project/ltp/issues/843

does it make sense to run it on IPv4 and broken_ip-totlen on IPv6? Both don't break but not in runtest file.

Hi Petr,

Yes it should work with the -L option, but these tests are the same (differs the descriptions for IPv4/IPv6):

diff -u broken_ip-plen broken_ip-totlen

broken_ip-totlen line 16

Quoted 8 lines
broken_ip-totlen renamed from broken_ip-plen +1 -1
@@ -10,7 +10,7 @@
 
 do_test()
 {
-	tst_res TINFO "Sending ICMPv$TST_IPVER with wrong payload len for $NS_DURATION sec"
+	tst_res TINFO "Sending ICMPv$TST_IPVER with wrong total len field for $NS_DURATION sec"
 	tst_icmp -t $NS_DURATION -s "0 100 500 1000 $NS_ICMP_SENDER_DATA_MAXSIZE" -L
 	tst_ping
 }

Good catch, thanks!

Quoted 1 line

So broken_ip-totlen should be just removed.

I merged commit which implements this.

Kind regards,
Petr