ACK: [PATCH 29/30] fwts-test: Add SPCR test

Alex Hung alex.hung at canonical.com
Tue Jun 23 06:02:45 UTC 2015


On 06/18/2015 04:49 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
> 
> Add two tests, one to check for a valid SPCR and another to check
> an invalid SPCR
> 
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  Makefile.am                           |  2 ++
>  fwts-test/spcr-0001/acpidump-0001.log | 32 ++++++++++++++++++++++++++++++++
>  fwts-test/spcr-0001/acpidump-0002.log | 32 ++++++++++++++++++++++++++++++++
>  fwts-test/spcr-0001/spcr-0001.log     | 13 +++++++++++++
>  fwts-test/spcr-0001/spcr-0002.log     | 24 ++++++++++++++++++++++++
>  fwts-test/spcr-0001/test-0001.sh      | 17 +++++++++++++++++
>  fwts-test/spcr-0001/test-0002.sh      | 17 +++++++++++++++++
>  7 files changed, 137 insertions(+)
>  create mode 100644 fwts-test/spcr-0001/acpidump-0001.log
>  create mode 100644 fwts-test/spcr-0001/acpidump-0002.log
>  create mode 100644 fwts-test/spcr-0001/spcr-0001.log
>  create mode 100644 fwts-test/spcr-0001/spcr-0002.log
>  create mode 100755 fwts-test/spcr-0001/test-0001.sh
>  create mode 100755 fwts-test/spcr-0001/test-0002.sh
> 
> diff --git a/Makefile.am b/Makefile.am
> index e53da9a..b8708da1 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -86,6 +86,8 @@ TESTS = fwts-test/acpidump-0001/test-0001.sh \
>  	fwts-test/rsdt-0001/test-0001.sh \
>  	fwts-test/sbst-0001/test-0001.sh \
>  	fwts-test/sbst-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 \
>  	fwts-test/srat-0001/test-0002.sh \
>  	fwts-test/syntaxcheck-0001/test-0001.sh \
> diff --git a/fwts-test/spcr-0001/acpidump-0001.log b/fwts-test/spcr-0001/acpidump-0001.log
> new file mode 100644
> index 0000000..07252f0
> --- /dev/null
> +++ b/fwts-test/spcr-0001/acpidump-0001.log
> @@ -0,0 +1,32 @@
> +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  ................
> +  0030: 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                                      ....
> +
> +SPCR @ 0x00000000
> +  0000: 53 50 43 52 50 00 00 00 01 53 53 55 4e 20 20 20  SPCRP....SSUN
> +  0010: 58 34 32 30 30 20 4d 32 34 00 00 00 4d 53 46 54  X4200 M24...MSFT
> +  0020: 97 00 00 00 00 00 00 00 01 08 00 00 f8 03 00 00  ................
> +  0030: 00 00 00 00 01 04 00 00 00 00 03 00 01 00 03 00  ................
> +  0040: ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00  ................
> +
> diff --git a/fwts-test/spcr-0001/acpidump-0002.log b/fwts-test/spcr-0001/acpidump-0002.log
> new file mode 100644
> index 0000000..50e42bb
> --- /dev/null
> +++ b/fwts-test/spcr-0001/acpidump-0002.log
> @@ -0,0 +1,32 @@
> +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  ................
> +  0030: 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                                      ....
> +
> +SPCR @ 0x00000000
> +  0000: 53 50 43 52 50 00 00 00 01 53 53 55 4e 20 20 20  SPCRP....SSUN
> +  0010: 58 34 32 30 30 20 4d 32 34 00 00 00 4d 53 46 54  X4200 M24...MSFT
> +  0020: 97 00 00 00 08 f0 20 00 f1 08 00 00 f8 03 00 00  ................
> +  0030: 00 00 00 00 01 04 00 00 00 00 08 00 01 00 0f 00  ................
> +  0040: 2f ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00  ................
> +
> diff --git a/fwts-test/spcr-0001/spcr-0001.log b/fwts-test/spcr-0001/spcr-0001.log
> new file mode 100644
> index 0000000..9bc5d03
> --- /dev/null
> +++ b/fwts-test/spcr-0001/spcr-0001.log
> @@ -0,0 +1,13 @@
> +spcr            spcr: SPCR Serial Port Console Redirection Table test.
> +spcr            ----------------------------------------------------------
> +spcr            Test 1 of 1: SPCR Serial Port Console Redirection Table
> +spcr            test.
> +spcr            Serial Interface: 16550 compatible
> +spcr            Baud Rate:        9600
> +spcr            Terminal Type:    ANSI
> +spcr            PASSED: Test 1, No issues found in SPCR table.
> +spcr            
> +spcr            ==========================================================
> +spcr            1 passed, 0 failed, 0 warning, 0 aborted, 0 skipped, 0
> +spcr            info only.
> +spcr            ==========================================================
> diff --git a/fwts-test/spcr-0001/spcr-0002.log b/fwts-test/spcr-0001/spcr-0002.log
> new file mode 100644
> index 0000000..ea2ebe1
> --- /dev/null
> +++ b/fwts-test/spcr-0001/spcr-0002.log
> @@ -0,0 +1,24 @@
> +spcr            spcr: SPCR Serial Port Console Redirection Table test.
> +spcr            ----------------------------------------------------------
> +spcr            Test 1 of 1: SPCR Serial Port Console Redirection Table
> +spcr            test.
> +spcr            Serial Interface: Reserved (Do not Use)
> +spcr            FAILED [HIGH] SPCRInterfaceReserved: Test 1, SPCR Serial
> +spcr            interface type 0x08 is a reserved interface
> +spcr            FAILED [LOW] SPCRReservedNonZero: Test 1, SPCR reserved
> +spcr            field must be zero, got 0xf02000 instead
> +spcr            Baud Rate:        Reserved
> +spcr            FAILED [HIGH] SPCRBaudRateReserved: Test 1, SPCR Serial
> +spcr            baud rate type 0x08 is a reserved baud rate
> +spcr            Terminal Type:    Reserved
> +spcr            FAILED [HIGH] SPCRTerminalTypeReserved: Test 1, SPCR
> +spcr            terminal type type 0x0f is a reserved terminal type
> +spcr            FAILED [HIGH] SPCRPciVendorID: Test 1, SPCR PCI vendor ID
> +spcr            is 0xffff, expecting non-0xffff for non-PCI device
> +spcr            FAILED [HIGH] SPCRPciFlagsBit0: Test 1, SPCR PCI flags
> +spcr            compatibility bit 0 is 0, expecting 1 for PCI device
> +spcr            
> +spcr            ==========================================================
> +spcr            0 passed, 6 failed, 0 warning, 0 aborted, 0 skipped, 0
> +spcr            info only.
> +spcr            ==========================================================
> diff --git a/fwts-test/spcr-0001/test-0001.sh b/fwts-test/spcr-0001/test-0001.sh
> new file mode 100755
> index 0000000..6db64a0
> --- /dev/null
> +++ b/fwts-test/spcr-0001/test-0001.sh
> @@ -0,0 +1,17 @@
> +#!/bin/bash
> +#
> +TEST="Test apcitables against SPCR"
> +NAME=test-0001.sh
> +TMPLOG=$TMP/spcr.log.$$
> +
> +$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/spcr-0001/acpidump-0001.log spcr - | cut -c7- | grep "^spcr" > $TMPLOG
> +diff $TMPLOG $FWTSTESTDIR/spcr-0001/spcr-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/spcr-0001/test-0002.sh b/fwts-test/spcr-0001/test-0002.sh
> new file mode 100755
> index 0000000..1d8e232
> --- /dev/null
> +++ b/fwts-test/spcr-0001/test-0002.sh
> @@ -0,0 +1,17 @@
> +#!/bin/bash
> +#
> +TEST="Test apcitables against invalid SPCR"
> +NAME=test-0001.sh
> +TMPLOG=$TMP/spcr.log.$$
> +
> +$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/spcr-0001/acpidump-0002.log spcr - | cut -c7- | grep "^spcr" > $TMPLOG
> +diff $TMPLOG $FWTSTESTDIR/spcr-0001/spcr-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