From patchwork Tue Nov 28 05:57:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ivanhu X-Patchwork-Id: 1869110 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SfWvz1XCkz1yRW for ; Tue, 28 Nov 2023 16:58:06 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1r7r6W-0004t0-0G; Tue, 28 Nov 2023 05:57:52 +0000 Received: from smtp-relay-canonical-0.internal ([10.131.114.83] helo=smtp-relay-canonical-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1r7r6T-0004sr-8X for fwts-devel@lists.ubuntu.com; Tue, 28 Nov 2023 05:57:49 +0000 Received: from canonical.com (unknown [106.104.136.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 2ED55416C9 for ; Tue, 28 Nov 2023 05:57:47 +0000 (UTC) From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 1/2] acpi: ibft: add tests for iBFT table Date: Tue, 28 Nov 2023 13:57:38 +0800 Message-Id: <20231128055739.47290-1-ivan.hu@canonical.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" Buglink: https://bugs.launchpad.net/fwts/+bug/2032397 Reference: https://learn.microsoft.com/en-us/windows-hardware/drivers/bringup/acpi-system-description-tables#iscsi-boot-firmware-table-ibft Signed-off-by: Ivan Hu --- src/Makefile.am | 1 + src/acpi/ibft/ibft.c | 379 ++++++++++++++++++++++++++++++++++++ src/lib/include/fwts_acpi.h | 93 +++++++++ 3 files changed, 473 insertions(+) create mode 100644 src/acpi/ibft/ibft.c diff --git a/src/Makefile.am b/src/Makefile.am index 215b9eaf..e3bed3dd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -107,6 +107,7 @@ fwts_SOURCES = main.c \ acpi/hpet/hpet.c \ acpi/hmat/hmat.c \ acpi/iort/iort.c \ + acpi/ibft/ibft.c \ acpi/ivrs/ivrs.c \ acpi/lid/lid.c \ acpi/lpit/lpit.c \ diff --git a/src/acpi/ibft/ibft.c b/src/acpi/ibft/ibft.c new file mode 100644 index 00000000..d85e0aee --- /dev/null +++ b/src/acpi/ibft/ibft.c @@ -0,0 +1,379 @@ +/* + * Copyright (C) 2023 Canonical + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ +#include "fwts.h" + +#if defined(FWTS_HAS_ACPI) + +#include +#include +#include +#include +#include + +static fwts_acpi_table_info *table; +acpi_table_init(iBFT, &table) + +static void ibfg_std_dump( fwts_framework *fw, const fwts_acpi_ibft_standard *std) +{ + fwts_log_info_simp_int(fw, " Structure ID: ", std->structure_id); + fwts_log_info_simp_int(fw, " Version: ", std->version); + fwts_log_info_simp_int(fw, " Length: ", std->length); + fwts_log_info_simp_int(fw, " Index: ", std->index); + fwts_log_info_simp_int(fw, " Flags: ", std->flags); +} + +static void ibfg_extensions_check( + fwts_framework *fw, + uint32_t offset, + bool *passed) +{ + + fwts_log_info_verbatim(fw, "iBFT Extensions Structure:"); + + fwts_acpi_ibft_standard *std = (fwts_acpi_ibft_standard *)(table->data + offset); + + if (offset >= table->length) { + fwts_failed(fw, LOG_LEVEL_HIGH, + "iBFTBadStructureOffset", + "iBFT Extensions structure exceed the table length, " + "table length 0x%8.8" PRIx32 ", but got 0x%8.8" PRIx32, + (uint32_t)table->length, offset); + *passed = false; + return; + } + + if (std->length < sizeof(fwts_acpi_ibft_standard)) { + fwts_failed(fw, LOG_LEVEL_HIGH, + "iBFTBadStructureLength", + "iBFT Extensions structure type length too short, " + "at least 0x%4.4" PRIx16 ", but got 0x%4.4" PRIx16, + (uint16_t)sizeof(fwts_acpi_ibft_standard), std->length); + *passed = false; + return; + } + + ibfg_std_dump(fw, std); +} + +static void ibfg_initiator_check( + fwts_framework *fw, + uint32_t offset, + bool *passed) +{ + + fwts_acpi_ibft_initiator *initiator = (fwts_acpi_ibft_initiator *)(table->data + offset); + + if (offset >= table->length) { + fwts_failed(fw, LOG_LEVEL_HIGH, + "iBFTBadStructureOffset", + "iBFT Initiator structure exceed the table length, " + "table length 0x%8.8" PRIx32 ", but got 0x%8.8" PRIx32, + (uint32_t)table->length, offset); + *passed = false; + return; + } + + if (initiator->std.length < sizeof(fwts_acpi_ibft_initiator)) { + fwts_failed(fw, LOG_LEVEL_HIGH, + "iBFTBadStructureLength", + "iBFT Initiator structure type length is not correct, " + "expecting 0x%4.4" PRIx16 ", but got 0x%4.4" PRIx16, + (uint16_t)sizeof(fwts_acpi_ibft_initiator), initiator->std.length); + *passed = false; + return; + } + + fwts_log_info_verbatim(fw, "iBFT Initiator Structure:"); + ibfg_std_dump(fw, &initiator->std); + fwts_acpi_reserved_bits("iBAF", "Flags", initiator->std.flags, 2, 7, passed); + fwts_log_info_verbatim(fw, " iSNS Server:"); + fwts_hexdump_data_prefix_all(fw, initiator->isns_server, " ", sizeof(initiator->isns_server)); + fwts_log_info_verbatim(fw, " SLP Server:"); + fwts_hexdump_data_prefix_all(fw, initiator->slp_server, " ", sizeof(initiator->slp_server)); + fwts_log_info_verbatim(fw, " Primary Radius Server:"); + fwts_hexdump_data_prefix_all(fw, initiator->primary_radius_server, " ", sizeof(initiator->primary_radius_server)); + fwts_log_info_verbatim(fw, " Secondary Radius Server:"); + fwts_hexdump_data_prefix_all(fw, initiator->secondary_radius_server, " ", sizeof(initiator->secondary_radius_server)); + fwts_log_info_simp_int(fw, " Initiator Name Length: ", initiator->initiator_name_length); + fwts_log_info_simp_int(fw, " Initiator Name Offset: ", initiator->initiator_name_offset); + + if ((initiator->initiator_name_length + initiator->initiator_name_offset) > table->length) { + fwts_failed(fw, LOG_LEVEL_HIGH, + "iBFTBadOffset", + "iBFT initiator name offset exceed table length"); + *passed = false; + return; + } +} + +static void ibfg_nic_check( + fwts_framework *fw, + uint32_t offset, + bool *passed) +{ + fwts_acpi_ibft_nic *nic = (fwts_acpi_ibft_nic *)(table->data + offset); + + if (offset >= table->length) { + fwts_failed(fw, LOG_LEVEL_HIGH, + "iBFTBadStructureOffset", + "iBFT NIC structure exceed the table length, " + "table length 0x%8.8" PRIx32 ", but got 0x%8.8" PRIx32, + (uint32_t)table->length, offset); + *passed = false; + return; + } + + if (nic->std.length < sizeof(fwts_acpi_ibft_nic)) { + fwts_failed(fw, LOG_LEVEL_HIGH, + "iBFTBadStructureLength", + "iBFT NIC structure type length is not correct, " + "expecting 0x%4.4" PRIx16 ", but got 0x%4.4" PRIx16, + (uint16_t)sizeof(fwts_acpi_ibft_nic), nic->std.length); + *passed = false; + return; + } + + fwts_log_info_verbatim(fw, "iBFT NIC Structure:"); + ibfg_std_dump(fw, &nic->std); + fwts_acpi_reserved_bits("iBAF", "Flags", nic->std.flags, 3, 7, passed); + fwts_log_info_verbatim(fw, " IP Address:"); + fwts_hexdump_data_prefix_all(fw, nic->ip_address, " ", sizeof(nic->ip_address)); + fwts_log_info_simp_int(fw, " Subnet Mask Prefix: ", nic->subnet_mask_prefix); + fwts_log_info_simp_int(fw, " Origin: ", nic->origin); + fwts_log_info_verbatim(fw, " Gateway:"); + fwts_hexdump_data_prefix_all(fw, nic->gateway, " ", sizeof(nic->gateway)); + fwts_log_info_verbatim(fw, " Primary DNS:"); + fwts_hexdump_data_prefix_all(fw, nic->primary_dns, " ", sizeof(nic->primary_dns)); + fwts_log_info_verbatim(fw, " Secondary DNS:"); + fwts_hexdump_data_prefix_all(fw, nic->secondary_dns, " ", sizeof(nic->secondary_dns)); + fwts_log_info_verbatim(fw, " DHCP:"); + fwts_hexdump_data_prefix_all(fw, nic->dhcp, " ", sizeof(nic->dhcp)); + fwts_log_info_simp_int(fw, " VLAN: ", nic->vlan); + fwts_log_info_verbatim(fw, " MAC Address:"); + fwts_hexdump_data_prefix_all(fw, nic->mac_address, " ", sizeof(nic->mac_address)); + fwts_log_info_simp_int(fw, " PCI Bus/Dev/Func: ", nic->pci_bus_dev_func); + fwts_log_info_simp_int(fw, " Host Name Length: ", nic->host_name_length); + fwts_log_info_simp_int(fw, " Host Name Offset: ", nic->host_name_offset); + + if ((nic->host_name_length + nic->host_name_offset) > table->length) { + fwts_failed(fw, LOG_LEVEL_HIGH, + "iBFTBadOffset", + "iBFT host name offset exceed table length"); + *passed = false; + return; + } +} + +static void ibfg_target_check( + fwts_framework *fw, + uint32_t offset, + bool *passed) +{ + fwts_acpi_ibft_target *target = (fwts_acpi_ibft_target *)(table->data + offset); + + if (offset >= table->length) { + fwts_failed(fw, LOG_LEVEL_HIGH, + "iBFTBadStructureOffset", + "iBFT Target structure exceed the table length, " + "table length 0x%8.8" PRIx32 ", but got 0x%8.8" PRIx32, + (uint32_t)table->length, offset); + *passed = false; + return; + } + + if (target->std.length < sizeof(fwts_acpi_ibft_target)) { + fwts_failed(fw, LOG_LEVEL_HIGH, + "iBFTBadStructureLength", + "iBFT Target structure type length is not correct, " + "expecting 0x%4.4" PRIx16 ", but got 0x%4.4" PRIx16, + (uint16_t)sizeof(fwts_acpi_ibft_target), target->std.length); + *passed = false; + return; + } + + fwts_log_info_verbatim(fw, "iBFT Target Structure:"); + + ibfg_std_dump(fw, &target->std); + fwts_acpi_reserved_bits("iBAF", "Flags", target->std.flags, 4, 7, passed); + fwts_log_info_verbatim(fw, " Target IP Address:"); + fwts_hexdump_data_prefix_all(fw, target->target_ip_address, " ", sizeof(target->target_ip_address)); + fwts_log_info_simp_int(fw, " Target IP Socket: ", target->target_ip_socket); + fwts_log_info_simp_int(fw, " Target Boot LUN: ", target->target_boot_lun); + fwts_log_info_simp_int(fw, " CHAP Type: ", target->chap_type); + fwts_acpi_reserved_type(fw, "iBFT", target->chap_type, 0, 2, passed); + + fwts_log_info_simp_int(fw, " NIC Association: ", target->nic_sssociation); + fwts_log_info_simp_int(fw, " Target Name Length: ", target->target_name_length); + fwts_log_info_simp_int(fw, " Target Name Offset: ", target->target_name_offset); + if ((target->target_name_length + target->target_name_offset) > table->length) { + fwts_failed(fw, LOG_LEVEL_HIGH, + "iBFTBadOffset", + "iBFT target name offset exceed table length"); + *passed = false; + } + + fwts_log_info_simp_int(fw, " CHAP Name Length: ", target->chap_name_length); + fwts_log_info_simp_int(fw, " CHAP Name Offset: ", target->chap_name_offset); + if ((target->chap_name_length + target->chap_name_offset) > table->length) { + fwts_failed(fw, LOG_LEVEL_HIGH, + "iBFTBadOffset", + "iBFT chap name offset exceed table length"); + *passed = false; + } + + fwts_log_info_simp_int(fw, " CHAP Secret Length: ", target->chap_secret_length); + fwts_log_info_simp_int(fw, " CHAP Secret Offset: ", target->chap_secret_offset); + if ((target->chap_secret_length + target->chap_secret_offset) > table->length) { + fwts_failed(fw, LOG_LEVEL_HIGH, + "iBFTBadOffset", + "iBFT chat secret offset exceed table length"); + *passed = false; + } + + fwts_log_info_simp_int(fw, " Reverse CHAP Name Length: ", target->reverse_chap_name_length); + fwts_log_info_simp_int(fw, " Reverse CHAP Name Offset: ", target->reverse_chap_name_offset); + if ((target->reverse_chap_name_length + target->reverse_chap_name_offset) > table->length) { + fwts_failed(fw, LOG_LEVEL_HIGH, + "iBFTBadOffset", + "iBFT resverse chap name offset exceed table length"); + *passed = false; + } + + fwts_log_info_simp_int(fw, " Reverse CHAP Secret Length: ", target->reverse_chap_secret_length); + fwts_log_info_simp_int(fw, " Reverse CHAP Secret Offset: ", target->reverse_chap_secret_offset); + if ((target->reverse_chap_secret_length + target->reverse_chap_secret_offset) > table->length) { + fwts_failed(fw, LOG_LEVEL_HIGH, + "iBFTBadOffset", + "iBFT reverse chap secret offset exceed table length"); + *passed = false; + } +} + +static int ibfg_test1(fwts_framework *fw) +{ + fwts_acpi_ibft_header *header; + fwts_acpi_ibft_control *control; + bool passed = true; + uint32_t offset; + + fwts_log_info_verbatim(fw, "iSCSI Boot Firmware Table:"); + + header = (fwts_acpi_ibft_header *)(table->data); + fwts_acpi_reserved_zero_array(fw, "iBFT", "Reserved", header->reserved, 24, &passed); + + offset = sizeof(fwts_acpi_ibft_header); + control = (fwts_acpi_ibft_control *)(table->data + offset); + + if (control->std.length < sizeof(fwts_acpi_ibft_control)) { + fwts_failed(fw, LOG_LEVEL_HIGH, + "iBFTBadStructureLength", + "iBFT Control structure type length too short, " + "at least 0x%4.4" PRIx16 ", but got 0x%4.4" PRIx16, + (uint16_t)sizeof(fwts_acpi_ibft_control), control->std.length); + return FWTS_OK; + } + + if (control->std.structure_id != FWTS_IBFT_CONTROL ) { + passed = false; + fwts_failed(fw, LOG_LEVEL_HIGH, + "iBFTBadStructureType", + "iBFT first structure type must to be control type(1) , got " + "0x%2.2" PRIx8 " instead", control->std.structure_id); + return FWTS_OK; + } + + fwts_log_info_verbatim(fw, "iBFT Control Structure:"); + ibfg_std_dump(fw, &control->std); + fwts_acpi_reserved_bits("iBAF", "Flags", control->std.flags, 1, 7, &passed); + fwts_log_info_simp_int(fw, " Extensions: ", control->extensions); + if (control->extensions != 0) + ibfg_extensions_check(fw, control->extensions, &passed); + fwts_log_info_simp_int(fw, " Initiator Offset: ", control->initiator_offset); + if (control->initiator_offset != 0) + ibfg_initiator_check(fw, control->initiator_offset, &passed); + fwts_log_info_simp_int(fw, " NIC 0 Offset: ", control->nic_0_offset); + if (control->nic_0_offset != 0) + ibfg_nic_check(fw, control->nic_0_offset, &passed); + fwts_log_info_simp_int(fw, " Target 0 Offset: ", control->target_0_offset); + if (control->target_0_offset != 0) + ibfg_target_check(fw, control->target_0_offset, &passed); + fwts_log_info_simp_int(fw, " NIC 1 Offset: ", control->nic_1_offset); + if (control->nic_1_offset != 0) + ibfg_nic_check(fw, control->nic_1_offset, &passed); + fwts_log_info_simp_int(fw, " Target 1 Offset: ", control->target_1_offset); + if (control->target_1_offset != 0) + ibfg_target_check(fw, control->target_1_offset, &passed); + offset += sizeof(fwts_acpi_ibft_control); + + while (offset < control->std.length) { + + /* Optional Structure Expansion */ + fwts_log_info_verbatim(fw, "iBFT Optional Structure Expansion:"); + + fwts_acpi_ibft_standard *std = (fwts_acpi_ibft_standard *)(table + offset); + + switch(std->structure_id) { + case FWTS_IBFT_INITIATOR: + ibfg_initiator_check(fw, offset, &passed); + break; + case FWTS_IBFT_NIC: + ibfg_nic_check(fw, offset, &passed); + break; + case FWTS_IBFT_TARGET: + ibfg_target_check(fw, offset, &passed); + break; + case FWTS_IBFT_EXTENSIONS: + ibfg_extensions_check(fw, offset, &passed); + break; + case FWTS_IBFT_CONTROL: + passed = false; + fwts_failed(fw, LOG_LEVEL_HIGH, + "iBFTBadStructureID", + "iBFT Control structure shouldn't got the Optional " + "Structure Expansion for Control structiure ID(1)"); + break; + case FWTS_IBFT_RESERVED: + default: + passed = false; + fwts_failed(fw, LOG_LEVEL_HIGH, + "iBFTBadStructureID", + "iBFT Optional Structure Expansion for Control structiure ID was reserved, got " + "or unknown got 0x%2.2" PRIx8, std->structure_id); + break; + } + + offset += sizeof(uint16_t); + } + + if (passed) + fwts_passed(fw, "No issues found in iBFT table."); + + return FWTS_OK; +} + +static fwts_framework_minor_test ibfg_tests[] = { + { ibfg_test1, "Validate iBFT table." }, + { NULL, NULL } +}; + +static fwts_framework_ops ibfg_ops = { + .description = "iBFT iSCSI Boot Firmware Table test.", + .init = iBFT_init, + .minor_tests = ibfg_tests +}; + +FWTS_REGISTER("ibft", &ibfg_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_BATCH | FWTS_FLAG_ACPI) + +#endif diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h index 3c3e5089..63841ddc 100644 --- a/src/lib/include/fwts_acpi.h +++ b/src/lib/include/fwts_acpi.h @@ -2641,4 +2641,97 @@ typedef struct { fwts_acpi_table_header header; } __attribute__ ((packed)) fwts_acpi_table_mpam; +/* + * iSCSI Boot Firmware Table (iBFT) + * https://download.microsoft.com/download/1/e/5/1e5a2287-366c-431a-8e05-b958540230b1/iBFT.docx + */ +typedef enum { + FWTS_IBFT_RESERVED = 0, + FWTS_IBFT_CONTROL = 1, + FWTS_IBFT_INITIATOR = 2, + FWTS_IBFT_NIC = 3, + FWTS_IBFT_TARGET = 4, + FWTS_IBFT_EXTENSIONS = 5, + FWTS_IBFT_UNKNOWN = 0xFF +} fwts_ibft_structure_types; + +typedef struct { + char signature[4]; + uint32_t length; + uint8_t revision; + uint8_t checksum; + char oem_id[6]; + char oem_tbl_id[8]; + uint8_t reserved[24]; +} __attribute__ ((packed)) fwts_acpi_ibft_header; + +typedef struct { + uint8_t structure_id; + uint8_t version; + uint16_t length; + uint8_t index; + uint8_t flags; +} __attribute__ ((packed)) fwts_acpi_ibft_standard; + +typedef struct { + fwts_acpi_ibft_standard std; + uint16_t extensions; + uint16_t initiator_offset; + uint16_t nic_0_offset; + uint16_t target_0_offset; + uint16_t nic_1_offset; + uint16_t target_1_offset; +} __attribute__ ((packed)) fwts_acpi_ibft_control; + +typedef struct { + fwts_acpi_ibft_standard std; + uint8_t isns_server[16]; + uint8_t slp_server[16]; + uint8_t primary_radius_server[16]; + uint8_t secondary_radius_server[16]; + uint16_t initiator_name_length; + uint16_t initiator_name_offset; +} __attribute__ ((packed)) fwts_acpi_ibft_initiator; + +typedef struct { + fwts_acpi_ibft_standard std; + uint8_t ip_address[16]; + uint8_t subnet_mask_prefix; + uint8_t origin; + uint8_t gateway[16]; + uint8_t primary_dns[16]; + uint8_t secondary_dns[16]; + uint8_t dhcp[16]; + uint16_t vlan; + uint8_t mac_address[6]; + uint16_t pci_bus_dev_func; + uint16_t host_name_length; + uint16_t host_name_offset; +} __attribute__ ((packed)) fwts_acpi_ibft_nic; + +typedef struct { + fwts_acpi_ibft_standard std; + uint8_t target_ip_address[16]; + uint16_t target_ip_socket; + uint64_t target_boot_lun; + uint8_t chap_type; + uint8_t nic_sssociation; + uint16_t target_name_length; + uint16_t target_name_offset; + uint16_t chap_name_length; + uint16_t chap_name_offset; + uint16_t chap_secret_length; + uint16_t chap_secret_offset; + uint16_t reverse_chap_name_length; + uint16_t reverse_chap_name_offset; + uint16_t reverse_chap_secret_length; + uint16_t reverse_chap_secret_offset; +} __attribute__ ((packed)) fwts_acpi_ibft_target; + +typedef struct { + fwts_acpi_ibft_header header; + uint32_t ivinfo; + uint64_t reserved; +} __attribute__ ((packed)) fwts_acpi_table_ibft; + #endif From patchwork Tue Nov 28 05:57:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ivanhu X-Patchwork-Id: 1869111 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SfWw25FlDz1yRW for ; Tue, 28 Nov 2023 16:58:10 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1r7r6f-0004ts-1O; Tue, 28 Nov 2023 05:58:01 +0000 Received: from smtp-relay-canonical-0.internal ([10.131.114.83] helo=smtp-relay-canonical-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1r7r6X-0004tI-On for fwts-devel@lists.ubuntu.com; Tue, 28 Nov 2023 05:57:53 +0000 Received: from canonical.com (unknown [106.104.136.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id C3E6C416C9 for ; Tue, 28 Nov 2023 05:57:52 +0000 (UTC) From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 2/2] fwts-test: add regression tests for iBFT Date: Tue, 28 Nov 2023 13:57:39 +0800 Message-Id: <20231128055739.47290-2-ivan.hu@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231128055739.47290-1-ivan.hu@canonical.com> References: <20231128055739.47290-1-ivan.hu@canonical.com> MIME-Version: 1.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" Signed-off-by: Ivan Hu --- Makefile.am | 2 + fwts-test/ibft-0001/acpidump-0001.log | 60 ++++++++++++ fwts-test/ibft-0001/acpidump-0002.log | 50 ++++++++++ fwts-test/ibft-0001/ibft-0001.log | 130 ++++++++++++++++++++++++++ fwts-test/ibft-0001/ibft-0002.log | 108 +++++++++++++++++++++ fwts-test/ibft-0001/test-0001.sh | 23 +++++ fwts-test/ibft-0001/test-0002.sh | 23 +++++ 7 files changed, 396 insertions(+) create mode 100644 fwts-test/ibft-0001/acpidump-0001.log create mode 100644 fwts-test/ibft-0001/acpidump-0002.log create mode 100644 fwts-test/ibft-0001/ibft-0001.log create mode 100644 fwts-test/ibft-0001/ibft-0002.log create mode 100755 fwts-test/ibft-0001/test-0001.sh create mode 100755 fwts-test/ibft-0001/test-0002.sh diff --git a/Makefile.am b/Makefile.am index 1949b7f8..46ee2a84 100644 --- a/Makefile.am +++ b/Makefile.am @@ -124,6 +124,8 @@ TESTS = fwts-test/acpidump-0001/test-0001.sh \ fwts-test/hest-0001/test-0002.sh \ fwts-test/hmat-0001/test-0001.sh \ fwts-test/hmat-0001/test-0002.sh \ + fwts-test/ibft-0001/test-0001.sh \ + fwts-test/ibft-0001/test-0002.sh \ fwts-test/iort-0001/test-0001.sh \ fwts-test/iort-0001/test-0002.sh \ fwts-test/ivrs-0001/test-0001.sh \ diff --git a/fwts-test/ibft-0001/acpidump-0001.log b/fwts-test/ibft-0001/acpidump-0001.log new file mode 100644 index 00000000..5ef30a92 --- /dev/null +++ b/fwts-test/ibft-0001/acpidump-0001.log @@ -0,0 +1,60 @@ +FACS @ 0x00000000 + 0000: 46 41 43 53 40 00 00 00 00 00 00 00 00 00 00 00 FACS@........... + 0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0020: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + +FACP @ 0x00000000 + 0000: 46 41 43 50 f4 00 00 00 03 f9 41 4d 44 20 20 20 FACP......AMD + 0010: 47 55 41 4d 20 20 20 20 00 00 04 06 41 4d 44 20 GUAM ....AMD + 0020: 40 42 0f 00 c0 2f e9 af 92 47 e8 af 00 02 09 00 @B.../...G...... + 0030: b0 00 00 00 f0 f1 00 00 00 80 00 00 00 00 00 00 ................ + 0040: 04 80 00 00 00 00 00 00 00 82 00 00 08 80 00 00 ................ + 0050: 20 80 00 00 00 00 00 00 04 02 01 04 08 00 00 00 ............... + 0060: 65 00 e9 03 00 00 00 00 01 00 0d 00 32 00 00 00 e...........2... + 0070: a5 c1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0080: 00 00 00 00 c0 2f e9 af 00 00 00 00 92 47 e8 af ...../.......G.. + 0090: 00 00 00 00 01 20 00 00 00 80 00 00 00 00 00 00 ..... .......... + 00a0: 00 00 00 00 00 00 00 00 00 00 00 00 01 10 00 00 ................ + 00b0: 04 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00c0: 00 00 00 00 01 08 00 00 00 82 00 00 00 00 00 00 ................ + 00d0: 01 20 00 00 08 80 00 00 00 00 00 00 01 40 00 00 . ...........@.. + 00e0: 20 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ............... + 00f0: 00 00 00 00 .... + +iBFT @ 0x00000000 + 0000: 69 42 46 54 1A 02 00 00 01 6C 49 4E 54 45 4C 20 iBFT.....lINTEL + 0010: 54 45 4D 50 4C 41 54 45 00 00 00 00 00 00 00 00 TEMPLATE........ + 0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0030: 01 01 12 00 00 00 00 00 48 00 98 00 00 01 38 01 ................ + 0040: A0 01 00 00 00 00 00 00 02 01 4A 00 00 00 11 22 ................ + 0050: 33 44 55 66 77 88 99 AA BB CC DD EE FF 00 00 01 ................ + 0060: 02 02 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 00 11 ................ + 0070: 22 33 44 55 66 77 88 99 AA BB CC DD EE FF AA AA ................ + 0080: AA AA BB BB BB BB CC CC CC CC DD DD DD DD 08 00 ................ + 0090: D8 01 00 00 00 00 00 00 03 01 66 00 00 00 FF EE ................ + 00a0: DD CC BB AA 99 88 77 66 55 44 33 22 11 00 18 00 ................ + 00b0: 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF ................ + 00c0: 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF ................ + 00d0: 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF ................ + 00e0: 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF ................ + 00f0: 00 00 11 22 33 44 55 66 00 00 04 00 E0 01 00 00 ................ + 0100: 04 01 36 00 00 00 00 11 22 33 44 55 66 77 88 99 ................ + 0110: AA BB CC DD EE FF 00 00 00 00 00 00 00 00 00 00 ................ + 0120: 00 00 04 00 E4 01 04 00 E8 01 04 00 EC 01 08 00 ................ + 0130: F0 01 08 00 F8 01 00 00 03 01 66 00 01 00 FF EE ................ + 0140: DD CC BB AA 99 88 77 66 55 44 33 22 11 00 18 00 ................ + 0150: 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF ................ + 0160: 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF ................ + 0170: 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF ................ + 0180: 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF ................ + 0190: 00 00 11 22 33 44 55 66 00 00 0F 00 00 02 00 00 ................ + 01a0: 04 01 36 00 01 00 00 11 22 33 44 55 66 77 88 99 ................ + 01b0: AA BB CC DD EE FF 00 00 00 00 00 00 00 00 00 00 ................ + 01c0: 00 00 02 00 10 02 02 00 12 02 02 00 14 02 02 00 ................ + 01d0: 16 02 02 00 18 02 00 00 41 41 41 41 41 41 41 41 ........AAAAAAAA + 01e0: 42 42 42 42 43 43 43 43 44 44 44 44 55 55 55 55 BBBBCCCCDDDDUUUU + 01f0: 66 66 66 66 66 66 66 66 77 77 77 77 77 77 77 77 ffffffffwwwwwwww + 0200: 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 EEEEEEEEEEEEEEEE + 0210: 47 47 48 48 49 49 4A 4A 4B 4B GGHHIIJJKK diff --git a/fwts-test/ibft-0001/acpidump-0002.log b/fwts-test/ibft-0001/acpidump-0002.log new file mode 100644 index 00000000..b317f50c --- /dev/null +++ b/fwts-test/ibft-0001/acpidump-0002.log @@ -0,0 +1,50 @@ +FACS @ 0x00000000 + 0000: 46 41 43 53 40 00 00 00 00 00 00 00 00 00 00 00 FACS@........... + 0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0020: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + +FACP @ 0x00000000 + 0000: 46 41 43 50 f4 00 00 00 03 f9 41 4d 44 20 20 20 FACP......AMD + 0010: 47 55 41 4d 20 20 20 20 00 00 04 06 41 4d 44 20 GUAM ....AMD + 0020: 40 42 0f 00 c0 2f e9 af 92 47 e8 af 00 02 09 00 @B.../...G...... + 0030: b0 00 00 00 f0 f1 00 00 00 80 00 00 00 00 00 00 ................ + 0040: 04 80 00 00 00 00 00 00 00 82 00 00 08 80 00 00 ................ + 0050: 20 80 00 00 00 00 00 00 04 02 01 04 08 00 00 00 ............... + 0060: 65 00 e9 03 00 00 00 00 01 00 0d 00 32 00 00 00 e...........2... + 0070: a5 c1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0080: 00 00 00 00 c0 2f e9 af 00 00 00 00 92 47 e8 af ...../.......G.. + 0090: 00 00 00 00 01 20 00 00 00 80 00 00 00 00 00 00 ..... .......... + 00a0: 00 00 00 00 00 00 00 00 00 00 00 00 01 10 00 00 ................ + 00b0: 04 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00c0: 00 00 00 00 01 08 00 00 00 82 00 00 00 00 00 00 ................ + 00d0: 01 20 00 00 08 80 00 00 00 00 00 00 01 40 00 00 . ...........@.. + 00e0: 20 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ............... + 00f0: 00 00 00 00 .... + +iBFT @ 0x00000000 + 0000: 69 42 46 54 7A 01 00 00 01 6C 49 4E 54 45 4C 20 iBFT.....lINTEL + 0010: 54 45 4D 50 4C 41 54 45 00 00 00 00 00 00 00 00 TEMPLATE........ + 0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0030: 01 01 12 00 00 02 00 00 48 00 98 00 00 01 00 00 ................ + 0040: A0 01 00 00 00 00 00 00 02 01 4A 00 00 04 11 22 ................ + 0050: 33 44 55 66 77 88 99 AA BB CC DD EE FF 00 00 01 ................ + 0060: 02 02 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 00 11 ................ + 0070: 22 33 44 55 66 77 88 99 AA BB CC DD EE FF AA AA ................ + 0080: AA AA BB BB BB BB CC CC CC CC DD DD DD DD 08 00 ................ + 0090: D8 01 00 00 00 00 00 00 03 01 66 00 00 08 FF EE ................ + 00a0: DD CC BB AA 99 88 77 66 55 44 33 22 11 00 18 00 ................ + 00b0: 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF ................ + 00c0: 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF ................ + 00d0: 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF ................ + 00e0: 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF ................ + 00f0: 00 00 11 22 33 44 55 66 00 00 04 00 E0 01 00 00 ................ + 0100: 04 01 36 00 00 10 00 11 22 33 44 55 66 77 88 99 ................ + 0110: AA BB CC DD EE FF 00 00 00 00 00 00 00 00 00 00 ................ + 0120: 00 00 04 00 E4 01 04 00 E8 01 04 00 EC 01 08 00 ................ + 0130: F0 01 08 00 F8 01 00 00 41 41 41 41 41 41 41 41 ........AAAAAAAA + 0140: 42 42 42 42 43 43 43 43 44 44 44 44 55 55 55 55 BBBBCCCCDDDDUUUU + 0150: 66 66 66 66 66 66 66 66 77 77 77 77 77 77 77 77 ffffffffwwwwwwww + 0160: 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 EEEEEEEEEEEEEEEE + 0170: 47 47 48 48 49 49 4A 4A 4B 4B GGHHIIJJKK diff --git a/fwts-test/ibft-0001/ibft-0001.log b/fwts-test/ibft-0001/ibft-0001.log new file mode 100644 index 00000000..a447be0b --- /dev/null +++ b/fwts-test/ibft-0001/ibft-0001.log @@ -0,0 +1,130 @@ +ibft ibft: iBFT iSCSI Boot Firmware Table test. +ibft ---------------------------------------------------------- +ibft Test 1 of 1: Validate iBFT table. +ibft iSCSI Boot Firmware Table: +ibft iBFT Control Structure: +ibft Structure ID: 0x01 +ibft Version: 0x01 +ibft Length: 0x0012 +ibft Index: 0x00 +ibft Flags: 0x00 +ibft Extensions: 0x0000 +ibft Initiator Offset: 0x0048 +ibft iBFT Initiator Structure: +ibft Structure ID: 0x02 +ibft Version: 0x01 +ibft Length: 0x004a +ibft Index: 0x00 +ibft Flags: 0x00 +ibft iSNS Server: +ibft 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF 00 +ibft SLP Server: +ibft 00 01 02 02 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F +ibft Primary Radius Server: +ibft 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF +ibft Secondary Radius Server: +ibft AA AA AA AA BB BB BB BB CC CC CC CC DD DD DD DD +ibft Initiator Name Length: 0x0008 +ibft Initiator Name Offset: 0x01d8 +ibft NIC 0 Offset: 0x0098 +ibft iBFT NIC Structure: +ibft Structure ID: 0x03 +ibft Version: 0x01 +ibft Length: 0x0066 +ibft Index: 0x00 +ibft Flags: 0x00 +ibft IP Address: +ibft FF EE DD CC BB AA 99 88 77 66 55 44 33 22 11 00 +ibft Subnet Mask Prefix: 0x18 +ibft Origin: 0x00 +ibft Gateway: +ibft 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF +ibft Primary DNS: +ibft 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF +ibft Secondary DNS: +ibft 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF +ibft DHCP: +ibft 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF +ibft VLAN: 0x0000 +ibft MAC Address: +ibft 11 22 33 44 55 66 +ibft PCI Bus/Dev/Func: 0x0000 +ibft Host Name Length: 0x0004 +ibft Host Name Offset: 0x01e0 +ibft Target 0 Offset: 0x0100 +ibft iBFT Target Structure: +ibft Structure ID: 0x04 +ibft Version: 0x01 +ibft Length: 0x0036 +ibft Index: 0x00 +ibft Flags: 0x00 +ibft Target IP Address: +ibft 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF +ibft Target IP Socket: 0x0000 +ibft Target Boot LUN: 0x0000000000000000 +ibft CHAP Type: 0x00 +ibft NIC Association: 0x00 +ibft Target Name Length: 0x0004 +ibft Target Name Offset: 0x01e4 +ibft CHAP Name Length: 0x0004 +ibft CHAP Name Offset: 0x01e8 +ibft CHAP Secret Length: 0x0004 +ibft CHAP Secret Offset: 0x01ec +ibft Reverse CHAP Name Length: 0x0008 +ibft Reverse CHAP Name Offset: 0x01f0 +ibft Reverse CHAP Secret Length: 0x0008 +ibft Reverse CHAP Secret Offset: 0x01f8 +ibft NIC 1 Offset: 0x0138 +ibft iBFT NIC Structure: +ibft Structure ID: 0x03 +ibft Version: 0x01 +ibft Length: 0x0066 +ibft Index: 0x01 +ibft Flags: 0x00 +ibft IP Address: +ibft FF EE DD CC BB AA 99 88 77 66 55 44 33 22 11 00 +ibft Subnet Mask Prefix: 0x18 +ibft Origin: 0x00 +ibft Gateway: +ibft 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF +ibft Primary DNS: +ibft 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF +ibft Secondary DNS: +ibft 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF +ibft DHCP: +ibft 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF +ibft VLAN: 0x0000 +ibft MAC Address: +ibft 11 22 33 44 55 66 +ibft PCI Bus/Dev/Func: 0x0000 +ibft Host Name Length: 0x000f +ibft Host Name Offset: 0x0200 +ibft Target 1 Offset: 0x01a0 +ibft iBFT Target Structure: +ibft Structure ID: 0x04 +ibft Version: 0x01 +ibft Length: 0x0036 +ibft Index: 0x01 +ibft Flags: 0x00 +ibft Target IP Address: +ibft 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF +ibft Target IP Socket: 0x0000 +ibft Target Boot LUN: 0x0000000000000000 +ibft CHAP Type: 0x00 +ibft NIC Association: 0x00 +ibft Target Name Length: 0x0002 +ibft Target Name Offset: 0x0210 +ibft CHAP Name Length: 0x0002 +ibft CHAP Name Offset: 0x0212 +ibft CHAP Secret Length: 0x0002 +ibft CHAP Secret Offset: 0x0214 +ibft Reverse CHAP Name Length: 0x0002 +ibft Reverse CHAP Name Offset: 0x0216 +ibft Reverse CHAP Secret Length: 0x0002 +ibft Reverse CHAP Secret Offset: 0x0218 +ibft PASSED: Test 1, No issues found in iBFT table. +ibft +ibft ========================================================== +ibft 1 passed, 0 failed, 0 warning, 0 aborted, 0 skipped, 0 +ibft info only. +ibft ========================================================== diff --git a/fwts-test/ibft-0001/ibft-0002.log b/fwts-test/ibft-0001/ibft-0002.log new file mode 100644 index 00000000..85002afa --- /dev/null +++ b/fwts-test/ibft-0001/ibft-0002.log @@ -0,0 +1,108 @@ +ibft ibft: iBFT iSCSI Boot Firmware Table test. +ibft ---------------------------------------------------------- +ibft Test 1 of 1: Validate iBFT table. +ibft iSCSI Boot Firmware Table: +ibft iBFT Control Structure: +ibft Structure ID: 0x01 +ibft Version: 0x01 +ibft Length: 0x0012 +ibft Index: 0x00 +ibft Flags: 0x02 +ibft FAILED [HIGH] iBAFReservedBitsNonZero: Test 1, iBAF Flags +ibft Bits [7..1] must be zero, got 0x02 instead +ibft Extensions: 0x0000 +ibft Initiator Offset: 0x0048 +ibft iBFT Initiator Structure: +ibft Structure ID: 0x02 +ibft Version: 0x01 +ibft Length: 0x004a +ibft Index: 0x00 +ibft Flags: 0x04 +ibft FAILED [HIGH] iBAFReservedBitsNonZero: Test 1, iBAF Flags +ibft Bits [7..2] must be zero, got 0x04 instead +ibft iSNS Server: +ibft 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF 00 +ibft SLP Server: +ibft 00 01 02 02 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F +ibft Primary Radius Server: +ibft 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF +ibft Secondary Radius Server: +ibft AA AA AA AA BB BB BB BB CC CC CC CC DD DD DD DD +ibft Initiator Name Length: 0x0008 +ibft Initiator Name Offset: 0x01d8 +ibft FAILED [HIGH] iBFTBadOffset: Test 1, iBFT initiator name +ibft offset exceed table length +ibft NIC 0 Offset: 0x0098 +ibft iBFT NIC Structure: +ibft Structure ID: 0x03 +ibft Version: 0x01 +ibft Length: 0x0066 +ibft Index: 0x00 +ibft Flags: 0x08 +ibft FAILED [HIGH] iBAFReservedBitsNonZero: Test 1, iBAF Flags +ibft Bits [7..3] must be zero, got 0x08 instead +ibft IP Address: +ibft FF EE DD CC BB AA 99 88 77 66 55 44 33 22 11 00 +ibft Subnet Mask Prefix: 0x18 +ibft Origin: 0x00 +ibft Gateway: +ibft 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF +ibft Primary DNS: +ibft 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF +ibft Secondary DNS: +ibft 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF +ibft DHCP: +ibft 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF +ibft VLAN: 0x0000 +ibft MAC Address: +ibft 11 22 33 44 55 66 +ibft PCI Bus/Dev/Func: 0x0000 +ibft Host Name Length: 0x0004 +ibft Host Name Offset: 0x01e0 +ibft FAILED [HIGH] iBFTBadOffset: Test 1, iBFT host name offset +ibft exceed table length +ibft Target 0 Offset: 0x0100 +ibft iBFT Target Structure: +ibft Structure ID: 0x04 +ibft Version: 0x01 +ibft Length: 0x0036 +ibft Index: 0x00 +ibft Flags: 0x10 +ibft FAILED [HIGH] iBAFReservedBitsNonZero: Test 1, iBAF Flags +ibft Bits [7..4] must be zero, got 0x10 instead +ibft Target IP Address: +ibft 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF +ibft Target IP Socket: 0x0000 +ibft Target Boot LUN: 0x0000000000000000 +ibft CHAP Type: 0x00 +ibft NIC Association: 0x00 +ibft Target Name Length: 0x0004 +ibft Target Name Offset: 0x01e4 +ibft FAILED [HIGH] iBFTBadOffset: Test 1, iBFT target name +ibft offset exceed table length +ibft CHAP Name Length: 0x0004 +ibft CHAP Name Offset: 0x01e8 +ibft FAILED [HIGH] iBFTBadOffset: Test 1, iBFT chap name offset +ibft exceed table length +ibft CHAP Secret Length: 0x0004 +ibft CHAP Secret Offset: 0x01ec +ibft FAILED [HIGH] iBFTBadOffset: Test 1, iBFT chat secret +ibft offset exceed table length +ibft Reverse CHAP Name Length: 0x0008 +ibft Reverse CHAP Name Offset: 0x01f0 +ibft FAILED [HIGH] iBFTBadOffset: Test 1, iBFT resverse chap +ibft name offset exceed table length +ibft Reverse CHAP Secret Length: 0x0008 +ibft Reverse CHAP Secret Offset: 0x01f8 +ibft FAILED [HIGH] iBFTBadOffset: Test 1, iBFT reverse chap +ibft secret offset exceed table length +ibft NIC 1 Offset: 0x0000 +ibft Target 1 Offset: 0x01a0 +ibft FAILED [HIGH] iBFTBadStructureOffset: Test 1, iBFT Target +ibft structure exceed the table length, table length 0x0000017a +ibft , but got 0x000001a0 +ibft +ibft ========================================================== +ibft 0 passed, 12 failed, 0 warning, 0 aborted, 0 skipped, 0 +ibft info only. +ibft ========================================================== diff --git a/fwts-test/ibft-0001/test-0001.sh b/fwts-test/ibft-0001/test-0001.sh new file mode 100755 index 00000000..6110ef5f --- /dev/null +++ b/fwts-test/ibft-0001/test-0001.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# +TEST="Test apci table against iBFT" +NAME=test-0001.sh +TMPLOG=$TMP/ibft.log.$$ + +$FWTS --show-tests | grep iBFT > /dev/null +if [ $? -eq 1 ]; then + echo SKIP: $TEST, $NAME + exit 77 +fi + +$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/ibft-0001/acpidump-0001.log ibft - | cut -c7- | grep "^ibft" > $TMPLOG +diff $TMPLOG $FWTSTESTDIR/ibft-0001/ibft-0001.log >> $FAILURE_LOG +ret=$? +if [ $ret -eq 0 ]; then + echo PASSED: $TEST, $NAME +else + echo FAILED: $TEST, $NAME +fi + +rm $TMPLOG +exit $ret diff --git a/fwts-test/ibft-0001/test-0002.sh b/fwts-test/ibft-0001/test-0002.sh new file mode 100755 index 00000000..cf4e3ca5 --- /dev/null +++ b/fwts-test/ibft-0001/test-0002.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# +TEST="Test apci table against iBFT" +NAME=test-0002.sh +TMPLOG=$TMP/ibft.log.$$ + +$FWTS --show-tests | grep iBFT > /dev/null +if [ $? -eq 1 ]; then + echo SKIP: $TEST, $NAME + exit 77 +fi + +$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/ibft-0001/acpidump-0002.log ibft - | cut -c7- | grep "^ibft" > $TMPLOG +diff $TMPLOG $FWTSTESTDIR/ibft-0001/ibft-0002.log >> $FAILURE_LOG +ret=$? +if [ $ret -eq 0 ]; then + echo PASSED: $TEST, $NAME +else + echo FAILED: $TEST, $NAME +fi + +rm $TMPLOG +exit $ret