Received: by 2002:ab2:3c46:0:b0:1f5:f2ab:c469 with SMTP id x6csp174289lqf; Fri, 26 Apr 2024 03:24:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW1VfYEJdRFnZJnl4GT/lSe6V0odW+Sy5WRLOmDr0OTs6fTEd8AtWVkUOFg3BS1PhL7RWi1wmA3Ub1T2cfbsdwXYJqDfmm7KYy4jVmacg== X-Google-Smtp-Source: AGHT+IEYzBCV4svqtCojWCE0XEiRmtZokS5cClCiy2ifSsGwW/cEIMGJQhzTr9mpy4zacbwJydFN X-Received: by 2002:a05:6a00:4b43:b0:6f0:c828:8e0b with SMTP id kr3-20020a056a004b4300b006f0c8288e0bmr3008295pfb.7.1714127061199; Fri, 26 Apr 2024 03:24:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714127061; cv=pass; d=google.com; s=arc-20160816; b=M5fABujxfh6wwdcnvlCK3+hiQgCHUJVtlp5LVmxIX3lAy8H8iGcH4ehE6t/wTA29Qs lqhLblpWPZwU95IL3zjW0sGChCoQ3XpePPko4MIboU7IjI3knUKpogc6wjLUei/Z31Dh w6OwfwFLh9BLTJ+hilDNcEALkB8ynBqwVXNMM41pqhAvwv8ACIJnxTktiF7RCIzTlziR ZG4g8bOvrgR/Et/BpHoQjovbK9VKLVQNnMsmXN1jHDoA2Zn0EyQU5vUrbEwrZ6wBgajU x/HVoizgYZ9A8ikrpKYFRG0mDSgBJ7gjwYQhj5svkFvBc8GHK7BcSqoivNzb1wFUEOrw NDzA== 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=VjcLdJQ5Tm+Dpms0pcai2j66AltbR6MM4QbYqmdhaHo=; fh=Kx2RyJe3nkNI+lFFA9foQPow09s9h1Pj/s/LipIVqsI=; b=iWRgIwpMz/ZVMUegVWeqmKCpO5lkGdQHdWSuB0M3gLKotSyrr2oN27UMPJN7oKQ0+B /c+EtvFpOHbAC2MeYE6yTZ8MMAZcBFW8Fxt4SiUtKGSIPc2KgWVsB9pcxNO3Nv/ZqcOX 7CIOPzQe5MF9uE71/Zf1MJ99xduavYQNjuf1hSkWGomD2Jhol0gCnHMhRpVoFstUvTcR roVPUJaq0dUjSQpMhgat6y5JyLYd/CK1CVWO94UdyF8KeBn3Ui3JVZuQELqYsqWU4lDL eeVQKiAd3nFDzBckhaCWKv91b4mb6ed6s7SR1AVQNiXdJS+XcmU4vymCPm5HHBM9tpNx QFZg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="uHKWPnK/"; 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-159857-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159857-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 w185-20020a6382c2000000b0060cdcd93618si1494854pgd.144.2024.04.26.03.24.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 03:24:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159857-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="uHKWPnK/"; 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-159857-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159857-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 8F07CB24CBE for ; Fri, 26 Apr 2024 10:20:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 20C1D145B1F; Fri, 26 Apr 2024 10:18:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="uHKWPnK/" 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 CBF89142625; Fri, 26 Apr 2024 10:18:00 +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=1714126682; cv=none; b=QwxBDothfmGMEJCICncEYDrL9bLMsZ/pePZ5OqWn+RRKvZ7P08lYd/skt6FL/ZCpg3L3K1WpF+Vy5AOSazOROdl27hRFdVhdSy1xCfmJCrsCPCUR1b7UVNFPKdDexj9Fj0HV0qOUKxFTD2++fXuZn+5HpMIJaLnpVIiRtr5x3lM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714126682; c=relaxed/simple; bh=SuhIwCajet75pBQ8i3LxLuVtlkqvgvktzAYz1G96tqk=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=NnbBp4MQk22LAJOmxws/aIocO1fTWFkw7g43lmHqGmBjEWGPJ3W99YMjZDIFAoVHF0JRvP6KjheQI13wLNhBWig8lkoFRgU1g7ifIdbwqYIkzg/zqnIeTdhl4T8oZVy0equPGRz0GbK/yF4DJIzhls1A0FSAdr7y4lEg3LXLpYY= 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=uHKWPnK/; 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=1714126679; bh=SuhIwCajet75pBQ8i3LxLuVtlkqvgvktzAYz1G96tqk=; h=From:To:Cc:Subject:Date:From; b=uHKWPnK/aXQOOIlE5fceeGsq+yhHf5pwIEWcwyHiqc1UrPvf08mMn1gVFgARoDHMy 5mU+rLw8++8MwKxyQtW1GoohvIUGJeD9Lq3jEUsvhmmenVFNlncVm3s+6Fdl1HLZq8 8J6Odz5GrRDQ2xIKEuNP4ZaCYqwzKcJIQ0VH9W+bBhB5kGa2sEzjG7HRe4iy0F8/X9 VVdE3DmpqrDvgjt3MV/NBlk2EQBl4WTHcKKICbh/9McFHjE2kuTDr2w2l0nRT5IIeo FY0oVXeL66EQ6nJya5lJb3PJWAIi2l5cQ3WxQYytjuD+Ir/q7Gp9d8+xubjzNQLr3g c3XOE9oEwccoQ== 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 2C5343782156; Fri, 26 Apr 2024 10:17:54 +0000 (UTC) From: Muhammad Usama Anjum To: Shuah Khan , Muhammad Usama Anjum Cc: "Chang S . Bae" , "Kirill A . Shutemov" , Binbin Wu , kernel@collabora.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] selftests: x86: conform test to TAP format output Date: Fri, 26 Apr 2024 15:18:22 +0500 Message-Id: <20240426101824.2894574-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 Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- Changes since v1: - No changes, sending it again as got no response on v1 even after weeks --- tools/testing/selftests/x86/vdso_restorer.c | 29 +++++++++------------ 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/tools/testing/selftests/x86/vdso_restorer.c b/tools/testing/selftests/x86/vdso_restorer.c index fe99f24341554..f621167424a9c 100644 --- a/tools/testing/selftests/x86/vdso_restorer.c +++ b/tools/testing/selftests/x86/vdso_restorer.c @@ -21,6 +21,7 @@ #include #include #include +#include "../kselftest.h" /* Open-code this -- the headers are too messy to easily use them. */ struct real_sigaction { @@ -44,17 +45,19 @@ static void handler_without_siginfo(int sig) int main() { - int nerrs = 0; struct real_sigaction sa; + ksft_print_header(); + ksft_set_plan(2); + void *vdso = dlopen("linux-vdso.so.1", RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD); if (!vdso) vdso = dlopen("linux-gate.so.1", RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD); if (!vdso) { - printf("[SKIP]\tFailed to find vDSO. Tests are not expected to work.\n"); - return 0; + ksft_print_msg("[SKIP]\tFailed to find vDSO. Tests are not expected to work.\n"); + return KSFT_SKIP; } memset(&sa, 0, sizeof(sa)); @@ -62,21 +65,16 @@ int main() sa.flags = SA_SIGINFO; sa.restorer = NULL; /* request kernel-provided restorer */ - printf("[RUN]\tRaise a signal, SA_SIGINFO, sa.restorer == NULL\n"); + ksft_print_msg("Raise a signal, SA_SIGINFO, sa.restorer == NULL\n"); if (syscall(SYS_rt_sigaction, SIGUSR1, &sa, NULL, 8) != 0) err(1, "raw rt_sigaction syscall"); raise(SIGUSR1); - if (handler_called) { - printf("[OK]\tSA_SIGINFO handler returned successfully\n"); - } else { - printf("[FAIL]\tSA_SIGINFO handler was not called\n"); - nerrs++; - } + ksft_test_result(handler_called, "SA_SIGINFO handler returned\n"); - printf("[RUN]\tRaise a signal, !SA_SIGINFO, sa.restorer == NULL\n"); + ksft_print_msg("Raise a signal, !SA_SIGINFO, sa.restorer == NULL\n"); sa.flags = 0; sa.handler = handler_without_siginfo; @@ -86,10 +84,7 @@ int main() raise(SIGUSR1); - if (handler_called) { - printf("[OK]\t!SA_SIGINFO handler returned successfully\n"); - } else { - printf("[FAIL]\t!SA_SIGINFO handler was not called\n"); - nerrs++; - } + ksft_test_result(handler_called, "SA_SIGINFO handler returned\n"); + + ksft_finished(); } -- 2.39.2