diff mbox

[2/2] fwts-test: Add UEFI ACPI data table regression tests

Message ID 1436174251-89180-3-git-send-email-ivan.hu@canonical.com
State Rejected
Headers show

Commit Message

Ivan Hu July 6, 2015, 9:17 a.m. UTC
Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
---
 Makefile.am                                        |  2 ++
 .../arg-show-tests-0001/arg-show-tests-0001.log    |  2 ++
 .../arg-show-tests-full-0001.log                   |  6 ++++-
 fwts-test/uefi-0001/acpidump-0001.log              | 31 ++++++++++++++++++++++
 fwts-test/uefi-0001/acpidump-0001.log~             | 31 ++++++++++++++++++++++
 fwts-test/uefi-0001/acpidump-0002.log              | 31 ++++++++++++++++++++++
 fwts-test/uefi-0001/acpidump-0002.log~             | 31 ++++++++++++++++++++++
 fwts-test/uefi-0001/test-0001.sh                   | 17 ++++++++++++
 fwts-test/uefi-0001/test-0002.sh                   | 17 ++++++++++++
 fwts-test/uefi-0001/uefi-0001.log                  | 14 ++++++++++
 fwts-test/uefi-0001/uefi-0002.log                  | 19 +++++++++++++
 11 files changed, 200 insertions(+), 1 deletion(-)
 create mode 100644 fwts-test/uefi-0001/acpidump-0001.log
 create mode 100644 fwts-test/uefi-0001/acpidump-0001.log~
 create mode 100644 fwts-test/uefi-0001/acpidump-0002.log
 create mode 100644 fwts-test/uefi-0001/acpidump-0002.log~
 create mode 100755 fwts-test/uefi-0001/test-0001.sh
 create mode 100755 fwts-test/uefi-0001/test-0002.sh
 create mode 100644 fwts-test/uefi-0001/uefi-0001.log
 create mode 100644 fwts-test/uefi-0001/uefi-0002.log
diff mbox

Patch

diff --git a/Makefile.am b/Makefile.am
index 7d5c1f0..a431c2e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -106,6 +106,8 @@  TESTS = fwts-test/acpidump-0001/test-0001.sh \
 	fwts-test/syntaxcheck-0001/test-0001.sh \
 	fwts-test/tcpa-0001/test-0001.sh \
 	fwts-test/tcpa-0001/test-0002.sh \
+	fwts-test/uefi-0001/test-0001.sh \
+	fwts-test/uefi-0001/test-0002.sh \
 	fwts-test/waet-0001/test-0001.sh \
 	fwts-test/waet-0001/test-0002.sh \
 	fwts-test/waet-0001/test-0003.sh \
diff --git a/fwts-test/arg-show-tests-0001/arg-show-tests-0001.log b/fwts-test/arg-show-tests-0001/arg-show-tests-0001.log
index bd388a6..06833c9 100644
--- a/fwts-test/arg-show-tests-0001/arg-show-tests-0001.log
+++ b/fwts-test/arg-show-tests-0001/arg-show-tests-0001.log
@@ -34,6 +34,7 @@  ACPI tests:
  spmi            SPMI Service Processor Management Interface Description Table test.
  srat            SRAT System Resource Affinity Table test.
  tcpa            Trusted Computing Platform Alliance Capabilities Table test.
+ uefitable       UEFI Data Table test.
  waet            Windows ACPI Emulated Devices Table test.
  wmi             Extract and analyse Windows Management Instrumentation (WMI).
  xenv            Xen Environment Table tests.
@@ -102,6 +103,7 @@  Batch tests:
  syntaxcheck     Re-assemble DSDT and SSDTs to find syntax errors and warnings.
  tcpa            Trusted Computing Platform Alliance Capabilities Table test.
  uefibootpath    Sanity check for UEFI Boot Path Boot####.
+ uefitable       UEFI Data Table test.
  version         Gather kernel system information.
  virt            CPU Virtualisation Configuration test.
  waet            Windows ACPI Emulated Devices Table test.
diff --git a/fwts-test/arg-show-tests-full-0001/arg-show-tests-full-0001.log b/fwts-test/arg-show-tests-full-0001/arg-show-tests-full-0001.log
index d81ebf0..324d660 100644
--- a/fwts-test/arg-show-tests-full-0001/arg-show-tests-full-0001.log
+++ b/fwts-test/arg-show-tests-full-0001/arg-show-tests-full-0001.log
@@ -256,6 +256,8 @@  ACPI tests:
   SRAT System Resource Affinity Table test.
  tcpa            (1 test):
   Validate TCPA table.
+ uefitable       (1 test):
+  UEFI Data Table test.
  waet            (1 test):
   Windows ACPI Emulated Devices Table test.
  wmi             (1 test):
@@ -603,6 +605,8 @@  Batch tests:
   Validate TCPA table.
  uefibootpath    (1 test):
   Test UEFI Boot Path Boot####.
+ uefitable       (1 test):
+  UEFI Data Table test.
  version         (4 tests):
   Gather kernel signature.
   Gather kernel system information.
@@ -812,4 +816,4 @@  UEFI tests:
   Test UEFI RT service query variable info interface stress test.
   Test UEFI RT service get variable interface, invalid parameters.
 
-Total of 660 tests
+Total of 662 tests
diff --git a/fwts-test/uefi-0001/acpidump-0001.log b/fwts-test/uefi-0001/acpidump-0001.log
new file mode 100644
index 0000000..f1f0b9e
--- /dev/null
+++ b/fwts-test/uefi-0001/acpidump-0001.log
@@ -0,0 +1,31 @@ 
+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                                      ....
+            
+UEFI @ 0x00000000
+  0000: 55 45 46 49 42 00 00 00 01 52 49 4E 54 45 4C 20  UEFIB....RINTEL 
+  0010: 45 44 4B 32 20 20 20 20 02 00 00 00 20 20 20 20  EDK2    ....    
+  0020: 13 00 00 01 E2 D8 8E C6 C6 9D BD 4C 9D 94 DB 65  ...........L...e
+  0030: AC C5 C3 32 36 00 03 00 00 00 00 00 00 00 00 00  ...26...........
+  0040: 00 00                                                            
diff --git a/fwts-test/uefi-0001/acpidump-0001.log~ b/fwts-test/uefi-0001/acpidump-0001.log~
new file mode 100644
index 0000000..6c964d1
--- /dev/null
+++ b/fwts-test/uefi-0001/acpidump-0001.log~
@@ -0,0 +1,31 @@ 
+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  ................
+  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  . ...........@..
+  00e0: 20 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ...............
+  00f0: 00 00 00 00                                      ....
+            
+UEFI @ 0x00000000
+  0000: 55 45 46 49 42 00 00 00 01 52 49 4E 54 45 4C 20  UEFIB....RINTEL 
+  0010: 45 44 4B 32 20 20 20 20 02 00 00 00 20 20 20 20  EDK2    ....    
+  0020: 13 00 00 01 E2 D8 8E C6 C6 9D BD 4C 9D 94 DB 65  ...........L...e
+  0030: AC C5 C3 32 36 00 03 00 00 00 00 00 00 00 00 00  ...26...........
+  0040: 00 00                                                            
diff --git a/fwts-test/uefi-0001/acpidump-0002.log b/fwts-test/uefi-0001/acpidump-0002.log
new file mode 100644
index 0000000..23d8ed7
--- /dev/null
+++ b/fwts-test/uefi-0001/acpidump-0002.log
@@ -0,0 +1,31 @@ 
+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                                      ....
+            
+UEFI @ 0x00000000
+  0000: 55 45 46 49 42 00 00 00 01 52 49 4E 54 45 4C 20  UEFIB....RINTEL 
+  0010: 45 44 4B 32 20 20 20 20 02 00 00 00 20 20 20 20  EDK2    ....    
+  0020: 13 00 00 01 E2 D8 8E C6 C6 9D BD 4C 9D 94 DB 65  ...........L...e
+  0030: AC C5 C3 32 46 00 03 00 00 00 00 00 00 00 00 00  ...26...........
+  0040: 00 00                                                            
diff --git a/fwts-test/uefi-0001/acpidump-0002.log~ b/fwts-test/uefi-0001/acpidump-0002.log~
new file mode 100644
index 0000000..beae65a
--- /dev/null
+++ b/fwts-test/uefi-0001/acpidump-0002.log~
@@ -0,0 +1,31 @@ 
+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  ................
+  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  . ...........@..
+  00e0: 20 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ...............
+  00f0: 00 00 00 00                                      ....
+            
+UEFI @ 0x00000000
+  0000: 55 45 46 49 42 00 00 00 01 52 49 4E 54 45 4C 20  UEFIB....RINTEL 
+  0010: 45 44 4B 32 20 20 20 20 02 00 00 00 20 20 20 20  EDK2    ....    
+  0020: 13 00 00 01 E2 D8 8E C6 C6 9D BD 4C 9D 94 DB 65  ...........L...e
+  0030: AC C5 C3 32 46 00 03 00 00 00 00 00 00 00 00 00  ...26...........
+  0040: 00 00                                                            
diff --git a/fwts-test/uefi-0001/test-0001.sh b/fwts-test/uefi-0001/test-0001.sh
new file mode 100755
index 0000000..4d47371
--- /dev/null
+++ b/fwts-test/uefi-0001/test-0001.sh
@@ -0,0 +1,17 @@ 
+#!/bin/bash
+#
+TEST="Test table against UEFI"
+NAME=test-0001.sh
+TMPLOG=$TMP/uefi.log.$$
+
+$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/uefi-0001/acpidump-0001.log uefitable - | cut -c7- | grep "^uefi" > $TMPLOG
+diff $TMPLOG $FWTSTESTDIR/uefi-0001/uefi-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/uefi-0001/test-0002.sh b/fwts-test/uefi-0001/test-0002.sh
new file mode 100755
index 0000000..3d457c3
--- /dev/null
+++ b/fwts-test/uefi-0001/test-0002.sh
@@ -0,0 +1,17 @@ 
+#!/bin/bash
+#
+TEST="Test table against invalid UEFI"
+NAME=test-0001.sh
+TMPLOG=$TMP/uefi.log.$$
+
+$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/uefi-0001/acpidump-0001.log uefitable - | cut -c7- | grep "^uefi" > $TMPLOG
+diff $TMPLOG $FWTSTESTDIR/uefi-0001/uefi-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/uefi-0001/uefi-0001.log b/fwts-test/uefi-0001/uefi-0001.log
new file mode 100644
index 0000000..9be9c19
--- /dev/null
+++ b/fwts-test/uefi-0001/uefi-0001.log
@@ -0,0 +1,14 @@ 
+uefitable       uefitable: UEFI Data Table test.
+uefitable       ----------------------------------------------------------
+uefitable       Test 1 of 1: UEFI Data Table test.
+uefitable       UEFI ACPI Data Table:
+uefitable         Identifier: C68ED8E2-9DC6-4CBD-9D94-DB65ACC5C332
+uefitable         DataOffset: 0x0036
+uefitable         SW SMI Number: 0x00000003
+uefitable         Buffer Ptr Address: 0x0000000000000000
+uefitable       PASSED: Test 1, No issues found in UEFI table.
+uefitable       
+uefitable       ==========================================================
+uefitable       1 passed, 0 failed, 0 warning, 0 aborted, 0 skipped, 0
+uefitable       info only.
+uefitable       ==========================================================
diff --git a/fwts-test/uefi-0001/uefi-0002.log b/fwts-test/uefi-0001/uefi-0002.log
new file mode 100644
index 0000000..b531070
--- /dev/null
+++ b/fwts-test/uefi-0001/uefi-0002.log
@@ -0,0 +1,19 @@ 
+uefitable       uefitable: UEFI Data Table test.
+uefitable       ----------------------------------------------------------
+uefitable       Test 1 of 1: UEFI Data Table test.
+uefitable       UEFI ACPI Data Table:
+uefitable         Identifier: C68ED8E2-9DC6-4CBD-9D94-DB65ACC5C332
+uefitable         DataOffset: 0x0046
+uefitable       FAILED [HIGH] UEFIDataOffset: Test 1, Invalid UEFI
+uefitable       DataOffset, exceed the whole table length 66 bytes,
+uefitable       instead got 70 offset bytes
+uefitable       FAILED [HIGH] UEFIDataOffset: Test 1, Invalid UEFI
+uefitable       DataOffset for SMM Communication table, DataOffset should
+uefitable       be 54, instead got 70 offset bytes
+uefitable         SW SMI Number: 0x00000003
+uefitable         Buffer Ptr Address: 0x0000000000000000
+uefitable       
+uefitable       ==========================================================
+uefitable       0 passed, 2 failed, 0 warning, 0 aborted, 0 skipped, 0
+uefitable       info only.
+uefitable       ==========================================================