[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <07903c7d-5afc-ce95-0f51-3c643eab8b37@redhat.com>
Date: Tue, 19 Apr 2022 19:40:43 +0200
From: Thomas Huth <thuth@...hat.com>
To: Janis Schoetterl-Glausch <scgl@...ux.ibm.com>, kvm@...r.kernel.org,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Janosch Frank <frankja@...ux.ibm.com>,
Claudio Imbrenda <imbrenda@...ux.ibm.com>
Cc: linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
David Hildenbrand <david@...hat.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Shuah Khan <shuah@...nel.org>
Subject: Re: [PATCH 1/4] KVM: s390: selftests: Use TAP interface in the memop
test
On 14/04/2022 14.48, Janis Schoetterl-Glausch wrote:
> On 4/14/22 12:53, Thomas Huth wrote:
>> The memop test currently does not have any output (unless one of the
>> TEST_ASSERT statement fails), so it's hard to say for a user whether
>> a certain new sub-test has been included in the binary or not. Let's
>> make this a little bit more user-friendly and include some TAP output
>> via the kselftests.h interface.
>>
>> Signed-off-by: Thomas Huth <thuth@...hat.com>
>> ---
>> tools/testing/selftests/kvm/s390x/memop.c | 90 ++++++++++++++++++-----
>> 1 file changed, 73 insertions(+), 17 deletions(-)
>>
>> diff --git a/tools/testing/selftests/kvm/s390x/memop.c b/tools/testing/selftests/kvm/s390x/memop.c
>> index b04c2c1b3c30..a2783d9afcac 100644
>> --- a/tools/testing/selftests/kvm/s390x/memop.c
>> +++ b/tools/testing/selftests/kvm/s390x/memop.c
>> @@ -12,6 +12,7 @@
>>
>> #include "test_util.h"
>> #include "kvm_util.h"
>> +#include "kselftest.h"
>>
>> enum mop_target {
>> LOGICAL,
>> @@ -648,33 +649,88 @@ static void test_errors(void)
>> kvm_vm_free(t.kvm_vm);
>> }
>>
>> +struct testdef {
>> + const char *name;
>> + void (*test)(void);
>> + bool needs_extension;
>
> Please make this numeric. You could also rename it to required_extension or similar.
[...]
>> +
>> + for (idx = 0; idx < ARRAY_SIZE(testlist); idx++) {
>> + if (!testlist[idx].needs_extension || extension_cap) {
>
> Then check here that extension_cap >= the required extension.
> This way the test can easily be adapted in case of future extensions.
Not sure whether a ">=" will really be safe, since a future extension does
not necessarily assert that previous extensions are available at the same time.
But I can still turn the bool into a numeric to make it a little bit more
flexible for future use.
Thomas
Powered by blists - more mailing lists