From patchwork Tue Mar 14 12:34:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Klauser X-Patchwork-Id: 69605 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1733282wrd; Tue, 14 Mar 2023 05:43:12 -0700 (PDT) X-Google-Smtp-Source: AK7set/Ld7fUNZXIQVNA6gg0rLwTyw7fOQBEdNm1ChAggeamW2NTkZOVUgNiWphE8J1vYfY7fB9P X-Received: by 2002:a17:90b:4d12:b0:233:d657:2c7e with SMTP id mw18-20020a17090b4d1200b00233d6572c7emr39544051pjb.8.1678797792003; Tue, 14 Mar 2023 05:43:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678797791; cv=none; d=google.com; s=arc-20160816; b=L+BnVfTxuCjXPBJaxD4ZXLfIub7AEsm8gjnJ2GmA2SUkbSRSfp2+SkK3V1/8HXrBey 0EamgDLzwnhcVkLNGlj0EoyClXUc2CpTJ1UWt0hMejJm0Q95xh1BLdNPZIU0zWbYb4nP imYZF8fnBn+GRGc3AnWw77aJS38s4NB8ycLRBqJSHENDPha3XlpECkXqLAa97YN+5RYL gnP/ofkD3iTa64b5BmfgP7gqUUPyNzK7IP/SK+h53XwqzfN+vDaVWlOB+F1B0G+Kxbmh xcDWIavPXVANtXw+Apy10XDPJx0ANvRdq69vL1OzdWScR4M4G19yFe2kpNYDEsE6jlEi xi9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=D83u3jito7UXOAKHOKxc0VTKBXXTIxMxfihPP1fjqyY=; b=dXPZug1Y+5qG4UHRKAXs/LDW9Gi78PTNlZaTvr0M3n3/OvaM5WxAKdtM2tPYmkgfT8 DgMuBF/ufecRVNeIM6U1+25+pIfjlF3ZnrJvUg2uwIJr0MCDDwF+cg+Dx0zuKxpBio+2 np8UkawybcBnl3ta1W6xYHmGf188x46velp18wU36Tc5bilLP87A75bIDsKprVfzCbwo dXI3JD6004u7Pj4XUnHbob5z4aWY0gXGAm+0vYYrxchBR3Mc0KkPbm+tJIUyf/X0EFrH 0NCyvOo+FV7QwpjOPo1zt6V24byV8XU1jMNLi2HINb5Gqw4Zh4TmxzdJWfh5jzVZzMfm FVJQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w12-20020a17090aea0c00b00225c981fee5si2297739pjy.112.2023.03.14.05.42.59; Tue, 14 Mar 2023 05:43:11 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231263AbjCNMfr (ORCPT + 99 others); Tue, 14 Mar 2023 08:35:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230111AbjCNMfq (ORCPT ); Tue, 14 Mar 2023 08:35:46 -0400 Received: from sym2.noone.org (sym.noone.org [IPv6:2a01:4f8:120:4161::3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47D5B9545C; Tue, 14 Mar 2023 05:35:10 -0700 (PDT) Received: by sym2.noone.org (Postfix, from userid 1002) id 4PbXyZ4t8yzvjfn; Tue, 14 Mar 2023 13:34:14 +0100 (CET) From: Tobias Klauser To: Christian Brauner , Shuah Khan Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] selftests/clone3: fix number of tests in ksft_set_plan Date: Tue, 14 Mar 2023 13:34:14 +0100 Message-Id: <20230314123414.26907-1-tklauser@distanz.ch> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20230314115352.20623-1-tklauser@distanz.ch> References: <20230314115352.20623-1-tklauser@distanz.ch> X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE,SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760344952114927330?= X-GMAIL-MSGID: =?utf-8?q?1760347073655358019?= Commit 515bddf0ec41 ("selftests/clone3: test clone3 with CLONE_NEWTIME") added an additional test, so the number passed to ksft_set_plan needs to be bumped accordingly. Also use ksft_finished() to print results and exit. This will catch future mismatches between ksft_set_plan() and the number of tests being run. Fixes: 515bddf0ec41 ("selftests/clone3: test clone3 with CLONE_NEWTIME") Cc: Christian Brauner Signed-off-by: Tobias Klauser Reviewed-by: Christian Brauner --- v2: - actually added ksft_finished call as mentioned in the commit message tools/testing/selftests/clone3/clone3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/clone3/clone3.c b/tools/testing/selftests/clone3/clone3.c index 4fce46afe6db..e495f895a2cd 100644 --- a/tools/testing/selftests/clone3/clone3.c +++ b/tools/testing/selftests/clone3/clone3.c @@ -129,7 +129,7 @@ int main(int argc, char *argv[]) uid_t uid = getuid(); ksft_print_header(); - ksft_set_plan(17); + ksft_set_plan(18); test_clone3_supported(); /* Just a simple clone3() should return 0.*/ @@ -198,5 +198,5 @@ int main(int argc, char *argv[]) /* Do a clone3() in a new time namespace */ test_clone3(CLONE_NEWTIME, 0, 0, CLONE3_ARGS_NO_TEST); - return !ksft_get_fail_cnt() ? ksft_exit_pass() : ksft_exit_fail(); + ksft_finished(); }