Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp964222pxb; Wed, 6 Apr 2022 05:28:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJwNKgZXpHe6ujQ0XDibUO0bzwjnMKE+5riTEMKFaQWaXmOd59mgyofJ1LA4dqpO8Eeymd X-Received: by 2002:a63:2cc8:0:b0:398:36ed:c12e with SMTP id s191-20020a632cc8000000b0039836edc12emr6857980pgs.290.1649248127252; Wed, 06 Apr 2022 05:28:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649248127; cv=none; d=google.com; s=arc-20160816; b=R6r0xw4g6POl9etGlTdyL81L5msa03ZQEZZhJnQ9ep57tPxyti8QT/h7j++p5LK/AH Jj4ED9mvY7qWVD8QWKOW6u2vkcOvULHJTZJ7pzQutb76w+gNDQSTuLBNSHg7JAUn/kvP GSZuaY3nXd3Kll1OVZ9y62wl5GCbysyO0zCROK3f3GXgMAjoFchvb/6lPihQeFV6VLFw EDrOgDPLfKK3ymTCgcwojHZxtZMCrsoYutwtcEhwWbCnrsYIWCGt50AbZV/0XEWKHvSA sqPqAXaC3VcfIJtL/WCnL7whXOhgkwTh8haxzmsNzA5kURxnqnZFqxKhIbrxJrCu6SZX bR2Q== 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=goAQw+ZYs/9VEt5MCErZcLjxEMV+Tl7EMUay/F7euwRa5OhVWcJllgE/9qVbqn95Nc 4DomWVsH2PRyZE7ISw4Rg8jNfu+//+7ixLYRvvK+49zc52sRo4ilbygs8BZUdUXo8gav 2EjZHlJOoUq0S6ciR5XB57KNrZgXekvdG2ce87nVfm0fgNnsUqdO9ilVc49wreJmTRbQ 9YfFp0cY8jKXj23B2nXyEsiCKqMNiQgSe2F5f+630caO8qhOHpJjqDXWivt3y8Be2xKq tVByXx7yim8/U/FAtHbIbLc8MiIsPiDlzaJFWlq/TnR0cl2IZA8fZIxyVgnv8pa/9jz3 1N3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DT7W85L9; 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 m14-20020a637d4e000000b003816043ef93si15279073pgn.392.2022.04.06.05.28.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:28:47 -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=DT7W85L9; 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 D8D346F8828; Wed, 6 Apr 2022 04:39:41 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1844582AbiDFBuH (ORCPT + 99 others); Tue, 5 Apr 2022 21:50:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243175AbiDEKfe (ORCPT ); Tue, 5 Apr 2022 06:35:34 -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 61D6EDF48C; Tue, 5 Apr 2022 03:19:21 -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 08A86616D7; Tue, 5 Apr 2022 10:19:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13F4EC385A0; Tue, 5 Apr 2022 10:19:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649153960; bh=98aCFofgFx1i2qmaGNmZ2Ir40iIRhlyna9C5ZXP/Y2o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DT7W85L9l/8uJ/w8EJEN4e2jYe7xtDTgYHWBkwwn1Z6jdWg9lSowIQXu0R2JbvCJ0 m9t8KE2EScQM2QNd8lFVHdaHxEt8YAXbJKzJGEwdAx+K5C360VZeF3D3PxyVEwNhwJ 9kdnpnUVxgEU9KOhwcXSHsN7EcXAxSWvuJdlpl6s= 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.10 371/599] selftests/bpf/test_lirc_mode2.sh: Exit with proper code Date: Tue, 5 Apr 2022 09:31:05 +0200 Message-Id: <20220405070309.870742871@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070258.802373272@linuxfoundation.org> References: <20220405070258.802373272@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