From patchwork Fri Jul 5 09:19:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Hu X-Patchwork-Id: 1957214 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 4WFnzB3m1gz1xr0 for ; Fri, 5 Jul 2024 19:19:50 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sPf6X-0005aD-Q3; Fri, 05 Jul 2024 09:19:45 +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 1sPf6V-0005Zw-Hq for fwts-devel@lists.ubuntu.com; Fri, 05 Jul 2024 09:19:43 +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 7D0073F30F for ; Fri, 5 Jul 2024 09:19:42 +0000 (UTC) From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 2/2] fwts-test: add regression tests for S3PT Date: Fri, 5 Jul 2024 17:19:30 +0800 Message-Id: <20240705091930.202589-2-ivan.hu@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240705091930.202589-1-ivan.hu@canonical.com> References: <20240705091930.202589-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 | 18 ++++++++------- fwts-test/s3pt-0001/acpidump-0001.log | 30 +++++++++++++++++++++++++ fwts-test/s3pt-0001/acpidump-0002.log | 31 ++++++++++++++++++++++++++ fwts-test/s3pt-0001/s3pt-0001.log | 25 +++++++++++++++++++++ fwts-test/s3pt-0001/s3pt-0002.log | 32 +++++++++++++++++++++++++++ fwts-test/s3pt-0001/test-0001.sh | 23 +++++++++++++++++++ fwts-test/s3pt-0001/test-0002.sh | 23 +++++++++++++++++++ 7 files changed, 174 insertions(+), 8 deletions(-) create mode 100644 fwts-test/s3pt-0001/acpidump-0001.log create mode 100644 fwts-test/s3pt-0001/acpidump-0002.log create mode 100644 fwts-test/s3pt-0001/s3pt-0001.log create mode 100644 fwts-test/s3pt-0001/s3pt-0002.log create mode 100755 fwts-test/s3pt-0001/test-0001.sh create mode 100755 fwts-test/s3pt-0001/test-0002.sh diff --git a/Makefile.am b/Makefile.am index 81185153..edc8888f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -140,14 +140,6 @@ TESTS = fwts-test/acpidump-0001/test-0001.sh \ fwts-test/klog-0002/test-0003.sh \ fwts-test/lpit-0001/test-0001.sh \ fwts-test/lpit-0001/test-0002.sh \ - fwts-test/sdei-0001/test-0001.sh \ - fwts-test/sdei-0001/test-0002.sh \ - fwts-test/sdev-0001/test-0001.sh \ - fwts-test/sdev-0001/test-0002.sh \ - fwts-test/slic-0001/test-0001.sh \ - fwts-test/slic-0001/test-0002.sh \ - fwts-test/slit-0001/test-0001.sh \ - fwts-test/slit-0001/test-0002.sh \ fwts-test/madt-0001/test-0001.sh \ fwts-test/madt-0001/test-0002.sh \ fwts-test/mchi-0001/test-0001.sh \ @@ -189,10 +181,20 @@ TESTS = fwts-test/acpidump-0001/test-0001.sh \ fwts-test/rsdt-0001/test-0001.sh \ fwts-test/s0idle-0001/test-0001.sh \ fwts-test/s0idle-0001/test-0002.sh \ + fwts-test/s3pt-0001/test-0001.sh \ + fwts-test/s3pt-0001/test-0002.sh \ fwts-test/sbst-0001/test-0001.sh \ fwts-test/sbst-0001/test-0002.sh \ + fwts-test/sdei-0001/test-0001.sh \ + fwts-test/sdei-0001/test-0002.sh \ + fwts-test/sdev-0001/test-0001.sh \ + fwts-test/sdev-0001/test-0002.sh \ fwts-test/skvl-0001/test-0001.sh \ fwts-test/skvl-0001/test-0002.sh \ + fwts-test/slic-0001/test-0001.sh \ + fwts-test/slic-0001/test-0002.sh \ + fwts-test/slit-0001/test-0001.sh \ + fwts-test/slit-0001/test-0002.sh \ fwts-test/spcr-0001/test-0001.sh \ fwts-test/spcr-0001/test-0002.sh \ fwts-test/srat-0001/test-0001.sh \ diff --git a/fwts-test/s3pt-0001/acpidump-0001.log b/fwts-test/s3pt-0001/acpidump-0001.log new file mode 100644 index 00000000..c7031dc1 --- /dev/null +++ b/fwts-test/s3pt-0001/acpidump-0001.log @@ -0,0 +1,30 @@ +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 .... + +S3PT @ 0x00000000 + 0000: 53 33 50 54 34 00 00 00 00 00 18 01 00 00 00 00 S3PT4........... + 0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0020: 01 00 14 01 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0030: 00 00 00 00 .... diff --git a/fwts-test/s3pt-0001/acpidump-0002.log b/fwts-test/s3pt-0001/acpidump-0002.log new file mode 100644 index 00000000..4a49ff4a --- /dev/null +++ b/fwts-test/s3pt-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 .... + +S3PT @ 0x00000000 + 0000: 53 33 50 54 44 00 00 00 01 00 14 01 00 00 00 00 S3PT4........... + 0010: 00 00 00 00 00 00 00 00 00 00 00 00 01 00 14 01 ................ + 0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0030: 02 00 14 01 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0040: 00 00 00 00 ............ diff --git a/fwts-test/s3pt-0001/s3pt-0001.log b/fwts-test/s3pt-0001/s3pt-0001.log new file mode 100644 index 00000000..3108c5ef --- /dev/null +++ b/fwts-test/s3pt-0001/s3pt-0001.log @@ -0,0 +1,25 @@ +s3pt s3pt: S3 Performance Table test. +s3pt ---------------------------------------------------------- +s3pt Test 1 of 1: Validate S3PT table. +s3pt S3 Performance Table: +s3pt Basic S3 Resume Performance Record: +s3pt Record Type: 0x0000 +s3pt Record Length: 0x18 +s3pt Revision: 0x01 +s3pt Resume Count: 0x00000000 +s3pt FullResume: 0x0000000000000000 +s3pt AverageResume: 0x0000000000000000 +s3pt +s3pt Basic S3 Suspend Performance Record: +s3pt Record Type: 0x0001 +s3pt Record Length: 0x14 +s3pt Revision: 0x01 +s3pt SuspendStart: 0x0000000000000000 +s3pt SuspendEnd: 0x0000000000000000 +s3pt +s3pt PASSED: Test 1, No issues found in S3PT table. +s3pt +s3pt ========================================================== +s3pt 1 passed, 0 failed, 0 warning, 0 aborted, 0 skipped, 0 +s3pt info only. +s3pt ========================================================== diff --git a/fwts-test/s3pt-0001/s3pt-0002.log b/fwts-test/s3pt-0001/s3pt-0002.log new file mode 100644 index 00000000..c16ae494 --- /dev/null +++ b/fwts-test/s3pt-0001/s3pt-0002.log @@ -0,0 +1,32 @@ +s3pt s3pt: S3 Performance Table test. +s3pt ---------------------------------------------------------- +s3pt Test 1 of 1: Validate S3PT table. +s3pt S3 Performance Table: +s3pt Basic S3 Suspend Performance Record: +s3pt Record Type: 0x0001 +s3pt Record Length: 0x14 +s3pt Revision: 0x01 +s3pt SuspendStart: 0x0000000000000000 +s3pt SuspendEnd: 0x0000000000000000 +s3pt +s3pt Basic S3 Suspend Performance Record: +s3pt Record Type: 0x0001 +s3pt Record Length: 0x14 +s3pt Revision: 0x01 +s3pt SuspendStart: 0x0000000000000000 +s3pt SuspendEnd: 0x0000000000000000 +s3pt +s3pt FAILED [HIGH] S3PTPerformanceRecordTypeInvalid: Test 1, +s3pt S3PT Performance Record Type is 2 which is invalid value. +s3pt +s3pt FAILED [HIGH] S3PTBadRecordTypeCount: Test 1, One of the +s3pt basic S3 resume performance record type and only will be +s3pt produced, but got 0 +s3pt FAILED [HIGH] S3PTBadRecordTypeCount: Test 1, Zero to one +s3pt of the basic S3 suspend performance record type will be +s3pt produced, but got 2 +s3pt +s3pt ========================================================== +s3pt 0 passed, 3 failed, 0 warning, 0 aborted, 0 skipped, 0 +s3pt info only. +s3pt ========================================================== diff --git a/fwts-test/s3pt-0001/test-0001.sh b/fwts-test/s3pt-0001/test-0001.sh new file mode 100755 index 00000000..99c4666b --- /dev/null +++ b/fwts-test/s3pt-0001/test-0001.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# +TEST="Test acpitables against S3PT" +NAME=test-0001.sh +TMPLOG=$TMP/s3pt.log.$$ + +$FWTS --show-tests | grep s3pt > /dev/null +if [ $? -eq 1 ]; then + echo SKIP: $TEST, $NAME + exit 77 +fi + +$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/s3pt-0001/acpidump-0001.log s3pt - | cut -c7- | grep "^s3pt" > $TMPLOG +diff $TMPLOG $FWTSTESTDIR/s3pt-0001/s3pt-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/s3pt-0001/test-0002.sh b/fwts-test/s3pt-0001/test-0002.sh new file mode 100755 index 00000000..282c8220 --- /dev/null +++ b/fwts-test/s3pt-0001/test-0002.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# +TEST="Test acpitables against invalid S3PT" +NAME=test-0001.sh +TMPLOG=$TMP/s3pt.log.$$ + +$FWTS --show-tests | grep s3pt > /dev/null +if [ $? -eq 1 ]; then + echo SKIP: $TEST, $NAME + exit 77 +fi + +$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/s3pt-0001/acpidump-0002.log s3pt - | cut -c7- | grep "^s3pt" > $TMPLOG +diff $TMPLOG $FWTSTESTDIR/s3pt-0001/s3pt-0002.log >> $FAILURE_LOG +ret=$? +if [ $ret -eq 0 ]; then + echo PASSED: $TEST, $NAME +else + echo FAILED: $TEST, $NAME +fi + +rm $TMPLOG +exit $ret