From patchwork Mon Mar 4 15:59:23 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: 209633 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:fa17:b0:10a:f01:a869 with SMTP id ju23csp1530206dyc; Mon, 4 Mar 2024 08:25:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUSJvPUy4G1I0f74KIlzZLeD3pWGopT4HiBLUevusaKwf6/EpMpdkHrBPLPA4/RDZmUj1EINHvl7Gi0C+A8n7FkJbUWdQ== X-Google-Smtp-Source: AGHT+IGk4Z63krxzogH+Zl6o3vHOaJzeVUDhxdyXQpVMBdOSzvuAREBAUOy47MH5iGfUFBo+fkB2 X-Received: by 2002:a05:6a20:1584:b0:1a0:fd53:740c with SMTP id h4-20020a056a20158400b001a0fd53740cmr12214407pzj.22.1709569558544; Mon, 04 Mar 2024 08:25:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709569558; cv=pass; d=google.com; s=arc-20160816; b=w6IeB0qLrXK7CqIvvzFSYcHBCWb8wlQt/kxcpav9b2ctL7+0mJFh5rzw2vrROZYixU OnonrjnBpnj8v8NeVJ9n/SXZngQhGU1YznB+btwNgan8TZZLl/lPBuJCx2uHOjPHT64Y 1V/P0omNqzCn3WeLaLA+8ps1dApmiECFn28gsu5BSfBaD343Zw41Jf5mPI/KrPPgHLIh ZxIZY5vBZ5PHp4SyeZhvHOv/JuwpZFE1GCPBkxZNL0xZ4lXRhMdDlN+NMnYadFLuvJht 3SiuRgGX4AIHdnUwOBdSYwExxthlm1sEs+B/PxrZH5ugNdANNFOBFXmezEMNeI4kQodc TIkQ== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=uHeCw6yfcJYTOU9ieSZ5STUfFs4EL/lIE8x96JBswcM=; fh=kIvWet5rGarCnyuEpkp6O8UZulXxc4w/bHj1na/Uhm4=; b=vJtdPvsLCzyviHRhVGTVirW04Ha6jHDP1k1CH+rutOvnAoz9PXQWlxgGbTwk8cvLpj EkMAf6fZG+FtlUxncx3wk+83BZZfyUFNG1FoJMhixAt+iBxbgP9JUq9SC1OIvIOFd6JW l2Z2ObXcYHzJW5fzrsijmeiO54h5RS4sNQgJrUW8Dd4QD1ES4ZLVJJENyynAa0c8uNSQ xmPdTthySGRgZcZiQCdiG7f6Oo0xDn+DdFgbyRouk91h1Mzl+0MPdWfPI9lwT8nm16VU H61jHx7LD6Oaw23LlS30n1YAd2LhMq4kp5rOhHt+PdSSGBi90vZmmEpi+5PcKy1ggZR9 GWig==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Ic2QKeqC; 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-90884-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90884-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d10-20020a63990a000000b005dcbb75b1fdsi8216304pge.218.2024.03.04.08.25.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 08:25:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90884-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Ic2QKeqC; 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-90884-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90884-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id D3A84B2338C for ; Mon, 4 Mar 2024 15:59:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7354148CDC; Mon, 4 Mar 2024 15:59:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="Ic2QKeqC" 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 59A811B273; Mon, 4 Mar 2024 15:59:18 +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=1709567959; cv=none; b=FkoUSALjyKmjIt44shNiE85tWRIyYhzgxfhsGk6PwR8sT9Idu9CxGSe6BnUCDrSrZu5dXUcF5AaMDrmVAMB/vXyXVkWXNdvhZSCfjSSBIWiqmWKjL1RYTaMMZVhnSAdoNsu+M9Dawa7L5CsLJBy3X1IcgWLotL4BVRtMy7LYILs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709567959; c=relaxed/simple; bh=ZjZh6MK4cK0nPO2xkcbSCU48Cy25SeM0mup4wcmCJx0=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=iUQBmHQGC/+N//hpzz6ill+cqw/i/Xh3GMMb05OVMf1MordFaTH1cRsN/E/bYCzdxkyL0+kZBgDgpgp8mLo7Ckw3Xr6oJZjhCLL5hC8lZYtW65td2w3qVGqHUeGpZcpR9981wqLUU/RIoUNoG8E0kVz8J4qSWj6+Quxpvy28c5M= 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=Ic2QKeqC; 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=1709567956; bh=ZjZh6MK4cK0nPO2xkcbSCU48Cy25SeM0mup4wcmCJx0=; h=From:To:Cc:Subject:Date:From; b=Ic2QKeqCWnv2YCtCbqdlmm6TQXqw+vJJ4o9Y/hkzs526iD/Xg6sjTT2v2rfRalK5r E9RIMd9iBKWZlKh4PJXTDUWMAoOt6qrAJvjk+qpQi4TE0Cc/IN3ifJvt38WogftARr cTyMSY/7nqGn60ybvTZgWfZdsjT5qBpMJk/69S9M5JUHwmvOdGH9GkTCVdBmLDfB4E cOIrZCquDjSTNw5Vm6cVjXuOVrJ+/YbfrjHo8bMEvb/itiKb6+LgALQqcypmQ7AfwF FOiYdUEOiwrnOjX9t8VcCWwgPbUcuLCw0ArSnkoj66tIqoAJ2f38jAs8jvzCgpSm7g kxkM1qltBck7g== 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 04BA037820D7; Mon, 4 Mar 2024 15:59:13 +0000 (UTC) From: Muhammad Usama Anjum To: Shuah Khan , Eric Biederman , Kees Cook , Muhammad Usama Anjum Cc: kernel@collabora.com, kernel-janitors@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] selftests/exec: Add the overall result line accourding to TAP Date: Mon, 4 Mar 2024 20:59:23 +0500 Message-Id: <20240304155928.1818928-1-usama.anjum@collabora.com> X-Mailer: git-send-email 2.39.2 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: 1792613609772383831 X-GMAIL-MSGID: 1792613609772383831 The following line is missing from the test's execution. Add it to make it fully TAP conformant: # Totals: pass:27 fail:0 xfail:0 xpass:0 skip:0 error:0 Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/exec/binfmt_script.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/exec/binfmt_script.py b/tools/testing/selftests/exec/binfmt_script.py index 05f94a741c7aa..2c575a2c0eab4 100755 --- a/tools/testing/selftests/exec/binfmt_script.py +++ b/tools/testing/selftests/exec/binfmt_script.py @@ -16,6 +16,8 @@ SIZE=256 NAME_MAX=int(subprocess.check_output(["getconf", "NAME_MAX", "."])) test_num=0 +pass_num=0 +fail_num=0 code='''#!/usr/bin/perl print "Executed interpreter! Args:\n"; @@ -42,7 +44,7 @@ foreach my $a (@ARGV) { # ... def test(name, size, good=True, leading="", root="./", target="/perl", fill="A", arg="", newline="\n", hashbang="#!"): - global test_num, tests, NAME_MAX + global test_num, pass_num, fail_num, tests, NAME_MAX test_num += 1 if test_num > tests: raise ValueError("more binfmt_script tests than expected! (want %d, expected %d)" @@ -80,16 +82,20 @@ def test(name, size, good=True, leading="", root="./", target="/perl", if good: print("ok %d - binfmt_script %s (successful good exec)" % (test_num, name)) + pass_num += 1 else: print("not ok %d - binfmt_script %s succeeded when it should have failed" % (test_num, name)) + fail_num = 1 else: if good: print("not ok %d - binfmt_script %s failed when it should have succeeded (rc:%d)" % (test_num, name, proc.returncode)) + fail_num = 1 else: print("ok %d - binfmt_script %s (correctly failed bad exec)" % (test_num, name)) + pass_num += 1 # Clean up crazy binaries os.unlink(script) @@ -166,6 +172,8 @@ test(name="two-under-trunc-arg", size=int(SIZE/2), arg=" ") test(name="two-under-leading", size=int(SIZE/2), leading=" ") test(name="two-under-lead-trunc-arg", size=int(SIZE/2), leading=" ", arg=" ") +print("# Totals: pass:%d fail:%d xfail:0 xpass:0 skip:0 error:0" % (pass_num, fail_num)) + if test_num != tests: raise ValueError("fewer binfmt_script tests than expected! (ran %d, expected %d" % (test_num, tests))