ACK: [PATCH 25/30] fwts-test: Add SBST test

ivanhu ivan.hu at canonical.com
Wed Jun 24 06:58:51 UTC 2015



On 2015年06月18日 16:49, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Add two tests, one to check for a valid SBST and another to check
> an invalid SBST.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>   Makefile.am                           |  2 ++
>   fwts-test/sbst-0001/acpidump-0001.log | 29 +++++++++++++++++++++++++++++
>   fwts-test/sbst-0001/acpidump-0002.log | 29 +++++++++++++++++++++++++++++
>   fwts-test/sbst-0001/sbst-0001.log     |  9 +++++++++
>   fwts-test/sbst-0001/sbst-0002.log     | 13 +++++++++++++
>   fwts-test/sbst-0001/test-0001.sh      | 17 +++++++++++++++++
>   fwts-test/sbst-0001/test-0002.sh      | 17 +++++++++++++++++
>   7 files changed, 116 insertions(+)
>   create mode 100644 fwts-test/sbst-0001/acpidump-0001.log
>   create mode 100644 fwts-test/sbst-0001/acpidump-0002.log
>   create mode 100644 fwts-test/sbst-0001/sbst-0001.log
>   create mode 100644 fwts-test/sbst-0001/sbst-0002.log
>   create mode 100755 fwts-test/sbst-0001/test-0001.sh
>   create mode 100755 fwts-test/sbst-0001/test-0002.sh
>
> diff --git a/Makefile.am b/Makefile.am
> index 5cfbfa4..467723e 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -82,6 +82,8 @@ TESTS = fwts-test/acpidump-0001/test-0001.sh \
>   	fwts-test/osilinux-0001/test-0002.sh \
>   	fwts-test/rsdp-0001/test-0001.sh \
>   	fwts-test/rsdt-0001/test-0001.sh \
> +	fwts-test/sbst-0001/test-0001.sh \
> +	fwts-test/sbst-0001/test-0002.sh \
>   	fwts-test/syntaxcheck-0001/test-0001.sh \
>   	fwts-test/wmi-0001/test-0001.sh \
>   	fwts-test/wmi-0001/test-0002.sh \
> diff --git a/fwts-test/sbst-0001/acpidump-0001.log b/fwts-test/sbst-0001/acpidump-0001.log
> new file mode 100644
> index 0000000..26feeca
> --- /dev/null
> +++ b/fwts-test/sbst-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                                      ....
> +
> +SBST @ 0x00000000
> +  0000: 53 42 53 54 30 00 00 00 01 c7 4c 45 4e 4f 56 4f  SBST0.....LENOVO
> +  0010: 54 50 2d 48 4e 20 20 20 10 10 00 00 50 54 4c 20  TP-HN   ....PTL
> +  0020: 02 00 00 00 01 00 00 00 01 00 00 00 01 00 00 00  ................
> diff --git a/fwts-test/sbst-0001/acpidump-0002.log b/fwts-test/sbst-0001/acpidump-0002.log
> new file mode 100644
> index 0000000..0e8e274
> --- /dev/null
> +++ b/fwts-test/sbst-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                                      ....
> +
> +SBST @ 0x00000000
> +  0000: 53 42 53 54 30 00 00 00 01 c7 4c 45 4e 4f 56 4f  SBST0.....LENOVO
> +  0010: 54 50 2d 48 4e 20 20 20 10 10 00 00 50 54 4c 20  TP-HN   ....PTL
> +  0020: 02 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00  ................
> diff --git a/fwts-test/sbst-0001/sbst-0001.log b/fwts-test/sbst-0001/sbst-0001.log
> new file mode 100644
> index 0000000..ba23046
> --- /dev/null
> +++ b/fwts-test/sbst-0001/sbst-0001.log
> @@ -0,0 +1,9 @@
> +sbst            sbst: SBST Smart Battery Specification Table test.
> +sbst            ----------------------------------------------------------
> +sbst            Test 1 of 1: SBST Smart Battery Specificiation Table test.
> +sbst            PASSED: Test 1, No issues found in SBST table.
> +sbst
> +sbst            ==========================================================
> +sbst            1 passed, 0 failed, 0 warning, 0 aborted, 0 skipped, 0
> +sbst            info only.
> +sbst            ==========================================================
> diff --git a/fwts-test/sbst-0001/sbst-0002.log b/fwts-test/sbst-0001/sbst-0002.log
> new file mode 100644
> index 0000000..91a3bef
> --- /dev/null
> +++ b/fwts-test/sbst-0001/sbst-0002.log
> @@ -0,0 +1,13 @@
> +sbst            sbst: SBST Smart Battery Specification Table test.
> +sbst            ----------------------------------------------------------
> +sbst            Test 1 of 1: SBST Smart Battery Specificiation Table test.
> +sbst            FAILED [MEDIUM] SBSTEnergeyLevel2: Test 1, SBST Low Energy
> +sbst            Energy Level (1) is greater than the Warning Energy Level
> +sbst            (0).
> +sbst            FAILED [MEDIUM] SBSTEnergyLevelZero: Test 1, SBST Warning
> +sbst            Energy Level is zero, which is probably too low.
> +sbst
> +sbst            ==========================================================
> +sbst            0 passed, 2 failed, 0 warning, 0 aborted, 0 skipped, 0
> +sbst            info only.
> +sbst            ==========================================================
> diff --git a/fwts-test/sbst-0001/test-0001.sh b/fwts-test/sbst-0001/test-0001.sh
> new file mode 100755
> index 0000000..40cb49e
> --- /dev/null
> +++ b/fwts-test/sbst-0001/test-0001.sh
> @@ -0,0 +1,17 @@
> +#!/bin/bash
> +#
> +TEST="Test apcitables against SBST"
> +NAME=test-0001.sh
> +TMPLOG=$TMP/sbst.log.$$
> +
> +$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/sbst-0001/acpidump-0001.log sbst - | cut -c7- | grep "^sbst" > $TMPLOG
> +diff $TMPLOG $FWTSTESTDIR/sbst-0001/sbst-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/sbst-0001/test-0002.sh b/fwts-test/sbst-0001/test-0002.sh
> new file mode 100755
> index 0000000..3ac3020
> --- /dev/null
> +++ b/fwts-test/sbst-0001/test-0002.sh
> @@ -0,0 +1,17 @@
> +#!/bin/bash
> +#
> +TEST="Test apcitables against invalid SBST"
> +NAME=test-0001.sh
> +TMPLOG=$TMP/sbst.log.$$
> +
> +$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/sbst-0001/acpidump-0002.log sbst - | cut -c7- | grep "^sbst" > $TMPLOG
> +diff $TMPLOG $FWTSTESTDIR/sbst-0001/sbst-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