Skip to contentSkip to conversation

fix incorrect parsing of df command in ftruncate04.sh

PATCH Caspar Zhang 2 participants 3 messages Sep 23, 2010 – Oct 3, 2010 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 117605613.400901285262212547.JavaMail.root@zmail04.collab.prod.int.phx2.redhat.com

#1 lore raw

Sorry for missing [PATCH] tag, now added.

Thanks,
Caspar

Quoted 91 lines · ----- "Caspar Zhang

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.

---
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
(quoted diff) +1 -1
@@ -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/

Signature · 5 lines
Quality Assurance Associate (Kernel) in
Red Hat Software (Beijing) Co., R&D Branch

TEL: +86-10-62608150
WEB: http://www.redhat.com/
testcases/kernel/syscalls/ftruncate/ftruncate04.sh +1 -1
@@ -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:"

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#2 lore raw
Quoted 91 lines · ----- "Caspar Zhang

Sorry for missing [PATCH] tag, now added.

Thanks,
Caspar

Quoted 52 lines · ----- "Caspar Zhang

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>>>

Quoted 4 lines
# mount | head -1
/dev/mapper/vg_rhel6beta-lv_root on / type ext4 (rw)
# df -P .
Filesystem         1024-blocks      Used Available Capacity Mounted

on

Quoted 4 lines

/dev/mapper/vg_rhel6beta-lv_root 2523808 2436380 0
100% /

So the test without the patch leaves the system in inconsistent

state

Quoted 6 lines

(mand option is kept for the filesystem) which is bad.

---

ltp-full-20100331.old/testcases/kernel/syscalls/ftruncate/ftruncate04.sh

Quoted 16 lines
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
testcases/kernel/syscalls/ftruncate/ftruncate04.sh +1 -1
@@ -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:"

Quoted 2 lines
Quoted 2 lines

Thanks,
Caspar

Hi, any comments on this?

Thanks,
Caspar

Signature · 15 lines
Quality Assurance Associate (Kernel) in
Red Hat Software (Beijing) Co., R&D Branch

TEL: +86-10-62608150
WEB: http://www.redhat.com/

------------------------------------------------------------------------------
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
#3 lore raw
Quoted 94 lines · Caspar Zhang
Quoted 91 lines · ----- "Caspar Zhang

Sorry for missing [PATCH] tag, now added.

Thanks,
Caspar

Quoted 52 lines · ----- "Caspar Zhang

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>>>

Quoted 4 lines
# mount | head -1
/dev/mapper/vg_rhel6beta-lv_root on / type ext4 (rw)
# df -P .
Filesystem         1024-blocks      Used Available Capacity Mounted

on

Quoted 4 lines

/dev/mapper/vg_rhel6beta-lv_root   2523808   2436380         0 100% /

So the test without the patch leaves the system in inconsistent

state

Quoted 6 lines

(mand option is kept for the filesystem) which is bad.

---

ltp-full-20100331.old/testcases/kernel/syscalls/ftruncate/ftruncate04.sh

Quoted 16 lines
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
(quoted diff) +0 -0
@@ -18,7 +18,7 @@

     export TST_TOTAL=1
 fi
 cd ${TMPDIR:=/tmp}

testcases/kernel/syscalls/ftruncate/ftruncate04.sh +1 -1
-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:"

Quoted 7 lines
Quoted 2 lines
Quoted 2 lines

Thanks,
Caspar

Hi, any comments on this?

Thanks,
Caspar

Looks fine (portable on Fedora 13 and FreeBSD at least), and it's
standard as per the opengroup SUS page (
http://www.opengroup.org/onlinepubs/009695399/utilities/df.html ). Committed.
Thanks!
-Garrett

------------------------------------------------------------------------------
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