diff options
author | 2023-10-10 14:33:42 +0000 | |
---|---|---|
committer | 2023-10-10 14:33:42 +0000 | |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/skiboot/external/ffspart/test/tests/18-eraseblock-gt-first-partition | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/skiboot/external/ffspart/test/tests/18-eraseblock-gt-first-partition')
-rw-r--r-- | roms/skiboot/external/ffspart/test/tests/18-eraseblock-gt-first-partition | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/roms/skiboot/external/ffspart/test/tests/18-eraseblock-gt-first-partition b/roms/skiboot/external/ffspart/test/tests/18-eraseblock-gt-first-partition new file mode 100644 index 000000000..662665172 --- /dev/null +++ b/roms/skiboot/external/ffspart/test/tests/18-eraseblock-gt-first-partition @@ -0,0 +1,45 @@ +#! /bin/sh + +EXPECTED="ID=01 FIRST 0x00000400..0x00000500 (actual=0x00000100) [----------]" +FFSIMG=$DATA_DIR/$CUR_TEST.gen + +command -v pflash > /dev/null || echo "skipping test: pflash required but not found in PATH" && exit 0 + + +# https://github.com/open-power/skiboot/issues/205 +touch $FFSIMG + +# Use a block size that works with the existing codebase +run_binary "./ffspart" "-s 0x100 -c 10 -i $DATA_DIR/$CUR_TEST.in -p $FFSIMG" +if [ "$?" -ne 0 ] ; then + fail_test +fi + +CONTENTS=$(pflash -i -F $FFSIMG | grep FIRST) + +if [ "$CONTENTS" != "$EXPECTED" ]; then + echo "Actual: $CONTENTS" + echo "Expected: $EXPECTED" + fail_test +fi + +# Use a block size that fails with the existing codebase. This test is expected +# to fail; change it to expect pass when the issue is fixed. +# https://github.com/open-power/skiboot/issues/202 +run_binary "./ffspart" "-s 0x1000 -c 10 -i $DATA_DIR/$CUR_TEST.in -p $FFSIMG" +if [ "$?" -ne 0 ] ; then + fail_test +fi + +CONTENTS=$(pflash -i -F $FFSIMG | grep FIRST) + +if [ "$CONTENTS" != "$EXPECTED" ]; then + echo "This case should be marked as fail but ffspart has bugs" + echo "https://github.com/open-power/skiboot/issues/202" + echo "Actual: $CONTENTS" + echo "Expected: $EXPECTED" + pass_test +fi + + +pass_test |