Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp4342996pxb; Wed, 20 Apr 2022 00:40:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBiAQc8/4fNqmIaoVVT7h0WrT9GZ72we6QwytbAs1+ViMbOWG2BkrYQnVBbvnSYeaDivWx X-Received: by 2002:a17:90b:3b46:b0:1c7:9ca8:a19e with SMTP id ot6-20020a17090b3b4600b001c79ca8a19emr2852351pjb.245.1650440456102; Wed, 20 Apr 2022 00:40:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650440456; cv=none; d=google.com; s=arc-20160816; b=vp3leVhPBthfKKbcxUAnPc4MTMTwqXQ87NnwSLHvXM2kbIT5jOJLiIVRa08ASp9xK5 OzLrdYRa91O3HcQBwSMJwc1Xd9WHlAmJHkMw65rx4us5pbIgVvy4dqun/HebfSxdKbDP +3jN9EGFjRrErsrMNkFM5w8O+MY0JqwKVICD+lT4uWTkSihTZpUgsZA6uw12QWYI7L6X CSY8P6KvXKXIgizFR3SWFu+yzh09Mjrx76+n3wemkHaN9dEealOiF3P7bJqJ43eV8FHb 5evB6/bHVITw0ExsTqITc+gOCMTCic5vNAWtY2mkyeyav9JeaukgVuFQGKDDBTzI/50e 15mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Qnonzc6fh8TJnpE7gaNyUxgdtOHFsR6ybsN1q248jMI=; b=S3VNmmO23dRgPjpLgKnuOg18zciYnHqoQUwBAlQZbswp07FvIUYsBDI1D9TgUvrrju ivVI/OgSJlE6zAFxhgkvExiNYlN4aVnzJ4oYeXRx09UDVZFzLvQIDBbUjD76aIWLrhbd yxZCDqWL88hc6NXs+RXu8+gBvztLbQrJEx7q0Pj52LPMe/09kB7yVRAI4yfMKKdJ7edO tsT8ofSdeLaBTjEjRfljmoN+TtiO4mug+65XJ4ge6798W+1aigS9gIIeDXITrGKYZAxJ CRThX0AUrno8GeKKlS2LiqRcBOxHeSvEKHnqQn5X5tPL5EQMme5hkz0MBoapYnFkItB+ mvWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=X6Tvn6Vn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mn20-20020a17090b189400b001caa43d9645si1275894pjb.95.2022.04.20.00.40.40; Wed, 20 Apr 2022 00:40:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=X6Tvn6Vn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352891AbiDSRng (ORCPT + 99 others); Tue, 19 Apr 2022 13:43:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233221AbiDSRnc (ORCPT ); Tue, 19 Apr 2022 13:43:32 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 197621D33A for ; Tue, 19 Apr 2022 10:40:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650390048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Qnonzc6fh8TJnpE7gaNyUxgdtOHFsR6ybsN1q248jMI=; b=X6Tvn6VnIaIFtuISjzE1K2ziDE77IHnNMLZLErc7XmPp73ZFd5uEa1is/92pwr6xOM+Hse GwzUzXk84QmGjR5w9fR5FhFMDqU3JVz9ANzFJqj5iUCzYMLCZ+vtkcq0imuCCzqgsSy9zh hBuscUe8WufueiRp9pmqnuRmMtdnevE= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-226-dsO5UCRrOaOuK_OQK1yd_g-1; Tue, 19 Apr 2022 13:40:47 -0400 X-MC-Unique: dsO5UCRrOaOuK_OQK1yd_g-1 Received: by mail-wm1-f72.google.com with SMTP id y11-20020a7bc18b000000b0038eac019fc0so1527238wmi.9 for ; Tue, 19 Apr 2022 10:40:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=Qnonzc6fh8TJnpE7gaNyUxgdtOHFsR6ybsN1q248jMI=; b=BPwGgL7zoshoZoFlw4kX1YGvLn2M97185vVjBK2EYADuCEc4RjRS1LsHgplGyEMGmV eVHStftSpVUMS2+5YF3sn3VcWa20szJqtx26VXTDpiNuN3ihRaix9dzEhZUq1SjAlxq6 SgQ1D9jdjLSsxDdLYOGWkbrIz9R/9bDBm32lcGs/HvEJBIU5wro0FQIjiYI6wH12jru0 OFumjXpJGGrtnH5OqxF2L67Sgf1Pdq+aUnNt4i2vlN5j/tau2PxoE1Akx5prDtC3Vouq 1vSvN0R4+YCMrXriuV7qPmaixamNLnxROmbkFf+9zKNC4LyPMMRp7zTpnsCvly7d1h6s a5zw== X-Gm-Message-State: AOAM532LBX6ujm/I2bE9Nb1xkWebAS47Y0PNHzJOX2DDsp8ZSe84wuIQ 7UlMkI4EQSJ4ZpQ1IIdhRqqxjHqpb6tdCKSV0+0K1kxin1QcSgLlqDjANEORay9AzK4vgDYelyt hHg2Pxccww0cmV2z42ZsFYuYx X-Received: by 2002:a7b:cc17:0:b0:38d:af7:3848 with SMTP id f23-20020a7bcc17000000b0038d0af73848mr17231889wmh.41.1650390045845; Tue, 19 Apr 2022 10:40:45 -0700 (PDT) X-Received: by 2002:a7b:cc17:0:b0:38d:af7:3848 with SMTP id f23-20020a7bcc17000000b0038d0af73848mr17231868wmh.41.1650390045650; Tue, 19 Apr 2022 10:40:45 -0700 (PDT) Received: from [192.168.8.102] (dynamic-046-114-170-162.46.114.pool.telefonica.de. [46.114.170.162]) by smtp.gmail.com with ESMTPSA id 20-20020a05600c22d400b0038c8dbdc1a3sm16472044wmg.38.2022.04.19.10.40.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Apr 2022 10:40:45 -0700 (PDT) Message-ID: <07903c7d-5afc-ce95-0f51-3c643eab8b37@redhat.com> Date: Tue, 19 Apr 2022 19:40:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH 1/4] KVM: s390: selftests: Use TAP interface in the memop test Content-Language: en-US To: Janis Schoetterl-Glausch , kvm@vger.kernel.org, Christian Borntraeger , Janosch Frank , Claudio Imbrenda Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, David Hildenbrand , Paolo Bonzini , Shuah Khan References: <20220414105322.577439-1-thuth@redhat.com> <20220414105322.577439-2-thuth@redhat.com> <3c627856-5e66-3cbe-adab-464ae573e23d@linux.ibm.com> From: Thomas Huth In-Reply-To: <3c627856-5e66-3cbe-adab-464ae573e23d@linux.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >> --- >> 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