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: 13580822 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id F38ECC5478C for ; Mon, 4 Mar 2024 15:59:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 52D436B0082; Mon, 4 Mar 2024 10:59:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4DD816B0085; Mon, 4 Mar 2024 10:59:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3B0DE6B0082; Mon, 4 Mar 2024 10:59:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 2709B6B0082 for ; Mon, 4 Mar 2024 10:59:27 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id EAD8B40CED for ; Mon, 4 Mar 2024 15:59:26 +0000 (UTC) X-FDA: 81859816332.26.09932A3 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) by imf18.hostedemail.com (Postfix) with ESMTP id 5F8141C0012 for ; Mon, 4 Mar 2024 15:59:25 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b="V/ymKtbU"; spf=pass (imf18.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.194 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=quarantine) header.from=collabora.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709567965; a=rsa-sha256; cv=none; b=GF/2dHVLEnKLCDpk7skfBBOYvNRY1PWTzzfkIJ+ivh97HFaKNWodEWiUN5JiOY7Fv9vJDV B55t+W+++/BpxHBZ4U6fv3YCY6cI87FxWiqmyPLQ6Ca4MDEP4W5NzOwExty2PrvSFef/UV cVnmZLKktUlEsk/HdXswA69usFakbFs= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b="V/ymKtbU"; spf=pass (imf18.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.194 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=quarantine) header.from=collabora.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709567965; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=QlAYY2DWT18yifXEUSrja72p7Ld+z3uDQmu3W7C2rk8=; b=STkGlXwWG0agNZ7zqeWylO5NumDFynjUN2A5NJvHnbvIWNr38PERRl2t+fd06EzWtBKkLY 8K1Wdc0TpMgdtQliliIymMJ9Vs1J2+oU9DnKaN3yv0K5KoguY+EAp+oZYUehSOS8bqf4H0 pEME2GmegPCUsFIPBTIkWO83Ve06rmI= 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> MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 5F8141C0012 X-Stat-Signature: sbaqfaycsjt6no33eggtphd5izh7snx4 X-Rspam-User: X-HE-Tag: 1709567965-401118 X-HE-Meta: U2FsdGVkX185s/MsAD1hhme58L2AgOOiDaW+VAUNjL0ZEK/LJfYno4kpAf+Uk4QT3GPmEHeIZnQlytv9twiwqQntWIm/qZSPSVfcegCBTjw/Ti+U8AZWzIBoleV25E/PKS95erqNesRf2q8+EDKdzT9jcCOZRlOq3+rwNzyt70EE8YIGzuzcHww3GxdTLbIcOJdNi+8Xzdn7Pv9bLNz+jpY3YtOp5yqDfSt3mesAubPlqqAO/Ysr7l/94IIedsF8i0xN+rbUlH48OPUXqyRgtQ+YU/pj6epz/nDL3bOMw14tExGOl7ED1ank5o8ATdPpEGWkC7l5YZh2T6ck9gX25L9UJSpBaKXr4rDyUnS/hRsdCpVwrxyFUcxonMI19ayhy6bch48FKBMp7ccCie0i1WFBxgRsQ/3WQvH5gwbBVfBtRsRK2yqP+EoJw7CMwgAWcquh11q226SQaUzvpiNJdkB5ruwSGsPbZgLHJdNXrQ4DPllYXuztfYPzqNNdx48iRKchQla6Ai51+CtNhgO4CGNs6Om/sAxq8VtU2SmFnLofEsTogwVHiDUVTU6SJ4QwuY0w5coIV/g3bzPCUUwPylLsnvlBHb4VlslsoEEuw0ewzDcd2unblx3QYBbEcngNpttze3Pvz4R/JMSwpDqZptCWl+CVLrSPvzWKkrjQrZ29reeru0dN7In0lPTYfjrLoZD8H/BPAsGXW1zrdAvAzWZHUOZlj/jY8xEejfJxCMTZEUmNdkI6SU3lywkOF0lYjSqgSDvsZcudIIiXyPo0aFUr+hvREeIOXKb1svtv42aD3Eo4feMAElRRiKIo7mnyJCjxLy2UAyP3SwmtW4/OMGfXlCkzcbQpdwcX8+cbGvrpjrQzs7Vma7KvbY6/PSA9YJinbm6fP1R1bcSqdOgZJXRynxNZeUa2TLooV1XkalQLN9HIzQThxQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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(); }