Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp670285pxb; Tue, 5 Apr 2022 18:06:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXk+Z1qSa0EVdYmhbsM9Oi+csnqpLaFQEouj4CQrpYleLBj6HoFkp8Ac35UEtBo4HgkB3/ X-Received: by 2002:a17:907:6e93:b0:6df:8c1a:d08b with SMTP id sh19-20020a1709076e9300b006df8c1ad08bmr5933547ejc.557.1649207184571; Tue, 05 Apr 2022 18:06:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649207184; cv=none; d=google.com; s=arc-20160816; b=S4mMJUvyt1k6Twdhs17u0zuOaCdkYxWLelbteokwsgWZFyustiFCaUUj12+lyiE9D/ lBkRoN03G1LDUjWhI9PTwLfdd6QOO3eepfMcmgljHCOMM3wCXIpjLGB2EKzK682eW3Xb +uBd+CD5RyP+pN8svY8iSdZooNaoZaiMA1bz+OkKcRPVgf+K+cfJCHBqPuqhPnaZxDVv seeWtpvHSx6T02/rppYwd/NKzG9n7z7p/8Gk1thdJWN/9J9X7B0qaexLX8vJnWT8ibO9 ufWdIogDwzXf4JwHEnYGif+lxWXNq0wam08H9+dE/Lv/WO2N6Ui8K5FsvjQ2JKqd2Ryt aMJA== 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=o/IWPMXp8kVgOO5/XBO+HTkTC7O0hKFxD5OtomRX0WUEKuPKP2tHYxxr4ZEPewvskP lQD1GuYTfcgTVGJb+kCbAgoWRpBwPTDaoxqxJIm5j+XX37MFoiVPRSR/eyTSrzXKCWb0 Z+eCOtXkp8mXSbqpJqh8eUATm6OfWpcmjvW/8dM0JA2jsjq0BXQFKdIVvZVRStxMBYpO PM6iQ94VM2SQ7pgN1t90Pg6edYQFg/ts+pGk5i96DA6OE1H+U1Wpvq64qH0wwSNM9N7I t8sN4/D6B6M8bEGa1tAnE5heNuxOIDRrVnRU0/pXCkLSYfI1qiVE1qVQ0fkuJVc4BdPG 52/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0dEhBcsS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s9-20020a056402014900b00418c2b5bee0si8894787edu.450.2022.04.05.18.06.00; Tue, 05 Apr 2022 18:06:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0dEhBcsS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378533AbiDEMws (ORCPT + 99 others); Tue, 5 Apr 2022 08:52:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244732AbiDEJKw (ORCPT ); Tue, 5 Apr 2022 05:10:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0BFF2BB09; Tue, 5 Apr 2022 01:59:57 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 1F98461500; Tue, 5 Apr 2022 08:59:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22571C385A0; Tue, 5 Apr 2022 08:59:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649149196; bh=98aCFofgFx1i2qmaGNmZ2Ir40iIRhlyna9C5ZXP/Y2o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0dEhBcsSrM/BKKNZc0wGDpSMwb8RV0HSEptCVhC3zP6bXoNVuUU2HD5UO526nlG6o Sl0rfDZ0U3nVshVZLMu4bjemiJrLBdczFeep9U5yXvgt25J0z3RfU1VM+BrhQa2QrY c1+TNYto0urLnxb7ejBH7Y5q9fpOlxjFsciWBHaQ= 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.16 0628/1017] selftests/bpf/test_lirc_mode2.sh: Exit with proper code Date: Tue, 5 Apr 2022 09:25:41 +0200 Message-Id: <20220405070412.924432360@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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