Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1930574lqg; Mon, 4 Mar 2024 07:59:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXnww8FYbliZWF5zv3OlcxOr71qCgfc81CrHSr4zd3eLK1i4NRv/LtzpqaMBUKOW+go04KUwdX42XbH2CX0RBnxGkjnZfg6f3Oon/VMqw== X-Google-Smtp-Source: AGHT+IF5IW3AEkCOhDWHLFSH3pPjdUlzZDU4SdVIIgo553d2qghbqBBrcZ0fpkluidUU0NLvFtDb X-Received: by 2002:aa7:9dc4:0:b0:6e4:68fa:f1f9 with SMTP id g4-20020aa79dc4000000b006e468faf1f9mr10171890pfq.2.1709567984146; Mon, 04 Mar 2024 07:59:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709567984; cv=pass; d=google.com; s=arc-20160816; b=R89iZxoyJqqmqcZTz4o5+JDOeG4UhljfyKVDYg8jLqfFVkKEAiislOJ+90m0hnyktf 4kuEwU0W9fs6aEQR8lSbTRNMkRWL4NXjuJAJp8uOJdUuvQEEg8Q2S3TcpdXpHPamqZdY +fwTrnv5Hbmp49jV4BO1iaLmkdIO7R7FUzBNLcFOcOitUUrWIr1R8AcuznIfnbdb4drT 0JL0PrLhufDuNuRnVtePnXFpr4AmWlhHdJwYQx6LObBUO3mNAB90dkbj7x+3/85/BWKZ lpbMg3N1oHKDcmf06D8w4b/PjJCt7WbC9yUeMUCAyYfxb5SrPZDIHinNvnWYKKxVzeph zvWQ== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90885-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id b2-20020a63cf42000000b005dc958db2fesi8412098pgj.34.2024.03.04.07.59.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 07:59:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90885-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90885-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 791DD2828F8 for ; Mon, 4 Mar 2024 15:59:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B390C4AEF1; Mon, 4 Mar 2024 15:59:27 +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 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 --- 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(); } -- 2.39.2