[PATCH 21/30] fwts-test: Add BOOT test

Colin King colin.king at canonical.com
Thu Jun 18 08:49:33 UTC 2015


From: Colin Ian King <colin.king at canonical.com>

Add two tests, one to check for a valid BOOT and another to check
an invalid BOOT.

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 Makefile.am                           |  2 ++
 fwts-test/boot-0001/acpidump-0001.log | 29 +++++++++++++++++++++++++++++
 fwts-test/boot-0001/acpidump-0002.log | 29 +++++++++++++++++++++++++++++
 fwts-test/boot-0001/boot-0001.log     | 17 +++++++++++++++++
 fwts-test/boot-0001/boot-0002.log     | 10 ++++++++++
 fwts-test/boot-0001/test-0001.sh      | 17 +++++++++++++++++
 fwts-test/boot-0001/test-0002.sh      | 17 +++++++++++++++++
 7 files changed, 121 insertions(+)
 create mode 100644 fwts-test/boot-0001/acpidump-0001.log
 create mode 100644 fwts-test/boot-0001/acpidump-0002.log
 create mode 100644 fwts-test/boot-0001/boot-0001.log
 create mode 100644 fwts-test/boot-0001/boot-0002.log
 create mode 100755 fwts-test/boot-0001/test-0001.sh
 create mode 100755 fwts-test/boot-0001/test-0002.sh

diff --git a/Makefile.am b/Makefile.am
index dd96e21..aa47673 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -54,6 +54,8 @@ TESTS = fwts-test/acpidump-0001/test-0001.sh \
 	fwts-test/arg-width-0001/test-0008.sh \
 	fwts-test/bert-0001/test-0001.sh \
 	fwts-test/bert-0001/test-0002.sh \
+	fwts-test/boot-0001/test-0001.sh \
+	fwts-test/boot-0001/test-0002.sh \
 	fwts-test/checksum-0001/test-0001.sh \
 	fwts-test/checksum-0001/test-0003.sh \
 	fwts-test/checksum-0001/test-0004.sh \
diff --git a/fwts-test/boot-0001/acpidump-0001.log b/fwts-test/boot-0001/acpidump-0001.log
new file mode 100644
index 0000000..5d4802b
--- /dev/null
+++ b/fwts-test/boot-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 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                                      ....
+
+BOOT @ 0x00000000
+  0000: 42 4f 4f 54 28 00 00 00 01 5a 41 43 52 53 59 53  BOOT(....ZACRSYS
+  0010: 41 43 52 50 52 44 43 54 01 00 00 00 31 30 32 35  ACRPRDCT....1025
+  0020: 13 00 00 01 44 00 00 00                          ....D...
diff --git a/fwts-test/boot-0001/acpidump-0002.log b/fwts-test/boot-0001/acpidump-0002.log
new file mode 100644
index 0000000..238ca7b
--- /dev/null
+++ b/fwts-test/boot-0001/acpidump-0002.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 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                                      ....
+
+BOOT @ 0x00000000
+  0000: 42 4f 4f 54 26 00 00 00 01 5a 41 43 52 53 59 53  BOOT(....ZACRSYS
+  0010: 41 43 52 50 52 44 43 54 01 00 00 00 31 30 32 35  ACRPRDCT....1025
+  0020: 13 00 00 01 44 00                                ....D.
diff --git a/fwts-test/boot-0001/boot-0001.log b/fwts-test/boot-0001/boot-0001.log
new file mode 100644
index 0000000..71a4969
--- /dev/null
+++ b/fwts-test/boot-0001/boot-0001.log
@@ -0,0 +1,17 @@
+boot            boot: BOOT Table test.
+boot            ----------------------------------------------------------
+boot            Test 1 of 1: BOOT Table test.
+boot            BOOT Table:
+boot              CMOS Index:               0x44
+boot              Reserved:                 0x00
+boot              Reserved:                 0x00
+boot              Reserved:                 0x00
+boot            
+boot            ACPI table loaded from file so fwts will skip the read of
+boot            the CMOS boot register
+boot            PASSED: Test 1, No issues found in BOOT table.
+boot            
+boot            ==========================================================
+boot            1 passed, 0 failed, 0 warning, 0 aborted, 0 skipped, 0
+boot            info only.
+boot            ==========================================================
diff --git a/fwts-test/boot-0001/boot-0002.log b/fwts-test/boot-0001/boot-0002.log
new file mode 100644
index 0000000..08a2676
--- /dev/null
+++ b/fwts-test/boot-0001/boot-0002.log
@@ -0,0 +1,10 @@
+boot            boot: BOOT Table test.
+boot            ----------------------------------------------------------
+boot            Test 1 of 1: BOOT Table test.
+boot            FAILED [HIGH] BOOTTooShort: Test 1, BOOT table too short,
+boot            expecting 40 bytes, instead got 38 bytes
+boot            
+boot            ==========================================================
+boot            0 passed, 1 failed, 0 warning, 0 aborted, 0 skipped, 0
+boot            info only.
+boot            ==========================================================
diff --git a/fwts-test/boot-0001/test-0001.sh b/fwts-test/boot-0001/test-0001.sh
new file mode 100755
index 0000000..f9a6307
--- /dev/null
+++ b/fwts-test/boot-0001/test-0001.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+#
+TEST="Test apcitables against BOOT"
+NAME=test-0001.sh
+TMPLOG=$TMP/boot.log.$$
+
+$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/boot-0001/acpidump-0001.log boot - | cut -c7- | grep "^boot" > $TMPLOG
+diff $TMPLOG $FWTSTESTDIR/boot-0001/boot-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/boot-0001/test-0002.sh b/fwts-test/boot-0001/test-0002.sh
new file mode 100755
index 0000000..ed0db5f
--- /dev/null
+++ b/fwts-test/boot-0001/test-0002.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+#
+TEST="Test apcitables against invalid BOOT"
+NAME=test-0001.sh
+TMPLOG=$TMP/boot.log.$$
+
+$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/boot-0001/acpidump-0002.log boot - | cut -c7- | grep "^boot" > $TMPLOG
+diff $TMPLOG $FWTSTESTDIR/boot-0001/boot-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.1.4




More information about the fwts-devel mailing list