From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Paolo Pisati <paolo.pisati@canonical.com>
Cc: "David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Shuah Khan <shuah@kernel.org>,
Jian Yang <jianyang@google.com>,
Network Development <netdev@vger.kernel.org>,
"open list:KERNEL SELFTEST FRAMEWORK"
<linux-kselftest@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] selftests: txtimestamp: tear down setup() 'tc' and 'ip' env on EXIT
Date: Tue, 21 Jul 2020 11:04:06 -0400 [thread overview]
Message-ID: <CA+FuTSeN8SONXySGys8b2EtTqJmHDKw1XVoDte0vzUPg=yuH5g@mail.gmail.com> (raw)
In-Reply-To: <20200721145249.72153-1-paolo.pisati@canonical.com>
On Tue, Jul 21, 2020 at 10:52 AM Paolo Pisati
<paolo.pisati@canonical.com> wrote:
>
> Add a cleanup() path upon exit, making it possible to run the test twice in a
> row:
>
> $ sudo bash -x ./txtimestamp.sh
> + set -e
> ++ ip netns identify
> + [[ '' == \r\o\o\t ]]
> + main
> + [[ 0 -eq 0 ]]
> + run_test_all
> + setup
> + tc qdisc add dev lo root netem delay 1ms
> Error: Exclusivity flag on, cannot modify.
>
> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
The test should already clean up after itself, by being run inside a
network namespace. That is a more robust method to ensure that all
state is reset.
The issue here is that the else branch is taken in
if [[ "$(ip netns identify)" == "root" ]]; then
./in_netns.sh $0 $@
else
main $@
fi
because the ip netns identify usually returns an empty string, not
"root". If we fix that, no need to add additional cleanup.
next prev parent reply other threads:[~2020-07-21 15:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-21 14:52 [PATCH] selftests: txtimestamp: tear down setup() 'tc' and 'ip' env on EXIT Paolo Pisati
2020-07-21 15:04 ` Willem de Bruijn [this message]
2020-07-21 16:17 ` [PATCH v2] selftest: txtimestamp: fix net ns entry logic Paolo Pisati
2020-07-21 16:25 ` Willem de Bruijn
2020-07-22 8:37 ` Paolo Pisati
2020-07-22 12:49 ` Willem de Bruijn
2020-07-21 23:11 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CA+FuTSeN8SONXySGys8b2EtTqJmHDKw1XVoDte0vzUPg=yuH5g@mail.gmail.com' \
--to=willemdebruijn.kernel@gmail.com \
--cc=davem@davemloft.net \
--cc=jianyang@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=paolo.pisati@canonical.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).