feat: add -z (--strip) to remove ECC data from an iso

This commit is contained in:
Stéphane Lesimple
2021-01-30 12:18:03 +01:00
parent fd4f8424f7
commit c336d039a9
12 changed files with 165 additions and 8 deletions

View File

@@ -260,10 +260,11 @@ function run_regtest()
if test "$answer" == "a"; then
cp $REFLOG $LOGDIR
head -n 2 $LOGDIR/${CODEC_PREFIX}_${testsymbol} >$REFLOG
sed -e "s=${SED_REMOVE_ISO_DIR}==g" $NEWLOG >>$REFLOG
sed -re "s=${SED_REMOVE_ISO_DIR}==g" $NEWLOG >>$REFLOG
pass="skip"
elif test "$answer" == "v"; then
vimdiff $REFLOG $NEWLOG
continue
else
pass="false"
@@ -295,7 +296,7 @@ function run_regtest()
image_md5=$(head -n 1 $REFLOG)
ecc_md5=$(head -n 2 $REFLOG | tail -n 1)
if test ${image_md5} != "ignore"; then
if test "${image_md5}" != "ignore"; then
md5=$($MD5SUM ${testiso} | cut -d\ -f 1)
if test "$image_md5" != "$md5"; then
if [ "$REGTEST_NO_UTF8" = 1 ]; then
@@ -309,7 +310,7 @@ function run_regtest()
fi
fi
if test ${ecc_md5} != "ignore"; then
if test "${ecc_md5}" != "ignore"; then
md5=$($MD5SUM ${testecc} | cut -d\ -f 1)
if test "$ecc_md5" != "$md5"; then
if [ "$pass" = false ] || [ "$REGTEST_NO_UTF8" = 1 ]; then
@@ -340,7 +341,7 @@ function run_regtest()
[ $nbfailed -ge 256 ] && nbfailed=255
echo "test symbol for config: $testsymbol"
if test "$fail_on_bad" == "yes"; then
next=$(grep -A 1 ${CODEC_PREFIX}_$testsymbol config.txt | tail -n 1 | cut -d\ -f 1)
next=$(grep -A 1 "${CODEC_PREFIX}_$testsymbol" config.txt | tail -n 1 | cut -d\ -f 1)
echo "FAIL_ON_BAD set to yes -- exiting"
if test "$gui_mode" == "true"; then
guiarg="gui"

View File

@@ -170,6 +170,11 @@ RS01_adaptive_medium_with_dsm yes
### RS02 tests
# Strip tests
RS02_strip_ecc yes
RS02_strip_ecc_not yes
# Verify tests
RS02_good yes
RS02_good_quick yes
@@ -335,6 +340,11 @@ RS02_adaptive_with_wrong_rs03_file yes
### RS03 augmented image tests
# Strip tests
RS03i_strip_ecc yes
RS03i_strip_ecc_not yes
# Verify tests
RS03i_good yes

View File

@@ -440,15 +440,16 @@ fi
# Read image with wrong ecc file and create new (other) ecc in the same program call.
# Tests whether CRC and ECC information is taken from the read process,
# not the wrong ecc file.
# FIXME expected output not in database, disabling for now:
if try "read image with wrong ecc (RS01) and create new ecc" ecc_recreate_after_read_wrong_rs01; then
if false && try "read image with wrong ecc (RS01) and create new ecc" ecc_recreate_after_read_wrong_rs01; then
cp $MASTERISO $SIMISO
$NEWVER --debug -i$TMPISO --random-image $((ISOSIZE-777)) --random-seed 1337 >>$LOGFILE 2>&1
$NEWVER --regtest --debug --set-version $SETVERSION -i$TMPISO -e$TMPECC -c -n 8 >>$LOGFILE 2>&1
extra_args="--debug --set-version $SETVERSION --sim-cd=$SIMISO --fixed-speed-values"
#run_regtest ecc_recreate_after_read_wrong_rs01 "-r -c $REDUNDANCY --spinup-delay=0 -v" $TMPISO $TMPECC
run_regtest ecc_recreate_after_read_wrong_rs01 "-r -c $REDUNDANCY --spinup-delay=0 -v" $TMPISO $TMPECC
fi
REGTEST_SECTION="Fixing tests"

View File

@@ -39,6 +39,27 @@ if ! file_exists $ISO_PLUS137; then
FILE_MSG=""
fi
### Strip tests
REGTEST_SECTION="Strip tests"
# Strip ECC from an augmented image
if try "strip ECC from augmented image" strip_ecc; then
cp $MASTERISO $TMPISO
run_regtest strip_ecc "-v --strip" $TMPISO
fi
# Strip ECC from a non-augmented image
if try "strip ECC from a non-augmented image" strip_ecc_not; then
cp $MASTERISO $TMPISO
$NEWVER -i$TMPISO --strip >>$LOGFILE 2>&1
run_regtest strip_ecc_not "-v --strip" $TMPISO
fi
### Verification tests
REGTEST_SECTION="Verify tests"

View File

@@ -36,6 +36,27 @@ if ! file_exists $LARGEMASTERISO; then
FILE_MSG=""
fi
### Strip tests
REGTEST_SECTION="Strip tests"
# Strip ECC from an augmented image
if try "strip ECC from augmented image" strip_ecc; then
cp $MASTERISO $TMPISO
run_regtest strip_ecc "-v --strip" $TMPISO
fi
# Strip ECC from a non-augmented image
if try "strip ECC from a non-augmented image" strip_ecc_not; then
cp $MASTERISO $TMPISO
$NEWVER -i$TMPISO --strip >>$LOGFILE 2>&1
run_regtest strip_ecc_not "-v --strip" $TMPISO
fi
### Verification tests
REGTEST_SECTION="Verify tests"