aboutsummaryrefslogtreecommitdiff
path: root/libflash
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 /libflash
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 'libflash')
-rw-r--r--libflash/test/Makefile.check7
-rw-r--r--libflash/test/test-miscprint.pnorbin3072 -> 0 bytes
-rwxr-xr-xlibflash/test/test-miscprint.sh27
3 files changed, 2 insertions, 32 deletions
diff --git a/libflash/test/Makefile.check b/libflash/test/Makefile.check
index 344cad0..1f92b9d 100644
--- a/libflash/test/Makefile.check
+++ b/libflash/test/Makefile.check
@@ -4,8 +4,8 @@ LIBFLASH_TEST := libflash/test/test-flash libflash/test/test-ecc libflash/test/t
LCOV_EXCLUDE += $(LIBFLASH_TEST:%=%.c)
.PHONY : libflash-check libc-coverage
-libflash-check: $(LIBFLASH_TEST:%=%-check) libflash/test/test-miscprint $(CORE_TEST:%=%-gcov-run)
-libflash-coverage: $(LIBFLASH_TEST:%=%-gcov-run) libflash/test/test-miscprint
+libflash-check: $(LIBFLASH_TEST:%=%-check) $(CORE_TEST:%=%-gcov-run)
+libflash-coverage: $(LIBFLASH_TEST:%=%-gcov-run)
check: libflash-check libc-coverage
coverage: libflash-coverage
@@ -16,9 +16,6 @@ $(LIBFLASH_TEST:%=%-gcov-run) : %-run: %
$(LIBFLASH_TEST:%=%-check) : %-check: %
$(call QTEST, RUN-TEST ,$(VALGRIND) $<, $<)
-libflash/test/test-miscprint: pflash
- $(call Q, RUN-TEST , ./libflash/test/test-miscprint.sh, $@)
-
libflash/test/stubs.o: libflash/test/stubs.c
$(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) -g -c -o $@ $<, $<)
diff --git a/libflash/test/test-miscprint.pnor b/libflash/test/test-miscprint.pnor
deleted file mode 100644
index 8a84eba..0000000
--- a/libflash/test/test-miscprint.pnor
+++ /dev/null
Binary files differ
diff --git a/libflash/test/test-miscprint.sh b/libflash/test/test-miscprint.sh
deleted file mode 100755
index b84a6cf..0000000
--- a/libflash/test/test-miscprint.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-
-# test-miscprint.pnor is constructed as follows:
-# PRESERVED,0x00000300,0x00000100,P,/dev/zero
-# READONLY,0x00000400,0x00000100,R,/dev/zero
-# REPROVISION,0x00000500,0x00000100,F,/dev/zero
-# BACKUP,0x00000600,0x00000100,B,/dev/zero
-
-wd="libflash/test"
-pflash="./external/pflash/pflash"
-
-pnor="$wd/test-miscprint.pnor"
-
-output1=$(${pflash} --detail=1 -F "$pnor" | grep "\[P\]")
-output2=$(${pflash} --detail=2 -F "$pnor" | grep "\[R\]")
-output3=$(${pflash} --detail=3 -F "$pnor" | grep "\[F\]")
-output4=$(${pflash} --detail=4 -F "$pnor" | grep "\[B\]")
-
-if [[ $output1 == "PRESERVED [P]" && $output2 == "READONLY [R]" &&
- $output3 == "REPROVISION [F]" && $output4 == "BACKUP [B]" ]]; then
- echo "Test passed!"
- exit 0;
-else
- echo "Test failed!"
- exit 1;
-fi
-