ACK: [PATCH 2/2] fwts-test: Add regression test for SDEV
ivanhu
ivan.hu at canonical.com
Wed Oct 25 06:41:51 UTC 2017
On 10/20/2017 04:23 PM, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung at canonical.com>
> ---
> Makefile.am | 2 ++
> fwts-test/sdev-0001/acpidump-0001.log | 35 +++++++++++++++++++++++++++++++++++
> fwts-test/sdev-0001/acpidump-0002.log | 35 +++++++++++++++++++++++++++++++++++
> fwts-test/sdev-0001/sdev-0001.log | 31 +++++++++++++++++++++++++++++++
> fwts-test/sdev-0001/sdev-0002.log | 34 ++++++++++++++++++++++++++++++++++
> fwts-test/sdev-0001/test-0001.sh | 23 +++++++++++++++++++++++
> fwts-test/sdev-0001/test-0002.sh | 23 +++++++++++++++++++++++
> 7 files changed, 183 insertions(+)
> create mode 100644 fwts-test/sdev-0001/acpidump-0001.log
> create mode 100644 fwts-test/sdev-0001/acpidump-0002.log
> create mode 100644 fwts-test/sdev-0001/sdev-0001.log
> create mode 100644 fwts-test/sdev-0001/sdev-0002.log
> create mode 100755 fwts-test/sdev-0001/test-0001.sh
> create mode 100755 fwts-test/sdev-0001/test-0002.sh
>
> diff --git a/Makefile.am b/Makefile.am
> index 95407f7..af2fb91 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -110,6 +110,8 @@ TESTS = fwts-test/acpidump-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 \
> diff --git a/fwts-test/sdev-0001/acpidump-0001.log b/fwts-test/sdev-0001/acpidump-0001.log
> new file mode 100644
> index 0000000..2bca356
> --- /dev/null
> +++ b/fwts-test/sdev-0001/acpidump-0001.log
> @@ -0,0 +1,35 @@
> +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 ....
> +
> +SDEV @ 0x0000000000000000
> + 0000: 53 44 45 56 72 00 00 00 01 36 49 4e 54 45 4c 20 SDEVr....6INTEL
> + 0010: 54 65 6d 70 6c 61 74 65 01 00 00 00 49 4e 54 4c Template....INTL
> + 0020: 29 09 17 20 00 01 2a 00 0c 00 16 00 22 00 08 00 ).. ..*....."...
> + 0030: 5c 5c 5f 53 42 5f 2e 50 43 49 30 2e 55 53 42 31 \\_SB_.PCI0.USB1
> + 0040: 2e 53 55 42 31 00 00 11 22 33 44 55 66 77 01 01 .SUB1..."3DUfw..
> + 0050: 24 00 10 00 20 00 10 00 04 00 14 00 10 00 11 22 $... .........."
> + 0060: 33 44 ee dd cc bb aa 55 66 77 88 99 aa bb cc dd 3D.....Ufw......
> + 0070: ee ff ..
> +
> diff --git a/fwts-test/sdev-0001/acpidump-0002.log b/fwts-test/sdev-0001/acpidump-0002.log
> new file mode 100644
> index 0000000..10628c5
> --- /dev/null
> +++ b/fwts-test/sdev-0001/acpidump-0002.log
> @@ -0,0 +1,35 @@
> +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 ....
> +
> +SDEV @ 0x0000000000000000
> + 0000: 53 44 45 56 72 00 00 00 01 36 49 4e 54 45 4c 20 SDEVr....6INTEL
> + 0010: 54 65 6d 70 6c 61 74 65 01 00 00 00 49 4e 54 4c Template....INTL
> + 0020: 29 09 17 20 00 03 2a 00 0c 00 16 00 22 00 08 00 ).. ..*....."...
> + 0030: 5c 5c 5f 53 42 5f 2e 50 43 49 30 2e 55 53 42 31 \\_SB_.PCI0.USB1
> + 0040: 2e 53 55 42 31 00 00 11 22 33 44 55 66 77 01 05 .SUB1..."3DUfw..
> + 0050: 24 00 10 00 20 00 10 00 04 00 14 00 10 00 11 22 $... .........."
> + 0060: 33 44 ee dd cc bb aa 55 66 77 88 99 aa bb cc dd 3D.....Ufw......
> + 0070: ee ff ..
> +
> diff --git a/fwts-test/sdev-0001/sdev-0001.log b/fwts-test/sdev-0001/sdev-0001.log
> new file mode 100644
> index 0000000..8e5dce5
> --- /dev/null
> +++ b/fwts-test/sdev-0001/sdev-0001.log
> @@ -0,0 +1,31 @@
> +sdev sdev: SDEV Secure Devices Table test
> +sdev ----------------------------------------------------------
> +sdev Test 1 of 1: Validate SDEV table.
> +sdev SDEV Secure Devices Table:
> +sdev ACPI Integrated Device (Type 0):
> +sdev Type: 0x00
> +sdev Flags: 0x01
> +sdev Length: 0x002a
> +sdev Device Id Offset: 0x000c
> +sdev Device Id Length: 0x0016
> +sdev Vendor Specific Data Offset: 0x0022
> +sdev Vendor Specific Data Length: 0x0008
> +sdev
> +sdev PCIe Endpoint Device (Type 1):
> +sdev Type: 0x01
> +sdev Flags: 0x01
> +sdev Length: 0x0024
> +sdev PCI Segment Number: 0x0010
> +sdev Start Bus Number: 0x0020
> +sdev PCI Path Offset: 0x0010
> +sdev PCI Path Length: 0x0004
> +sdev Vendor Specific Data Offset: 0x0014
> +sdev Vendor Specific Data Length: 0x0010
> +sdev
> +sdev
> +sdev PASSED: Test 1, No issues found in SDEV table.
> +sdev
> +sdev ==========================================================
> +sdev 1 passed, 0 failed, 0 warning, 0 aborted, 0 skipped, 0
> +sdev info only.
> +sdev ==========================================================
> diff --git a/fwts-test/sdev-0001/sdev-0002.log b/fwts-test/sdev-0001/sdev-0002.log
> new file mode 100644
> index 0000000..ff83c69
> --- /dev/null
> +++ b/fwts-test/sdev-0001/sdev-0002.log
> @@ -0,0 +1,34 @@
> +sdev sdev: SDEV Secure Devices Table test
> +sdev ----------------------------------------------------------
> +sdev Test 1 of 1: Validate SDEV table.
> +sdev SDEV Secure Devices Table:
> +sdev ACPI Integrated Device (Type 0):
> +sdev Type: 0x00
> +sdev Flags: 0x03
> +sdev Length: 0x002a
> +sdev Device Id Offset: 0x000c
> +sdev Device Id Length: 0x0016
> +sdev Vendor Specific Data Offset: 0x0022
> +sdev Vendor Specific Data Length: 0x0008
> +sdev FAILED [HIGH] SDEVReservedBitsNonZero: Test 1, SDEV Flags
> +sdev Bits [15..1] must be zero, got 0x03 instead
> +sdev
> +sdev PCIe Endpoint Device (Type 1):
> +sdev Type: 0x01
> +sdev Flags: 0x05
> +sdev Length: 0x0024
> +sdev PCI Segment Number: 0x0010
> +sdev Start Bus Number: 0x0020
> +sdev PCI Path Offset: 0x0010
> +sdev PCI Path Length: 0x0004
> +sdev Vendor Specific Data Offset: 0x0014
> +sdev Vendor Specific Data Length: 0x0010
> +sdev FAILED [HIGH] SDEVReservedBitsNonZero: Test 1, SDEV Flags
> +sdev Bits [15..1] must be zero, got 0x05 instead
> +sdev
> +sdev
> +sdev
> +sdev ==========================================================
> +sdev 0 passed, 2 failed, 0 warning, 0 aborted, 0 skipped, 0
> +sdev info only.
> +sdev ==========================================================
> diff --git a/fwts-test/sdev-0001/test-0001.sh b/fwts-test/sdev-0001/test-0001.sh
> new file mode 100755
> index 0000000..68ae51f
> --- /dev/null
> +++ b/fwts-test/sdev-0001/test-0001.sh
> @@ -0,0 +1,23 @@
> +#!/bin/bash
> +#
> +TEST="Test acpitables against SDEV"
> +NAME=test-0001.sh
> +TMPLOG=$TMP/sdev.log.$$
> +
> +$FWTS --show-tests | grep sdev > /dev/null
> +if [ $? -eq 1 ]; then
> + echo SKIP: $TEST, $NAME
> + exit 77
> +fi
> +
> +$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/sdev-0001/acpidump-0001.log sdev - | cut -c7- | grep "^sdev" > $TMPLOG
> +diff $TMPLOG $FWTSTESTDIR/sdev-0001/sdev-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/sdev-0001/test-0002.sh b/fwts-test/sdev-0001/test-0002.sh
> new file mode 100755
> index 0000000..df1e25c
> --- /dev/null
> +++ b/fwts-test/sdev-0001/test-0002.sh
> @@ -0,0 +1,23 @@
> +#!/bin/bash
> +#
> +TEST="Test acpitables against invalid SDEV"
> +NAME=test-0001.sh
> +TMPLOG=$TMP/sdev.log.$$
> +
> +$FWTS --show-tests | grep sdev > /dev/null
> +if [ $? -eq 1 ]; then
> + echo SKIP: $TEST, $NAME
> + exit 77
> +fi
> +
> +$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/sdev-0001/acpidump-0002.log sdev - | cut -c7- | grep "^sdev" > $TMPLOG
> +diff $TMPLOG $FWTSTESTDIR/sdev-0001/sdev-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: Ivan Hu <ivan.hu at canonical.com>
More information about the fwts-devel
mailing list