lkml.org 
[lkml]   [2020]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.7 346/477] NTB: ntb_test: Fix bug when counting remote files
    Date
    From: Logan Gunthorpe <logang@deltatee.com>

    [ 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 <logang@deltatee.com>
    Acked-by: Allen Hubbe <allenbh@gmail.com>
    Tested-by: Alexander Fomichev <fomichev.ru@gmail.com>
    Signed-off-by: Jon Mason <jdmason@kudzu.us>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    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 9c60337317c60..020137b614079 100755
    --- a/tools/testing/selftests/ntb/ntb_test.sh
    +++ b/tools/testing/selftests/ntb/ntb_test.sh
    @@ -241,7 +241,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


    \
     
     \ /
      Last update: 2020-06-23 23:30    [W:4.270 / U:0.048 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site