Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp699801pxb; Tue, 5 Apr 2022 19:19:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgYT3fh6+OCXb8fktYbp5ikxi7qzPrzeJaDKAeFWqBr7CcCeEYpP5Nb5krNOx/Gi2CSpvI X-Received: by 2002:a17:90a:244:b0:1ca:6724:55b4 with SMTP id t4-20020a17090a024400b001ca672455b4mr7348122pje.30.1649211557972; Tue, 05 Apr 2022 19:19:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649211557; cv=none; d=google.com; s=arc-20160816; b=BWHhFUyJkfK6vK/iY7fXNEjhuaJfUOmDOcukvZyTYqFwT4IFnCPctVEt9ZUnL2IbLF GQqQtTwX/GHKIkJr3Y21auxEQUvOcy8IVfOySv6aiEihniNNkeYZXCIWlHoFaiR/NIhs GFYyGmz3S/RRZS2v5/2KKd8af8v0qLNZTI863pg5KoRpaRII+4a6P2xp9D6ZAjN2EbnV hLwIs1v0J7wlp//GHrvKz81bAXn66rXidc4Bw1QkTozIddwq6BP3/kDsj8nwvD/c4DEQ ly4b0y0Oo4ct/mEKQbxZeVqmXACt7ai+Sk3dghZey5bXKuJ8Q71euUg+PmXNSQtSpluG cxZQ== 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=ek/lzb+tJieHU5ehuhYOPT4A/VnK7wJ0JF3L6LNC0rLwNE3I9WmtGDMzo3ZvCow9PW 7ljfbFzbVoMyMl6nqQiL32+iRMz9hIKwkUqnkDfkOV5P0Ls7CT+7o76d+O8BE4cpLnSD baQQCPI63qW4tCdMI//sFRUv8oe0OHvsdz8pbFkVcu5O0kOtA3DF/F4jSrVpTz2YihR0 nzhzHSKZOKUGpDhAjQrOZdYNMzaciDbsgccHb/s1oYzNgLxU2UQctpBTA/D/7Lp4arV1 bjQFgQEmUDscG+NqG8CLd4IzGeJfSJbqUZivXEktxEKlWVEkMYT6+2XNP9z0Kt5vkLCV AQrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Y4k3OFyU; 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 m2-20020a656a02000000b003816043f02bsi2685713pgu.544.2022.04.05.19.19.01; Tue, 05 Apr 2022 19:19:17 -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=Y4k3OFyU; 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 S241593AbiDEJHN (ORCPT + 99 others); Tue, 5 Apr 2022 05:07:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239294AbiDEIT5 (ORCPT ); Tue, 5 Apr 2022 04:19:57 -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 575FF6D854; Tue, 5 Apr 2022 01:10:55 -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 029E6B81B90; Tue, 5 Apr 2022 08:10:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D159C385A0; Tue, 5 Apr 2022 08:10:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649146252; bh=98aCFofgFx1i2qmaGNmZ2Ir40iIRhlyna9C5ZXP/Y2o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y4k3OFyUnpC3GZFN1VAC/AMhGcm5lTjkCHDpVXsiMM0zNxgR8VyO40VFVIomXj+Q3 RdpwrWmyG66VIVbhhklh+yQe3OAUNuL29MK28t+jzCPep/Z2ZRpAc1hX60DDQD7uuQ PkVh5IR8m17dPlggnnxtxhUFr121vvaGCRIz47cY= 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.17 0697/1126] selftests/bpf/test_lirc_mode2.sh: Exit with proper code Date: Tue, 5 Apr 2022 09:24:04 +0200 Message-Id: <20220405070428.068045446@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@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