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

Petr Uzel petr.uzel at suse.cz
Wed Jun 10 12:06:47 UTC 2009


On Mon, Jun 01, 2009 at 06:17:31PM +0200, Jim Meyering wrote:
> 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)
> >
> 
> 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.

With the following patch the test runs fine. However, I still have no
idea why it behaves differently on my system (see my previous mail).

> 
> 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
>        '
> 
> _______________________________________________
> parted-devel mailing list
> parted-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/parted-devel

-- 
Best regards / s pozdravem

Petr Uzel, Packages maintainer
---------------------------------------------------------------------
SUSE LINUX, s.r.o.                          e-mail: puzel at suse.cz
Lihovarská 1060/12                          http://www.suse.cz
190 00 Prague 9                             
Czech Republic                              



More information about the parted-devel mailing list