[PATCH 3/3] fwts-test: Add regression test for DRTM

Alex Hung alex.hung at canonical.com
Mon Aug 22 03:25:01 UTC 2016


Signed-off-by: Alex Hung <alex.hung at canonical.com>
---
 Makefile.am                           |  2 ++
 fwts-test/drtm-0001/acpidump-0001.log | 39 ++++++++++++++++++++++
 fwts-test/drtm-0001/acpidump-0002.log | 38 +++++++++++++++++++++
 fwts-test/drtm-0001/drtm-0001.log     | 55 +++++++++++++++++++++++++++++++
 fwts-test/drtm-0001/drtm-0002.log     | 62 +++++++++++++++++++++++++++++++++++
 fwts-test/drtm-0001/test-0001.sh      | 23 +++++++++++++
 fwts-test/drtm-0001/test-0002.sh      | 23 +++++++++++++
 7 files changed, 242 insertions(+)
 create mode 100644 fwts-test/drtm-0001/acpidump-0001.log
 create mode 100644 fwts-test/drtm-0001/acpidump-0002.log
 create mode 100644 fwts-test/drtm-0001/drtm-0001.log
 create mode 100644 fwts-test/drtm-0001/drtm-0002.log
 create mode 100755 fwts-test/drtm-0001/test-0001.sh
 create mode 100755 fwts-test/drtm-0001/test-0002.sh

diff --git a/Makefile.am b/Makefile.am
index f942f7a..c944c42 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -68,6 +68,8 @@ TESTS = fwts-test/acpidump-0001/test-0001.sh \
 	fwts-test/dbgp-0001/test-0001.sh \
 	fwts-test/dbgp-0001/test-0002.sh \
 	fwts-test/disassemble-0001/test-0001.sh \
+	fwts-test/drtm-0001/test-0001.sh \
+	fwts-test/drtm-0001/test-0002.sh \
 	fwts-test/erst-0001/test-0001.sh \
 	fwts-test/erst-0001/test-0002.sh \
 	fwts-test/facs-0001/test-0001.sh \
diff --git a/fwts-test/drtm-0001/acpidump-0001.log b/fwts-test/drtm-0001/acpidump-0001.log
new file mode 100644
index 0000000..3444a8f
--- /dev/null
+++ b/fwts-test/drtm-0001/acpidump-0001.log
@@ -0,0 +1,39 @@
+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                                      ....
+
+DRTM @ 0x0000000000000000
+  0000: 44 52 54 4d bc 00 00 00 01 2f 49 4e 54 45 4c 20  DRTM...../INTEL 
+  0010: 54 45 4d 50 4c 41 54 45 01 00 00 00 49 4e 54 4c  TEMPLATE....INTL
+  0020: 27 05 16 20 00 00 00 f0 00 00 00 00 00 00 00 10  '.. ............
+  0030: 00 00 00 00 00 20 00 00 00 00 00 30 00 00 00 00  ..... .....0....
+  0040: 00 00 00 40 00 00 00 00 00 00 00 50 00 00 00 00  ... at .......P....
+  0050: 00 60 00 00 00 00 00 70 00 00 00 00 0f 00 00 00  .`.....p........
+  0060: 02 00 00 00 00 00 00 a0 00 00 00 00 00 00 00 b0  ................
+  0070: 00 00 00 00 03 00 00 00 00 01 00 00 00 00 00 00  ................
+  0080: aa 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00  ................
+  0090: bb 00 00 00 00 00 00 00 00 03 00 00 00 00 00 00  ................
+  00a0: cc 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+  00b0: 00 00 00 00 00 00 00 00 00 00 00 00              ............
+
diff --git a/fwts-test/drtm-0001/acpidump-0002.log b/fwts-test/drtm-0001/acpidump-0002.log
new file mode 100644
index 0000000..21c11f6
--- /dev/null
+++ b/fwts-test/drtm-0001/acpidump-0002.log
@@ -0,0 +1,38 @@
+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                                      ....
+
+DRTM @ 0x0000000000000000
+  0000: 44 52 54 4d bc 00 00 00 01 72 49 4e 54 45 4c 20  DRTM.....rINTEL 
+  0010: 54 45 4d 50 4c 41 54 45 01 00 00 00 49 4e 54 4c  TEMPLATE....INTL
+  0020: 27 05 16 20 00 00 00 f0 00 00 00 00 00 00 00 10  '.. ............
+  0030: 00 00 00 00 00 20 00 00 00 00 00 30 00 00 00 00  ..... .....0....
+  0040: 00 00 00 40 00 00 00 00 00 00 00 50 00 00 00 00  ... at .......P....
+  0050: 00 60 00 00 00 00 00 70 00 00 00 00 00 80 00 00  .`.....p........
+  0060: 02 00 00 00 00 00 00 a0 00 00 00 00 00 00 00 b0  ................
+  0070: 00 00 00 00 03 00 00 00 00 01 00 00 00 00 00 04  ................
+  0080: aa 00 00 00 00 00 00 00 00 02 00 00 00 00 00 08  ................
+  0090: bb 00 00 00 00 00 00 00 00 03 00 00 00 00 00 40  ...............@
+  00a0: cc 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+  00b0: 00 00 00 00 00 00 00 00 00 00 00 00              ............
diff --git a/fwts-test/drtm-0001/drtm-0001.log b/fwts-test/drtm-0001/drtm-0001.log
new file mode 100644
index 0000000..f74b712
--- /dev/null
+++ b/fwts-test/drtm-0001/drtm-0001.log
@@ -0,0 +1,55 @@
+drtm            drtm: DRTM D-RTM Resources Table test.
+drtm            ----------------------------------------------------------
+drtm            Test 1 of 1: DRTM D-RTM Resources Table test.
+drtm            DRTM D-RTM Resources Table:
+drtm              DL_Entry_Base:            0x00000000f0000000
+drtm              DL_Entry_Length:          0x0000000010000000
+drtm              DL_Entry32:               0x00002000
+drtm              DL_Entry64:               0x0000000030000000
+drtm              DLME_Exit:                0x0000000040000000
+drtm              Log_Area_Start:           0x0000000050000000
+drtm              Log_Area_Length:          0x00006000
+drtm              Architecture_Dependent:   0x0000000070000000
+drtm              DRT_Flags:                0x0000000f
+drtm            
+drtm              VTL_Length:               0x00000002
+drtm              Validated_Tables:         0x00000000a0000000
+drtm              Validated_Tables:         0x00000000b0000000
+drtm            
+drtm              RL_Length:                0x00000003
+drtm              Resource Size:            0x0000000000000100
+drtm              Resource Type:            0x00
+drtm              Resource Address:         0x00000000000000aa
+drtm            
+drtm              Resource Size:            0x0000000000000200
+drtm              Resource Type:            0x00
+drtm              Resource Address:         0x00000000000000bb
+drtm            
+drtm              Resource Size:            0x0000000000000300
+drtm              Resource Type:            0x00
+drtm              Resource Address:         0x00000000000000cc
+drtm            
+drtm              DPS_Length:               0x00000000
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm            
+drtm            PASSED: Test 1, No issues found in DRTM table.
+drtm            
+drtm            ==========================================================
+drtm            1 passed, 0 failed, 0 warning, 0 aborted, 0 skipped, 0
+drtm            info only.
+drtm            ==========================================================
diff --git a/fwts-test/drtm-0001/drtm-0002.log b/fwts-test/drtm-0001/drtm-0002.log
new file mode 100644
index 0000000..01fe9e1
--- /dev/null
+++ b/fwts-test/drtm-0001/drtm-0002.log
@@ -0,0 +1,62 @@
+drtm            drtm: DRTM D-RTM Resources Table test.
+drtm            ----------------------------------------------------------
+drtm            Test 1 of 1: DRTM D-RTM Resources Table test.
+drtm            DRTM D-RTM Resources Table:
+drtm              DL_Entry_Base:            0x00000000f0000000
+drtm              DL_Entry_Length:          0x0000000010000000
+drtm              DL_Entry32:               0x00002000
+drtm              DL_Entry64:               0x0000000030000000
+drtm              DLME_Exit:                0x0000000040000000
+drtm              Log_Area_Start:           0x0000000050000000
+drtm              Log_Area_Length:          0x00006000
+drtm              Architecture_Dependent:   0x0000000070000000
+drtm              DRT_Flags:                0x00008000
+drtm            FAILED [MEDIUM] DRTMBadFlagReservedNonZero: Test 1, DRTM
+drtm            DRT_Flags Bits [31:4] are reserved, got 0x00008000 instead
+drtm            
+drtm              VTL_Length:               0x00000002
+drtm              Validated_Tables:         0x00000000a0000000
+drtm              Validated_Tables:         0x00000000b0000000
+drtm            
+drtm              RL_Length:                0x00000003
+drtm              Resource Size:            0x0000000000000100
+drtm              Resource Type:            0x04
+drtm              Resource Address:         0x00000000000000aa
+drtm            FAILED [MEDIUM] DRTMBadResourceType: Test 1, DRTM Resource
+drtm            Type Bits [6:2] are reserved, got 0x04 instead
+drtm            
+drtm              Resource Size:            0x0000000000000200
+drtm              Resource Type:            0x08
+drtm              Resource Address:         0x00000000000000bb
+drtm            FAILED [MEDIUM] DRTMBadResourceType: Test 1, DRTM Resource
+drtm            Type Bits [6:2] are reserved, got 0x08 instead
+drtm            
+drtm              Resource Size:            0x0000000000000300
+drtm              Resource Type:            0x40
+drtm              Resource Address:         0x00000000000000cc
+drtm            FAILED [MEDIUM] DRTMBadResourceType: Test 1, DRTM Resource
+drtm            Type Bits [6:2] are reserved, got 0x40 instead
+drtm            
+drtm              DPS_Length:               0x00000000
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm              DLME Platform Id:         0x00
+drtm            
+drtm            
+drtm            ==========================================================
+drtm            0 passed, 4 failed, 0 warning, 0 aborted, 0 skipped, 0
+drtm            info only.
+drtm            ==========================================================
diff --git a/fwts-test/drtm-0001/test-0001.sh b/fwts-test/drtm-0001/test-0001.sh
new file mode 100755
index 0000000..047c563
--- /dev/null
+++ b/fwts-test/drtm-0001/test-0001.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+#
+TEST="Test apcitables against DRTM"
+NAME=test-0001.sh
+TMPLOG=$TMP/drtm.log.$$
+
+$FWTS --show-tests | grep drtm > /dev/null
+if [ $? -eq 1 ]; then
+	echo SKIP: $TEST, $NAME
+	exit 77
+fi
+
+$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/drtm-0001/acpidump-0001.log drtm - | cut -c7- | grep "^drtm" > $TMPLOG
+diff $TMPLOG $FWTSTESTDIR/drtm-0001/drtm-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/drtm-0001/test-0002.sh b/fwts-test/drtm-0001/test-0002.sh
new file mode 100755
index 0000000..c6d68b5
--- /dev/null
+++ b/fwts-test/drtm-0001/test-0002.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+#
+TEST="Test apcitables against invalid DRTM"
+NAME=test-0001.sh
+TMPLOG=$TMP/drtm.log.$$
+
+$FWTS --show-tests | grep drtm > /dev/null
+if [ $? -eq 1 ]; then
+	echo SKIP: $TEST, $NAME
+	exit 77
+fi
+
+$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/drtm-0001/acpidump-0002.log drtm - | cut -c7- | grep "^drtm" > $TMPLOG
+diff $TMPLOG $FWTSTESTDIR/drtm-0001/drtm-0002.log >> $FAILURE_LOG
+ret=$?
+if [ $ret -eq 0 ]; then
+	echo PASSED: $TEST, $NAME
+else
+	echo FAILED: $TEST, $NAME
+fi
+
+rm $TMPLOG
+exit $ret
-- 
2.7.4




More information about the fwts-devel mailing list