Hi all, an error in ftruncate04 test is found, 
The problem I see is due to incorrect parsing 
of `df` command output:

<<<test_start>>>
tag=ftruncate04 stime=1284729392
cmdline="ftruncate04.sh"
contacts=""
analysis=exit
<<<test_output>>>
DEV:         /dev/mapper/vg_rhel6beta-lv_root
MOUNT_POINT: /dev/mapper/vg_rhel6beta-lv_root
FLAG:        rw,mand
ftruncate04    1  TPASS  :  Test passed.
mount: you must specify the filesystem type
ftruncate04.sh : ERROR : mounting /dev/mapper/vg_rhel6beta-lv_root
remount,rw,mand failed
incrementing stop
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=0 corefile=no
cutime=1 cstime=7
<<<test_end>>>

# mount | head -1
/dev/mapper/vg_rhel6beta-lv_root on / type ext4 (rw,mand)

# df .
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/vg_rhel6beta-lv_root
                       2523808   2436384         0 100% /

A patch is attached to fix this problem. After applied the patch, 
the failure gone:

<<<test_start>>>
tag=ftruncate04 stime=1284729277
cmdline="ftruncate04.sh"
contacts=""
analysis=exit
<<<test_output>>>
DEV:         /dev/mapper/vg_rhel6beta-lv_root
MOUNT_POINT: /
FLAG:        rw,mand
ftruncate04    1  TPASS  :  Test passed.
incrementing stop
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=0 corefile=no
cutime=1 cstime=9
<<<test_end>>>

# mount | head -1
/dev/mapper/vg_rhel6beta-lv_root on / type ext4 (rw)
# df -P .
Filesystem         1024-blocks      Used Available Capacity Mounted on
/dev/mapper/vg_rhel6beta-lv_root   2523808   2436380         0     100% /

So the test without the patch leaves the system in inconsistent state
(mand option is kept for the filesystem) which is bad.

Signed-off-by: Caspar Zhang <[email protected]>

--- ltp-full-20100331.old/testcases/kernel/syscalls/ftruncate/ftruncate04.sh    
2010-09-17 15:06:44.292158981 +0200
+++ ltp-full-20100331/testcases/kernel/syscalls/ftruncate/ftruncate04.sh        
2010-09-17 15:10:26.646160911 +0200
@@ -18,7 +18,7 @@
     export TST_TOTAL=1
 fi
 cd ${TMPDIR:=/tmp}
-set -- $(df . | awk '/^\// { print $1, $NF }')
+set -- $(df -P . | awk '/^\// { print $1, $NF }')
 DEV=$1; MOUNT_POINT=$2
 if [ "x$DEV" = x -o "x$MOUNT_POINT" = x ] ; then
     tst_resm TCONF "backend mountpoint for $TMPDIR does not correspond to a 
real device:"


Thanks,
Caspar

-- 
Quality Assurance Associate (Kernel) in
Red Hat Inc. (Beijing R&D Branch)

TEL: +86-10-62608150
Web: http://www.redhat.com/
--- ltp-full-20100331.old/testcases/kernel/syscalls/ftruncate/ftruncate04.sh	2010-09-17 15:06:44.292158981 +0200
+++ ltp-full-20100331/testcases/kernel/syscalls/ftruncate/ftruncate04.sh	2010-09-17 15:10:26.646160911 +0200
@@ -18,7 +18,7 @@
     export TST_TOTAL=1
 fi
 cd ${TMPDIR:=/tmp}
-set -- $(df . | awk '/^\// { print $1, $NF }')
+set -- $(df -P . | awk '/^\// { print $1, $NF }')
 DEV=$1; MOUNT_POINT=$2
 if [ "x$DEV" = x -o "x$MOUNT_POINT" = x ] ; then
     tst_resm TCONF "backend mountpoint for $TMPDIR does not correspond to a real device:"
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to