From patchwork Wed May 29 07:24:53 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: 13677972 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 C32EE169385; Wed, 29 May 2024 07:26:08 +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=1716967570; cv=none; b=J73JnzGqjQ4yyHcH8w9dtzn8jWtwwqjmv8ppue0l6pQ51OGlVXKG1UXpus8/9NEUtxjQujy/9z75B7w5q3zHr21HrhJj06+wcfhysKX3L3LMm8aI29nP/TYdqTgwMxd6AbH8kqQkkRt5znXYhglrLCBI0wmRp2owNE3dDFt8Fcc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716967570; c=relaxed/simple; bh=Vry0QvqeeNdr1PQL4qhBb23PCn3qOnl455a/3LEzC80=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=btYFLlYx/kLf14snfCMWRS2AiYsgmX9YHYxQzU8z74UbZ3baLx3kVPIKDYR0JKrI/GnWmoyzTOWyRxrDcli2E9wfnaBf/1+6NhAPP1Ps6gMaxGQPASIv1FRCB9hjt4Gjgqu/HULVomigqi8F2y3s/LCC4ajzvSDBRHuIH1b+Zs4= 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=iH64bjMA; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="iH64bjMA" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1716967567; bh=Vry0QvqeeNdr1PQL4qhBb23PCn3qOnl455a/3LEzC80=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iH64bjMAlY7fkjLOqOS3VP3MKegPc03JzkXaLLcfcajAsetlV0lBchPe7YbW0Skv8 F/HJXQBmQkejWV7Mmj6G3oo2LYFcz7VJSimweGqnMJr4vAm08XROrJwmO9rBJ38ZBe q6iWkycEN6MiQ8023BSV8IAN1AbaBgcnKefZWn3YnW3xvPxrHyIsT63BOiMeDp3UCo 02lg191UlyQz0W+0CP6IL4gsF2zAoPY7kNCyKtVXL4oYihiovhqU0M2lDOVr3rM/qV 1zro/J1F4cfF5FDAOeSgoDUtU7+ttypLuhjxAIXiFw4jkECil2xgUlORpiluq5FNEF HuofpZDGN58+w== Received: from localhost.localdomain (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 2EAAE3780627; Wed, 29 May 2024 07:25:59 +0000 (UTC) From: Muhammad Usama Anjum To: Shuah Khan , Vincenzo Frascino , Muhammad Usama Anjum , Colin Ian King , Tiezhu Yang , Andrew Morton , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: kernel@collabora.com Subject: [PATCH 3/4] kselftests: vdso: vdso_test_getcpu: conform test to TAP output Date: Wed, 29 May 2024 12:24:53 +0500 Message-Id: <20240529072454.2522495-4-usama.anjum@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240529072454.2522495-1-usama.anjum@collabora.com> References: <20240529072454.2522495-1-usama.anjum@collabora.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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/vDSO/vdso_test_getcpu.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/vDSO/vdso_test_getcpu.c b/tools/testing/selftests/vDSO/vdso_test_getcpu.c index b758f68c6c9c2..d8e247783057a 100644 --- a/tools/testing/selftests/vDSO/vdso_test_getcpu.c +++ b/tools/testing/selftests/vDSO/vdso_test_getcpu.c @@ -28,9 +28,12 @@ int main(int argc, char **argv) getcpu_t get_cpu; long ret; + ksft_print_header(); + ksft_set_plan(1); + sysinfo_ehdr = getauxval(AT_SYSINFO_EHDR); if (!sysinfo_ehdr) { - printf("AT_SYSINFO_EHDR is not present!\n"); + ksft_print_msg("AT_SYSINFO_EHDR is not present!\n"); return KSFT_SKIP; } @@ -38,17 +41,12 @@ int main(int argc, char **argv) get_cpu = (getcpu_t)vdso_sym(version, name[4]); if (!get_cpu) { - printf("Could not find %s\n", name[4]); + ksft_print_msg("Could not find %s\n", name[4]); return KSFT_SKIP; } ret = get_cpu(&cpu, &node, 0); - if (ret == 0) { - printf("Running on CPU %u node %u\n", cpu, node); - } else { - printf("%s failed\n", name[4]); - return KSFT_FAIL; - } + ksft_test_result(ret == 0, "Running on CPU %u node %u\n", cpu, node); - return 0; + ksft_finished(); }