From: Paolo Pisati Date: Tue, 21 Jul 2020 16:17:10 +0000 (+0200) Subject: selftest: txtimestamp: fix net ns entry logic X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b346c0c85892cb8c53e8715734f71ba5bbec3387;p=linux.git selftest: txtimestamp: fix net ns entry logic According to 'man 8 ip-netns', if `ip netns identify` returns an empty string, there's no net namespace associated with current PID: fix the net ns entrance logic. Signed-off-by: Paolo Pisati Acked-by: Willem de Bruijn Signed-off-by: David S. Miller --- diff --git a/tools/testing/selftests/net/txtimestamp.sh b/tools/testing/selftests/net/txtimestamp.sh index eea6f5193693f..31637769f59f6 100755 --- a/tools/testing/selftests/net/txtimestamp.sh +++ b/tools/testing/selftests/net/txtimestamp.sh @@ -75,7 +75,7 @@ main() { fi } -if [[ "$(ip netns identify)" == "root" ]]; then +if [[ -z "$(ip netns identify)" ]]; then ./in_netns.sh $0 $@ else main $@