[PATCH] selftests: fib_tests: mute cleanup error message

Po-Hsu Lin posted 1 patch 2 years, 7 months ago
There is a newer version of this series
tools/testing/selftests/net/fib_tests.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] selftests: fib_tests: mute cleanup error message
Posted by Po-Hsu Lin 2 years, 7 months ago
In the end of the test, there will be an error message induced by the
`ip netns del ns1` command in cleanup()

  Tests passed: 201
  Tests failed:   0
  Cannot remove namespace file "/run/netns/ns1": No such file or directory

Redirect the error message to /dev/null to mute it.

Fixes: a0e11da78f48 ("fib_tests: Add tests for metrics on routes")
Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
---
 tools/testing/selftests/net/fib_tests.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/fib_tests.sh b/tools/testing/selftests/net/fib_tests.sh
index 7da8ec8..35d89df 100755
--- a/tools/testing/selftests/net/fib_tests.sh
+++ b/tools/testing/selftests/net/fib_tests.sh
@@ -68,7 +68,7 @@ setup()
 cleanup()
 {
 	$IP link del dev dummy0 &> /dev/null
-	ip netns del ns1
+	ip netns del ns1 &> /dev/null
 	ip netns del ns2 &> /dev/null
 }
 
-- 
2.7.4
Re: [PATCH] selftests: fib_tests: mute cleanup error message
Posted by Ido Schimmel 2 years, 7 months ago
On Wed, May 17, 2023 at 12:11:19PM +0800, Po-Hsu Lin wrote:
> In the end of the test, there will be an error message induced by the
> `ip netns del ns1` command in cleanup()
> 
>   Tests passed: 201
>   Tests failed:   0
>   Cannot remove namespace file "/run/netns/ns1": No such file or directory
> 
> Redirect the error message to /dev/null to mute it.
> 
> Fixes: a0e11da78f48 ("fib_tests: Add tests for metrics on routes")

I don't think this tag is correct. More likely that this is caused by
commit b60417a9f2b8 ("selftest: fib_tests: Always cleanup before exit").

You can even reproduce it with '-h':

# ./fib_tests.sh -h
usage: fib_tests.sh OPTS
[...]
Cannot remove namespace file "/var/run/netns/ns1": No such file or directory

Reverting the commit I mentioned makes it go away.

Also, please use "PATCH net" prefix:
https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html#tl-dr
Re: [PATCH] selftests: fib_tests: mute cleanup error message
Posted by Po-Hsu Lin 2 years, 7 months ago
On Wed, May 17, 2023 at 2:00 PM Ido Schimmel <idosch@idosch.org> wrote:
>
> On Wed, May 17, 2023 at 12:11:19PM +0800, Po-Hsu Lin wrote:
> > In the end of the test, there will be an error message induced by the
> > `ip netns del ns1` command in cleanup()
> >
> >   Tests passed: 201
> >   Tests failed:   0
> >   Cannot remove namespace file "/run/netns/ns1": No such file or directory
> >
> > Redirect the error message to /dev/null to mute it.
> >
> > Fixes: a0e11da78f48 ("fib_tests: Add tests for metrics on routes")
>
> I don't think this tag is correct. More likely that this is caused by
> commit b60417a9f2b8 ("selftest: fib_tests: Always cleanup before exit").
>
> You can even reproduce it with '-h':
>
> # ./fib_tests.sh -h
> usage: fib_tests.sh OPTS
> [...]
> Cannot remove namespace file "/var/run/netns/ns1": No such file or directory
>
> Reverting the commit I mentioned makes it go away.
>
> Also, please use "PATCH net" prefix:
> https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html#tl-dr

Thank you!
I will submit V2 for this.