Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2668158lqp; Mon, 25 Mar 2024 06:12:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVoj1bgkN3ecNWFmPDdfVyX3QQEM7e9/SemCldO2eZEOMaYvKv5EQj1DFVGMvWTbl5DAlgKEvyL/RiCO1YkF4id3c1/rqU73alrvTbxIg== X-Google-Smtp-Source: AGHT+IGGdlqDSeUbtoBRy2hc1sLZm8kmnx/KR8jj7fS8BIDIe9+5gmfsuidYg50t5FNlaXVt6FlM X-Received: by 2002:a17:906:70d1:b0:a46:4bd4:df86 with SMTP id g17-20020a17090670d100b00a464bd4df86mr4912290ejk.3.1711372352173; Mon, 25 Mar 2024 06:12:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711372352; cv=pass; d=google.com; s=arc-20160816; b=qhm3lcKM0R9dY9IzJnt3fzZ2PCIu0TDAZiGGG5wbgdNDwKbVsnTjRU5RLgBmbWFzIw f7OulyfhwA7upViSpRxbZeKSWoAxvmfD7CyLdXj+Tgqy82r4hg9kGGIzPV3SXsThSyux RkrjvdaIlKpPJYglIKaR/bxVt2KhRWAG6xh4v1gOYqvfioxd1TErZ8PYqRcbuw9pVk8g NqmxKA5gJWb0Xj9xIQi4VN2Stn+bvE6/0GHBfzzj+E/xNEt9ejfsQ/xnnHNGuxPYHOq9 n6KmW6vxUWFsm7uL9UeHSbHZkbNHAqxbCZswy7S9caW8+Q0CHvW51MsagOhS3GNISnkJ R9+A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:cc:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=AknakidvsYgdFHwJN8S2C0Gmkdq1TqNAygmVfg0U0ew=; fh=G19b1/02jVuK/IQA74E6NAg4B1iVTkiT1n992vBavxQ=; b=lvb/00qZWamIp/gEagaTPK1ZaXb/Cjz2MLhz3hS9QmqUvJnBpwXfz4P7pCRPjhymUX KUyFrwhO2ZJw+bUiAfmpGesCWxP3qo7gADPnOnhmmrstb23rRdKlBCQSkgkK4PMY7nhu g0m/4OKHj1T5tFAnR/Z7aYFukgpU/XGHFSfKkyv5mbMhwflA3OX1sM6qU4olQeSpc91o dYzGSsQo9mAQbpKAyQ2KPV2kDajZ9ugJ8nJwcpdpfCSBzduZpSnrcocjRs87SyB/Dpp/ 5YGSci+roML2wcMIbL29b78osSffvaw9TMm38tx+x4FmtwjXLthVN93G7G4DDJK3j00R Vfig==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="j22xJ/w6"; 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-116614-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116614-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id lf8-20020a170907174800b00a46cb8e0f34si2602829ejc.772.2024.03.25.06.12.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 06:12:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116614-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="j22xJ/w6"; 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-116614-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116614-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 am.mirrors.kernel.org (Postfix) with ESMTPS id E41DE1F307D3 for ; Mon, 25 Mar 2024 13:12:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A16EB17263C; Mon, 25 Mar 2024 09:10:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="j22xJ/w6" 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 619937319F; Mon, 25 Mar 2024 07:06:42 +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=1711350404; cv=none; b=o4Eeob5Z+IMjaGjxGyY+iK6LdZbwO+wrB6H/SBNepBPPEnjQ3rTuJqW7mTmoIDmy8ngXzoFwJX4EBGn5F7JOM51B2I5znb2ElgpTjCwCxAJNBWTpmHQITF24VSDfpIHcCmIZYRCY9MlaY8hxQ2NISh0tXTxViwAAJDJjnvUN9TM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711350404; c=relaxed/simple; bh=2BI+P40kX8mCNe18wq2erATH2487oY9xn8frIy2QuAY=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=MuT+YYKiHIvxgZPVtvlAeuhWR2uJGWB2LF8siTRyN5Tt55dSsk21Qd63WwjK11F6zz9PgAWMVNGZEFN8UqBPgwFAY3QglL2C+OkZZwifDveH9e8IW9kIju3fFmIqvFiqRl2bYW+hObQGoLshmByKrfVQZDxei6uido78/DbEec8= 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=j22xJ/w6; 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=1711350400; bh=2BI+P40kX8mCNe18wq2erATH2487oY9xn8frIy2QuAY=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=j22xJ/w676BIdvmye1gkOBURBDit3tPNtdL2O6CbIZ0Wqm1JX5xZ96yz7/DKqz1Z/ MGiMSZdVvO/4aO66fShJrOMoy4yvVnms7+90f9GavTydIJ4wvZqAJgeDrVS1bg9/K1 vWpMTV8PwnlojLL/wHGL7bncTDrfBuulQVYeKEIlo8kMFtJYiFN64k+SbsIXHpUMaj sa1ATVHWT6R1uLT+DnIRg9X4Q1+pmJa8wULt6c4ZOiKh/UXpXeHI84LD1b2Sli9dlD Ja3C/K4HrQ54Uvgl+ezdS1EwAQuiTOo+iBrjt0YyiJUp6S2SeMIVWsSH5YbJ0+z7Qe eAeLkYXDtPsMw== Received: from [10.193.1.1] (broslavsky.collaboradmins.com [68.183.210.73]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 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 43BC3378148F; Mon, 25 Mar 2024 07:06:37 +0000 (UTC) Message-ID: <3c3b8d18-7f52-4914-8a1e-8e32b4dd8b20@collabora.com> Date: Mon, 25 Mar 2024 12:07:13 +0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: Muhammad Usama Anjum , kernel@collabora.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] selftests: x86: conform test to TAP format output Content-Language: en-US To: Shuah Khan References: <20240307183708.2857513-1-usama.anjum@collabora.com> From: Muhammad Usama Anjum In-Reply-To: <20240307183708.2857513-1-usama.anjum@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Soft reminder On 3/7/24 11:37 PM, Muhammad Usama Anjum wrote: > 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 > --- > 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(); > } -- BR, Muhammad Usama Anjum