From patchwork Wed Jan 31 22:02:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Patchwork-Id: 768678 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 2E91639FDA; Wed, 31 Jan 2024 22:04:46 +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=1706738688; cv=none; b=GmNzCFyNM7RLXD0crhmLQC0MaOLOvKzII4QmDI/DTYwRo4xo2Gt2YZSxteT4me+jUI4tEddGRVF5lMGHTvqzOXZ//Djm2Ddt8s7qP4XTvdEA2H9xUeVnA83QfvuVIcALDOHREx4uRX4fh4+NVpUXAOTeSyTqUqB8q2tBHaW6kac= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706738688; c=relaxed/simple; bh=HbsXRGtiyi3ELSqaY6WtU/YJy+Gt0wI2oltVvs97Qqo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=s8mkDK4/vAD3SBUj2rtYgH8n/MGdGh90Pc94r/N/XiT+SZVSvIqUbCE++g3Pd0v2ENDmKW7+owGccgLfx1zDwqHUX9roJTzrq3pwcnjVZ1pl7eaiBiOoLWYr0w12IBYiCx+H2xEwc0bzLv5o/pFBIue2sZOEMgrMnpHyp1tmM4o= 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=1Yd2X8KM; 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="1Yd2X8KM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1706738685; bh=HbsXRGtiyi3ELSqaY6WtU/YJy+Gt0wI2oltVvs97Qqo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=1Yd2X8KMheYZZSLs3DvbOYoyRERViAlV050nb0292K+2NBfP1VkoX6cxCz7ZfAPHG h3612R3SVAmQNm9Eun7sY4vWlD7ssLWWYt4BmuGWsBap7p91RDoZsVQxyzc7zB0mMn 0TrZmND1+B4IZqppCM8WA1JBnvzt5xjwaYqCqHMVQi16NXDmppyb4ATCfYa5xxAHks UM5AbPWafILt4NSiEKT7NM9Q3PB2JknDFx/qs4mEtioi0ZCx4AXDJvlVCU+WI96yw8 Hhp0YheQ6IxFOyYOWC/ZkXXfwypMvMgwSkYp92sJAcozoeiqMELREWkvulnpyEUzKv w99qTwnM+rkCA== Received: from [192.168.1.211] (zone.collabora.co.uk [167.235.23.81]) (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: nfraprado) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 77272378206C; Wed, 31 Jan 2024 22:04:44 +0000 (UTC) From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= Date: Wed, 31 Jan 2024 17:02:40 -0500 Subject: [PATCH 1/4] selftests: ktap_helpers: Add helper to print diagnostic messages Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240131-ktap-sh-helpers-extend-v1-1-98ffb468712c@collabora.com> References: <20240131-ktap-sh-helpers-extend-v1-0-98ffb468712c@collabora.com> In-Reply-To: <20240131-ktap-sh-helpers-extend-v1-0-98ffb468712c@collabora.com> To: Shuah Khan Cc: kernel@collabora.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Laura Nao , =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Mailer: b4 0.12.4 Similar to the C counterpart, add a helper to print a diagnostic message. Signed-off-by: NĂ­colas F. R. A. Prado --- tools/testing/selftests/kselftest/ktap_helpers.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/testing/selftests/kselftest/ktap_helpers.sh b/tools/testing/selftests/kselftest/ktap_helpers.sh index dd79d96f3b5a..ecc1413c22cd 100644 --- a/tools/testing/selftests/kselftest/ktap_helpers.sh +++ b/tools/testing/selftests/kselftest/ktap_helpers.sh @@ -19,6 +19,11 @@ ktap_print_header() { echo "TAP version 13" } +ktap_print_msg() +{ + echo "#" $@ +} + ktap_set_plan() { num_tests="$1" From patchwork Wed Jan 31 22:02:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Patchwork-Id: 768677 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 3BA9C3A1AB; Wed, 31 Jan 2024 22:04:49 +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=1706738691; cv=none; b=pNXlYhkL8lSrPA37GJV+YJBRW+VZytUp9bRXIaet+XAjy9U/JfCIDA/pRHQAtDZRFAK5JUlL3354Yy2QyPqPY/PX7Q7jnFVxIqYd6Mr73o/r6Z5IUQkJTakG8JWVRG8Mi6g6oSCiZLmHcL4y12HnXjPnIrrIIbLI7m2nYDaLsNM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706738691; c=relaxed/simple; bh=ppHfbf9qGqvGLoKdV8hXyPGwjYwRrEFpDWQkMI0RS/Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dtw8PWEM+51yc0XbFsaKWHAq9uUiJww6S7wBZMknu88v1LnNnGfh1LdbO12XSPjyAOZKwsL5XrHcjeF7rCeoLoFFYO9Rig6vh5MrHbapXXwaA09680V3Fv6kqgeIGax5w8KVgxndDyymK3hdSHMK9o1e7F67X5QhLjwoESLA37Y= 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=aImREWYd; 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="aImREWYd" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1706738688; bh=ppHfbf9qGqvGLoKdV8hXyPGwjYwRrEFpDWQkMI0RS/Q=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=aImREWYd/iXeOoZvTIRwYZeAqDtmwpg/dRn+p8kBsTwKT64NB3moS/b79jXi+cQk0 OdwQdJSEUFX2MM/USzRpnkw0t/RuShOOIXmakPI4qPqpKoWdTaZoE6/4CtafaRHFds rDSVbWoooMZh6WkqbM1zNYHFdp6xQ18iHXRZ/8JbYm2z4ojCx8EVme7V7DVhjEfQKZ hN6N0n6o0/mOSe+kcEtrV6WHEawuozYdrwKH8HGFQy+uFjfgt0t1AN+nsAZkY4kZ6+ dh+0KsYRaB7vOeb0DoV/NZpri1Qj28qt3AaRlaRH6zzx6FTe9Ew8DfYtc391cMMBcI +pt66XoatbaYw== Received: from [192.168.1.211] (zone.collabora.co.uk [167.235.23.81]) (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: nfraprado) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 2961C3782074; Wed, 31 Jan 2024 22:04:47 +0000 (UTC) From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= Date: Wed, 31 Jan 2024 17:02:42 -0500 Subject: [PATCH 3/4] selftests: ktap_helpers: Add a helper to abort the test Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240131-ktap-sh-helpers-extend-v1-3-98ffb468712c@collabora.com> References: <20240131-ktap-sh-helpers-extend-v1-0-98ffb468712c@collabora.com> In-Reply-To: <20240131-ktap-sh-helpers-extend-v1-0-98ffb468712c@collabora.com> To: Shuah Khan Cc: kernel@collabora.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Laura Nao , =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Mailer: b4 0.12.4 Similar to the C counterpart, add a helper function to abort the remainder of the test. Signed-off-by: NĂ­colas F. R. A. Prado --- tools/testing/selftests/kselftest/ktap_helpers.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/testing/selftests/kselftest/ktap_helpers.sh b/tools/testing/selftests/kselftest/ktap_helpers.sh index 29107924f5c2..87f93c6900c5 100644 --- a/tools/testing/selftests/kselftest/ktap_helpers.sh +++ b/tools/testing/selftests/kselftest/ktap_helpers.sh @@ -87,6 +87,13 @@ ktap_test_result() { fi } +ktap_exit_fail_msg() { + echo "Bail out! " $@ + ktap_print_totals + + exit "$KSFT_FAIL" +} + ktap_print_totals() { echo "# Totals: pass:$KTAP_CNT_PASS fail:$KTAP_CNT_FAIL xfail:0 xpass:0 skip:$KTAP_CNT_SKIP error:0" }