From patchwork Wed May 24 16:08:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 9746351 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 E7A796032B for ; Wed, 24 May 2017 16:08:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D721A289B6 for ; Wed, 24 May 2017 16:08:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CBF53289BC; Wed, 24 May 2017 16:08:58 +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,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 595D9289B6 for ; Wed, 24 May 2017 16:08:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030638AbdEXQI4 (ORCPT ); Wed, 24 May 2017 12:08:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54328 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030571AbdEXQIr (ORCPT ); Wed, 24 May 2017 12:08:47 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 818D180F93 for ; Wed, 24 May 2017 16:08:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 818D180F93 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=drjones@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 818D180F93 Received: from kamzik.brq.redhat.com (kamzik.brq.redhat.com [10.34.1.143]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8B7EC91727; Wed, 24 May 2017 16:08:38 +0000 (UTC) From: Andrew Jones To: kvm@vger.kernel.org Cc: pbonzini@redhat.com, rkrcmar@redhat.com, lvivier@redhat.com, thuth@redhat.com Subject: [PATCH kvm-unit-tests 6/8] README: add section on guarding unsafe tests Date: Wed, 24 May 2017 18:08:16 +0200 Message-Id: <20170524160818.4326-7-drjones@redhat.com> In-Reply-To: <20170524160818.4326-1-drjones@redhat.com> References: <20170524160818.4326-1-drjones@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 24 May 2017 16:08:41 +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 Signed-off-by: Andrew Jones --- README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/README.md b/README.md index 49fbc9c50bce..fb257af1762b 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,40 @@ Additionally these self-explanatory variables are reserved QEMU_MAJOR, QEMU_MINOR, QEMU_MICRO, KERNEL_VERSION, KERNEL_PATCHLEVEL, KERNEL_SUBLEVEL, KERNEL_EXTRAVERSION +# Guarding unsafe tests + +Some tests are not safe to run by default, as they may crash the +host. kvm-unit-tests provides two ways to handle tests like those. + + 1) Adding 'nodefault' to the groups field for the unit test in the + unittests.cfg file. When a unit test is in the nodefault group + it is only run when invoked + + a) independently, arch-run arch/test + b) by specifying any other non-nodefault group it is in, + groups = nodefault,mygroup : ./run_tests.sh -g mygroup + c) by specifying all tests should be run, ./run_tests.sh -a + + 2) Making the test conditional on errata in the code, + if (ERRATA(abcdef012345)) { + do_unsafe_test(); + } + + With the errata condition the unsafe unit test is only run + when + + a) the ERRATA_abcdef012345 environ variable is provided and 'y' + b) the ERRATA_FORCE environ variable is provided and 'y' + c) by specifying all tests should be run, ./run_tests.sh -a + (The -a switch ensures the ERRATA_FORCE is provided and set + to 'y'.) + +The errata.txt file provides a mapping of the commits needed by errata +conditionals to their respective minimum kernel versions. By default, +when the user does not provide an environ, then an environ generated +from the errata.txt file and the host's kernel version is provided to +all unit tests. + # Contributing ## Directory structure