From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D57EEC43461 for ; Mon, 27 Jul 2020 23:29:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A52F02173E for ; Mon, 27 Jul 2020 23:29:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595892579; bh=h34qtxaIin9fvca5iz4rgj6oOZSApYPiXFr73+LDPjY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=1eVHAHlHxrfv8tA60GTHvIifzRzVNMz5EELcb7xCTvvZDE4W4bb6EwC13G+pTiNvg yL+S4ifUV2I/pXpNkctUWqaSFm0MG2Y7oWRShY0nEOe4HAQwmlwTzRGeLzXgFswRno +59rXRrKKf2k7l/avtFXdcHcnEsscjYls3HopeNc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728562AbgG0X3Y (ORCPT ); Mon, 27 Jul 2020 19:29:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:34970 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726171AbgG0XYG (ORCPT ); Mon, 27 Jul 2020 19:24:06 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9DEE02173E; Mon, 27 Jul 2020 23:24:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595892245; bh=h34qtxaIin9fvca5iz4rgj6oOZSApYPiXFr73+LDPjY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z0TETOFPJ4YcNgEhVxA1UVuq5Pbif0kCWRscX9+EgSsPnkb/sG24s7DHBu5s1hjMd sDPvSX2wx7XOeZ2Wzxa8UrNS5qQpp3tAq+vOB4hwGS/l29Y8EoH3VDC9uIg2Zkt2/p gMfd/uHvSlI37AzeLMEHAf8usGo4g9yXnYWLQwfg= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Paolo Pisati , Willem de Bruijn , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 14/25] selftest: txtimestamp: fix net ns entry logic Date: Mon, 27 Jul 2020 19:23:34 -0400 Message-Id: <20200727232345.717432-14-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200727232345.717432-1-sashal@kernel.org> References: <20200727232345.717432-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org From: Paolo Pisati [ Upstream commit b346c0c85892cb8c53e8715734f71ba5bbec3387 ] 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 Signed-off-by: Sasha Levin --- tools/testing/selftests/net/txtimestamp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 $@ -- 2.25.1