aboutsummaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorCyril Bur <cyril.bur@au1.ibm.com>2017-07-28 16:46:37 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-08-01 13:58:07 +1000
commit1f2f67aa78fa1e4f9ce7b2e5a4e9fe29760e5b72 (patch)
tree11e2dc30a8d797d47d205fb5fa86ea394dc1c919 /external
parent8ce2d051af1e3db42bdde3647c29631810d62c5a (diff)
downloadskiboot-1f2f67aa78fa1e4f9ce7b2e5a4e9fe29760e5b72.zip
skiboot-1f2f67aa78fa1e4f9ce7b2e5a4e9fe29760e5b72.tar.gz
skiboot-1f2f67aa78fa1e4f9ce7b2e5a4e9fe29760e5b72.tar.bz2
external/pflash: tests: Move the test-miscprint to pflash tests
New code that is very much pflash functionality was added in commit f2c87a3d2f6 "pflash option to retrieve PNOR partition flags". Unfortunately at the time there wasn't an easy way to test pflash. The previous patch adds pflash infrastructure and plumbs it into `make check` nicely. This commit converts the tests originally added to libflash tests. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'external')
-rw-r--r--external/pflash/test/files/06-miscprint.ffs4
-rw-r--r--external/pflash/test/results/06-miscprint.err0
-rw-r--r--external/pflash/test/results/06-miscprint.out36
-rw-r--r--external/pflash/test/tests/06-miscprint37
4 files changed, 77 insertions, 0 deletions
diff --git a/external/pflash/test/files/06-miscprint.ffs b/external/pflash/test/files/06-miscprint.ffs
new file mode 100644
index 0000000..8f916f3
--- /dev/null
+++ b/external/pflash/test/files/06-miscprint.ffs
@@ -0,0 +1,4 @@
+PRESERVED,0x00300,0x100,P,/dev/zero
+READONLY,0x000400,0x100,R,/dev/zero
+REPROVISION,0x500,0x100,F,/dev/zero
+BACKUP,0x00000600,0x100,B,/dev/zero
diff --git a/external/pflash/test/results/06-miscprint.err b/external/pflash/test/results/06-miscprint.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/external/pflash/test/results/06-miscprint.err
diff --git a/external/pflash/test/results/06-miscprint.out b/external/pflash/test/results/06-miscprint.out
new file mode 100644
index 0000000..e90976d
--- /dev/null
+++ b/external/pflash/test/results/06-miscprint.out
@@ -0,0 +1,36 @@
+Detailed partition information
+Name:
+PRESERVED (ID=01)
+
+Start End Actual
+0x00000300 0x00000400 0x00000100
+
+Flags:
+PRESERVED [P]
+Detailed partition information
+Name:
+READONLY (ID=02)
+
+Start End Actual
+0x00000400 0x00000500 0x00000100
+
+Flags:
+READONLY [R]
+Detailed partition information
+Name:
+REPROVISION (ID=03)
+
+Start End Actual
+0x00000500 0x00000600 0x00000100
+
+Flags:
+REPROVISION [F]
+Detailed partition information
+Name:
+BACKUP (ID=04)
+
+Start End Actual
+0x00000600 0x00000700 0x00000100
+
+Flags:
+BACKUP [B]
diff --git a/external/pflash/test/tests/06-miscprint b/external/pflash/test/tests/06-miscprint
new file mode 100644
index 0000000..e4957a9
--- /dev/null
+++ b/external/pflash/test/tests/06-miscprint
@@ -0,0 +1,37 @@
+#! /bin/sh
+
+touch "$DATA_DIR/$CUR_TEST.pnor"
+
+# Don't record the output of ffspart
+../ffspart/ffspart -s 0x100 -c 10 -i "$DATA_DIR/$CUR_TEST.ffs" \
+ -p "$DATA_DIR/$CUR_TEST.pnor" 2>&1 >/dev/null
+if [ "$?" -ne 0 ] ; then
+ fail_test
+fi
+
+run_binary "./pflash" "--detail=1 -F $DATA_DIR/$CUR_TEST.pnor"
+if [ "$?" -ne 0 ] ; then
+ fail_test;
+fi
+run_binary "./pflash" "--detail=2 -F $DATA_DIR/$CUR_TEST.pnor"
+if [ "$?" -ne 0 ] ; then
+ fail_test;
+fi
+run_binary "./pflash" "--detail=3 -F $DATA_DIR/$CUR_TEST.pnor"
+if [ "$?" -ne 0 ] ; then
+ fail_test;
+fi
+run_binary "./pflash" "--detail=4 -F $DATA_DIR/$CUR_TEST.pnor"
+if [ "$?" -ne 0 ] ; then
+ fail_test;
+fi
+
+# The test infrastructure will clean up but lets no chew unnecessarily
+# though disk space
+rm "$DATA_DIR/$CUR_TEST.pnor"
+
+strip_version_from_result "pflash"
+
+diff_with_result
+
+pass_test