From patchwork Thu Sep 29 06:47:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ivanhu X-Patchwork-Id: 1684241 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=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=Mu8RUC8d; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (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 4MdP7Z6zJPz20Vm for ; Thu, 29 Sep 2022 16:47:54 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1odnKl-0008Dn-UD; Thu, 29 Sep 2022 06:47:47 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1odnKj-0008Dd-Rw for fwts-devel@lists.ubuntu.com; Thu, 29 Sep 2022 06:47:45 +0000 Received: from canonical.com (118-163-61-247.hinet-ip.hinet.net [118.163.61.247]) (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-1.canonical.com (Postfix) with ESMTPSA id E97C23F3D5 for ; Thu, 29 Sep 2022 06:47:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1664434065; bh=d+qC4jLHthvzHjmkAdX8blsNrsnLjGqQrKNA5hDF8BU=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Mu8RUC8dg7bQdw9Hhna7q4YjaX4Fkz7Xcij7GfZ8lSOn8ZiDQxFpcrPdXC7TjLEG4 TT8uDB5uImjiLxxEwXOaQhvUVc2jOL1/ut1y1gQaxoPk6NLFWED9Dofe71Y6QNMq3r N0qTPS2WLF1TfmbR72Y0rg53MmL02id6cReMuaawoZnbI/xSykfTbZG+sIbzenfKFW 9OykkzEVUGKuNA1yd2DNx+HHH8wRa/Ds3uRy54lzN/ukR1D2CAw39EMt2+pi0QvwK2 J4Og+fZ+Gpk0bxnbyGDOMv2XmZpAXdQO9eabSN66DsnS5qGoVNvwgFicAwk5ivQmm7 xiAGUtug9rt/g== From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 2/2] fwts-test: add regression test for RGRT Date: Thu, 29 Sep 2022 14:47:37 +0800 Message-Id: <20220929064737.52838-2-ivan.hu@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929064737.52838-1-ivan.hu@canonical.com> References: <20220929064737.52838-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/rgrt-0001/acpidump-0001.log | 31 +++++++++++++++++++++++++++ fwts-test/rgrt-0001/acpidump-0002.log | 31 +++++++++++++++++++++++++++ fwts-test/rgrt-0001/rgrt-0001.log | 18 ++++++++++++++++ fwts-test/rgrt-0001/rgrt-0002.log | 21 ++++++++++++++++++ fwts-test/rgrt-0001/test-0001.sh | 23 ++++++++++++++++++++ fwts-test/rgrt-0001/test-0002.sh | 23 ++++++++++++++++++++ 7 files changed, 149 insertions(+) create mode 100644 fwts-test/rgrt-0001/acpidump-0001.log create mode 100644 fwts-test/rgrt-0001/acpidump-0002.log create mode 100644 fwts-test/rgrt-0001/rgrt-0001.log create mode 100644 fwts-test/rgrt-0001/rgrt-0002.log create mode 100755 fwts-test/rgrt-0001/test-0001.sh create mode 100755 fwts-test/rgrt-0001/test-0002.sh diff --git a/Makefile.am b/Makefile.am index 7f121ed5..bc95f7cc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -167,6 +167,8 @@ TESTS = fwts-test/acpidump-0001/test-0001.sh \ fwts-test/pptt-0001/test-0002.sh \ fwts-test/rasf-0001/test-0001.sh \ fwts-test/rasf-0001/test-0002.sh \ + fwts-test/rgrt-0001/test-0001.sh \ + fwts-test/rgrt-0001/test-0002.sh \ fwts-test/rsdp-0001/test-0001.sh \ fwts-test/rsdt-0001/test-0001.sh \ fwts-test/s0idle-0001/test-0001.sh \ diff --git a/fwts-test/rgrt-0001/acpidump-0001.log b/fwts-test/rgrt-0001/acpidump-0001.log new file mode 100644 index 00000000..1df840f4 --- /dev/null +++ b/fwts-test/rgrt-0001/acpidump-0001.log @@ -0,0 +1,31 @@ +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 .... + +RGRT @ 0x0000000000000000 + 0000: 52 47 52 54 50 00 00 00 01 33 49 4E 54 45 4C 20 RGRTP....3INTEL + 0010: 54 65 6D 70 6C 61 74 65 01 00 00 00 49 4E 54 4C Template....INTL + 0020: 31 03 21 20 01 00 01 00 AA 01 02 03 04 05 06 07 1.! ............ + 0030: 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 ................ + 0040: 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 ........ !"#$%&' diff --git a/fwts-test/rgrt-0001/acpidump-0002.log b/fwts-test/rgrt-0001/acpidump-0002.log new file mode 100644 index 00000000..d61cba16 --- /dev/null +++ b/fwts-test/rgrt-0001/acpidump-0002.log @@ -0,0 +1,31 @@ +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 .... + +RGRT @ 0x0000000000000000 + 0000: 52 47 52 54 50 00 00 00 01 33 49 4E 54 45 4C 20 RGRTP....3INTEL + 0010: 54 65 6D 70 6C 61 74 65 01 00 00 00 49 4E 54 4C Template....INTL + 0020: 31 03 21 20 00 00 02 00 AA 01 02 03 04 05 06 07 1.! ............ + 0030: 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 ................ + 0040: 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 ........ !"#$%&' diff --git a/fwts-test/rgrt-0001/rgrt-0001.log b/fwts-test/rgrt-0001/rgrt-0001.log new file mode 100644 index 00000000..97ad902d --- /dev/null +++ b/fwts-test/rgrt-0001/rgrt-0001.log @@ -0,0 +1,18 @@ +rgrt rgrt: RGRT Regulatory Graphics Resource Table test +rgrt ---------------------------------------------------------- +rgrt Test 1 of 1: Validate RGRT table. +rgrt RGRT Regulatory Graphics Resource Table: +rgrt Version: 0x0001 +rgrt Image Type: 0x01 +rgrt Reserved: 0x00 +rgrt Image: +rgrt 0000: AA 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F ................ +rgrt 0010: 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F ................ +rgrt 0020: 20 21 22 23 24 25 26 27 !"#$%&' +rgrt +rgrt PASSED: Test 1, No issues found in RGRT table. +rgrt +rgrt ========================================================== +rgrt 1 passed, 0 failed, 0 warning, 0 aborted, 0 skipped, 0 +rgrt info only. +rgrt ========================================================== diff --git a/fwts-test/rgrt-0001/rgrt-0002.log b/fwts-test/rgrt-0001/rgrt-0002.log new file mode 100644 index 00000000..a7d219ef --- /dev/null +++ b/fwts-test/rgrt-0001/rgrt-0002.log @@ -0,0 +1,21 @@ +rgrt rgrt: RGRT Regulatory Graphics Resource Table test +rgrt ---------------------------------------------------------- +rgrt Test 1 of 1: Validate RGRT table. +rgrt RGRT Regulatory Graphics Resource Table: +rgrt Version: 0x0000 +rgrt Image Type: 0x02 +rgrt Reserved: 0x00 +rgrt Image: +rgrt 0000: AA 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F ................ +rgrt 0010: 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F ................ +rgrt 0020: 20 21 22 23 24 25 26 27 !"#$%&' +rgrt FAILED [MEDIUM] RGRTBadFieldValue: Test 1, RGRT Version +rgrt field must be 1, got 0 instead. +rgrt FAILED [MEDIUM] RGRTBadFieldValue: Test 1, RGRT Image Type +rgrt field must be 1, got 2 instead. +rgrt +rgrt +rgrt ========================================================== +rgrt 0 passed, 2 failed, 0 warning, 0 aborted, 0 skipped, 0 +rgrt info only. +rgrt ========================================================== diff --git a/fwts-test/rgrt-0001/test-0001.sh b/fwts-test/rgrt-0001/test-0001.sh new file mode 100755 index 00000000..60bf82a9 --- /dev/null +++ b/fwts-test/rgrt-0001/test-0001.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# +TEST="Test acpitables against RGRT" +NAME=test-0001.sh +TMPLOG=$TMP/rgrt.log.$$ + +$FWTS --show-tests | grep rgrt > /dev/null +if [ $? -eq 1 ]; then + echo SKIP: $TEST, $NAME + exit 77 +fi + +$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/rgrt-0001/acpidump-0001.log rgrt - | cut -c7- | grep "^rgrt" > $TMPLOG +diff $TMPLOG $FWTSTESTDIR/rgrt-0001/rgrt-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/rgrt-0001/test-0002.sh b/fwts-test/rgrt-0001/test-0002.sh new file mode 100755 index 00000000..3d0639fd --- /dev/null +++ b/fwts-test/rgrt-0001/test-0002.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# +TEST="Test acpitables against RGRT" +NAME=test-0001.sh +TMPLOG=$TMP/rgrt.log.$$ + +$FWTS --show-tests | grep rgrt > /dev/null +if [ $? -eq 1 ]; then + echo SKIP: $TEST, $NAME + exit 77 +fi + +$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/rgrt-0001/acpidump-0002.log rgrt - | cut -c7- | grep "^rgrt" > $TMPLOG +diff $TMPLOG $FWTSTESTDIR/rgrt-0001/rgrt-0002.log >> $FAILURE_LOG +ret=$? +if [ $ret -eq 0 ]; then + echo PASSED: $TEST, $NAME +else + echo FAILED: $TEST, $NAME +fi + +rm $TMPLOG +exit $ret