From d006fc0dadea510aaed48a7abe02857e3a06fe57 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 28 Jun 2011 07:12:35 +0000 Subject: [PATCH] Option -fail for test_hardlinks to simulate failure, moved tmp to releng/tmp --- libisoburn/trunk/releng/test_hardlinks | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/libisoburn/trunk/releng/test_hardlinks b/libisoburn/trunk/releng/test_hardlinks index 8c8b584d..22a30f4e 100755 --- a/libisoburn/trunk/releng/test_hardlinks +++ b/libisoburn/trunk/releng/test_hardlinks @@ -14,6 +14,7 @@ export in_iso="" export copy_on_disk="$workdir"/xorriso_hardlinks_copy_dir export keep=0 export failure=0 +export simulate_failure=0 export next_is_xorriso=0 export next_is_rc=0 export bad=0 @@ -106,8 +107,11 @@ do elif test x"$i" = x"-v" then report_about="-report_about ALL" + elif test x"$i" = x"-fail" + then + simulate_failure=1 else - echo "Usage: $0 [-rc FILE] [-keep] [-cleanup] [-xorriso PATH] [-v]" >&2 + echo "Usage: $0 [-rc FILE] [-keep] [-cleanup] [-fail] [-xorriso PATH] [-v]" >&2 exit 2 fi done @@ -191,8 +195,14 @@ echo "=== Copying from image to temporary disk tree" >&2 -extract "$in_iso" "$copy_on_disk" -## For testing the test: Let it fail deliberately -# rm "$copy_on_disk"/file_1_link_b +if test "$simulate_failure" = 1 +then + echo "===" >&2 + echo "=== SIMULATING FAILURE BY REMOVING AN EXTRACTED FILE" >&2 + echo "===" >&2 + echo "FAIL : $prog : Simulated failure caused by option -fail" + rm "$copy_on_disk"/file_1_link_b +fi echo "=== Comparing original disk tree and temporary one" >&2 @@ -230,6 +240,7 @@ echo if test "$failure" = 1 then echo "======== $prog :" 'FAILED' + echo exit 1 else echo "======== $prog :" "Passed"