ACK: [PATCH 3/3] fwts-test: Add ASF! table regression tests

Alex Hung alex.hung at canonical.com
Tue Aug 4 02:44:52 UTC 2015


On 07/31/2015 12:24 AM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
> 
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  Makefile.am                                        |  2 ++
>  .../arg-show-tests-0001/arg-show-tests-0001.log    |  2 ++
>  .../arg-show-tests-full-0001.log                   |  4 +++
>  fwts-test/asf-0001/acpidump-0001.log               | 37 ++++++++++++++++++++++
>  fwts-test/asf-0001/acpidump-0002.log               | 37 ++++++++++++++++++++++
>  fwts-test/asf-0001/asf-0001.log                    | 15 +++++++++
>  fwts-test/asf-0001/asf-0002.log                    | 35 ++++++++++++++++++++
>  fwts-test/asf-0001/test-0001.sh                    | 17 ++++++++++
>  fwts-test/asf-0001/test-0002.sh                    | 17 ++++++++++
>  9 files changed, 166 insertions(+)
>  create mode 100644 fwts-test/asf-0001/acpidump-0001.log
>  create mode 100644 fwts-test/asf-0001/acpidump-0002.log
>  create mode 100644 fwts-test/asf-0001/asf-0001.log
>  create mode 100644 fwts-test/asf-0001/asf-0002.log
>  create mode 100755 fwts-test/asf-0001/test-0001.sh
>  create mode 100755 fwts-test/asf-0001/test-0002.sh
> 
> diff --git a/Makefile.am b/Makefile.am
> index 22085ca..535cc82 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -49,6 +49,8 @@ TESTS = fwts-test/acpidump-0001/test-0001.sh \
>  	fwts-test/arg-width-0001/test-0006.sh \
>  	fwts-test/arg-width-0001/test-0007.sh \
>  	fwts-test/arg-width-0001/test-0008.sh \
> +	fwts-test/asf-0001/test-0001.sh \
> +	fwts-test/asf-0001/test-0002.sh \
>  	fwts-test/bert-0001/test-0001.sh \
>  	fwts-test/bert-0001/test-0002.sh \
>  	fwts-test/bgrt-0001/test-0001.sh \
> diff --git a/fwts-test/arg-show-tests-0001/arg-show-tests-0001.log b/fwts-test/arg-show-tests-0001/arg-show-tests-0001.log
> index a84117d..ac4e4f1 100644
> --- a/fwts-test/arg-show-tests-0001/arg-show-tests-0001.log
> +++ b/fwts-test/arg-show-tests-0001/arg-show-tests-0001.log
> @@ -2,6 +2,7 @@ ACPI tests:
>   acpiinfo        General ACPI information test.
>   acpitables      ACPI table headers sanity tests.
>   apicinstance    Test for single instance of APIC/MADT table.
> + asf             ASF! Alert Standard Format Table test.
>   bert            BERT Boot Error Record Table test.
>   bgrt            BGRT Boot Graphics Resource Table test.
>   boot            BOOT Table test.
> @@ -50,6 +51,7 @@ Batch tests:
>   acpitables      ACPI table headers sanity tests.
>   apicedge        APIC edge/level test.
>   apicinstance    Test for single instance of APIC/MADT table.
> + asf             ASF! Alert Standard Format Table test.
>   aspm            PCIe ASPM test.
>   autobrightness  Automated LCD brightness test.
>   bert            BERT Boot Error Record Table test.
> diff --git a/fwts-test/arg-show-tests-full-0001/arg-show-tests-full-0001.log b/fwts-test/arg-show-tests-full-0001/arg-show-tests-full-0001.log
> index aff1731..8f1f03a 100644
> --- a/fwts-test/arg-show-tests-full-0001/arg-show-tests-full-0001.log
> +++ b/fwts-test/arg-show-tests-full-0001/arg-show-tests-full-0001.log
> @@ -7,6 +7,8 @@ ACPI tests:
>    Test ACPI headers.
>   apicinstance    (1 test):
>    Test for single instance of APIC/MADT table.
> + asf             (1 test):
> +  ASF! Alert Standard Format Table test.
>   bert            (1 test):
>    BERT Boot Error Record Table test.
>   bgrt            (1 test):
> @@ -288,6 +290,8 @@ Batch tests:
>    Legacy and PCI Interrupt Edge/Level trigger tests.
>   apicinstance    (1 test):
>    Test for single instance of APIC/MADT table.
> + asf             (1 test):
> +  ASF! Alert Standard Format Table test.
>   aspm            (2 tests):
>    PCIe ASPM ACPI test.
>    PCIe ASPM registers test.
> diff --git a/fwts-test/asf-0001/acpidump-0001.log b/fwts-test/asf-0001/acpidump-0001.log
> new file mode 100644
> index 0000000..75dfdd1
> --- /dev/null
> +++ b/fwts-test/asf-0001/acpidump-0001.log
> @@ -0,0 +1,37 @@
> +FACS @ 0x00000000
> +  0000: 46 41 43 53 40 00 00 00 00 00 00 00 00 00 00 00  FACS at ...........
> +  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  . ........... at ..
> +  00e0: 20 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ...............
> +  00f0: 00 00 00 00                                      ....
> +
> +ASF! @ 0x00000000
> +  0000: 41 53 46 21 A5 00 00 00 20 3D 4C 45 4E 4F 56 4F  ASF!.... =LENOVO
> +  0010: 54 50 2D 47 32 20 20 20 10 11 00 00 50 54 4C 20  TP-G2   ....PTL 
> +  0020: 02 00 00 00 00 00 10 00 FF FF 17 20 00 00 4A 66  ........... ..Jf
> +  0030: 00 00 00 00 01 00 2C 00 00 00 03 0C 00 00 00 00  ......,.........
> +  0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> +  0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> +  0060: 02 00 18 00 04 04 00 00 00 88 00 03 01 88 00 02  ................
> +  0070: 02 88 00 01 03 88 00 04 03 00 17 00 00 F8 00 00  ................
> +  0080: 00 13 F0 01 00 00 00 00 00 00 00 00 00 00 00 84  ................
> +  0090: 00 16 00 00 10 5C 68 88 C2 D2 DC A0 A2 A4 A6 C8  .....\h.........
> +  00A0: 00 00 00 00 00                                   .....
> diff --git a/fwts-test/asf-0001/acpidump-0002.log b/fwts-test/asf-0001/acpidump-0002.log
> new file mode 100644
> index 0000000..e61f0ba
> --- /dev/null
> +++ b/fwts-test/asf-0001/acpidump-0002.log
> @@ -0,0 +1,37 @@
> +FACS @ 0x00000000
> +  0000: 46 41 43 53 40 00 00 00 00 00 00 00 00 00 00 00  FACS at ...........
> +  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  . ........... at ..
> +  00e0: 20 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ...............
> +  00f0: 00 00 00 00                                      ....
> +
> +ASF! @ 0x00000000
> +  0000: 41 53 46 21 A5 00 00 00 20 3D 4C 45 4E 4F 56 4F  ASF!.... =LENOVO
> +  0010: 54 50 2D 47 32 20 20 20 10 11 00 00 50 54 4C 20  TP-G2   ....PTL 
> +  0020: 02 00 00 00 00 00 10 00 00 00 17 20 00 00 4A 66  ........... ..Jf
> +  0030: ff 10 20 40 01 00 2C 00 00 00 23 0C 00 00 00 00  ......,.........
> +  0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> +  0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> +  0060: 02 00 18 00 04 05 00 00 08 88 00 03 01 88 00 02  ................
> +  0070: 02 88 00 01 03 88 00 04 03 00 17 00 00 F8 00 00  ................
> +  0080: 00 13 F0 01 00 00 00 00 00 00 00 00 00 00 00 84  ................
> +  0090: 00 18 00 00 10 5C 68 88 C2 D2 DC A0 A2 A4 A6 C8  .....\h.........
> +  00A0: 00 00 00 00 00                                   .....
> diff --git a/fwts-test/asf-0001/asf-0001.log b/fwts-test/asf-0001/asf-0001.log
> new file mode 100644
> index 0000000..48d6cc0
> --- /dev/null
> +++ b/fwts-test/asf-0001/asf-0001.log
> @@ -0,0 +1,15 @@
> +asf             asf: ASF! Alert Standard Format Table test.
> +asf             ----------------------------------------------------------
> +asf             Test 1 of 1: ASF! Alert Standard Format Table test.
> +asf             ASF! Hardware Error Source Table
> +asf             PASSED: Test 1, No issues found in ASF! ASF_INFO record.
> +asf             PASSED: Test 1, No issues found in ASF! ASF_ALRT record.
> +asf             PASSED: Test 1, No issues found in ASF! ASF_RCTL record.
> +asf             PASSED: Test 1, No issues found in ASF! ASF_RMCP record.
> +asf             PASSED: Test 1, No issues found in ASF! ASF_ADDR record.
> +asf             PASSED: Test 1, No issues found in ASF! table.
> +asf             
> +asf             ==========================================================
> +asf             6 passed, 0 failed, 0 warning, 0 aborted, 0 skipped, 0
> +asf             info only.
> +asf             ==========================================================
> diff --git a/fwts-test/asf-0001/asf-0002.log b/fwts-test/asf-0001/asf-0002.log
> new file mode 100644
> index 0000000..e8d25bc
> --- /dev/null
> +++ b/fwts-test/asf-0001/asf-0002.log
> @@ -0,0 +1,35 @@
> +asf             asf: ASF! Alert Standard Format Table test.
> +asf             ----------------------------------------------------------
> +asf             Test 1 of 1: ASF! Alert Standard Format Table test.
> +asf             ASF! Hardware Error Source Table
> +asf             FAILED [HIGH] ASF!InfoMinWatchDogInvalid: Test 1, ASF!
> +asf             ASF_INFO Minimum Watchdog Reset Value is 0x00 and must be
> +asf             in the range 0x01..0xff
> +asf             FAILED [HIGH] ASF!InfoMinPollWaitTimeInvalid: Test 1, ASF!
> +asf             ASF_INFO Minimum Poll Wait Time is 0x0 and must be in the
> +asf             range 0x02..0xff
> +asf             FAILED [HIGH] ASF!InfoFeatureFlagsReserved: Test 1, ASF!
> +asf             ASF_INFO Feature Flags is 0xff, however reserved bits [7
> +asf             :1] must be zero
> +asf             FAILED [HIGH] ASF!InfoReservedNonZero: Test 1, ASF!
> +asf             ASF_INFO Reserved fields must be zero, however one or more
> +asf             of them are non-zero
> +asf             FAILED [HIGH] ASF!AlrtNumOfAlertsInvalid: Test 1, ASF!
> +asf             ASF_ALRT Number of Alerts field is 0x23 and must be in the
> +asf             range 0x01..0x08
> +asf             FAILED [HIGH] ASF!RctlArrayElementLengthInvalid: Test 1,
> +asf             ASF! ASF_RCTL Array Element Length is 0x5 and must be
> +asf             instead 0x4
> +asf             FAILED [HIGH] ASF!RctlCtrlFuncInvalid: Test 1, ASF!
> +asf             ASF_RCTL Control Function is 0x8 and must be in the range
> +asf             0x00..0x03
> +asf             PASSED: Test 1, No issues found in ASF! ASF_RMCP record.
> +asf             FAILED [HIGH] ASF!InfoRecordLengthTooLong: Test 1, ASF!
> +asf             Information Record Reserved length is 24 and this is too
> +asf             long for the size given by the ASF! table. Expected at
> +asf             most 22 bytes.
> +asf             
> +asf             ==========================================================
> +asf             1 passed, 8 failed, 0 warning, 0 aborted, 0 skipped, 0
> +asf             info only.
> +asf             ==========================================================
> diff --git a/fwts-test/asf-0001/test-0001.sh b/fwts-test/asf-0001/test-0001.sh
> new file mode 100755
> index 0000000..aacad01
> --- /dev/null
> +++ b/fwts-test/asf-0001/test-0001.sh
> @@ -0,0 +1,17 @@
> +#!/bin/bash
> +#
> +TEST="Test apci table against ASF!"
> +NAME=test-0001.sh
> +TMPLOG=$TMP/asf.log.$$
> +
> +$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/asf-0001/acpidump-0001.log asf - | cut -c7- | grep "^asf" > $TMPLOG
> +diff $TMPLOG $FWTSTESTDIR/asf-0001/asf-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/asf-0001/test-0002.sh b/fwts-test/asf-0001/test-0002.sh
> new file mode 100755
> index 0000000..2cf32ce
> --- /dev/null
> +++ b/fwts-test/asf-0001/test-0002.sh
> @@ -0,0 +1,17 @@
> +#!/bin/bash
> +#
> +TEST="Test apci against invalid ASF!"
> +NAME=test-0002.sh
> +TMPLOG=$TMP/asf.log.$$
> +
> +$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/asf-0001/acpidump-0002.log asf - | cut -c7- | grep "^asf" > $TMPLOG
> +diff $TMPLOG $FWTSTESTDIR/asf-0001/asf-0002.log >> $FAILURE_LOG
> +ret=$?
> +if [ $ret -eq 0 ]; then
> +	echo PASSED: $TEST, $NAME
> +else
> +	echo FAILED: $TEST, $NAME
> +fi
> +
> +rm $TMPLOG
> +exit $ret
> 

Acked-by: Alex Hung <alex.hung at canonical.com>



More information about the fwts-devel mailing list