From: CAI Q. <ca...@cc...> - 2009-05-08 11:49:01
|
From: rohit verma <roh...@gm...> Subject: Re: Patch for [LTP] :Unzip01 Test Not Working Correctly Date: Thu, 7 May 2009 16:40:39 +0530 > Dear Qian, > > I feel there were some formatting issues in previous patch. > > So I have attached patch for unzip with this mail. > I request you to apply this patch. > After applied the patch, I am getting the failure like this, # unzip_tests.sh $LTPROOT/testcases/commands/unzip/tst_unzip_file.zip ... unzip01 0 INFO : Test #1: unzip command un-compresses a .zip file. unzip01 1 FAIL : Test #1: unzip output differs from expected output. Details 4,5d3 < extracting: tst_unzip.dir/d.0/f.1 < extracting: tst_unzip.dir/d.0/f.0 7,9d4 < extracting: tst_unzip.dir/d.0/d.1/f.1 < extracting: tst_unzip.dir/d.0/d.1/f.0 < extracting: tst_unzip.dir/d.0/d.1/f.2 13a9,13 > extracting: tst_unzip.dir/d.0/d.1/f.1 > extracting: tst_unzip.dir/d.0/d.1/f.0 > extracting: tst_unzip.dir/d.0/d.1/f.2 > extracting: tst_unzip.dir/d.0/f.1 > extracting: tst_unzip.dir/d.0/f.0 ... It looks like the expected and original files have a different order of lines. I have added a little bit debug output here, diff -iwB "$PWD/tst_unzip.out" "$PWD/tst_unzip.out.exp" > "$PWD/tst_unzip.out.err" || RC=$? if [ $RC -ne 0 ] then echo "cat $PWD/tst_unzip.out" cat "$PWD/tst_unzip.out" echo echo "cat $PWD/tst_unzip.out.exp" cat "$PWD/tst_unzip.out.exp" tst_res TFAIL "$PWD/tst_unzip.out.err" \ "Test #1: unzip output differs from expected output. Details" else cat /home/caiqian/buffer/ltp/testcases/bin/4126.WN28Jt/tst_unzip.out Archive: /home/caiqian/buffer/ltp/testcases/commands/unzip/tst_unzip_file.zip creating: tst_unzip.dir/ creating: tst_unzip.dir/d.0/ extracting: tst_unzip.dir/d.0/f.1 extracting: tst_unzip.dir/d.0/f.0 creating: tst_unzip.dir/d.0/d.1/ extracting: tst_unzip.dir/d.0/d.1/f.1 extracting: tst_unzip.dir/d.0/d.1/f.0 extracting: tst_unzip.dir/d.0/d.1/f.2 creating: tst_unzip.dir/d.0/d.1/d.2/ extracting: tst_unzip.dir/d.0/d.1/d.2/f.1 extracting: tst_unzip.dir/d.0/d.1/d.2/f.0 extracting: tst_unzip.dir/d.0/d.1/d.2/f.2 extracting: tst_unzip.dir/d.0/f.2 cat /home/caiqian/buffer/ltp/testcases/bin/4126.WN28Jt/tst_unzip.out.exp Archive: /home/caiqian/buffer/ltp/testcases/commands/unzip/tst_unzip_file.zip creating: tst_unzip.dir/ creating: tst_unzip.dir/d.0/ creating: tst_unzip.dir/d.0/d.1/ creating: tst_unzip.dir/d.0/d.1/d.2/ extracting: tst_unzip.dir/d.0/d.1/d.2/f.1 extracting: tst_unzip.dir/d.0/d.1/d.2/f.0 extracting: tst_unzip.dir/d.0/d.1/d.2/f.2 extracting: tst_unzip.dir/d.0/d.1/f.1 extracting: tst_unzip.dir/d.0/d.1/f.0 extracting: tst_unzip.dir/d.0/d.1/f.2 extracting: tst_unzip.dir/d.0/f.1 extracting: tst_unzip.dir/d.0/f.0 extracting: tst_unzip.dir/d.0/f.2 I am not sure if you can predict the order of those lines in the actual output. It probably make more sense to sort those lines, and ignore leading spaces/tabs for both files before comparison. Please make the attachment as a text rather than octex-stream in your mail client in the future, so it is easier for review. CAI Qian > > Regards, > Rohit > > On Thu, May 7, 2009 at 12:22 PM, CAI Qian <ca...@cc...> wrote: >> >> >> >> --- On Wed, 5/6/09, rohit verma <roh...@gm...> wrote: >> >>> From: rohit verma <roh...@gm...> >>> Subject: Re: Patch for [LTP] :Unzip01 Test Not Working Correctly >>> To: "CAI Qian" <ca...@cc...> >>> Cc: ltp...@li... >>> Date: Wednesday, May 6, 2009, 12:56 PM >>> Hi, >>> >>> Patch for unzip01 is as follows. I have checked the >>> same at on FC10. >>> It is working fine. Please check and let me know if >>> any issues. >>> >>> diff -ruxB >>> ltp-full-20090430_original/testcases/commands/unzip/unzip_tests.sh >>> ltp-full-20090430/testcases/commands/unzip/unzip_tests.sh >>> --- >>> ltp-full-20090430_original/testcases/commands/unzip/unzip_tests.sh >>> 2009-02-26 18:40:54.000000000 +0530 >>> >>> +++ >>> ltp-full-20090430/testcases/commands/unzip/unzip_tests.sh >>> 2009-05-06 14:58:46.000000000 +0530 >>> @@ -44,7 +44,7 @@ >>> chk_ifexists() >>> { >>> RC=0 >>> - which $2 > >>> "$LTPTMP/tst_unzip.err" || RC=$? >>> >>> + which $2 > "$PWD/tst_unzip.err" >>> || RC=$? >>> if [ $? -ne 0 ] >>> then >>> tst_brkm TBROK NULL >>> "$1: command $2 not found." >>> @@ -98,21 +98,22 @@ >>> chk_ifexists INIT awk || return >>> $RC >>> >>> # create expected output files. >>> tst_unzip.exp >>> - cat > $LTPTMP/tst_unzip.out.exp >>> <<-EOF >>> - Archive: $TMP/tst_unzip_file.zip >>> + cat > $PWD/tst_unzip.out.exp <<-EOF >>> >>> + Archive: $1 >>> creating: tst_unzip.dir/ >>> creating: tst_unzip.dir/d.0/ >>> - extracting: tst_unzip.dir/d.0/f.0 >>> - extracting: tst_unzip.dir/d.0/f.1 >>> - extracting: tst_unzip.dir/d.0/f.2 >>> creating: tst_unzip.dir/d.0/d.1/ >>> >>> - extracting: tst_unzip.dir/d.0/d.1/f.0 >>> - extracting: tst_unzip.dir/d.0/d.1/f.1 >>> - extracting: tst_unzip.dir/d.0/d.1/f.2 >>> creating: tst_unzip.dir/d.0/d.1/d.2/ >>> - extracting: tst_unzip.dir/d.0/d.1/d.2/f.0 >>> >>> extracting: tst_unzip.dir/d.0/d.1/d.2/f.1 >>> + extracting: tst_unzip.dir/d.0/d.1/d.2/f.0 >>> extracting: tst_unzip.dir/d.0/d.1/d.2/f.2 >>> + extracting: tst_unzip.dir/d.0/d.1/f.1 >>> + extracting: tst_unzip.dir/d.0/d.1/f.0 >>> >>> + extracting: tst_unzip.dir/d.0/d.1/f.2 >>> + extracting: tst_unzip.dir/d.0/f.1 >>> + extracting: tst_unzip.dir/d.0/f.0 >>> + extracting: tst_unzip.dir/d.0/f.2 >>> + >>> EOF >>> >>> >>> Regards, >>> rohit >>> >> >> I can't apply the patch on the latest CVS version. Can you re-send it? >> >> # patch -Np1 <unzip.patch >> patching file testcases/commands/unzip/unzip_tests.sh >> Hunk #1 FAILED at 44. >> Hunk #2 FAILED at 98. >> 2 out of 2 hunks FAILED -- saving rejects to file testcases/commands/unzip/unzip_tests.sh.rej >> >> ]# cat testcases/commands/unzip/unzip_tests.sh.rej >> *************** >> *** 44,50 **** >> chk_ifexists() >> { >> RC=0 >> - which $2 > "$LTPTMP/tst_unzip.err" || RC=$? >> if [ $? -ne 0 ] >> then >> tst_brkm TBROK NULL "$1: command $2 not found." >> --- 44,50 ---- >> chk_ifexists() >> { >> RC=0 >> + which $2 > "$PWD/tst_unzip.err" || RC=$? >> if [ $? -ne 0 ] >> then >> tst_brkm TBROK NULL "$1: command $2 not found." >> *************** >> *** 98,118 **** >> chk_ifexists INIT awk || return $RC >> # create expected output files. tst_unzip.exp >> - cat > $LTPTMP/tst_unzip.out.exp <<-EOF >> - Archive: $TMP/tst_unzip_file.zip >> creating: tst_unzip.dir/ >> creating: tst_unzip.dir/d.0/ >> - extracting: tst_unzip.dir/d.0/f.0 >> - extracting: tst_unzip.dir/d.0/f.1 >> - extracting: tst_unzip.dir/d.0/f.2 >> creating: tst_unzip.dir/d.0/d.1/ >> - extracting: tst_unzip.dir/d.0/d.1/f.0 >> - extracting: tst_unzip.dir/d.0/d.1/f.1 >> - extracting: tst_unzip.dir/d.0/d.1/f.2 >> creating: tst_unzip.dir/d.0/d.1/d.2/ >> - extracting: tst_unzip.dir/d.0/d.1/d.2/f.0 >> extracting: tst_unzip.dir/d.0/d.1/d.2/f.1 >> extracting: tst_unzip.dir/d.0/d.1/d.2/f.2 >> EOF >> >> >> >> --- 98,119 ---- >> chk_ifexists INIT awk || return $RC >> # create expected output files. tst_unzip.exp >> + cat > $PWD/tst_unzip.out.exp <<-EOF >> + Archive: $1 >> creating: tst_unzip.dir/ >> creating: tst_unzip.dir/d.0/ >> creating: tst_unzip.dir/d.0/d.1/ >> creating: tst_unzip.dir/d.0/d.1/d.2/ >> extracting: tst_unzip.dir/d.0/d.1/d.2/f.1 >> + extracting: tst_unzip.dir/d.0/d.1/d.2/f.0 >> extracting: tst_unzip.dir/d.0/d.1/d.2/f.2 >> + extracting: tst_unzip.dir/d.0/d.1/f.1 >> + extracting: tst_unzip.dir/d.0/d.1/f.0 >> + extracting: tst_unzip.dir/d.0/d.1/f.2 >> + extracting: tst_unzip.dir/d.0/f.1 >> + extracting: tst_unzip.dir/d.0/f.0 >> + extracting: tst_unzip.dir/d.0/f.2 >> + >> EOF >> >> CAI Qian >> >>> >>> >>> On Mon, Apr 13, 2009 at 4:54 PM, >>> CAI Qian <ca...@cc...> >>> wrote: >>> >>> From: rohit verma <roh...@gm...> >>> >>> Subject: [LTP] Reg:Unzip01 Test Not Working Correctly >>> Date: Mon, 13 Apr 2009 14:25:21 +0530 >>> >>> >>> > Hi, >>> > >>> > http://www.nabble.com/Unzip01-Test-Not-Working-Correctly-td22575152.html >>> > >>> >>> > Please confirm if the bug related to unzip01 mentioned >>> at the above URL is >>> > fixed in ltp-full-20090331release. >>> > >>> >>> Not yet. >>> >>> >>> >>> >>> > I have got the same error in 20090331-release. >>> > >>> > >>> > Regards, >>> > Rohit >>> >>> >>> >> |