[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4b84f8ac08cf5d4037bdfefc1927cd05db09804b.camel@redhat.com>
Date: Tue, 15 Nov 2022 21:40:53 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Xin Long <lucien.xin@...il.com>
Cc: network dev <netdev@...r.kernel.org>, linux-sctp@...r.kernel.org,
davem@...emloft.net, kuba@...nel.org,
Eric Dumazet <edumazet@...gle.com>,
Marcelo Ricardo Leitner <marcelo.leitner@...il.com>,
Neil Horman <nhorman@...driver.com>,
David Ahern <dsahern@...il.com>,
Carlo Carraro <colrack@...il.com>
Subject: Re: [PATCH net-next 7/7] selftests: add a selftest for sctp vrf
On Tue, 2022-11-15 at 10:33 -0500, Xin Long wrote:
> On Tue, Nov 15, 2022 at 5:29 AM Paolo Abeni <pabeni@...hat.com> wrote:
> > On Sun, 2022-11-13 at 11:44 -0500, Xin Long wrote:
> >
> > > +testup() {
> > > + ip netns exec $SERVER_NS sysctl -w net.sctp.l3mdev_accept=1 2>&1 >/dev/null
> > > + echo -n "TEST 01: nobind, connect from client 1, l3mdev_accept=1, Y "
> > > + do_test $CLIENT_NS1 || { echo "[FAIL]"; return 1; }
> > > + echo "[PASS]"
> > > +
> > > + echo -n "TEST 02: nobind, connect from client 2, l3mdev_accept=1, N "
> > > + do_test $CLIENT_NS2 && { echo "[FAIL]"; return 1; }
> > > + echo "[PASS]"
> > > +
> > > + ip netns exec $SERVER_NS sysctl -w net.sctp.l3mdev_accept=0 2>&1 >/dev/null
> > > + echo -n "TEST 03: nobind, connect from client 1, l3mdev_accept=0, N "
> > > + do_test $CLIENT_NS1 && { echo "[FAIL]"; return 1; }
> > > + echo "[PASS]"
> > > +
> > > + echo -n "TEST 04: nobind, connect from client 2, l3mdev_accept=0, N "
> > > + do_test $CLIENT_NS2 && { echo "[FAIL]"; return 1; }
> > > + echo "[PASS]"
> > > +
> > > + echo -n "TEST 05: bind veth2 in server, connect from client 1, N "
> > > + do_test $CLIENT_NS1 veth2 && { echo "[FAIL]"; return 1; }
> > > + echo "[PASS]"
> > > +
> > > + echo -n "TEST 06: bind veth1 in server, connect from client 1, Y "
> > > + do_test $CLIENT_NS1 veth1 || { echo "[FAIL]"; return 1; }
> > > + echo "[PASS]"
> > > +
> > > + echo -n "TEST 07: bind vrf-1 in server, connect from client 1, Y "
> > > + do_test $CLIENT_NS1 vrf-1 || { echo "[FAIL]"; return 1; }
> > > + echo "[PASS]"
> > > +
> > > + echo -n "TEST 08: bind vrf-2 in server, connect from client 1, N "
> > > + do_test $CLIENT_NS1 vrf-2 && { echo "[FAIL]"; return 1; }
> > > + echo "[PASS]"
> > > +
> > > + echo -n "TEST 09: bind vrf-2 in server, connect from client 2, Y "
> > > + do_test $CLIENT_NS2 vrf-2 || { echo "[FAIL]"; return 1; }
> > > + echo "[PASS]"
> > > +
> > > + echo -n "TEST 10: bind vrf-1 in server, connect from client 2, N "
> > > + do_test $CLIENT_NS2 vrf-1 && { echo "[FAIL]"; return 1; }
> > > + echo "[PASS]"
> > > +
> > > + echo -n "TEST 11: bind vrf-1 & 2 in server, connect from client 1 & 2, Y "
> > > + do_testx vrf-1 vrf-2 || { echo "[FAIL]"; return 1; }
> > > + echo "[PASS]"
> > > +
> > > + echo -n "TEST 12: bind vrf-2 & 1 in server, connect from client 1 & 2, N "
> > > + do_testx vrf-2 vrf-1 || { echo "[FAIL]"; return 1; }
> > > + echo "[PASS]"
> > > +}
> > > +
> > > +trap cleanup EXIT
> > > +setup || exit $?
> > > +echo "Testing For SCTP VRF:"
> > > +CLIENT_IP=$CLIENT_IP4 SERVER_IP=$SERVER_IP4 AF="-4" testup && echo "***v4 Tests Done***" &&
> > > +CLIENT_IP=$CLIENT_IP6 SERVER_IP=$SERVER_IP6 AF="-6" testup && echo "***v6 Tests Done***"
> >
> > To properly integrate with the self-test suite, you need to ensure that
> > the script exits with an error code in case of failure, e.g. storing
> > the error in a global variable 'ret' and adding a final:
> >
> > exit $ret
> the above lines are equal to "exit $ret".
> the exit code in testup() will return if it's not 0.
> Do you mean I should make it more clear?
I admit I initially did not notice that the posted code is equivalent
to
exit $ret
so perhaps make it more explicit could help :) Not a big deal anyway.
Thanks,
Paolo
Powered by blists - more mailing lists