All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] Found a bug in the file_test.sh
@ 2012-06-15 10:06 sujith h
  2012-06-15 12:07 ` chrubis
  0 siblings, 1 reply; 3+ messages in thread
From: sujith h @ 2012-06-15 10:06 UTC (permalink / raw)
  To: ltp-list


[-- Attachment #1.1: Type: text/plain, Size: 9156 bytes --]

Hi,

I was testing the file command test case and noticed a small issue in the
file_test.sh script.
The below mentioned is the output of the script executed:

root@freescale-qsb:/opt/ltp# ./runltp -p -l file.log -f
/opt/ltp/runtest/mycustomtest
INFO: creating /opt/ltp/results directory
If some fields are empty or look unusual you may have an old version.
Compare to the current minimal requirements in Documentation/Changes.

MontaVista Automotive Technology Platform 1.1, (.dev-snapshot-20120604)
Linux freescale-qsb 2.6.38.8.mvatp-fsl-imx53 #1 PREEMPT Wed Jun 6 00:55:46
PDT 2012 armv7l GNU/Linux

Gnu C                  arm-montavista-linux-gnueabi-gcc (MontaVista Linux
Sourcery G++ 4.4-312) 4.4.1
Gnu make               3.81
util-linux             ng 2.17)
mount                  ng 2.17 (with libblkid support)
modutils               3.4
/opt/ltp/ver_linux: line 52: ldd: not found
awk: cmd. line:1: (FILENAME=- FNR=1) fatal: attempt to access field -1
/opt/ltp/ver_linux: line 55: ldd: not found
Procps                 3.2.8
iproute2              iproute2-ss100224
Kbd                    70:
Sh-utils               8.5
Modules Loaded         ipv6 evbug exportfs nfsd

free reports:
             total       used       free     shared    buffers     cached
Mem:        870808      47296     823512          0         44      23200
-/+ buffers/cache:      24052     846756
Swap:            0          0          0

/proc/cpuinfo
Processor       : ARMv7 Processor rev 5 (v7l)
BogoMIPS        : 999.42
Features        : swp half thumb fastmult vfp edsp neon vfpv3
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x2
CPU part        : 0xc08
CPU revision    : 5

Hardware        : Freescale MX53 LOCO Board
Revision        : 53021
Serial          : 0000000000000000
remove test cases which require the block device.
You can specify it with option -b
COMMAND:    /opt/ltp/bin/ltp-pan  -e -S   -a 3153     -n 3153  -p  -f
/tmp/ltp-wHY6LgV3Pc/alltests -l /opt/ltp/results/file.log  -C
/opt/ltp/output/LTP_RUN_ON-file.log.failed
LOG File: /opt/ltp/results/file.log
FAILED COMMAND File: /opt/ltp/output/LTP_RUN_ON-file.log.failed
Running tests.......
<<<test_start>>>
tag=file stime=1204614
cmdline="export TCdat=$LTPROOT/testcases/bin; file_test.sh"
contacts=""
analysis=exit
<<<test_output>>>
incrementing stop
file01      0  TINFO  :  TEST #1: file command recogizes ASCII text files
file01      1  TPASS  :  file: Recognised ASCII file correctly
file02      0  TINFO  :  TEST #2: file command recognizes bash shell scripts
file02      2  TPASS  :  file: Recognised bash shell script correctly
file03      0  TINFO  :  TEST #3: file command recognizes korn shell scripts
file03      3  TPASS  :  file: recognised korn shell script
file04      0  TINFO  :  TEST #4: file command recognizes C shell scripts
file04      4  TPASS  :  file: Recognised C shell script correctly
file05      0  TINFO  :  TEST #5: file command recognizes C programs text
file05      5  TPASS  :  file: Recognised C program text correctly
file06      0  TINFO  :  TEST #6: file command recognizes ELF executables
file06      6  TPASS  :  file: Recognized ELF binary executable
file07      0  TINFO  :  TEST #7: file command recognizes tar files.
file07      7  TPASS  :  file: Recognised tar files
file08      0  TINFO  :  TEST #8: file command recognizes tar zip files
file08      8  TBROK  :  expected string: gzip compressed data, deflated,
original filename, `files.tar'
file08      9  TBROK  :  Remaining cases broken
file08      8  TFAIL  :  file: Failed to Recognize tar zip. Reason:
/tmp/files.tar.gz: cannot open `/tmp/files.tar.gz' (No such file or
directory)
file09      0  TINFO  :  TEST #9: file command recognizes RPM files
file09      9  TCONF  :  rpm not installed
file10      0  TINFO  :  TEST #10: file command recognizes vmlinu file
file10     10  TPASS  :  file: Recognised vmlinu file correctly
<<<execution_status>>>
initiation_status="ok"
duration=6 termination_type=exited termination_id=1 corefile=no
cutime=31 cstime=25
<<<test_end>>>
INFO: ltp-pan reported some tests FAIL
LTP Version: 20120401

       ###############################################################

            Done executing testcases.
            LTP Version:  20120401
       ###############################################################


Here we can see that the script couldn't find the files.tar.gz file and
exited. The problem I noticed in the script was, when the script executes
the gzip command on the files.tar, the files.tar.gz file is created in the
$PWD and hence it has to be moved to the $LTPTMP directory. After doing
this change the output of the script was mentioned below:

root@freescale-qsb:/opt# /opt/ltp/runltp -p -l file.log -f
/opt/ltp/runtest/mycustomtest
INFO: creating /opt/ltp/results directory
If some fields are empty or look unusual you may have an old version.
Compare to the current minimal requirements in Documentation/Changes.

MontaVista Automotive Technology Platform 1.1, (.dev-snapshot-20120604)
Linux freescale-qsb 2.6.38.8.mvatp-fsl-imx53 #1 PREEMPT Wed Jun 6 00:55:46
PDT 2012 armv7l GNU/Linux

Gnu C                  arm-montavista-linux-gnueabi-gcc (MontaVista Linux
Sourcery G++ 4.4-312) 4.4.1
Gnu make               3.81
util-linux             ng 2.17)
mount                  ng 2.17 (with libblkid support)
modutils               3.4
/opt/ltp/ver_linux: line 52: ldd: not found
awk: cmd. line:1: (FILENAME=- FNR=1) fatal: attempt to access field -1
/opt/ltp/ver_linux: line 55: ldd: not found
Procps                 3.2.8
iproute2              iproute2-ss100224
Kbd                    70:
Sh-utils               8.5
Modules Loaded         ipv6 evbug exportfs nfsd

free reports:
             total       used       free     shared    buffers     cached
Mem:        870808      64280     806528          0         44      38204
-/+ buffers/cache:      26032     844776
Swap:            0          0          0

/proc/cpuinfo
Processor       : ARMv7 Processor rev 5 (v7l)
BogoMIPS        : 999.42
Features        : swp half thumb fastmult vfp edsp neon vfpv3
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x2
CPU part        : 0xc08
CPU revision    : 5

Hardware        : Freescale MX53 LOCO Board
Revision        : 53021
Serial          : 0000000000000000
remove test cases which require the block device.
You can specify it with option -b
COMMAND:    /opt/ltp/bin/ltp-pan  -e -S   -a 8100     -n 8100  -p  -f
/tmp/ltp-hkmNZkJsaD/alltests -l /opt/ltp/results/file.log  -C
/opt/ltp/output/LTP_RUN_ON-file.log.failed
LOG File: /opt/ltp/results/file.log
FAILED COMMAND File: /opt/ltp/output/LTP_RUN_ON-file.log.failed
Running tests.......
<<<test_start>>>
tag=file stime=1210390
cmdline="export TCdat=$LTPROOT/testcases/bin; file_test.sh"
contacts=""
analysis=exit
<<<test_output>>>
incrementing stop
file01      0  TINFO  :  TEST #1: file command recogizes ASCII text files
file01      1  TPASS  :  file: Recognised ASCII file correctly
file02      0  TINFO  :  TEST #2: file command recognizes bash shell scripts
file02      2  TPASS  :  file: Recognised bash shell script correctly
file03      0  TINFO  :  TEST #3: file command recognizes korn shell scripts
file03      3  TPASS  :  file: recognised korn shell script
file04      0  TINFO  :  TEST #4: file command recognizes C shell scripts
file04      4  TPASS  :  file: Recognised C shell script correctly
file05      0  TINFO  :  TEST #5: file command recognizes C programs text
file05      5  TPASS  :  file: Recognised C program text correctly
file06      0  TINFO  :  TEST #6: file command recognizes ELF executables
file06      6  TPASS  :  file: Recognized ELF binary executable
file07      0  TINFO  :  TEST #7: file command recognizes tar files.
file07      7  TPASS  :  file: Recognised tar files
file08      0  TINFO  :  TEST #8: file command recognizes tar zip files
file08      8  TPASS  :  file: Recognised tar zip file
file09      0  TINFO  :  TEST #9: file command recognizes RPM files
file09      9  TCONF  :  rpm not installed
file10      0  TINFO  :  TEST #10: file command recognizes vmlinu file
file10     10  TPASS  :  file: Recognised vmlinu file correctly
<<<execution_status>>>
initiation_status="ok"
duration=4 termination_type=exited termination_id=0 corefile=no
cutime=32 cstime=9
<<<test_end>>>
INFO: ltp-pan reported all tests PASS
LTP Version: 20120401

       ###############################################################

            Done executing testcases.
            LTP Version:  20120401
       ###############################################################


Hence I am attaching the patch along with this mail. If this is not the
mailing list to post the patch, please let me know so that I can do so.


Thanks,
Sujith H


-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #1.2: Type: text/html, Size: 12264 bytes --]

[-- Attachment #2: 0001-Modifiying-the-file_test.sh-because-of-the-failure-n.patch --]
[-- Type: application/octet-stream, Size: 970 bytes --]

From b188c9bca50822b16c2288b5a0443039e068e1bd Mon Sep 17 00:00:00 2001
From: Sujith H <sharidasan@mvista.com>
Date: Fri, 15 Jun 2012 15:23:31 +0530
Subject: [PATCH] Modifiying the file_test.sh because of the failure noticed
 in the test8. gzip when executed on the $D/files.tar will
 create the files.tar.gz in the $PWD. Hence we need to move
 files.tar.gz to the $D/ directory.

---
 testcases/commands/ade/file/file_test.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/testcases/commands/ade/file/file_test.sh b/testcases/commands/ade/file/file_test.sh
index 70420e3..afe791b 100755
--- a/testcases/commands/ade/file/file_test.sh
+++ b/testcases/commands/ade/file/file_test.sh
@@ -440,7 +440,8 @@ then
     $LTPBIN/tst_brk TBROK $LTPTMP/file.out NULL \
         "file: gzip failed unexpectedly. Reason:"
 fi
-    
+
+mv $PWD/files.tar.gz $LTPTMP/    
 file $LTPTMP/files.tar.gz > $LTPTMP/file.out 2>&1
 if [ $? -eq 0 ]
 then
-- 
1.7.7.6


[-- Attachment #3: Type: text/plain, Size: 395 bytes --]

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [LTP] Found a bug in the file_test.sh
  2012-06-15 10:06 [LTP] Found a bug in the file_test.sh sujith h
@ 2012-06-15 12:07 ` chrubis
       [not found]   ` <CADyYWLmoLwZNe0t1L92eQV787vemJxgv9B-W2asDQYBFE3d7eA@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: chrubis @ 2012-06-15 12:07 UTC (permalink / raw)
  To: sujith h; +Cc: ltp-list

Hi!
> Here we can see that the script couldn't find the files.tar.gz file and
> exited. The problem I noticed in the script was, when the script executes
> the gzip command on the files.tar, the files.tar.gz file is created in the
> $PWD and hence it has to be moved to the $LTPTMP directory. After doing
> this change the output of the script was mentioned below:

Maybe it would be better to create the file directly in LTPTMP.

And regarding the patch. Please send one with signed-of-by, line (git
can create these for you). And change the comment a little. Usuall
format is:

First line with short description
(empty line)
Longer description composing possibly of several lines.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [LTP] Found a bug in the file_test.sh
       [not found]   ` <CADyYWLmoLwZNe0t1L92eQV787vemJxgv9B-W2asDQYBFE3d7eA@mail.gmail.com>
@ 2012-06-21 12:26     ` chrubis
  0 siblings, 0 replies; 3+ messages in thread
From: chrubis @ 2012-06-21 12:26 UTC (permalink / raw)
  To: sujith h; +Cc: ltp-list

Hi!
> I had updated the patch with the signoff and the instructions mentioned as
> above. Hope this patch now looks better.

The patch is better.

But I'm wondering what version of gzip you are using, because the GNU
variant leaves the gziped files in the original directory.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-06-21 13:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-15 10:06 [LTP] Found a bug in the file_test.sh sujith h
2012-06-15 12:07 ` chrubis
     [not found]   ` <CADyYWLmoLwZNe0t1L92eQV787vemJxgv9B-W2asDQYBFE3d7eA@mail.gmail.com>
2012-06-21 12:26     ` chrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.