summaryrefslogtreecommitdiffstats
path: root/tools/testing
diff options
context:
space:
mode:
authorPaolo Pisati <paolo.pisati@canonical.com>2020-07-21 18:17:10 +0200
committerDavid S. Miller <davem@davemloft.net>2020-07-21 16:11:07 -0700
commitb346c0c85892cb8c53e8715734f71ba5bbec3387 (patch)
treec9f61013bdf425700a85f9aea910610a5c2a5131 /tools/testing
parent785ed9c32aa1e709e62a475e44139bd875b00c9d (diff)
downloadlinux-b346c0c85892cb8c53e8715734f71ba5bbec3387.tar.bz2
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 <paolo.pisati@canonical.com> Acked-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing')
-rwxr-xr-xtools/testing/selftests/net/txtimestamp.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/net/txtimestamp.sh b/tools/testing/selftests/net/txtimestamp.sh
index eea6f5193693..31637769f59f 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 $@