Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp969801pxb; Wed, 6 Apr 2022 05:38:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/6HMrJASxojKNyhA+/b0EG+GFI898y2rM69Y7bmFfgPVVmG7OYWNsXJ/1mCtfgcsZfXl+ X-Received: by 2002:a05:6a00:a14:b0:4fd:f66a:e201 with SMTP id p20-20020a056a000a1400b004fdf66ae201mr8802063pfh.66.1649248714291; Wed, 06 Apr 2022 05:38:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649248714; cv=none; d=google.com; s=arc-20160816; b=0KgrREwp3q/jYhr/oEsAhOyYtJxu020MEyXeqGBEt4MGHx8iDFid5aLEHlyeiKt90N Q/5vmOWj3hvLdLEaL+8UNyILn54qQp5fZCQXAFJKYEy8oKkBUT0Te5CMA0rZI4ru/RuD Gw24ItIos/xFJPwn2B2OecCNWPS6uM/muwLjliSbCndenduW1jH6Mt3/PoN3oeqLTsgM Lv6LQEqrtCXYxVSC1kB5EeQoifMY1cPqBY2VeojedE78st8jyQ8pCCqs0+SR7FWJ1Wm0 jJVTDPTP5yCi7JBzN3wEpNqEudU1fF41cCYEI1qpLPNakUzXwVUXZVJyqkaotmh43tsM 3e+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xhtfYHTtRIUtiLWrlG1HjxndnsoO+r7wzbcTIzTU2tI=; b=JaqmfPcNHxj2Bh468xCU5cY6PbUWZOTBVh0oiCLKHgHupL09J1hitJAbwBV8PTawbV 1yY396WaWnhv/3585GZEP0543sMzD+jW8wFK14X9sqAcbFXVvw4MIYL0ez0wj9jCNd4/ uzsiSZDukKuR+7DRSUJO8CBz4HYpiNrceqO96+7YuakuPGnLSLYomLscKXnGXRktPYhC TRsbMOBLNDRYvXJJLFrwTAZ0Iz7HqZ2rXzBX2uJmAD3RQKWY1FlCGulCR/hWIgaFRZyq gqdk43S6Mcal7P1XCFQx5QBOedFNwaBFUFd9c7929gDYehhheNNjQ0j6Hh2YsDSZ/2Sh 8xTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1zxKVXEi; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id cn17-20020a17090af09100b001c780f95fe1si4422999pjb.81.2022.04.06.05.38.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:38:34 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1zxKVXEi; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 75857480845; Wed, 6 Apr 2022 02:11:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1392387AbiDEWJq (ORCPT + 99 others); Tue, 5 Apr 2022 18:09:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349347AbiDEJtl (ORCPT ); Tue, 5 Apr 2022 05:49:41 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47FACDBC; Tue, 5 Apr 2022 02:44:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 08CA5B817D3; Tue, 5 Apr 2022 09:44:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4DBD5C385A2; Tue, 5 Apr 2022 09:44:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151856; bh=98aCFofgFx1i2qmaGNmZ2Ir40iIRhlyna9C5ZXP/Y2o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1zxKVXEiH0Nj3a108bCEZ6cymdOupquHXyny9iUU3ZuBgK1Md4ZSyu398PNtRZ5ho 5Ao3mC2GoEAvs5NRazgQNhTULPr4pZqCqKmQCQHCeI3j8ENFyPcDOL1MR9RuX1pZe9 HSOdDBb+9/TL9KXh/l7jAuCIjbruQEnzz0NQRKoQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hangbin Liu , Daniel Borkmann , Sasha Levin Subject: [PATCH 5.15 565/913] selftests/bpf/test_lirc_mode2.sh: Exit with proper code Date: Tue, 5 Apr 2022 09:27:07 +0200 Message-Id: <20220405070356.780493269@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hangbin Liu [ Upstream commit ec80906b0fbd7be11e3e960813b977b1ffe5f8fe ] When test_lirc_mode2_user exec failed, the test report failed but still exit with 0. Fix it by exiting with an error code. Another issue is for the LIRCDEV checking. With bash -n, we need to quote the variable, or it will always be true. So if test_lirc_mode2_user was not run, just exit with skip code. Fixes: 6bdd533cee9a ("bpf: add selftest for lirc_mode2 type program") Signed-off-by: Hangbin Liu Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220321024149.157861-1-liuhangbin@gmail.com Signed-off-by: Sasha Levin --- tools/testing/selftests/bpf/test_lirc_mode2.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/test_lirc_mode2.sh b/tools/testing/selftests/bpf/test_lirc_mode2.sh index ec4e15948e40..5252b91f48a1 100755 --- a/tools/testing/selftests/bpf/test_lirc_mode2.sh +++ b/tools/testing/selftests/bpf/test_lirc_mode2.sh @@ -3,6 +3,7 @@ # Kselftest framework requirement - SKIP code is 4. ksft_skip=4 +ret=$ksft_skip msg="skip all tests:" if [ $UID != 0 ]; then @@ -25,7 +26,7 @@ do fi done -if [ -n $LIRCDEV ]; +if [ -n "$LIRCDEV" ]; then TYPE=lirc_mode2 ./test_lirc_mode2_user $LIRCDEV $INPUTDEV @@ -36,3 +37,5 @@ then echo -e ${GREEN}"PASS: $TYPE"${NC} fi fi + +exit $ret -- 2.34.1