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=-10.1 required=3.0 tests=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 193DFC433E1 for ; Thu, 18 Jun 2020 01:55:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ED17B2088E for ; Thu, 18 Jun 2020 01:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592445338; bh=gY4isXoW+MbbJvD0uF60Gw7xxlbj5s9u5gXAPpzrZGo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=NVkckOrhyOJsmnlU5moimM0dJburv6RxZnF/3GSYe06Os1bEWsLVTG7ImByD3YjH9 FxgryVlZy54hic6fwItgrvY1cBJnYraS83jlMzcNRv0DwHAAUsw3ALL5YeFJ03F4z2 7ju9YO91G0QcmREPWktZYGkp2LJZu8kaGFWxSIZw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732877AbgFRBzb (ORCPT ); Wed, 17 Jun 2020 21:55:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:32794 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730804AbgFRBZo (ORCPT ); Wed, 17 Jun 2020 21:25:44 -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 DCB4C2088E; Thu, 18 Jun 2020 01:25:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592443543; bh=gY4isXoW+MbbJvD0uF60Gw7xxlbj5s9u5gXAPpzrZGo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZnE/cNLmO024ewCkcU9lIV7nYLb3Uaclv6Ss06xcFK6vFCUD/vK9iffUVTZ/zD5uA g2AUrhCFsNozsPmIkz0HjSctl9Gt6NI3F4YyA7aAFbKAjsZa+ntV3QsS48QGvzNp2l enTsjugfdcCs6b1sGpIE/pkGiJ3hZB2YIaQLtXHc= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Logan Gunthorpe , Allen Hubbe , Alexander Fomichev , Jon Mason , Sasha Levin , linux-ntb@googlegroups.com, linux-kselftest@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 160/172] NTB: ntb_test: Fix bug when counting remote files Date: Wed, 17 Jun 2020 21:22:06 -0400 Message-Id: <20200618012218.607130-160-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200618012218.607130-1-sashal@kernel.org> References: <20200618012218.607130-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: Logan Gunthorpe [ Upstream commit 2130c0ba69d69bb21f5c52787f2587db00d13d8a ] When remote files are counted in get_files_count, without using SSH, the code returns 0 because there is a colon prepended to $LOC. $VPATH should have been used instead of $LOC. Fixes: 06bd0407d06c ("NTB: ntb_test: Update ntb_tool Scratchpad tests") Signed-off-by: Logan Gunthorpe Acked-by: Allen Hubbe Tested-by: Alexander Fomichev Signed-off-by: Jon Mason Signed-off-by: Sasha Levin --- tools/testing/selftests/ntb/ntb_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/ntb/ntb_test.sh b/tools/testing/selftests/ntb/ntb_test.sh index 08cbfbbc7029..17ca36403d04 100755 --- a/tools/testing/selftests/ntb/ntb_test.sh +++ b/tools/testing/selftests/ntb/ntb_test.sh @@ -250,7 +250,7 @@ function get_files_count() split_remote $LOC if [[ "$REMOTE" == "" ]]; then - echo $(ls -1 "$LOC"/${NAME}* 2>/dev/null | wc -l) + echo $(ls -1 "$VPATH"/${NAME}* 2>/dev/null | wc -l) else echo $(ssh "$REMOTE" "ls -1 \"$VPATH\"/${NAME}* | \ wc -l" 2> /dev/null) -- 2.25.1