From patchwork Fri Dec 14 09:47:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 153792 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1856994ljp; Fri, 14 Dec 2018 01:45:03 -0800 (PST) X-Google-Smtp-Source: AFSGD/XV2QyjcYWKbApYcznqcjpS+DaSocqXAm3MrvhHfXvWXFDMiqG72H6MPnldDZt0ozHorIeP X-Received: by 2002:a50:a4fc:: with SMTP id x57mr2336505edb.229.1544780703715; Fri, 14 Dec 2018 01:45:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544780703; cv=none; d=google.com; s=arc-20160816; b=gNIF6HQGfOJJnY5zZCZ0tPFBEGPHFMZwxR2kjkrTJpOz1aEV5qDYHEOPujSkvaXMPW bV3JkN2yVzIbbXWYTSMQbLilNG7cMLQ7eufOdx3DgvrYPR+ONoHT3GKmNXWvbf5iLxFz 2xUiI+FhjvDe+AixJPZTPCfS9MGBwD1WqIUIw/12G3qovo3Fx+fiSW5mBJG9lvfv4UxX lWkKtzHlM5fDH+hcvpT0MWaaGpmmQABDF2v1HX/dEAOPWoiTQ0hFnN8JkfVGMxJM1zvY NZKrP+2C+INB2zlKs8thC/FDJyFn2u5mT0+gtedgCPetWcQMahlcgOI2qgX6Xfg6ZMhf IVpA== 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=J/ze6NnuP1mTRf2/csTrfwbIPrVTi3NJf7gIGShxcVU=; b=R5sdmjgjNhiHyIrrX7jcb01XG88uDelGE0FU11w7afg5/jaCAiiEkOhWUaP3h0yMIy nuNVhx/OC8Tlq/l3bEtDszaQnLUm9/hG3g++mCsvFk9LCbGLZviwBlZHNTH2sutllel4 YwGUUisaQknSJesYpJlEj0YfqaHKlLOw88mgrU5mKpFhk1vdlxDb6nxvg3++tubIJYHl rPNHsmdLBiwucmDQuQTlhs9TbA+Mi6eEa975dG+TcIBxKPhvXgW2Y68sYItraPV8lpLQ CgHKUqI1gjX7852LS9sKSNgAgwpPXjhkxXNl7muWdK7Hm/KQUdkPtvXGcjHbVb0dZ3Qd kH3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Ra30AYVp; 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 y4si1770694edr.395.2018.12.14.01.45.03; Fri, 14 Dec 2018 01:45:03 -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=Ra30AYVp; 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 F02C6C22652; Fri, 14 Dec 2018 09:44:32 +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_MSPIKE_H2, 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 CEABEC22728; Fri, 14 Dec 2018 09:44:28 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C7BF5C225D0; Fri, 14 Dec 2018 09:44:18 +0000 (UTC) Received: from mail-yb1-f173.google.com (mail-yb1-f173.google.com [209.85.219.173]) by lists.denx.de (Postfix) with ESMTPS id 35EE1C225C8 for ; Fri, 14 Dec 2018 09:44:13 +0000 (UTC) Received: by mail-yb1-f173.google.com with SMTP id d187so2016755ybb.5 for ; Fri, 14 Dec 2018 01:44:13 -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=CDOCf6059/4xxW6OStGHy9rjzPfoXP4ZZeC/hh4z/6w=; b=Ra30AYVpcW9PX+VR84peaGU5VlMAFPiQ0/Zq8JTfSkA8j78g4+kNoEtmpFTos84/UY Z+ODaxp7J6PHhMPunMSbrrsUZf3SxSFafE6ExbntEAEWGHQA1/hXCNKElvdjC8/XExxe GfwclDpAgaaH6dQOSFzOmTVUnC3x7o2EovLm4= 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=CDOCf6059/4xxW6OStGHy9rjzPfoXP4ZZeC/hh4z/6w=; b=chg8yz43TFHCINaJWU+J9Zr742j2K3X8Sb9JVMaNZUSQnKUJAxbKU1MWiZjio4hw+6 ILLboWTatKZOAEwYoF+TSWMNSdeL1Z3PGlPty0jhINPLIRNVhetxLa7noMCX3aD+cvS6 LoWA+SRkU7sYqu+1/yuLBDj8ghSAfGOgZ2lXYqV8MUlQmMuMHZSqndZEjF+ByV4xF5QL sFhMBUr4CqlKlyomDBDrCcOh/FXlF2+tAA6c8I2/a5k3itOOpQwfpSaLWpABcY7rsjQq dwha5zxp7CSDOgonS/cIC4kLrAweroMgQsv7UGE7CQGAstbpjpldPgQHJ1hOsuF5Dx2I IQnw== X-Gm-Message-State: AA+aEWbAjY2IXHW5H8o2uU8zjU1hlSVCp4F1J+AJ+HGBM5pOEG7WhARj SN3JV11ZUivvW0jx0bhjO7GzZw== X-Received: by 2002:a25:b783:: with SMTP id n3mr2215642ybh.141.1544780652111; Fri, 14 Dec 2018 01:44:12 -0800 (PST) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id v202sm1565349ywv.19.2018.12.14.01.44.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Dec 2018 01:44:11 -0800 (PST) From: AKASHI Takahiro To: trini@konsulko.com, agraf@suse.de, xypron.glpk@gmx.de Date: Fri, 14 Dec 2018 18:47:12 +0900 Message-Id: <20181214094712.9051-2-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181214094712.9051-1-takahiro.akashi@linaro.org> References: <20181214094712.9051-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 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);