From patchwork Mon Jan 21 03:10:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 156138 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp5898690jaa; Sun, 20 Jan 2019 19:12:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN7RiVMPuUaR4aQODDx8enQVVJUH9Mz2tnUcePuOamE+iB+Kk7oFdbo5cTRlXk7D+6PssQws X-Received: by 2002:a50:a347:: with SMTP id 65mr25662099edn.40.1548040326528; Sun, 20 Jan 2019 19:12:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548040326; cv=none; d=google.com; s=arc-20160816; b=YZkwXxHdr3fRSTvLkb9lJRmAhZ0CMe5EYPnwYAZZVKzCLPrxBsL16xR+mCIoel1it6 yktOJN6cIuyYRKZHt8rSV/S7dSW4AWRWMh6w1jwxkeCbvS1WiX24GazzAUI+Img4evgk BNgJt41bai/vsoNTC5Svmccau27seAoUoaK5Z3R9tUjJcI9cRUBJjv68IChyp2JADuRe F+sB/ViidaDNEIGValhjpIxyWJZ46qBB2BDwSp8y46B6w8t1ptE8e0AjiYPXYmEVB5iR U+QM8vTER0OchQxlvbsvWyUxBFLHnwLDB8FuEbIDM93XqZuWeKfj2KC705UD0Xfa9mqH dzyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature; bh=LGrQj/Fa12Fyq/fVgWMt2SZPgVDfUOV12pWGUvltN6U=; b=BQnxJXucySt+o53mb81JtHecUGG/cTjnH6fEhQBiu99vk/T5bs42xtrwmKkduFpPog cObsXjzElRwSufc/9YfqVK3HLyiOHjerIJhcxzIAu9Y6mNfsY/KeTy9AX2R/e9d0TnLg m63DHO3+wYxDB6X6qic5YVl8dxFR9+PWzT6/IJet90X5ONV/5vAlDT20MWhI0CYcMXTt rRwolatjyhlzWssaEbh4DLgfcLKb3Z55kb/Mm4lfT45wvTXq69TpBHZxhW9DqGH/oon9 xGNhDOoflDnTa0RD9wZv/ynyQxRC8azl/r1wetGNQD8tmPpBYbygPeBRUcKxcHvpmCQc PxSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=i3AHusJC; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id y32si3597601ede.115.2019.01.20.19.12.06; Sun, 20 Jan 2019 19:12:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=i3AHusJC; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 2BC9DC21E0D; Mon, 21 Jan 2019 03:11:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id B0FD7C21E42; Mon, 21 Jan 2019 03:11:09 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D22D9C21E6A; Mon, 21 Jan 2019 03:10:43 +0000 (UTC) Received: from mail-yw1-f42.google.com (mail-yw1-f42.google.com [209.85.161.42]) by lists.denx.de (Postfix) with ESMTPS id 14902C21ECC for ; Mon, 21 Jan 2019 03:10:39 +0000 (UTC) Received: by mail-yw1-f42.google.com with SMTP id x2so7515748ywc.9 for ; Sun, 20 Jan 2019 19:10:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XpFKzFeVwmQVuFpaUw7Xh1a58FeFdJJyYOVhnuq+BmQ=; b=i3AHusJCwIJ9wjaK7EelpHhEGkOPflk1sSEIHwxHprvdZ14boA7l8/IikgxgWVCkxY 3ApWUAonEkI7k6KastMnBYv7OtnTXHr8e9Vg7gEVwVdSEk+k+YdgnxTw+c4Br1fp5RLd KXPPLTiAU9NeG78xvGuRlzcXvf5k1BvCk9tDQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XpFKzFeVwmQVuFpaUw7Xh1a58FeFdJJyYOVhnuq+BmQ=; b=F/xywd9SJOSWAbdFmoJSJArW/c9tNIGQKOHw2rPSrH5M8pnp+2j3q2CWTh1f6S6yaq 28y/xRu9LulfO1xIlm28BrnRXZCebJXYr4kGv3k3O8bGh6hbJQBwdn3RVne4DGUDsXqf IXLeyRts6AKPKmYVRnR2q22kfQafjn3XmpIbgSqo07E5l9vvV98Q56HBM1LVzv/7knQ0 xZnOMS1rVhasPP/Viu8PfTjR7lV0U1x6f+3B9CG+HEZiFxWXw7XcNCH7HGm+VLCDQV1b 5pjdae2/6NvP7ICM1Jm/orQTzS22p4auG9VkIhqGmaRggBe9gp9J0bFHnMlRz/FyRizK lw7A== X-Gm-Message-State: AJcUukcGgX0eRvUIBrsv1SkmDoC2c1gnbmS65zprCJVDoLqT+KWJAAWz FDXMIlCYc8OcUBoFQNqTPGFavw== X-Received: by 2002:a81:59c1:: with SMTP id n184mr26894097ywb.230.1548040237932; Sun, 20 Jan 2019 19:10:37 -0800 (PST) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id l74sm5098817ywl.99.2019.01.20.19.10.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Jan 2019 19:10:37 -0800 (PST) From: AKASHI Takahiro To: trini@konsulko.com, agraf@suse.de, xypron.glpk@gmx.de Date: Mon, 21 Jan 2019 12:10:40 +0900 Message-Id: <20190121031040.1621-3-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190121031040.1621-1-takahiro.akashi@linaro.org> References: <20190121031040.1621-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v2 2/2] efi_selftest: fix variables test for GetNextVariableName() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" There is a bug in efi variables test. Fix it with some cosmetic improvements. Please note that efi variables test still fails at QueryVariableInfo() and GetVariable(), but this is not due to a change in this patch. ==8<== Testing EFI API implementation Selected test: 'variables' Setting up 'variables' Setting up 'variables' succeeded Executing 'variables' .../u-boot/lib/efi_selftest/efi_selftest_variables.c(60): TODO: QueryVariableInfo failed .../u-boot/lib/efi_selftest/efi_selftest_variables.c(131): TODO: GetVariable returned wrong length 7 .../u-boot/lib/efi_selftest/efi_selftest_variables.c(133): TODO: GetVariable returned wrong value Executing 'variables' succeeded Boot services terminated Summary: 0 failures ==>8== Signed-off-by: AKASHI Takahiro Reviewed-by: Heinrich Schuchardt --- lib/efi_selftest/efi_selftest_variables.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/efi_selftest/efi_selftest_variables.c b/lib/efi_selftest/efi_selftest_variables.c index e4c389a872fa..c58434289325 100644 --- a/lib/efi_selftest/efi_selftest_variables.c +++ b/lib/efi_selftest/efi_selftest_variables.c @@ -141,19 +141,22 @@ static int execute(void) if (ret == EFI_NOT_FOUND) break; if (ret != EFI_SUCCESS) { - efi_st_todo("GetNextVariableName failed\n"); - break; + efi_st_error("GetNextVariableName failed (%u)\n", + (unsigned int)ret); + return EFI_ST_FAILURE; } if (!efi_st_memcmp(&guid, &guid_vendor0, sizeof(efi_guid_t)) && !efi_st_strcmp_16_8(varname, "efi_st_var0")) - flag |= 2; + flag |= 1; if (!efi_st_memcmp(&guid, &guid_vendor1, sizeof(efi_guid_t)) && !efi_st_strcmp_16_8(varname, "efi_st_var1")) flag |= 2; } - if (flag != 3) - efi_st_todo( + if (flag != 3) { + efi_st_error( "GetNextVariableName did not return all variables\n"); + return EFI_ST_FAILURE; + } /* Delete variable 1 */ ret = runtime->set_variable(L"efi_st_var1", &guid_vendor1, 0, 0, NULL);