From patchwork Wed May 25 17:19:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= X-Patchwork-Id: 9135861 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1EFB3607D7 for ; Wed, 25 May 2016 17:19:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D40927E72 for ; Wed, 25 May 2016 17:19:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 018AA2829C; Wed, 25 May 2016 17:19:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,HK_RANDOM_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87AFA27E72 for ; Wed, 25 May 2016 17:19:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755953AbcEYRTd (ORCPT ); Wed, 25 May 2016 13:19:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39787 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755945AbcEYRTc (ORCPT ); Wed, 25 May 2016 13:19:32 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 219164AD7C for ; Wed, 25 May 2016 17:19:31 +0000 (UTC) Received: from potion (dhcp-1-116.brq.redhat.com [10.34.1.116]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id u4PHJSiB011198; Wed, 25 May 2016 13:19:29 -0400 Received: by potion (sSMTP sendmail emulation); Wed, 25 May 2016 19:19:28 +0200 Date: Wed, 25 May 2016 19:19:28 +0200 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Paolo Bonzini Cc: kvm@vger.kernel.org, Andrew Jones Subject: Re: [kvm-unit-tests PATCH v4 02/13] x86/*: report skipped tests Message-ID: <20160525171927.GA8077@potion> References: <1462983171-4208-1-git-send-email-rkrcmar@redhat.com> <1462983171-4208-3-git-send-email-rkrcmar@redhat.com> <573B0C67.8010707@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <573B0C67.8010707@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 25 May 2016 17:19:31 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 2016-05-17 14:19+0200, Paolo Bonzini: > On 11/05/2016 18:12, Radim Krčmář wrote: >> if (!(cpuid_indexed(7, 0).c & (1 << X86_FEATURE_PKU))) { >> printf("PKU not enabled, aborting\n"); >> - abort(); >> + return report_summary(); > > Needs report_skip? > >> diff --git a/x86/pmu.c b/x86/pmu.c >> @@ -387,7 +387,7 @@ int main(int ac, char **av) >> if (!eax.split.version_id) { >> printf("No pmu is detected!\n"); >> - return 1; >> + return report_summary(); > > Needs report_skip? > >> diff --git a/x86/smap.c b/x86/smap.c >> @@ -93,7 +93,7 @@ int main(int ac, char **av) >> if (!(cpuid_indexed(7, 0).b & (1 << X86_FEATURE_SMAP))) { >> printf("SMAP not enabled, aborting\n"); >> - abort(); >> + return report_summary(); > > Needs report_skip? > >> diff --git a/x86/svm.c b/x86/svm.c >> if (!(cpuid(0x80000001).c & 4)) { >> printf("SVM not availble\n"); >> - return 0; >> + return report_summary(); > > Needs report_skip? > >> diff --git a/x86/tsc.c b/x86/tsc.c >> printf("rdtscp not supported\n"); > > Needs report_skip? > >> - return 0; >> + return report_summary(); > > Just sending a fixup patch is enough. report_skip is not needed, because the a test that ended in report_summary without any report is considered as skipped. The fixup below turns printfs to report_skip is below. The difference is that summary will now print SKIP pku (1 tests, 1 skipped) instead of previous SKIP pku (0 tests) I like "0 tests" summary better and only x86/hyperv_synic does the opposite, so a fix could go both ways. ---8<--- --- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/x86/pku.c b/x86/pku.c index 6214f0bc151f..4b418fdc8a20 100644 --- a/x86/pku.c +++ b/x86/pku.c @@ -67,7 +67,7 @@ int main(int ac, char **av) unsigned int pkru_wd = 0x20; if (!(cpuid_indexed(7, 0).c & (1 << X86_FEATURE_PKU))) { - printf("PKU not enabled, aborting\n"); + report_skip("PKU not enabled\n"); return report_summary(); } diff --git a/x86/pmu.c b/x86/pmu.c index b0f9f81af68e..308274761336 100644 --- a/x86/pmu.c +++ b/x86/pmu.c @@ -390,7 +390,7 @@ int main(int ac, char **av) host_nmi_watchdog = atol_keyval(ac, av, "host_nmi_watchdog"); if (!eax.split.version_id) { - printf("No pmu is detected!\n"); + report_skip("No pmu is detected!\n"); return report_summary(); } printf("PMU version: %d\n", eax.split.version_id); diff --git a/x86/smap.c b/x86/smap.c index c9de081a474b..23722beb00f5 100644 --- a/x86/smap.c +++ b/x86/smap.c @@ -92,7 +92,7 @@ int main(int ac, char **av) unsigned long i; if (!(cpuid_indexed(7, 0).b & (1 << X86_FEATURE_SMAP))) { - printf("SMAP not enabled, aborting\n"); + report_skip("SMAP not enabled\n"); return report_summary(); } diff --git a/x86/svm.c b/x86/svm.c index 301cf8cb2d6b..005cbf7c3352 100644 --- a/x86/svm.c +++ b/x86/svm.c @@ -1063,7 +1063,7 @@ int main(int ac, char **av) smp_init(); if (!(cpuid(0x80000001).c & 4)) { - printf("SVM not availble\n"); + report_skip("SVM not availble\n"); return report_summary(); } diff --git a/x86/tsc.c b/x86/tsc.c index 62450e71725c..33fdc114c04c 100644 --- a/x86/tsc.c +++ b/x86/tsc.c @@ -42,6 +42,6 @@ int main() test_rdtscp(10); test_rdtscp(0x100); } else - printf("rdtscp not supported\n"); + report_skip("rdtscp not supported\n"); return report_summary(); }