From patchwork Fri Jan 4 09:05:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Hu X-Patchwork-Id: 209400 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 61E982C007A for ; Fri, 4 Jan 2013 20:05:31 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Tr3DV-0004jh-KN; Fri, 04 Jan 2013 09:05:29 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Tr3DU-0004jc-EW for fwts-devel@lists.ubuntu.com; Fri, 04 Jan 2013 09:05:28 +0000 Received: from [175.180.135.244] (helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Tr3DT-0005R3-Hn; Fri, 04 Jan 2013 09:05:28 +0000 From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 1/4] uefirtvariable: add stress test for UEFI runtime interface SetVariable with the same data Date: Fri, 4 Jan 2013 17:05:22 +0800 Message-Id: <1357290322-4170-1-git-send-email-ivan.hu@canonical.com> X-Mailer: git-send-email 1.7.9.5 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 This stress test tests the UEFI runtime interface SetVariable by calling with the same data multiple times. All bios implementations have a limit of how much flash nvram space they have (ie win8 logo requirements is 64k min). When doing repeated setnvram and delete nvram variables will eventually hit the end of the 64k nvram limit (deletes just mark the variable as deleted in the link list but it still writes into new nvram space in flash), bios will do the reclaim after reboot. Since this series setvariable stress tests cannot reboot the system, consider the tests multiple times of setvariable on this test, decide to use double times from UEFI SCT tests, i.e. 40. To safe some nvram space for the coming setvariable stress tests. Signed-off-by: Ivan Hu Acked-by: Colin Ian King Acked-by: Keng-Yu Lin --- src/uefi/uefirtvariable/uefirtvariable.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c index 73d1049..e88d26e 100644 --- a/src/uefi/uefirtvariable/uefirtvariable.c +++ b/src/uefi/uefirtvariable/uefirtvariable.c @@ -901,12 +901,38 @@ static int uefirtvariable_test5(fwts_framework *fw) } +static int uefirtvariable_test6(fwts_framework *fw) +{ + uint32_t multitesttime = 40; + uint64_t datasize = 10; + uint8_t datadiff = 0; + uint32_t i; + + fwts_log_info(fw, "Testing SetVariable on setting the variable with the same data multiple times."); + for (i = 0; i < multitesttime; i++) { + if (setvariable_insertvariable(fw, attributes, datasize, variablenametest, + >estguid1, datadiff) == FWTS_ERROR) { + if (i > 0) + setvariable_insertvariable(fw, attributes, 0, variablenametest, + >estguid1, datadiff); + return FWTS_ERROR; + } + } + if (setvariable_insertvariable(fw, attributes, 0, variablenametest, + >estguid1, datadiff) == FWTS_ERROR) + return FWTS_ERROR; + fwts_passed(fw, "SetVariable on setting the variable with the same data multiple times passed."); + + return FWTS_OK; +} + static fwts_framework_minor_test uefirtvariable_tests[] = { { uefirtvariable_test1, "Test UEFI RT service get variable interface." }, { uefirtvariable_test2, "Test UEFI RT service get next variable name interface." }, { uefirtvariable_test3, "Test UEFI RT service set variable interface." }, { uefirtvariable_test4, "Test UEFI RT service query variable info interface." }, { uefirtvariable_test5, "Test UEFI RT service variable interface stress test." }, + { uefirtvariable_test6, "Test UEFI RT service set variable interface stress test." }, { NULL, NULL } };