On Thu, Feb 23, 2023 at 04:36:25PM +0100, Ilya Maximets wrote: > On 2/23/23 16:33, Simon Horman wrote: > > On Thu, Feb 23, 2023 at 04:09:10PM +0100, Ilya Maximets wrote: > >> On 2/23/23 15:19, Ilya Maximets wrote: > >>> On 2/23/23 14:02, Simon Horman wrote: > > > > ... > > > >>>> + AT_CHECK([ > >>>> + if ! tc qdisc add dev veth0 handle ffff: ingress; then > >>>> + ip link del veth0 > >>> > >>> Instead of deleting in every branch, we might add on_exit call somewhere > >>> at the beginning of this function. The port will stick around till the > >>> end of the test, but I'm not sure if that's a problem if the name is > >>> special enough. Or we may keep one extra del at the very end. > >>> > >>> With on_exit, can probably be transformed into something like (untested): > >>> > >>> AT_CHECK([tc qdisc add dev veth0 handle ffff: ingress || exit 77]) > >> > >> Just AT_SKIP_IF([! tc qdisc add dev veth0 handle ffff: ingress]) should > >> work, I guess. > > > > The reason I used AT_CHECK rather than AT_SKIP_IF was to > > capture stderr/stdout. Which serves two purposes: > > > > 1. It avoids mess on the console - although that could also > > be avoided with something like >& /dev/null > > 2. The capture output is useful in debugging > > e.g. when developing this script. > > > > I can move to AT_SKIP_IF if you have a strong preference. > > But AT_CHECK did seem a bit better to me - except the '77' bit. > > Makes sense. AT_CHECK is fine then.
Thanks, I'll prepare v2 with the other changes you suggested. _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
