*Hi All,*

I have faced a problem while running unzip test case on my ARM board.
I am using* ltp-full-20130904 release.*
As i observed the unzip test case is failing due to mismatch in the verbose
message.
test case expects "extracting" but on my board the unzip binary shows
"inflating"
So  this is a patch for* unzip_file.zip.*This checks the created directory
structure rather than verbose message.

This is my first patch. So please regret for any wrong formatting of make
the patch review. :)
*I will eagerly wait for your valuable reply ASAP. Please find the patch
below.*
*
*
Change-Id: I6add048bfe03bca1f466ab843e010d833ecf1a46
Signed-off-by: siva padhy <[email protected]>
---
 testcases/commands/unzip/unzip_tests.sh |   74
++++++++++++++++---------------
 1 file changed, 39 insertions(+), 35 deletions(-)

diff --git a/testcases/commands/unzip/unzip_tests.sh
b/testcases/commands/unzip/unzip_tests.sh
index 9a7a7b5..b245c66 100755
--- a/testcases/commands/unzip/unzip_tests.sh
+++ b/testcases/commands/unzip/unzip_tests.sh
@@ -96,23 +96,29 @@ init()
        chk_ifexists INIT unzip     || return $RC
        chk_ifexists INIT mkdir     || return $RC
        chk_ifexists INIT awk       || return $RC
+       chk_ifexists INIT ls        || return $RC

-       # create expected output files. tst_unzip.exp
+       # create expected directory tree. tst_unzip.out.exp
        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.2
+       $PWD/tst_unzip.dir/:
+       d.0
+
+       $PWD/tst_unzip.dir/d.0:
+       d.1
+       f.0
+       f.1
+       f.2
+
+       $PWD/tst_unzip.dir/d.0/d.1:
+       d.2
+       f.0
+       f.1
+       f.2
+
+       $PWD/tst_unzip.dir/d.0/d.1/d.2:
+       f.0
+       f.1
+       f.2
        EOF

        return $RC
@@ -140,39 +146,37 @@ test01()

        tst_resm TINFO "Test #1: unzip command un-compresses a .zip file."

-       unzip "${zipfile}" > "$PWD/tst_unzip.out" || RC=$?
+       unzip "${zipfile}" || RC=$?
        if [ $RC -ne 0 ]
        then
                tst_res TFAIL "$PWD/tst_unzip.out" \
                        "Test #1: unzip command failed. Return value = $RC.
Details:"
                return $RC
        else
-               sort -o "$PWD/tst_unzip.out" "$PWD/tst_unzip.out"
-               sort -o "$PWD/tst_unzip.out.exp" "$PWD/tst_unzip.out.exp"
-
-               diff -iwB "$PWD/tst_unzip.out" "$PWD/tst_unzip.out.exp" >\
-                         "$PWD/tst_unzip.out.err" || RC=$?
-
-               if [ $RC -ne 0 ]
+               tst_resm TINFO "Test #1: check if \"$PWD/tst_unzip.dir\"
exits."
+               if ! [ -d $PWD/tst_unzip.dir ]
                then
-                       tst_res TFAIL "$PWD/tst_unzip.out.err" \
-                               "Test #1: unzip output differs from
expected output. Details"
+                       tst_resm TFAIL  "Test #1: unzip did not uncompress
the .zip file"
+                       $((RC+1))
                else
-                       tst_resm TINFO "Test #1: check if
\"$PWD/tst_unzip.dir\" exits."
-                       if ! [ -d $PWD/tst_unzip.dir ]
+                       ls -R $PWD/tst_unzip.dir/ > "$PWD/tst_unzip.out" ||
RC=$?
+                       if [ $RC -ne 0 ]
                        then
-                               tst_resm TFAIL \
-                                       "Test #1: unzip did not uncompress
the .zip file"
-                               $((RC+1))
+                               tst_res TFAIL "Test #1: ls command failed"
+                               return $RC
                        else
-                               tst_resm TINFO \
-                                       "Test #1: \"$PWD/tst_unzip.dir\"
was created by unzip"
-                               tst_resm TPASS \
-                                  "Test #1: unzip can uncompress .zip file
correctly."
+                               diff -iwB "$PWD/tst_unzip.out"
"$PWD/tst_unzip.out.exp" > "$PWD/tst_unzip.out.err" || RC=$?
+                               if [ $RC -ne 0 ]
+                               then
+                                       tst_res TFAIL
"$PWD/tst_unzip.out.err" \
+                                               "Test #1: unzip output
differs from expected output. Details"
+                               else
+                                       tst_resm TINFO "Test #1:
\"$PWD/tst_unzip.dir\" was created by unzip"
+                                       tst_resm TPASS "Test #1: unzip can
uncompress .zip file correctly."
+                               fi
                        fi
                fi
        fi
-
        return $RC
 }


Regards,
Siva Sankar Padhy
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to