[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fbe79380237a2d6f4aca0c6b6909afd20b35a058.camel@linux.ibm.com>
Date: Mon, 19 Dec 2022 17:13:20 +0100
From: Janis Schoetterl-Glausch <scgl@...ux.ibm.com>
To: Christian Borntraeger <borntraeger@...ux.ibm.com>,
Janosch Frank <frankja@...ux.ibm.com>,
Claudio Imbrenda <imbrenda@...ux.ibm.com>,
Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>
Cc: David Hildenbrand <david@...hat.com>,
Jonathan Corbet <corbet@....net>, kvm@...r.kernel.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org, linux-s390@...r.kernel.org,
Paolo Bonzini <pbonzini@...hat.com>,
Shuah Khan <shuah@...nel.org>,
Sven Schnelle <svens@...ux.ibm.com>,
Thomas Huth <thuth@...hat.com>
Subject: Re: [PATCH v4 5/9] KVM: s390: selftest: memop: Move testlist into
main
On Tue, 2022-12-13 at 17:54 +0100, Janis Schoetterl-Glausch wrote:
> This allows checking if the necessary requirements for a test case are
> met via an arbitrary expression. In particular, it is easy to check if
> certain bits are set in the memop extension capability.
>
> Signed-off-by: Janis Schoetterl-Glausch <scgl@...ux.ibm.com>
> Reviewed-by: Thomas Huth <thuth@...hat.com>
> ---
> tools/testing/selftests/kvm/s390x/memop.c | 132 +++++++++++-----------
> 1 file changed, 66 insertions(+), 66 deletions(-)
>
> diff --git a/tools/testing/selftests/kvm/s390x/memop.c b/tools/testing/selftests/kvm/s390x/memop.c
> index 286185a59238..10f34c629cac 100644
> --- a/tools/testing/selftests/kvm/s390x/memop.c
> +++ b/tools/testing/selftests/kvm/s390x/memop.c
> @@ -690,87 +690,87 @@ static void test_errors(void)
> kvm_vm_free(t.kvm_vm);
> }
>
[...]
>
> int main(int argc, char *argv[])
> {
> int extension_cap, idx;
>
> + setbuf(stdout, NULL); /* Tell stdout not to buffer its content */
> TEST_REQUIRE(kvm_has_cap(KVM_CAP_S390_MEM_OP));
> + extension_cap = kvm_check_cap(KVM_CAP_S390_MEM_OP_EXTENSION);
>
[...]
>
> ksft_print_header();
> -
> ksft_set_plan(ARRAY_SIZE(testlist));
>
> - extension_cap = kvm_check_cap(KVM_CAP_S390_MEM_OP_EXTENSION);
> for (idx = 0; idx < ARRAY_SIZE(testlist); idx++) {
> - if (extension_cap >= testlist[idx].extension) {
> + if (testlist[idx].requirements_met) {
> testlist[idx].test();
> ksft_test_result_pass("%s\n", testlist[idx].name);
> } else {
> - ksft_test_result_skip("%s - extension level %d not supported\n",
> - testlist[idx].name,
> - testlist[idx].extension);
> + ksft_test_result_skip("%s - requirements not met (kernel has extension cap %#x\n)",
oops, should be )\n ofc ^
> + testlist[idx].name, extension_cap);
> }
> }
>
Powered by blists - more mailing lists