From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [kvm-unit-tests PATCH v4 06/13] x86/pmu: expect failure with nmi_watchdog Date: Wed, 11 May 2016 18:12:48 +0200 Message-ID: <1462983171-4208-7-git-send-email-rkrcmar@redhat.com> References: <1462983171-4208-1-git-send-email-rkrcmar@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Paolo Bonzini , Andrew Jones To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:10982 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932165AbcEKQNZ (ORCPT ); Wed, 11 May 2016 12:13:25 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (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 38A0063141 for ; Wed, 11 May 2016 16:13:25 +0000 (UTC) In-Reply-To: <1462983171-4208-1-git-send-email-rkrcmar@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Host's nmi_watchdog takes one slot, making the "all counters" unit-test fail. We know exactly what happens, mark it as expected failure. PMU test is now executed regardless of host_nmi_watchdog. Signed-off-by: Radim Kr=C4=8Dm=C3=A1=C5=99 --- v4: improved command line parsing [Drew] x86/Makefile.common | 1 + x86/pmu.c | 6 +++++- x86/unittests.cfg | 3 +-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/x86/Makefile.common b/x86/Makefile.common index 356d879a986b..4951210f3331 100644 --- a/x86/Makefile.common +++ b/x86/Makefile.common @@ -3,6 +3,7 @@ all: test_cases =20 cflatobjs +=3D lib/pci.o +cflatobjs +=3D lib/util.o cflatobjs +=3D lib/x86/io.o cflatobjs +=3D lib/x86/smp.o cflatobjs +=3D lib/x86/vm.o diff --git a/x86/pmu.c b/x86/pmu.c index c68980044dee..a4b88b410904 100644 --- a/x86/pmu.c +++ b/x86/pmu.c @@ -8,6 +8,7 @@ #include "x86/vm.h" =20 #include "libcflat.h" +#include #include =20 #define FIXED_CNT_INDEX 32 @@ -92,6 +93,7 @@ struct pmu_event { }; =20 static int num_counters; +static bool host_nmi_watchdog; =20 char *buf; =20 @@ -291,7 +293,7 @@ static void check_counters_many(void) if (!verify_counter(&cnt[i])) break; =20 - report("all counters", i =3D=3D n); + report_xfail("all counters", host_nmi_watchdog, i =3D=3D n); } =20 static void check_counter_overflow(void) @@ -385,6 +387,8 @@ int main(int ac, char **av) ebx.full =3D id.b; edx.full =3D id.d; =20 + host_nmi_watchdog =3D args_parse_keyval(ac, av, "host_nmi_watchdog"); + if (!eax.split.version_id) { printf("No pmu is detected!\n"); return report_summary(); diff --git a/x86/unittests.cfg b/x86/unittests.cfg index 60747cfca94e..3852b40a2927 100644 --- a/x86/unittests.cfg +++ b/x86/unittests.cfg @@ -121,8 +121,7 @@ file =3D msr.flat =20 [pmu] file =3D pmu.flat -extra_params =3D -cpu host -check =3D /proc/sys/kernel/nmi_watchdog=3D0 +extra_params =3D -cpu host -append "host_nmi_watchdog=3D`cat /proc/sys= /kernel/nmi_watchdog`" =20 [port80] file =3D port80.flat --=20 2.8.2