ACK: [PATCH 2/2] fwts-test: Add regression test for RASF

Colin Ian King colin.king at canonical.com
Tue Aug 22 22:18:56 UTC 2017


On 22/08/17 20:30, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung at canonical.com>
> ---
>  Makefile.am                           |  2 ++
>  fwts-test/rasf-0001/acpidump-0001.log | 29 +++++++++++++++++++++++++++++
>  fwts-test/rasf-0001/acpidump-0002.log | 29 +++++++++++++++++++++++++++++
>  fwts-test/rasf-0001/rasf-0001.log     | 22 ++++++++++++++++++++++
>  fwts-test/rasf-0001/rasf-0002.log     | 11 +++++++++++
>  fwts-test/rasf-0001/test-0001.sh      | 23 +++++++++++++++++++++++
>  fwts-test/rasf-0001/test-0002.sh      | 23 +++++++++++++++++++++++
>  7 files changed, 139 insertions(+)
>  create mode 100644 fwts-test/rasf-0001/acpidump-0001.log
>  create mode 100644 fwts-test/rasf-0001/acpidump-0002.log
>  create mode 100644 fwts-test/rasf-0001/rasf-0001.log
>  create mode 100644 fwts-test/rasf-0001/rasf-0002.log
>  create mode 100755 fwts-test/rasf-0001/test-0001.sh
>  create mode 100755 fwts-test/rasf-0001/test-0002.sh
> 
> diff --git a/Makefile.am b/Makefile.am
> index f53ee07..95407f7 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -136,6 +136,8 @@ TESTS = fwts-test/acpidump-0001/test-0001.sh \
>  	fwts-test/pmtt-0001/test-0002.sh \
>  	fwts-test/pptt-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/rsdp-0001/test-0001.sh \
>  	fwts-test/rsdt-0001/test-0001.sh \
>  	fwts-test/sbst-0001/test-0001.sh \
> diff --git a/fwts-test/rasf-0001/acpidump-0001.log b/fwts-test/rasf-0001/acpidump-0001.log
> new file mode 100644
> index 0000000..e677fc2
> --- /dev/null
> +++ b/fwts-test/rasf-0001/acpidump-0001.log
> @@ -0,0 +1,29 @@
> +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                                      ....
> +
> +RASF @ 0x0000000000000000
> +  0000: 52 41 53 46 30 00 00 00 01 eb 49 4e 54 45 4c 20  RASF0.....INTEL 
> +  0010: 54 65 6d 70 6c 61 74 65 01 00 00 00 49 4e 54 4c  Template....INTL
> +  0020: 28 07 17 20 00 01 02 03 04 05 06 07 08 09 0a 0b  (.. ............
> diff --git a/fwts-test/rasf-0001/acpidump-0002.log b/fwts-test/rasf-0001/acpidump-0002.log
> new file mode 100644
> index 0000000..e78d385
> --- /dev/null
> +++ b/fwts-test/rasf-0001/acpidump-0002.log
> @@ -0,0 +1,29 @@
> +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                                      ....
> +
> +RASF @ 0x0000000000000000
> +  0000: 52 41 53 46 31 00 00 00 01 eb 49 4e 54 45 4c 20  RASF0.....INTEL 
> +  0010: 54 65 6d 70 6c 61 74 65 01 00 00 00 49 4e 54 4c  Template....INTL
> +  0020: 28 07 17 20 00 01 02 03 04 05 06 07 08 09 0a 0b  (.. ............
> diff --git a/fwts-test/rasf-0001/rasf-0001.log b/fwts-test/rasf-0001/rasf-0001.log
> new file mode 100644
> index 0000000..a857d51
> --- /dev/null
> +++ b/fwts-test/rasf-0001/rasf-0001.log
> @@ -0,0 +1,22 @@
> +rasf            rasf: RASF RAS Feature Table test
> +rasf            ----------------------------------------------------------
> +rasf            Test 1 of 1: Validate RASF table.
> +rasf            RASF (RAS Feature) Table:
> +rasf              Channel Identifier [00]:   0x00
> +rasf              Channel Identifier [01]:   0x01
> +rasf              Channel Identifier [02]:   0x02
> +rasf              Channel Identifier [03]:   0x03
> +rasf              Channel Identifier [04]:   0x04
> +rasf              Channel Identifier [05]:   0x05
> +rasf              Channel Identifier [06]:   0x06
> +rasf              Channel Identifier [07]:   0x07
> +rasf              Channel Identifier [08]:   0x08
> +rasf              Channel Identifier [09]:   0x09
> +rasf              Channel Identifier [10]:   0x0a
> +rasf              Channel Identifier [11]:   0x0b
> +rasf            PASSED: Test 1, No issues found in RASF table.
> +rasf            
> +rasf            ==========================================================
> +rasf            1 passed, 0 failed, 0 warning, 0 aborted, 0 skipped, 0
> +rasf            info only.
> +rasf            ==========================================================
> diff --git a/fwts-test/rasf-0001/rasf-0002.log b/fwts-test/rasf-0001/rasf-0002.log
> new file mode 100644
> index 0000000..deb10bf
> --- /dev/null
> +++ b/fwts-test/rasf-0001/rasf-0002.log
> @@ -0,0 +1,11 @@
> +rasf            rasf: RASF RAS Feature Table test
> +rasf            ----------------------------------------------------------
> +rasf            Test 1 of 1: Validate RASF table.
> +rasf            RASF (RAS Feature) Table:
> +rasf            FAILED [CRITICAL] RASFBadLength: Test 1, RASF structure
> +rasf            must have length 0x00000030, got 0x00000031
> +rasf            
> +rasf            ==========================================================
> +rasf            0 passed, 1 failed, 0 warning, 0 aborted, 0 skipped, 0
> +rasf            info only.
> +rasf            ==========================================================
> diff --git a/fwts-test/rasf-0001/test-0001.sh b/fwts-test/rasf-0001/test-0001.sh
> new file mode 100755
> index 0000000..38e9d6d
> --- /dev/null
> +++ b/fwts-test/rasf-0001/test-0001.sh
> @@ -0,0 +1,23 @@
> +#!/bin/bash
> +#
> +TEST="Test acpitables against RASF"
> +NAME=test-0001.sh
> +TMPLOG=$TMP/rasf.log.$$
> +
> +$FWTS --show-tests | grep rasf > /dev/null
> +if [ $? -eq 1 ]; then
> +	echo SKIP: $TEST, $NAME
> +	exit 77
> +fi
> +
> +$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/rasf-0001/acpidump-0001.log rasf - | cut -c7- | grep "^rasf" > $TMPLOG
> +diff $TMPLOG $FWTSTESTDIR/rasf-0001/rasf-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/rasf-0001/test-0002.sh b/fwts-test/rasf-0001/test-0002.sh
> new file mode 100755
> index 0000000..782ef56
> --- /dev/null
> +++ b/fwts-test/rasf-0001/test-0002.sh
> @@ -0,0 +1,23 @@
> +#!/bin/bash
> +#
> +TEST="Test acpitables against invalid RASF"
> +NAME=test-0001.sh
> +TMPLOG=$TMP/rasf.log.$$
> +
> +$FWTS --show-tests | grep rasf > /dev/null
> +if [ $? -eq 1 ]; then
> +	echo SKIP: $TEST, $NAME
> +	exit 77
> +fi
> +
> +$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/rasf-0001/acpidump-0002.log rasf - | cut -c7- | grep "^rasf" > $TMPLOG
> +diff $TMPLOG $FWTSTESTDIR/rasf-0001/rasf-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: Colin Ian King <colin.king at canonical.com>



More information about the fwts-devel mailing list