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: 0001-Modifiying-the-file_test.sh-because-of-the-failure-n.patch
Description: Binary data

------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to