From patchwork Fri Jul 11 03:20:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Hu X-Patchwork-Id: 368937 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id D2562140117; Fri, 11 Jul 2014 13:20:54 +1000 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1X5ROF-0005N2-74; Fri, 11 Jul 2014 03:20:51 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1X5RO9-0005Mn-TR for fwts-devel@lists.ubuntu.com; Fri, 11 Jul 2014 03:20:45 +0000 Received: from [175.41.48.77] (helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1X5RO9-0004cg-8I; Fri, 11 Jul 2014 03:20:45 +0000 From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH] uefi: uefirtvariable: print out the duplicate variable name (LP: #1340492) Date: Fri, 11 Jul 2014 11:20:39 +0800 Message-Id: <1405048839-5013-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.14 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: fwts-devel-bounces@lists.ubuntu.com When fwts tests find out a duplicate name exist, print out the duplicate variable name. Signed-off-by: Ivan Hu Acked-by: Colin Ian King Acked-by: Alex Hung --- src/uefi/uefirtvariable/uefirtvariable.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c index 7ddfeb1..fd2dc7e 100644 --- a/src/uefi/uefirtvariable/uefirtvariable.c +++ b/src/uefi/uefirtvariable/uefirtvariable.c @@ -565,6 +565,7 @@ static int getnextvariable_test3(fwts_framework *fw) uint64_t variablenamesize = MAX_DATA_LENGTH; uint16_t variablename[MAX_DATA_LENGTH]; EFI_GUID vendorguid; + char name[MAX_DATA_LENGTH]; getnextvariablename.VariableNameSize = &variablenamesize; getnextvariablename.VariableName = variablename; @@ -632,9 +633,10 @@ static int getnextvariable_test3(fwts_framework *fw) item->hash = hash_func(variablename, variablenamesize); if (bucket_insert(item)) { + fwts_uefi_str16_to_str(name, sizeof(name), variablename); fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetNextVariableName", - "Duplicate variable name found."); + "Duplicate variable name %s found.", name); free(item->name); free(item->guid); free(item);