From patchwork Mon Mar 4 15:59:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 209622 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6359:6299:b0:17c:1df7:5ed3 with SMTP id se25csp287585rwb; Mon, 4 Mar 2024 08:07:21 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWWFhuvZFqeoySuCLggDQZNohes3jlJBW8u/siaecMKktb73zfbTDJiRxLCyBqkgaug/X6bCASbduxL0YDhQaXn0AVyuQ== X-Google-Smtp-Source: AGHT+IEjAMVirup5jqQdg+tIMg4ibTdhtTKVZayRnxQBVNeoj65MHvnTlognyXaefLnCisG+vZbO X-Received: by 2002:a17:906:264b:b0:a43:d1a5:e907 with SMTP id i11-20020a170906264b00b00a43d1a5e907mr6251408ejc.58.1709568441560; Mon, 04 Mar 2024 08:07:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709568441; cv=pass; d=google.com; s=arc-20160816; b=eC303MpRbN1wo39k10w3oe+DmLbw68JsZEEaZ0g8gZSPLYPZGNsPMoFt0vSmouXWjW /KyP7DP7SWUkdtUNSpfDT85LGMeebQ4+f6QUb7e5JiUVXep5H8IJ0TKETDiLbI14iRQh 48iSORIn5Pe9EoL2vEivBMFCxPEtb2fBz0ycD1xtr3scDSJf1C0EW5t+VMLobhgUVozL +qK2HrxI3wncd3VA6q2rNfTydoeyvjpKkHX2kbXKVow55/PgqWjQauOfXkXkzUXl0IHB GyOY+dxgmh0zqT5CiGwMMxFNne79NWNMExYDr7hrJJnfW0fBbSY8GGeb26ad5mu3m5Bh b/jg== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=QlAYY2DWT18yifXEUSrja72p7Ld+z3uDQmu3W7C2rk8=; fh=1Jfmq3vZr7PtBvoeUFB4e3RsVLj7M6kTr4UK8fn0TwA=; b=SuUJPuuQ1n3ayD7/sG6ZYP1Ljfl4B8TYlX/hCV+l8MPG7VBRQeLKtotiohD0ZN+Rzd zJA90xHv8zol3z49WlorPLOCkz7WPUGVcJ5SyDOsNETvRxZirL+UOa5BfCSRs+Pa7cvy iOPOLrXXngIcf+G05RjHLOfMiJAatNRWM1qX7ZAl5Zb6dqQ10d5NMbohw+wuRC47UPuE pzs32SgYrM0u+1FHLWixWbO2AaX1jmLehYQ8i6Tl0ERXZLCboLsqTJv/lSqCHHX5kD23 g5dd5sew9HzH9DuLaKx62uqPzooeXwYoD173jNYp8a28MI83jf7f4x6FmkGMLo8f3CxF EzVQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="V/ymKtbU"; 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-90885-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90885-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id i20-20020a170906265400b00a3e82455348si4121058ejc.858.2024.03.04.08.07.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 08:07:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90885-ouuuleilei=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="V/ymKtbU"; 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-90885-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90885-ouuuleilei=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 0E6181F23BDC for ; Mon, 4 Mar 2024 15:59:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 70774482D4; Mon, 4 Mar 2024 15:59:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="V/ymKtbU" 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 7C4FC1B273; Mon, 4 Mar 2024 15:59:25 +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=1709567967; cv=none; b=sS1P2xgyUFweKoJS0LGBw3XbeVHuhhTLpE9afmtOEdThJReXymTTNRsVvmZ6f8x45s1dQ0wDFWSbEIzCBPrVRYzXI3MdKJZ/r8NnJDLG9bTBzNImCfAGHsl0Pw/bbEs7bSvZiwFJMayxlpqWj4m7DWJpsxCTo6yg2aNs3gC7zPE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709567967; c=relaxed/simple; bh=hDJ+1B+zZE31bqNelWnsX1xAb8MS/M4MyzfsBFhvn0g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Vj7XAAj9vrtj/odxcur8MjuD0z3FpYgmCc0076TFesbb69+47ioVeA1oDmNLl+b+qqjgjGcaosFgfgYvCFeri90oOzmcOVnHg29CcXr9Hq9kKf1gGzdBNTJoY/vfHwWp+Hmzye0zfYCaNyo/WUaz6GaNC9udO6FTdlr1y2seNY4= 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=V/ymKtbU; 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=1709567964; bh=hDJ+1B+zZE31bqNelWnsX1xAb8MS/M4MyzfsBFhvn0g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V/ymKtbUVUuWevduols2PiqD0visrQxCth/3JhrOkjWaLAuxTr5rxoPzc3FBvSxZp zZHjXYn4gPIAxXkAZ4z3X8GvHlVCUut1SeVVLiXMsxfaNyK5xD81+dcd/LYDCPkk5S soBoo+MYi2+OG5twAke5IaDJFVqvc7p02lisrN4W9HWC4IPV7iX071RMrdUWEDTYWn bwwgA3V8a4RBfVc6O7lcgJztC4PrQ1VjJqiR/Frlniw2jHhdekeGHKkZjOKwuS3aRy Z31/kE+ikR8kxkOqG0sUPQ04iIXeV+4Gml/X3rEUn2PC2avw9wsu7uqrlH5pdUjFlO nU2PAjOIIiVoA== Received: from localhost.localdomain (broslavsky.collaboradmins.com [68.183.210.73]) (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 8644C37820CB; Mon, 4 Mar 2024 15:59:19 +0000 (UTC) From: Muhammad Usama Anjum To: Eric Biederman , Kees Cook , Shuah Khan , Muhammad Usama Anjum Cc: kernel@collabora.com, kernel-janitors@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] selftest/exec: conform test to TAP format output Date: Mon, 4 Mar 2024 20:59:24 +0500 Message-Id: <20240304155928.1818928-2-usama.anjum@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240304155928.1818928-1-usama.anjum@collabora.com> References: <20240304155928.1818928-1-usama.anjum@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792612438181713642 X-GMAIL-MSGID: 1792612438181713642 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/exec/load_address.c | 34 +++++++++------------ 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/tools/testing/selftests/exec/load_address.c b/tools/testing/selftests/exec/load_address.c index d487c2f6a6150..17e3207d34ae7 100644 --- a/tools/testing/selftests/exec/load_address.c +++ b/tools/testing/selftests/exec/load_address.c @@ -5,6 +5,7 @@ #include #include #include +#include "../kselftest.h" struct Statistics { unsigned long long load_address; @@ -41,28 +42,23 @@ int main(int argc, char **argv) unsigned long long misalign; int ret; + ksft_print_header(); + ksft_set_plan(1); + ret = dl_iterate_phdr(ExtractStatistics, &extracted); - if (ret != 1) { - fprintf(stderr, "FAILED\n"); - return 1; - } + if (ret != 1) + ksft_exit_fail_msg("FAILED: dl_iterate_phdr\n"); - if (extracted.alignment == 0) { - fprintf(stderr, "No alignment found\n"); - return 1; - } else if (extracted.alignment & (extracted.alignment - 1)) { - fprintf(stderr, "Alignment is not a power of 2\n"); - return 1; - } + if (extracted.alignment == 0) + ksft_exit_fail_msg("FAILED: No alignment found\n"); + else if (extracted.alignment & (extracted.alignment - 1)) + ksft_exit_fail_msg("FAILED: Alignment is not a power of 2\n"); misalign = extracted.load_address & (extracted.alignment - 1); - if (misalign) { - printf("alignment = %llu, load_address = %llu\n", - extracted.alignment, extracted.load_address); - fprintf(stderr, "FAILED\n"); - return 1; - } + if (misalign) + ksft_exit_fail_msg("FAILED: alignment = %llu, load_address = %llu\n", + extracted.alignment, extracted.load_address); - fprintf(stderr, "PASS\n"); - return 0; + ksft_test_result_pass("Completed\n"); + ksft_finished(); }