[LTP] [RFC PATCH v8 08/11] network/stress: Fix and cleanup route IPv4 tests
Petr Vorel
pvorel@suse.cz
Wed Aug 23 15:49:14 CEST 2017
Hi Alexey,
> >>> Tests using route_test_change() use background traffic instead of ns-udpsender
> >>> but I fixed it that it uses route. Is it too much overhead? The reason is I'd
> >> How do you use it to make a background traffic if you change route on
> >> every loop iteration?
> >>> like to get rid of all ugly scripts and binaries in
> >>> testcases/network/stress/ns-tools, including ns-udpsender.c.
> >> ns-udpsender can send a single UDP datagram over the new route without
> >> waiting for answer but unfortunately we don't know for sure whether it
> >> actually sent datagram and/or destination received it.
> > What would you suggest? I chose netstress as it's kind of client & server application. Do
> > we want to write something from scratch?
> > I don't like also the infinite loop in send_udp_datagram (I've caused one crash in local
> > network in previous tests by sending too many packets).
> I would convert to match the previous version for now, e.g.route-change-dst.
Sorry, do you to use ns-udpsender just in route-change-dst (as it's the only one which
kill netstress each time in loop by calling netstress_cleanup() ) or in all route tests
which are using it?
> do_test()
> {
> local new_rtaddrcnt
> local if=$(tst_iface)
> local inet="inet$TST_IPV6"
> tst_resm TINFO "change IPv$ipver route $NS_TIMES times"
> local udp_size=1472
> local mask=24
> if [ "$TST_IPV6" ]; then
> udp_size=1452
> mask=64
> fi
> cnt=1
> while [ $cnt -le $NS_TIMES ]; do
> new_rt="$(tst_ipaddr_un $cnt)/$mask"
> addr="$(tst_ipaddr_un $cnt 1)"
> ROD ip route add $new_rt dev $if
> ROD ip ne replace $addr lladdr $(tst_hwaddr rhost) nud
> permanent dev $if
> # Load the route with one UDP datagram
> ROD ns-udpsender -f $ipver -D $addr -p $cnt -o -s $udp_size
> ROD ip neigh del $addr lladdr $(tst_hwaddr rhost)dev $if
> ROD ip route del $new_rt dev $if
> cnt=$(($cnt + 1))
> done
> tst_resm TPASS "Test is finished correctly"
> }
> For background traffic it's better to have 'netstress' running.
I see you probably don't like manipulate_route (the name is ugly - too long and I have to
admit that direct commands are more readable). If you want, I can replace it into direct
commands (as you mentioned some time ago). I just don't like many 'case' commands and
code repeating.
Kind regards,
Petr
More information about the ltp
mailing list