Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp624460lqp; Wed, 22 May 2024 14:47:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXLjitH2l8nagl2a+6mugsm1mWOR3JMCYZ7cw8GygGpdiELXJjgTm78eV8xAYkrGLTrwyOvf8DJOEXVz/G812SjGUtUX/U2SeluHPBfIg== X-Google-Smtp-Source: AGHT+IEzRs6eOtuYiR6iBi5MALYWc3PeORw5IZD9YbirzhmIKzfHUpaQHu/sRmZGLmwdadexvVUO X-Received: by 2002:a17:902:ea0b:b0:1f2:f738:bbae with SMTP id d9443c01a7336-1f31c9e63f7mr46732715ad.50.1716414438500; Wed, 22 May 2024 14:47:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716414438; cv=pass; d=google.com; s=arc-20160816; b=soojAcoI70pC1uadc4NMBvXOl5e+wPnBClgnJqTJMU1WMqNS+PGIpeP27NyNg2+PSi HZFxUfwUp/MUnzX9p1ml9/ZN9WyCNrSR7RdlyzZJh9K2SSeWRf0MSL4Cr+J4SJMEdrD3 BeaypzgNcXLADvP/laKftiQzzVc2EDjGrMFljfd4hYZdXCDfA1a5NXcgwl/czIdtAIev d9rPQehNKfUyGELwMfFf90iY4lQGQ05MSrJc/F764p5gvSPWkoYTRrF+Dh/a4z1icsi6 y6/nb/gYIX5PYIm02i2x6uJCZ6wlailFhUWni9pWDsPPy9QzYyDVBI87MJirFbANhCGr rr7w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=EOGUD8O414tWstDpBseZeWmPuLmz0zhjZ0RymgMKrb0=; fh=3ITA+hG5KH7F/YE3za0C4YE3vOQC6OhXaAYfDI4ufbk=; b=q6O8PBDHBeKInMaZQpFA2RrsbFuZAVIG4AS+70wR8DWa2TwoKmYTHB8PBW4/Qhy/Y2 8nQEpXU3ya0wq5Q6ej/PyLqcQX4DffOe/RmNexMgtYqLuQwyVRig1COXEsmRNXWDamDe iiJpwIEOVqi4iw5GU7M6ymUa8vcVmDYMcYIoDdmqkv9mDe1y02S+h7EkROSOcRYiVuW5 b1Ip81bAtSXEKJoplXlB7qxKCwIoCBYUcFFCTl5txWkm5jfqHI1ez1bHcIPLOLWJLIbT 6ou0bMRBW9dc975Ra0DenhrWTq/ehe9prBtKdAXaFJjTwJvXsU2s+K0DaYIzZPZxLTBP RaWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ZSV05dcW; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-186743-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186743-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0c14c89asi277851935ad.499.2024.05.22.14.47.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 14:47:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-186743-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ZSV05dcW; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-186743-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186743-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 6932CB2062F for ; Wed, 22 May 2024 21:47:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 74E721422C1; Wed, 22 May 2024 21:47:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="ZSV05dcW" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 170AF146A69; Wed, 22 May 2024 21:47:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716414427; cv=none; b=HfB9pTHklwMoS1ZsEfWw/tsRwTL9N0XFg/6SeBnE4BdT+lP0Ybara39AQL9AV0pvbpC2puVXUVkH5DFzMwjejiv6ir7rCGH02oeJh4lwva1usumGrxMMgkka2xwnPF2hyLLxx1dVvulhK79awrUjwLmvE8sN+tpIBFeWSj8ZwQY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716414427; c=relaxed/simple; bh=c4vBuU7VQ4mwFEFn2s+RaMllEqyyW2emcOv9iqGvLOM=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=ULlEezPGrZI2oW7nIt5vlXaA7mT6KWcXkrwHuHGIaneR6WDVMMqeGuqM/U6tNPpSpQNH+eX6kLfXPtExIdJNiosFXt5YUZOKbvK2wuHoRUVWDD10nMTTPWsBsePLu6KWIos0RDKfNNrbdr/bTck6ws85nomnoxA72zDzBvfQD34= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=ZSV05dcW; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1716414424; bh=c4vBuU7VQ4mwFEFn2s+RaMllEqyyW2emcOv9iqGvLOM=; h=From:To:Cc:Subject:Date:From; b=ZSV05dcWkVQ8FSBYxpOXtffDFdzh8LXdBYkrp4Sy2c7vtNZEIFgH6c4RT62JNl1SS N/xB+itHYM7Ek0D/pfC0nTFIeeMxD3QF21ifRBzMu55RDgM/p9nTtGrcbY7789okD3 ZYcD21LYRwl8OFWFd3XLIhaAmAZ9r39Qv6j/kR4KZmfLCJltuqFBH1gIPK34CvwfxA 2zG4mdpUEZz0pEgiLqcvvB3icAUOh6O4ZM8G6ArdEaSLi5ZcnYDrG791sNCLwQX0M9 PQMaCMvv2Y/IEGpZWsyMdgjmN2Ly4dkK/Qx4dVGBazLOEkT3vrhXaa91oKviIPHemo bdCFAskYNfyGA== Received: from localhost.localdomain (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madrid.collaboradmins.com (Postfix) with ESMTPSA id D24513782180; Wed, 22 May 2024 21:47:02 +0000 (UTC) From: Muhammad Usama Anjum To: Shuah Khan , Muhammad Usama Anjum Cc: kernel@collabora.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] selftests: openat2: don't print total number of tests and then skip Date: Wed, 22 May 2024 14:46:45 -0700 Message-Id: <20240522214647.3568788-1-usama.anjum@collabora.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Don't print that 88 sub-tests are going to be executed. But then skip. The error is printed that executed test was only 1 while 88 should have run: Old output: TAP version 13 1..88 ok 2 # SKIP all tests require euid == 0 # Planned tests != run tests (88 != 1) # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:1 error:0 New and correct output: TAP version 13 1..0 # SKIP all tests require euid == 0 Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/openat2/resolve_test.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/openat2/resolve_test.c b/tools/testing/selftests/openat2/resolve_test.c index bbafad440893c..5472ec478d227 100644 --- a/tools/testing/selftests/openat2/resolve_test.c +++ b/tools/testing/selftests/openat2/resolve_test.c @@ -508,12 +508,13 @@ void test_openat2_opath_tests(void) int main(int argc, char **argv) { ksft_print_header(); - ksft_set_plan(NUM_TESTS); /* NOTE: We should be checking for CAP_SYS_ADMIN here... */ - if (geteuid() != 0) + if (geteuid()) ksft_exit_skip("all tests require euid == 0\n"); + ksft_set_plan(NUM_TESTS); + test_openat2_opath_tests(); if (ksft_get_fail_cnt() + ksft_get_error_cnt() > 0) -- 2.39.2