From patchwork Fri Feb 15 06:56:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1042631 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 44144z5xwbz9s4Z for ; Fri, 15 Feb 2019 18:04:35 +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="PlN8rv2F"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="xt9IEvL2"; 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 44144z3pw7zDqf0 for ; Fri, 15 Feb 2019 18:04:35 +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="PlN8rv2F"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="xt9IEvL2"; 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 4413xy2B8FzDqVD for ; Fri, 15 Feb 2019 17:58:30 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id D5A0321F24; Fri, 15 Feb 2019 01:58:27 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:58:27 -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=NQzGC1GIr9chq uOqlrh9YPxX7vBh5NK/nPG5MVZfty4=; b=PlN8rv2Fy9akzBEmuYiDQPQ9+y654 qTb97etZQSsTjJUDsOj4hlBBbWg+DveVCJ7SqhBNlbPlpMduyFybEKD2v4RtFXgg 5pRgloCo1DsKbedUissAzQu/0PQrQfUP5rlJRRcRr22Pg/WZ5SIK2eUpbqkcPR4c fpFafqCtTiX2mHNOs1UhghWUkzatk+rgqoiMtx1gELGlqCLvtedtyICSu7o3Ft8j sYdgO6SViGoRJx5kNqDhr42POgDbHe7klukRMlQ1JmnycySyell74vY7qWe5n6qS bUiqoFFLzAsU2aCP0xYVBfewyrLR5dqP7MM1yv9DWtHQNk1gC4WNE9HVA== 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=NQzGC1GIr9chquOqlrh9YPxX7vBh5NK/nPG5MVZfty4=; b=xt9IEvL2 ZCdk8ssIdgGLP/GhtLjNijwFuiA7wehQglR4hGM7QONXgw2jSI5cCd1dSrZV2ouU Lk3pOlU24XAmWAx/2VTDhFVIseZgxTUe/bZKd6cx2cHPtBf0Wq3hQV7BE3QJCKqd 2pAZjqiS5Rc+knCn+sSQfXyklrBxwO8TEu0MonAeEkkfONm+RCbvP4HUCuB974Bw pPI7wCE+iGfRk7RDQsy87SnkuwCP/qRbAGGAyxyAuv5jijGE1yPa9NHsrUXok7Kl Hg8TPvddmn33lNbp/OM3V0NHwQ/Ew9mISM0cxoOlinyoCb/9TrBIFZA1PHoo/t8n rO1MS/b+caNXPQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepudek X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 73A2CE4438; Fri, 15 Feb 2019 01:58:25 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:40 +1030 Message-Id: <20190215065708.6086-24-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 23/51] test-ipmi-hiomap: Add erase-two-blocks 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" Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 64 ++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 242fc9bb2ed6..99b2902b6446 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -1165,6 +1165,69 @@ scenario_hiomap_protocol_erase_one_block[] = { SCENARIO_SENTINEL, }; +static const struct scenario_event +scenario_hiomap_protocol_erase_two_blocks[] = { + { .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_event_p, + .p = &hiomap_create_write_window_qs0l2_rs0l1_call, + }, + { .type = scenario_event_p, .p = &hiomap_erase_qs0l1_call, }, + { .type = scenario_event_p, .p = &hiomap_flush_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_write_window_qs1l1_rs1l1_call, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_ERASE, + .seq = 8, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .resp = { + .cmd = HIOMAP_C_ERASE, + .seq = 8, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_FLUSH, + .seq = 9, + }, + .resp = { + .cmd = HIOMAP_C_FLUSH, + .seq = 9, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_protocol_erase_two_blocks(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + + scenario_enter(scenario_hiomap_protocol_erase_two_blocks); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 2 * (1 << ctx->block_size_shift); + assert(!bl->erase(bl, 0, len)); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + static void test_hiomap_protocol_erase_one_block(void) { struct blocklevel_device *bl; @@ -1232,6 +1295,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_protocol_event_before_write), TEST_CASE(test_hiomap_protocol_event_during_write), TEST_CASE(test_hiomap_protocol_erase_one_block), + TEST_CASE(test_hiomap_protocol_erase_two_blocks), TEST_CASE(test_hiomap_protocol_persistent_error), { NULL, NULL }, };