Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp849995ybh; Tue, 21 Jul 2020 09:17:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRErsveqNPf5e+C3F4q+ZfvBXJXbAnhwP/OxzthtdwpfYTGDUubTVtppyt99J/Won/K66t X-Received: by 2002:a17:906:5246:: with SMTP id y6mr25384800ejm.316.1595348269088; Tue, 21 Jul 2020 09:17:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595348269; cv=none; d=google.com; s=arc-20160816; b=vWLFOiyvdpiMrPtqCUF0oZHpEU2FntJlCsThpdBXM9zfFam0g9wj9+KkhrLg2GdvKK F/OmXS0B0eAWTTyDw3XuVQvKKdGyovOS1iwcqW3qPVwry3wOU97TxyGw0dfnWQHjXj2s SuzfM6uD8A/Fb2udNo2eET6fNjHg9PunqYqtWHkL0eyeMgDoo6nbcDDzS/SwiJ7HeYm5 fEkuLfe9291yvukRaoihBGWspfRD0huJAHK0jpyGZKolNwDJRTLRWQKgKPieQD7geL4A 7YGYSwfYrRWo4U9rTUpCixOviAyq71XrZh/QnR1JExv1RQluNZxMTKt8byQGPdbP5jQb f8hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=JndeE0+TcRUgCVbsdiX5CKCYfxZVy1h1Jhy06PM5KbM=; b=Xi+jaPaNMlKbQztz7kNF6RDganmChLTneRGOMre186AGCMxkE4rfciZQBsJZ/yCSxQ AFizWKoYhIlj5Uihp4VqB7J9PSaxNv2zH+ISDvA2T9hb+EjO5lWHGtzsqaNBf3vNiuXr WZlTKjpTod892NvYknDWLcn6mr86ZlEgwcL8Of0V4XfSptnDtS6oJKEBvCscFBp/2Cpw xKK2P7ds9gBi/n1yzUfnyXIBtq4x/ia8TqPnDZfoXsRxlhX+7ZuS0B/9nAwL7JYAfIOP l/zl61cuYWafTm6hBIn26FQ3UuB1tNziT2zUXhmrqER+vwR7DIoZAbfZoGEhGx2kPNbR ZhlA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id yd21si13391461ejb.727.2020.07.21.09.17.26; Tue, 21 Jul 2020 09:17:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728937AbgGUQRP (ORCPT + 99 others); Tue, 21 Jul 2020 12:17:15 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:58809 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727778AbgGUQRP (ORCPT ); Tue, 21 Jul 2020 12:17:15 -0400 Received: from 1.general.ppisati.uk.vpn ([10.172.193.134] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jxux4-0003gj-EU; Tue, 21 Jul 2020 16:17:10 +0000 From: Paolo Pisati To: "David S . Miller" , Jakub Kicinski , Shuah Khan , Willem de Bruijn , Jian Yang Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] selftest: txtimestamp: fix net ns entry logic Date: Tue, 21 Jul 2020 18:17:10 +0200 Message-Id: <20200721161710.80797-1-paolo.pisati@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 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 $@ -- 2.27.0