From patchwork Thu Feb 21 06:28:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045807 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lCD4Zr0z9sBF for ; Thu, 21 Feb 2019 17:37:44 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="BX5AM4bs"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="24w76hHb"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lCD3NS3zDqQ0 for ; Thu, 21 Feb 2019 17:37:44 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="BX5AM4bs"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="24w76hHb"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l2j33bzzDqMH for ; Thu, 21 Feb 2019 17:30:21 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 2C9DD2217B; Thu, 21 Feb 2019 01:30:19 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=9RqGAe6heS6p8 H9l0ZCcEFUbEHaiI4gZXeMpM5lRIxw=; b=BX5AM4bs/RdUgOwuxSyjSXyOirJYU 7u39JPql0CIRy8I6IRh82R59f5hNEsgafrsZJMihrbsfYP7Il8z0BMKLA0n1JfeR ZNQfCnTEeiok02Y2bFtmu9SP8w3GZewycE5I/ZMKPrv5wyl6x8/0y4tueB9cGAp7 y1403GJfS/12V1WiwlIsNssMyofDgixqs+cc/RRRBS/yDxsFPx8aMEAv6/1vJ+FH z2H6NJLxCWXCtmthxw9LHTuuAj+4AtJBVjNZzX/Ar0LwBw8iZ38C896ONOBqbqqd NC+WBE6Y6xhDDXZKH4vqkJm973hQ0u70pmLpqYb+TsEurc/trdRdhHEVg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=9RqGAe6heS6p8H9l0ZCcEFUbEHaiI4gZXeMpM5lRIxw=; b=24w76hHb JT2cJY1SZTH6LoT5bqNm6bwDzCMm/olXqj6PAylEt/GwhVUJEgrBjgbLVJHkBM+7 m59IJzHUTOfmPOF7uTH+nGltNcnBMn/kFMY+zG4YwxmZEFHlCH2Dfdf6H+l+035A w2gg6GEyf93zkFIn7HiL54paqkt2gZxsvle684EytNvDapSCIMmkg5ZzgkTKrQ3R WAcytWk9xIGF42Ban9L9Nl3ic9O2ohFoRZ3jUeYQ/wu/zX0X4fHtrBINlUNHcaOu kV6vOf19F4++0JeiO4X/NDUpD0yHlXgGQJsCdt8IgGKY4dX1/91Ke3t5JdJVLMjG uPSJ0VIXGjs2bA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv pedvhe X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 386B5E419A; Thu, 21 Feb 2019 01:30:16 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:29 +1030 Message-Id: <20190221062851.21958-31-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 30/52] test-ipmi-hiomap: Add get-flash-info test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 46 ++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 7e7689196307..e29242f73b69 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -1355,6 +1355,51 @@ static void test_hiomap_protocol_action_error(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_protocol_get_flash_info[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 4, + .args = { + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 4, + .args = { + [0] = 0x00, [1] = 0x20, + [2] = 0x01, [3] = 0x00, + }, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_protocol_get_flash_info(void) +{ + struct blocklevel_device *bl; + const char *name; + uint32_t granule; + uint64_t size; + + scenario_enter(scenario_hiomap_protocol_get_flash_info); + assert(!ipmi_hiomap_init(&bl)); + assert(!bl->get_info(bl, &name, &size, &granule)); + assert(!name); + assert(size == (32 * 1024 * 1024)); + assert(granule == (4 * 1024)); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + static const struct scenario_event scenario_hiomap_protocol_persistent_error[] = { { .type = scenario_event_p, .p = &hiomap_ack_call, }, @@ -1413,6 +1458,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_protocol_bad_sequence), TEST_CASE(test_hiomap_protocol_action_error), TEST_CASE(test_hiomap_protocol_persistent_error), + TEST_CASE(test_hiomap_protocol_get_flash_info), { NULL, NULL }, };