Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp767511rdb; Fri, 2 Feb 2024 03:34:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IHfPBwi4i05zHDtNQk7LvDj/VJ+8KJQkVipRc7HgC2oUVH7t573lmzDFOf6PV7o4kVlMMma X-Received: by 2002:a05:651c:1061:b0:2d0:8ea8:7ca9 with SMTP id y1-20020a05651c106100b002d08ea87ca9mr70419ljm.23.1706873693606; Fri, 02 Feb 2024 03:34:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706873693; cv=pass; d=google.com; s=arc-20160816; b=apRitWvmDpOZRQvWMbo8xNSyJ6LrgBciDOgFPvX3CgEezPMJUieGxamv2DoOW0ssac uMOoBIPy0lQOF+8reVYgpsazVbMkeV/Lg5vv7xMEjgiSQ5PPcamfU66120MPdjqJRq1z paQeJsWqRGZOEyE5KmE4phVBvm1uhVJ+b4K4F6Ltp+vZWDlsNOksQbCDYLQiUuAqBh4s /Hju8Tp3jmOmY8XCA5IDWcDKvwn6nFXDbKz8bk0lRdz4xUxaVhr+XIL03nYDIwuWT2Ar pbUHuK2wDMt8DE+e/dJQG2rnqd5Wm1dPFCkNkQKScSbr0ECQX5QMpKmmDog0J3bJd3As H65A== 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=asUANzFqAgLjH6ZwJV82sNijZ4nVe9PH98JXMjUtul4=; fh=NjfZU3MFiPdfW2jn2WtTzuo791KRxKMTOr84dsXfteQ=; b=doa4T2oPJCmlIdMrK1FwE7dYdGK5G+aUwfE2t1HiqbfEcK3CIYEgKRplhq51SEYb85 X9led3Q8APxg6ce4egCBycmqRYt2NLpWTVlcAKyCAdbuSxhizMg3lGPpBThmiu1LDGFK dT1No5j9DCw2ujvjNSRburuUM2KL978Jf9HQ+8FvRenIWUouItJMDGN8xelhlDWKw6pd Hi0+AZCtzdOmXjJagZAuQ/dVCCkD2ktVyJVG+6VpA+sThoGvyhJoV3Y+4J7y6FTgqHDL QMZqT/WQvgFNzHSACkY35E0w8OGKoZWsCtnIxkeAddgiErG+crDYXO+gAqPg3mblJeOJ AhHw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=5jrbRNKk; 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-49759-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49759-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com X-Forwarded-Encrypted: i=1; AJvYcCWKp7xKnBsaNUaqVpScy2IDdFdzI+vzS1mXPFpLKBiPurVWZmOzo3k3rNLFsRXiJlddWs86arSoBuOiqcFfsFVy9+u5tgmsz9GrKWT1iA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id j26-20020aa7ca5a000000b0055fce148755si728086edt.401.2024.02.02.03.34.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 03:34:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49759-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=5jrbRNKk; 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-49759-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49759-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 2EC441F259BC for ; Fri, 2 Feb 2024 11:34:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2EB9D144610; Fri, 2 Feb 2024 11:31:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="5jrbRNKk" 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 C1CE51420C6; Fri, 2 Feb 2024 11:31:55 +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=1706873517; cv=none; b=r95J/sbhsXKBlwl/6BAeMymoN6pfws92DNTZ5FeUZkg3rufwCwUGZ1eZ/7hTi1MndBvujlAAGgiGtMACeFTCRYQC0qMibMbFSI+HJ7+U4ucRYft1Np0PN/qPf31HUclMWoPX5ZZrYbOYgUhXzKQCnAE1GKxk3aP3FVeb/mFeSLo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706873517; c=relaxed/simple; bh=2kIkJOhTpv8Q3QiyGfqRKh0McTWdwjht00wQfRsByJM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CWpF+0YUL92HJjeFV3oYLyPWTr75Fr1HdZOhffWJWx0YL5J2cjLuw5pvCIsS5JaJbsY70GJUuJm1/23vUKYBG71crzKTXqBOzAw78rKrmTO0Fjr+5GtRRML8w3lfByB1DjLBJB81AFSqWC9nbvsMV1eWiySwECjPbtIYJDN7w8k= 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=5jrbRNKk; 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=1706873514; bh=2kIkJOhTpv8Q3QiyGfqRKh0McTWdwjht00wQfRsByJM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=5jrbRNKk2culQ7Kp1jvUG6aqXkgZGNOc8qXtU/77rVinmrrbF6j5UzkcypE4v7SzV 1sO8jFCGmlohyfABEMbYhlNulnL3KlfpqyHBfy8y1i/Zysv5SY2cws+zuUO7/7EH5n b2y3r6zBw0bwETOeTG23b0P5VWzHBbFVkVGy9K+INzWMymN+6GtiTyy02TbgBLQeSP uleeXDj31LR55nOzdR8Mn620o4NbUmjDKcMDn+Y4a9dbP5SDECDwTpSO8SYRdlJoPm eS/hqInMh9SclMZCxfJsspNL0xSJctOq5MgTF/S9RMtyVOTL8wSS2vZpuLE/04MbBD Q5sERtgWJq9Pw== Received: from localhost.localdomain (cola.collaboradmins.com [195.201.22.229]) (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 A3C913782099; Fri, 2 Feb 2024 11:31:52 +0000 (UTC) From: Muhammad Usama Anjum To: Andrew Morton , Shuah Khan Cc: Muhammad Usama Anjum , kernel@collabora.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 12/12] selftests/mm: virtual_address_range: conform to TAP format output Date: Fri, 2 Feb 2024 16:31:19 +0500 Message-ID: <20240202113119.2047740-13-usama.anjum@collabora.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240202113119.2047740-1-usama.anjum@collabora.com> References: <20240202113119.2047740-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 --- .../selftests/mm/virtual_address_range.c | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/tools/testing/selftests/mm/virtual_address_range.c b/tools/testing/selftests/mm/virtual_address_range.c index bae0ceaf95b13..7bcf8d48256a6 100644 --- a/tools/testing/selftests/mm/virtual_address_range.c +++ b/tools/testing/selftests/mm/virtual_address_range.c @@ -12,6 +12,7 @@ #include #include #include +#include "../kselftest.h" /* * Maximum address range mapped with a single mmap() @@ -68,23 +69,15 @@ static char *hind_addr(void) return (char *) (1UL << bits); } -static int validate_addr(char *ptr, int high_addr) +static void validate_addr(char *ptr, int high_addr) { unsigned long addr = (unsigned long) ptr; - if (high_addr) { - if (addr < HIGH_ADDR_MARK) { - printf("Bad address %lx\n", addr); - return 1; - } - return 0; - } + if (high_addr && addr < HIGH_ADDR_MARK) + ksft_exit_fail_msg("Bad address %lx\n", addr); - if (addr > HIGH_ADDR_MARK) { - printf("Bad address %lx\n", addr); - return 1; - } - return 0; + if (addr > HIGH_ADDR_MARK) + ksft_exit_fail_msg("Bad address %lx\n", addr); } static int validate_lower_address_hint(void) @@ -107,23 +100,29 @@ int main(int argc, char *argv[]) char *hint; unsigned long i, lchunks, hchunks; + ksft_print_header(); + ksft_set_plan(1); + for (i = 0; i < NR_CHUNKS_LOW; i++) { ptr[i] = mmap(NULL, MAP_CHUNK_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if (ptr[i] == MAP_FAILED) { - if (validate_lower_address_hint()) - return 1; + if (validate_lower_address_hint()) { + ksft_test_result_skip("Memory constraint not fulfilled\n"); + ksft_finished(); + } break; } - if (validate_addr(ptr[i], 0)) - return 1; + validate_addr(ptr[i], 0); } lchunks = i; hptr = (char **) calloc(NR_CHUNKS_HIGH, sizeof(char *)); - if (hptr == NULL) - return 1; + if (hptr == NULL) { + ksft_test_result_skip("Memory constraint not fulfilled\n"); + ksft_finished(); + } for (i = 0; i < NR_CHUNKS_HIGH; i++) { hint = hind_addr(); @@ -133,8 +132,7 @@ int main(int argc, char *argv[]) if (hptr[i] == MAP_FAILED) break; - if (validate_addr(hptr[i], 1)) - return 1; + validate_addr(hptr[i], 1); } hchunks = i; @@ -145,5 +143,7 @@ int main(int argc, char *argv[]) munmap(hptr[i], MAP_CHUNK_SIZE); free(hptr); - return 0; + + ksft_test_result_pass("Test\n"); + ksft_finished(); } -- 2.42.0