From patchwork Thu Sep 6 09:34:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 182128 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 1DC592C0090 for ; Thu, 6 Sep 2012 19:34:34 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1T9YSb-0005Rs-AL; Thu, 06 Sep 2012 09:33:17 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1T9YSa-0005Rn-1A for fwts-devel@lists.ubuntu.com; Thu, 06 Sep 2012 09:33:16 +0000 Received: from cpc3-craw6-2-0-cust180.croy.cable.virginmedia.com ([77.100.248.181] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1T9YTm-0005Wm-RQ for fwts-devel@lists.ubuntu.com; Thu, 06 Sep 2012 09:34:30 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH] lib: framework: Add "unsafe" test category Date: Thu, 6 Sep 2012 10:34:30 +0100 Message-Id: <1346924070-16438-1-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.7.10.4 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: fwts-devel-bounces@lists.ubuntu.com Errors-To: fwts-devel-bounces@lists.ubuntu.com From: Colin Ian King Some tests we may add in the future (such as UEFI run time services) can cause the kernel to oops if the firmware is buggy, so we should add a new "unsafe" test category for these kinds of tests. Currently there are no "unsafe" tests in fwts, so this does not make any difference to output to fwts --show-tests until we start adding the actual tests, so this is a fairly benign addition. Also add the --unsafe and -U option to run unsafe tests. Signed-off-by: Colin Ian King Acked-by: Alex Hung Acked-by: Keng-Yu Lin --- src/lib/include/fwts_framework.h | 2 ++ src/lib/src/fwts_framework.c | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/lib/include/fwts_framework.h b/src/lib/include/fwts_framework.h index de28612..ad490c7 100644 --- a/src/lib/include/fwts_framework.h +++ b/src/lib/include/fwts_framework.h @@ -42,6 +42,7 @@ typedef enum { FWTS_FRAMEWORK_FLAGS_INTERACTIVE_EXPERIMENTAL = 0x00008000, FWTS_FRAMEWORK_FLAGS_POWER_STATES = 0x00010000, FWTS_FRAMEWORK_FLAGS_ROOT_PRIV = 0x00020000, + FWTS_FRAMEWORK_FLAGS_UNSAFE = 0x00040000, FWTS_FRAMEWORK_FLAGS_TEST_BIOS = 0x01000000, FWTS_FRAMEWORK_FLAGS_TEST_UEFI = 0x02000000, FWTS_FRAMEWORK_FLAGS_TEST_ACPI = 0x04000000, @@ -235,6 +236,7 @@ static inline int fwts_tests_passed(const fwts_framework *fw) #define FWTS_POWER_STATES FWTS_FRAMEWORK_FLAGS_POWER_STATES #define FWTS_UTILS FWTS_FRAMEWORK_FLAGS_UTILS #define FWTS_ROOT_PRIV FWTS_FRAMEWORK_FLAGS_ROOT_PRIV +#define FWTS_UNSAFE FWTS_FRAMEWORK_FLAGS_UNSAFE #define FWTS_TEST_BIOS FWTS_FRAMEWORK_FLAGS_TEST_BIOS #define FWTS_TEST_UEFI FWTS_FRAMEWORK_FLAGS_TEST_UEFI diff --git a/src/lib/src/fwts_framework.c b/src/lib/src/fwts_framework.c index c6536a6..1ad3d0d 100644 --- a/src/lib/src/fwts_framework.c +++ b/src/lib/src/fwts_framework.c @@ -37,7 +37,8 @@ FWTS_BATCH_EXPERIMENTAL | \ FWTS_INTERACTIVE_EXPERIMENTAL |\ FWTS_POWER_STATES | \ - FWTS_UTILS) + FWTS_UTILS | \ + FWTS_UNSAFE) #define FWTS_ARGS_WIDTH 28 #define FWTS_MIN_TTY_WIDTH 50 @@ -78,6 +79,7 @@ static fwts_option fwts_framework_options[] = { { "lp-tags-log", "", 0, "Output LaunchPad bug tags in results log." }, { "disassemble-aml", "", 0, "Disassemble AML from DSDT and SSDT tables." }, { "log-type", "", 1, "Specify log type (plaintext, json, html or xml)." }, + { "unsafe", "U", 0, "Unsafe tests (tests that can potentially cause kernel oopses." }, { NULL, NULL, 0, NULL } }; @@ -230,6 +232,7 @@ static void fwts_framework_show_tests(fwts_framework *fw, bool full) { "Interactive Experimental", FWTS_INTERACTIVE_EXPERIMENTAL }, { "Power States", FWTS_POWER_STATES }, { "Utilities", FWTS_UTILS }, + { "Unsafe", FWTS_UNSAFE }, { NULL, 0 }, }; @@ -984,6 +987,9 @@ int fwts_framework_options_handler(fwts_framework *fw, int argc, char * const ar if (fwts_framework_log_type_parse(fw, optarg) != FWTS_OK) return FWTS_ERROR; break; + case 33: /* --unsafe */ + fw->flags |= FWTS_FRAMEWORK_FLAGS_UNSAFE; + break; } break; case 'a': /* --all */ @@ -1051,6 +1057,9 @@ int fwts_framework_options_handler(fwts_framework *fw, int argc, char * const ar case 'u': /* --utils */ fw->flags |= FWTS_FRAMEWORK_FLAGS_UTILS; break; + case 'U': /* --unsafe */ + fw->flags |= FWTS_FRAMEWORK_FLAGS_UNSAFE; + break; case 'v': /* --version */ fwts_framework_show_version(stdout, argv[0]); return FWTS_COMPLETE;