From mboxrd@z Thu Jan 1 00:00:00 1970 From: Petr Vorel Date: Tue, 3 Aug 2021 17:37:46 +0200 Subject: [LTP] [PATCH 2/2] broken_ip: TCONF when test run on unsupported protocol In-Reply-To: <80a6cbec-50b7-9912-d682-915a1076bbec@bell-sw.com> References: <20210714140716.1568-1-pvorel@suse.cz> <20210714140716.1568-3-pvorel@suse.cz> <57d4c109-d01a-2c7f-39c7-41013e70abf9@bell-sw.com> <80a6cbec-50b7-9912-d682-915a1076bbec@bell-sw.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ltp@lists.linux.it Hi Alexey, > Hi Petr, > On 02.08.2021 21:06, Petr Vorel wrote: > > Hi Alexey, > >> Hi Petr, > >> On 27.07.2021 20:35, Petr Vorel wrote: > >>> Hi Alexey, > >>>> On 14.07.2021 17:07, Petr Vorel wrote: > >>>>> net_stress.broken_ip runtest file is correct, but some users try to run > >>>>> tests manually. > >>>>> Fixes: #843 > >> ... > >>>>> do_test() > >>>> The generic version looks fine: > >>>> Reviewed-by: Alexey Kodanev > >>> 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. > 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 --- testcases/network/stress/broken_ip/broken_ip-checksum +++ testcases/network/stress/broken_ip/broken_ip-checksum @@ -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 } > > Kind regards, > > Petr > >>> Kind regards, > >>> Petr