diff mbox

[2/2] fwts-test: add wsmt test

Message ID 1498194220-24377-2-git-send-email-alex.hung@canonical.com
State Accepted
Headers show

Commit Message

Alex Hung June 23, 2017, 5:03 a.m. UTC
Signed-off-by: Alex Hung <alex.hung@canonical.com>
---
 Makefile.am                           |  2 ++
 fwts-test/wsmt-0001/acpidump-0001.log | 29 +++++++++++++++++++++++++++++
 fwts-test/wsmt-0001/acpidump-0002.log | 30 ++++++++++++++++++++++++++++++
 fwts-test/wsmt-0001/test-0001.sh      | 23 +++++++++++++++++++++++
 fwts-test/wsmt-0001/test-0002.sh      | 23 +++++++++++++++++++++++
 fwts-test/wsmt-0001/wsmt-0001.log     | 13 +++++++++++++
 fwts-test/wsmt-0001/wsmt-0002.log     | 14 ++++++++++++++
 7 files changed, 134 insertions(+)
 create mode 100644 fwts-test/wsmt-0001/acpidump-0001.log
 create mode 100644 fwts-test/wsmt-0001/acpidump-0002.log
 create mode 100755 fwts-test/wsmt-0001/test-0001.sh
 create mode 100755 fwts-test/wsmt-0001/test-0002.sh
 create mode 100644 fwts-test/wsmt-0001/wsmt-0001.log
 create mode 100644 fwts-test/wsmt-0001/wsmt-0002.log

Comments

Colin Ian King June 23, 2017, 8:21 a.m. UTC | #1
On 23/06/17 06:03, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  Makefile.am                           |  2 ++
>  fwts-test/wsmt-0001/acpidump-0001.log | 29 +++++++++++++++++++++++++++++
>  fwts-test/wsmt-0001/acpidump-0002.log | 30 ++++++++++++++++++++++++++++++
>  fwts-test/wsmt-0001/test-0001.sh      | 23 +++++++++++++++++++++++
>  fwts-test/wsmt-0001/test-0002.sh      | 23 +++++++++++++++++++++++
>  fwts-test/wsmt-0001/wsmt-0001.log     | 13 +++++++++++++
>  fwts-test/wsmt-0001/wsmt-0002.log     | 14 ++++++++++++++
>  7 files changed, 134 insertions(+)
>  create mode 100644 fwts-test/wsmt-0001/acpidump-0001.log
>  create mode 100644 fwts-test/wsmt-0001/acpidump-0002.log
>  create mode 100755 fwts-test/wsmt-0001/test-0001.sh
>  create mode 100755 fwts-test/wsmt-0001/test-0002.sh
>  create mode 100644 fwts-test/wsmt-0001/wsmt-0001.log
>  create mode 100644 fwts-test/wsmt-0001/wsmt-0002.log
> 
> diff --git a/Makefile.am b/Makefile.am
> index 65c9198..2729e39 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -155,6 +155,8 @@ TESTS = fwts-test/acpidump-0001/test-0001.sh \
>  	fwts-test/wmi-0001/test-0001.sh \
>  	fwts-test/wpbt-0001/test-0001.sh \
>  	fwts-test/wpbt-0001/test-0002.sh \
> +	fwts-test/wsmt-0001/test-0001.sh \
> +	fwts-test/wsmt-0001/test-0002.sh \
>  	fwts-test/wmi-0001/test-0002.sh \
>  	fwts-test/wmi-0001/test-0003.sh \
>  	fwts-test/xenv-0001/test-0001.sh \
> diff --git a/fwts-test/wsmt-0001/acpidump-0001.log b/fwts-test/wsmt-0001/acpidump-0001.log
> new file mode 100644
> index 0000000..a658e37
> --- /dev/null
> +++ b/fwts-test/wsmt-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@...........
> +  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                                      ....
> +
> +WSMT @ 0x0000000000000000
> +  0000: 57 53 4d 54 28 00 00 00 00 ea 49 4e 54 45 4c 20  WSMT(.....INTEL 
> +  0010: 54 45 4d 50 4c 41 54 45 00 00 00 00 49 4e 54 4c  TEMPLATE....INTL
> +  0020: 31 05 17 20 07 00 00 00                          1.. ....
> diff --git a/fwts-test/wsmt-0001/acpidump-0002.log b/fwts-test/wsmt-0001/acpidump-0002.log
> new file mode 100644
> index 0000000..45b4bce
> --- /dev/null
> +++ b/fwts-test/wsmt-0001/acpidump-0002.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                                      ....
> +
> +WSMT @ 0x0000000000000000
> +  0000: 57 53 4d 54 28 00 00 00 00 e8 49 4e 54 45 4c 20  WSMT(.....INTEL 
> +  0010: 54 45 4d 50 4c 41 54 45 00 00 00 00 49 4e 54 4c  TEMPLATE....INTL
> +  0020: 31 05 17 20 09 00 00 00                          1.. ....
> +
> diff --git a/fwts-test/wsmt-0001/test-0001.sh b/fwts-test/wsmt-0001/test-0001.sh
> new file mode 100755
> index 0000000..4175ff5
> --- /dev/null
> +++ b/fwts-test/wsmt-0001/test-0001.sh
> @@ -0,0 +1,23 @@
> +#!/bin/bash
> +#
> +TEST="Test apcitables against WSMT"
> +NAME=test-0001.sh
> +TMPLOG=$TMP/wsmt.log.$$
> +
> +$FWTS --show-tests | grep wsmt > /dev/null
> +if [ $? -eq 1 ]; then
> +	echo SKIP: $TEST, $NAME
> +	exit 77
> +fi
> +
> +$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/wsmt-0001/acpidump-0001.log wsmt - | cut -c7- | grep "^wsmt" > $TMPLOG
> +diff $TMPLOG $FWTSTESTDIR/wsmt-0001/wsmt-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/wsmt-0001/test-0002.sh b/fwts-test/wsmt-0001/test-0002.sh
> new file mode 100755
> index 0000000..0faaf93
> --- /dev/null
> +++ b/fwts-test/wsmt-0001/test-0002.sh
> @@ -0,0 +1,23 @@
> +#!/bin/bash
> +#
> +TEST="Test apcitables against invalid WSMT"
> +NAME=test-0001.sh
> +TMPLOG=$TMP/wsmt.log.$$
> +
> +$FWTS --show-tests | grep wsmt > /dev/null
> +if [ $? -eq 1 ]; then
> +	echo SKIP: $TEST, $NAME
> +	exit 77
> +fi
> +
> +$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/wsmt-0001/acpidump-0002.log wsmt - | cut -c7- | grep "^wsmt" > $TMPLOG
> +diff $TMPLOG $FWTSTESTDIR/wsmt-0001/wsmt-0002.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/wsmt-0001/wsmt-0001.log b/fwts-test/wsmt-0001/wsmt-0001.log
> new file mode 100644
> index 0000000..d6bdbb2
> --- /dev/null
> +++ b/fwts-test/wsmt-0001/wsmt-0001.log
> @@ -0,0 +1,13 @@
> +wsmt            wsmt: WSMT Windows SMM Security Mitigations Table test.
> +wsmt            ----------------------------------------------------------
> +wsmt            Test 1 of 1: WSMT Windows SMM Security Mitigations Table
> +wsmt            test.
> +wsmt            WSMT Windows SMM Security Mitigations Table:
> +wsmt              Protection Flags:      0x00000007
> +wsmt            
> +wsmt            PASSED: Test 1, No issues found in WSMT table.
> +wsmt            
> +wsmt            ==========================================================
> +wsmt            1 passed, 0 failed, 0 warning, 0 aborted, 0 skipped, 0
> +wsmt            info only.
> +wsmt            ==========================================================
> diff --git a/fwts-test/wsmt-0001/wsmt-0002.log b/fwts-test/wsmt-0001/wsmt-0002.log
> new file mode 100644
> index 0000000..b862a8f
> --- /dev/null
> +++ b/fwts-test/wsmt-0001/wsmt-0002.log
> @@ -0,0 +1,14 @@
> +wsmt            wsmt: WSMT Windows SMM Security Mitigations Table test.
> +wsmt            ----------------------------------------------------------
> +wsmt            Test 1 of 1: WSMT Windows SMM Security Mitigations Table
> +wsmt            test.
> +wsmt            WSMT Windows SMM Security Mitigations Table:
> +wsmt              Protection Flags:      0x00000009
> +wsmt            FAILED [MEDIUM] WSMTFlagsReserved: Test 1, WSMT Protection
> +wsmt            Flags reserved bits [3:31] must be zero, instead got 0x9
> +wsmt            
> +wsmt            
> +wsmt            ==========================================================
> +wsmt            0 passed, 1 failed, 0 warning, 0 aborted, 0 skipped, 0
> +wsmt            info only.
> +wsmt            ==========================================================
> 
Acked-by: Colin Ian King <colin.king@canonical.com>
Ivan Hu June 26, 2017, 9:45 a.m. UTC | #2
On 06/23/2017 01:03 PM, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>   Makefile.am                           |  2 ++
>   fwts-test/wsmt-0001/acpidump-0001.log | 29 +++++++++++++++++++++++++++++
>   fwts-test/wsmt-0001/acpidump-0002.log | 30 ++++++++++++++++++++++++++++++
>   fwts-test/wsmt-0001/test-0001.sh      | 23 +++++++++++++++++++++++
>   fwts-test/wsmt-0001/test-0002.sh      | 23 +++++++++++++++++++++++
>   fwts-test/wsmt-0001/wsmt-0001.log     | 13 +++++++++++++
>   fwts-test/wsmt-0001/wsmt-0002.log     | 14 ++++++++++++++
>   7 files changed, 134 insertions(+)
>   create mode 100644 fwts-test/wsmt-0001/acpidump-0001.log
>   create mode 100644 fwts-test/wsmt-0001/acpidump-0002.log
>   create mode 100755 fwts-test/wsmt-0001/test-0001.sh
>   create mode 100755 fwts-test/wsmt-0001/test-0002.sh
>   create mode 100644 fwts-test/wsmt-0001/wsmt-0001.log
>   create mode 100644 fwts-test/wsmt-0001/wsmt-0002.log
> 
> diff --git a/Makefile.am b/Makefile.am
> index 65c9198..2729e39 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -155,6 +155,8 @@ TESTS = fwts-test/acpidump-0001/test-0001.sh \
>   	fwts-test/wmi-0001/test-0001.sh \
>   	fwts-test/wpbt-0001/test-0001.sh \
>   	fwts-test/wpbt-0001/test-0002.sh \
> +	fwts-test/wsmt-0001/test-0001.sh \
> +	fwts-test/wsmt-0001/test-0002.sh \
>   	fwts-test/wmi-0001/test-0002.sh \
>   	fwts-test/wmi-0001/test-0003.sh \
>   	fwts-test/xenv-0001/test-0001.sh \
> diff --git a/fwts-test/wsmt-0001/acpidump-0001.log b/fwts-test/wsmt-0001/acpidump-0001.log
> new file mode 100644
> index 0000000..a658e37
> --- /dev/null
> +++ b/fwts-test/wsmt-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@...........
> +  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                                      ....
> +
> +WSMT @ 0x0000000000000000
> +  0000: 57 53 4d 54 28 00 00 00 00 ea 49 4e 54 45 4c 20  WSMT(.....INTEL
> +  0010: 54 45 4d 50 4c 41 54 45 00 00 00 00 49 4e 54 4c  TEMPLATE....INTL
> +  0020: 31 05 17 20 07 00 00 00                          1.. ....
> diff --git a/fwts-test/wsmt-0001/acpidump-0002.log b/fwts-test/wsmt-0001/acpidump-0002.log
> new file mode 100644
> index 0000000..45b4bce
> --- /dev/null
> +++ b/fwts-test/wsmt-0001/acpidump-0002.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                                      ....
> +
> +WSMT @ 0x0000000000000000
> +  0000: 57 53 4d 54 28 00 00 00 00 e8 49 4e 54 45 4c 20  WSMT(.....INTEL
> +  0010: 54 45 4d 50 4c 41 54 45 00 00 00 00 49 4e 54 4c  TEMPLATE....INTL
> +  0020: 31 05 17 20 09 00 00 00                          1.. ....
> +
> diff --git a/fwts-test/wsmt-0001/test-0001.sh b/fwts-test/wsmt-0001/test-0001.sh
> new file mode 100755
> index 0000000..4175ff5
> --- /dev/null
> +++ b/fwts-test/wsmt-0001/test-0001.sh
> @@ -0,0 +1,23 @@
> +#!/bin/bash
> +#
> +TEST="Test apcitables against WSMT"
> +NAME=test-0001.sh
> +TMPLOG=$TMP/wsmt.log.$$
> +
> +$FWTS --show-tests | grep wsmt > /dev/null
> +if [ $? -eq 1 ]; then
> +	echo SKIP: $TEST, $NAME
> +	exit 77
> +fi
> +
> +$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/wsmt-0001/acpidump-0001.log wsmt - | cut -c7- | grep "^wsmt" > $TMPLOG
> +diff $TMPLOG $FWTSTESTDIR/wsmt-0001/wsmt-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/wsmt-0001/test-0002.sh b/fwts-test/wsmt-0001/test-0002.sh
> new file mode 100755
> index 0000000..0faaf93
> --- /dev/null
> +++ b/fwts-test/wsmt-0001/test-0002.sh
> @@ -0,0 +1,23 @@
> +#!/bin/bash
> +#
> +TEST="Test apcitables against invalid WSMT"
> +NAME=test-0001.sh
> +TMPLOG=$TMP/wsmt.log.$$
> +
> +$FWTS --show-tests | grep wsmt > /dev/null
> +if [ $? -eq 1 ]; then
> +	echo SKIP: $TEST, $NAME
> +	exit 77
> +fi
> +
> +$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/wsmt-0001/acpidump-0002.log wsmt - | cut -c7- | grep "^wsmt" > $TMPLOG
> +diff $TMPLOG $FWTSTESTDIR/wsmt-0001/wsmt-0002.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/wsmt-0001/wsmt-0001.log b/fwts-test/wsmt-0001/wsmt-0001.log
> new file mode 100644
> index 0000000..d6bdbb2
> --- /dev/null
> +++ b/fwts-test/wsmt-0001/wsmt-0001.log
> @@ -0,0 +1,13 @@
> +wsmt            wsmt: WSMT Windows SMM Security Mitigations Table test.
> +wsmt            ----------------------------------------------------------
> +wsmt            Test 1 of 1: WSMT Windows SMM Security Mitigations Table
> +wsmt            test.
> +wsmt            WSMT Windows SMM Security Mitigations Table:
> +wsmt              Protection Flags:      0x00000007
> +wsmt
> +wsmt            PASSED: Test 1, No issues found in WSMT table.
> +wsmt
> +wsmt            ==========================================================
> +wsmt            1 passed, 0 failed, 0 warning, 0 aborted, 0 skipped, 0
> +wsmt            info only.
> +wsmt            ==========================================================
> diff --git a/fwts-test/wsmt-0001/wsmt-0002.log b/fwts-test/wsmt-0001/wsmt-0002.log
> new file mode 100644
> index 0000000..b862a8f
> --- /dev/null
> +++ b/fwts-test/wsmt-0001/wsmt-0002.log
> @@ -0,0 +1,14 @@
> +wsmt            wsmt: WSMT Windows SMM Security Mitigations Table test.
> +wsmt            ----------------------------------------------------------
> +wsmt            Test 1 of 1: WSMT Windows SMM Security Mitigations Table
> +wsmt            test.
> +wsmt            WSMT Windows SMM Security Mitigations Table:
> +wsmt              Protection Flags:      0x00000009
> +wsmt            FAILED [MEDIUM] WSMTFlagsReserved: Test 1, WSMT Protection
> +wsmt            Flags reserved bits [3:31] must be zero, instead got 0x9
> +wsmt
> +wsmt
> +wsmt            ==========================================================
> +wsmt            0 passed, 1 failed, 0 warning, 0 aborted, 0 skipped, 0
> +wsmt            info only.
> +wsmt            ==========================================================
> 

Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox

Patch

diff --git a/Makefile.am b/Makefile.am
index 65c9198..2729e39 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -155,6 +155,8 @@  TESTS = fwts-test/acpidump-0001/test-0001.sh \
 	fwts-test/wmi-0001/test-0001.sh \
 	fwts-test/wpbt-0001/test-0001.sh \
 	fwts-test/wpbt-0001/test-0002.sh \
+	fwts-test/wsmt-0001/test-0001.sh \
+	fwts-test/wsmt-0001/test-0002.sh \
 	fwts-test/wmi-0001/test-0002.sh \
 	fwts-test/wmi-0001/test-0003.sh \
 	fwts-test/xenv-0001/test-0001.sh \
diff --git a/fwts-test/wsmt-0001/acpidump-0001.log b/fwts-test/wsmt-0001/acpidump-0001.log
new file mode 100644
index 0000000..a658e37
--- /dev/null
+++ b/fwts-test/wsmt-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@...........
+  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                                      ....
+
+WSMT @ 0x0000000000000000
+  0000: 57 53 4d 54 28 00 00 00 00 ea 49 4e 54 45 4c 20  WSMT(.....INTEL 
+  0010: 54 45 4d 50 4c 41 54 45 00 00 00 00 49 4e 54 4c  TEMPLATE....INTL
+  0020: 31 05 17 20 07 00 00 00                          1.. ....
diff --git a/fwts-test/wsmt-0001/acpidump-0002.log b/fwts-test/wsmt-0001/acpidump-0002.log
new file mode 100644
index 0000000..45b4bce
--- /dev/null
+++ b/fwts-test/wsmt-0001/acpidump-0002.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                                      ....
+
+WSMT @ 0x0000000000000000
+  0000: 57 53 4d 54 28 00 00 00 00 e8 49 4e 54 45 4c 20  WSMT(.....INTEL 
+  0010: 54 45 4d 50 4c 41 54 45 00 00 00 00 49 4e 54 4c  TEMPLATE....INTL
+  0020: 31 05 17 20 09 00 00 00                          1.. ....
+
diff --git a/fwts-test/wsmt-0001/test-0001.sh b/fwts-test/wsmt-0001/test-0001.sh
new file mode 100755
index 0000000..4175ff5
--- /dev/null
+++ b/fwts-test/wsmt-0001/test-0001.sh
@@ -0,0 +1,23 @@ 
+#!/bin/bash
+#
+TEST="Test apcitables against WSMT"
+NAME=test-0001.sh
+TMPLOG=$TMP/wsmt.log.$$
+
+$FWTS --show-tests | grep wsmt > /dev/null
+if [ $? -eq 1 ]; then
+	echo SKIP: $TEST, $NAME
+	exit 77
+fi
+
+$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/wsmt-0001/acpidump-0001.log wsmt - | cut -c7- | grep "^wsmt" > $TMPLOG
+diff $TMPLOG $FWTSTESTDIR/wsmt-0001/wsmt-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/wsmt-0001/test-0002.sh b/fwts-test/wsmt-0001/test-0002.sh
new file mode 100755
index 0000000..0faaf93
--- /dev/null
+++ b/fwts-test/wsmt-0001/test-0002.sh
@@ -0,0 +1,23 @@ 
+#!/bin/bash
+#
+TEST="Test apcitables against invalid WSMT"
+NAME=test-0001.sh
+TMPLOG=$TMP/wsmt.log.$$
+
+$FWTS --show-tests | grep wsmt > /dev/null
+if [ $? -eq 1 ]; then
+	echo SKIP: $TEST, $NAME
+	exit 77
+fi
+
+$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/wsmt-0001/acpidump-0002.log wsmt - | cut -c7- | grep "^wsmt" > $TMPLOG
+diff $TMPLOG $FWTSTESTDIR/wsmt-0001/wsmt-0002.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/wsmt-0001/wsmt-0001.log b/fwts-test/wsmt-0001/wsmt-0001.log
new file mode 100644
index 0000000..d6bdbb2
--- /dev/null
+++ b/fwts-test/wsmt-0001/wsmt-0001.log
@@ -0,0 +1,13 @@ 
+wsmt            wsmt: WSMT Windows SMM Security Mitigations Table test.
+wsmt            ----------------------------------------------------------
+wsmt            Test 1 of 1: WSMT Windows SMM Security Mitigations Table
+wsmt            test.
+wsmt            WSMT Windows SMM Security Mitigations Table:
+wsmt              Protection Flags:      0x00000007
+wsmt            
+wsmt            PASSED: Test 1, No issues found in WSMT table.
+wsmt            
+wsmt            ==========================================================
+wsmt            1 passed, 0 failed, 0 warning, 0 aborted, 0 skipped, 0
+wsmt            info only.
+wsmt            ==========================================================
diff --git a/fwts-test/wsmt-0001/wsmt-0002.log b/fwts-test/wsmt-0001/wsmt-0002.log
new file mode 100644
index 0000000..b862a8f
--- /dev/null
+++ b/fwts-test/wsmt-0001/wsmt-0002.log
@@ -0,0 +1,14 @@ 
+wsmt            wsmt: WSMT Windows SMM Security Mitigations Table test.
+wsmt            ----------------------------------------------------------
+wsmt            Test 1 of 1: WSMT Windows SMM Security Mitigations Table
+wsmt            test.
+wsmt            WSMT Windows SMM Security Mitigations Table:
+wsmt              Protection Flags:      0x00000009
+wsmt            FAILED [MEDIUM] WSMTFlagsReserved: Test 1, WSMT Protection
+wsmt            Flags reserved bits [3:31] must be zero, instead got 0x9
+wsmt            
+wsmt            
+wsmt            ==========================================================
+wsmt            0 passed, 1 failed, 0 warning, 0 aborted, 0 skipped, 0
+wsmt            info only.
+wsmt            ==========================================================