[parted-devel] t7000-scripting.sh test fails

Jim Meyering jim at meyering.net
Mon Jun 1 16:17:31 UTC 2009


Petr Uzel wrote:
> t7000-scripting.sh test from current master fails:
>
> ~> ./t7000-scripting.sh
> *   ok 1: Create the test file
> *   ok 2: Test the scripting mode of mkpart
> *   ok 3: Compare the real error and the expected one
> *   ok 4: Create the test file
> *   ok 5: Test the interactive mode of mkpart
> *   ok 6: normalize the actual output
> * FAIL 7: Compare the real error and the expected one
>         compare out errI
> *   ok 8: Create the test file
> *   ok 9: Test the scripting mode of mkpartfs
> *   ok 10: Compare the real error and the expected one
> *   ok 11: Create the test file
> *   ok 12: Test the interactive mode of mkpartfs
> *   ok 13: normalize the actual output
> * FAIL 14: Compare the real error and the expected one
>         compare out errI
> * failed 2 among 14 test(s)
>
>
> Following 'patch' fixes it for me:
>
> ------------------------
> --- a/tests/t7000-scripting.sh
> +++ b/tests/t7000-scripting.sh
> @@ -28,7 +28,7 @@ EOF
>
>  { emit_superuser_warning
>    sed s/Error/Warning/ errS
> -  printf 'Is this still acceptable to you?\nYes/No?'; } >> errI || fail=1
> +  printf 'Is this still acceptable to you?\nYes/No? n\n'; } >> errI || fail=1
>
>   for mkpart in mkpart mkpartfs; do
> ------------------------
>
> Has anybody else encountered this?
>
> The same happens with 'next' branch.

Thanks for the testing and the report.

I cannot reproduce that.
However, I recall similar problems when building without readline
support.  With what options did you configure?

There is a test at the top of that script to ensure it is
skipped if parted is built without readline support.
In particular, what curses library are you using?
I.e., what shared libraries does ldd report your version of parted
is using?

In any case, here's a patch that should help you get past that.
Your answer to the above might help me fill in the "???" blank
in the patch below:

BTW, your patch would make the test fail for me.

diff --git a/tests/t7000-scripting.sh b/tests/t7000-scripting.sh
index 71251bc..f104146 100755
--- a/tests/t7000-scripting.sh
+++ b/tests/t7000-scripting.sh
@@ -20,7 +20,6 @@ test_description='Make sure the scripting option works (-s) properly.'
 : ${srcdir=.}
 . $srcdir/test-lib.sh

-config_h=$abs_top_srcdir
 grep '^#define HAVE_LIBREADLINE 1' $CONFIG_HEADER > /dev/null ||
   {
     say "skipping $0: configured without readline support"
@@ -38,7 +37,7 @@ normalize_part_diag_ errS || fail=1

 { emit_superuser_warning
   sed s/Error/Warning/ errS
-  printf 'Is this still acceptable to you?\nYes/No?'; } >> errI || fail=1
+  printf 'Is this still acceptable to you?\nYes/No?\n'; } >> errI || fail=1

 for mkpart in mkpart mkpartfs; do

@@ -72,10 +71,14 @@ for mkpart in mkpart mkpartfs; do
       "mklabel gpt '$mkpart' primary ext3 1s -1s" > out
       '
   # We have to format the output before comparing.
+  # The contortions are to handle slightly different output
+  # when parted is built ???
   test_expect_success \
       'normalize the actual output' \
       '
        sed "s,
   *
,,;s, $,," out > o2 && mv -f o2 out &&
+       sed "s, n\$,," out > o2 && mv -f o2 out &&
+       { test $(tail -1c out|wc -l) = 0 && echo >> out || :; } &&
        normalize_part_diag_ out
       '



More information about the parted-devel mailing list