public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] syscalls/mount0* and inotify03 tests are getting skipped from runltp
@ 2013-03-26 17:55 Ramesh
  2013-03-26 19:47 ` chrubis
  0 siblings, 1 reply; 5+ messages in thread
From: Ramesh @ 2013-03-26 17:55 UTC (permalink / raw)
  To: ltp-list

I tried to run syscalls test with ./runltp -f syscalls, it's found that 
the below tests
are getting skipped from the run,
-----------
inotify03 inotify03 -D DEVICE -T DEVICE_FS_TYPE
mount01 mount01 -D DEVICE -T DEVICE_FS_TYPE
mount02 mount02 -D DEVICE -T DEVICE_FS_TYPE
mount03 mount03 -D DEVICE -T DEVICE_FS_TYPE
mount04 mount04 -D DEVICE -T DEVICE_FS_TYPE
umount01 umount01 -D DEVICE -T DEVICE_FS_TYPE
umount02 umount02 -D DEVICE -T DEVICE_FS_TYPE
umount03 umount03 -D DEVICE -T DEVICE_FS_TYPE
-----------

I didn't get the value of DEVICE & DEVICE_FS_TYPE in any of conf files 
and also, as
the tests expect a block device, I executed the tests by specifying a 
block device
(-D /dev/sda1 -T ext4), tests passed.

Also,as the DEVICE & DEVICE_FS_TYPE need to be explicitly specifed to 
all the tests,
these tests should be commented out in ltp/runtest/syscalls which is 
used by runltp.

Any comments on this issue are appreciated.

Also, let me know is there a way by which we can make these tests to run 
from runltp
in an automated environment.


Regards,
Ramesh YR






------------------------------------------------------------------------------
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game 
on Steam. $5K grand prize plus 10 genre and skill prizes. 
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] syscalls/mount0* and inotify03 tests are getting skipped from runltp
  2013-03-26 17:55 [LTP] syscalls/mount0* and inotify03 tests are getting skipped from runltp Ramesh
@ 2013-03-26 19:47 ` chrubis
       [not found]   ` <51529266.2080906@linux.vnet.ibm.com>
  0 siblings, 1 reply; 5+ messages in thread
From: chrubis @ 2013-03-26 19:47 UTC (permalink / raw)
  To: Ramesh; +Cc: ltp-list

Hi!
> I tried to run syscalls test with ./runltp -f syscalls, it's found that 
> the below tests
> are getting skipped from the run,
> -----------
> inotify03 inotify03 -D DEVICE -T DEVICE_FS_TYPE
> mount01 mount01 -D DEVICE -T DEVICE_FS_TYPE
> mount02 mount02 -D DEVICE -T DEVICE_FS_TYPE
> mount03 mount03 -D DEVICE -T DEVICE_FS_TYPE
> mount04 mount04 -D DEVICE -T DEVICE_FS_TYPE
> umount01 umount01 -D DEVICE -T DEVICE_FS_TYPE
> umount02 umount02 -D DEVICE -T DEVICE_FS_TYPE
> umount03 umount03 -D DEVICE -T DEVICE_FS_TYPE
> -----------
> 
> I didn't get the value of DEVICE & DEVICE_FS_TYPE in any of conf files 
> and also, as
> the tests expect a block device, I executed the tests by specifying a 
> block device
> (-D /dev/sda1 -T ext4), tests passed.
> 
> Also,as the DEVICE & DEVICE_FS_TYPE need to be explicitly specifed to 
> all the tests,
> these tests should be commented out in ltp/runtest/syscalls which is 
> used by runltp.
> 
> Any comments on this issue are appreciated.

The runtest files are processed before they are executed. See -b DEVICE and
-B DEVICE_FS_TYPE runltp parameters.

The current runltp script is more of the hack than solution. I've send a
RFC email with a description of planned successor to the LTP mailing
list not that long ago (but I haven't started writing the code yet).

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game 
on Steam. $5K grand prize plus 10 genre and skill prizes. 
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] syscalls/mount0* and inotify03 tests are getting skipped from runltp
       [not found]   ` <51529266.2080906@linux.vnet.ibm.com>
@ 2013-03-27 10:28     ` chrubis
       [not found]       ` <515C133C.6030803@linux.vnet.ibm.com>
  0 siblings, 1 reply; 5+ messages in thread
From: chrubis @ 2013-03-27 10:28 UTC (permalink / raw)
  To: Ramesh; +Cc: ltp-list

Hi!
> > The runtest files are processed before they are executed. See -b DEVICE and
> > -B DEVICE_FS_TYPE runltp parameters.
> >
> > The current runltp script is more of the hack than solution. I've send a
> > RFC email with a description of planned successor to the LTP mailing
> > list not that long ago (but I haven't started writing the code yet).
> 
> Thanks Cyril !
> 
> I got it from runltp --usage, then I tried to execute the tests by passing
> -b DEVICE and -B DEVICE_FS_TYPE to runltp but it failed with the below 
> error,
> 
> ---
> sed: can't read : No such file or directory
> FATAL: error during processing alltests file by sed
> ---
> 
> I went through the runltp script to see the cause for this error and 
> found that
> the below substitution by sed leading to the error.
> 
>  >> sed -i "" -e "s|DEVICE_FS_TYPE|$DEVICE_FS_TYPE|"  ${TMP}/alltests
> 
> Here, I don't see any reason why the -e is used with sed as we are not 
> performing
> sed operation on multiple expressions.
> 
> I just removed -e option and ran the tests, tests were successfully 
> executed.
> 
> <patch snippet>
> --- runltp_org    2013-03-27 14:40:12.029836439 +0530
> +++ runltp    2013-03-27 14:39:59.322856566 +0530
> @@ -719,7 +719,7 @@ main()
>       fi
> 
>       if [ -n "$DEVICE" ]; then
> -        sed -i "" -e "s|DEVICE_FS_TYPE|$DEVICE_FS_TYPE|"  ${TMP}/alltests
> +        sed -i "s|DEVICE_FS_TYPE|$DEVICE_FS_TYPE|"  ${TMP}/alltests
>       fi
> 
>       if [ $? -ne 0 ]; then
> 
> 
> 
> Please le me know if the removal of -e is a better solution for the 
> issue or is it really
> required for any other advantages.

This has been fixed in 0b6c356437acfa2b4cf131a80a52a8407d096fac (about
ten months ago).

If you runned into this bug you are not using latest release. You really
should use the latest release otherwise you will find more bugs that
were fixed meanwhile.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game 
on Steam. $5K grand prize plus 10 genre and skill prizes. 
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] syscalls/mount0* and inotify03 tests are getting skipped from runltp
       [not found]       ` <515C133C.6030803@linux.vnet.ibm.com>
@ 2013-04-03 11:47         ` chrubis
       [not found]           ` <515C5D28.3050604@linux.vnet.ibm.com>
  0 siblings, 1 reply; 5+ messages in thread
From: chrubis @ 2013-04-03 11:47 UTC (permalink / raw)
  To: Ramesh; +Cc: ltp-list

Hi!
> I would like to share a work around which I have tried to make the tests 
> to run
> by default when -b and -B arguments are not specified.Please share your 
> thoughts
> on this and also let me know if there is any disadvantage in using a 
> loop device
> as I have made use of it in my changes. Also, suggest me an alternate 
> way to use
> this work around if the changes in runltp is not a better idea.


The runltp script is considered a hack rather than proper solution but
we don't have replacement yet, so we have to live with it as it is now.

The patch looks realtively good. Comments bellow.

> Here is the work around that I tried,
> 
> +++ runltp    2013-04-02 16:42:47.836836402 +0530
> @@ -681,17 +681,43 @@ main()
> 
>       if [ -n "$DEVICE" ]; then
>           sed -i "s|DEVICE|$DEVICE|"  ${TMP}/alltests
> +         RC=$?
>       else
> -        echo "remove test cases which require the block device."
> -        echo "You can specify it with option -b"
> -        sed -i "/DEVICE/d"  ${TMP}/alltests
> +         #create a block device with ext4 filesystem.
> +        dd if=/dev/zero of=${TMP}/test.img bs=1 count=10MB &>/dev/null

If I'm not mistaken the bs=1 would make the whole process way too slow.

Also I'm not sure if 10MB is enough for ext4.

> +        if [ $? -ne 0 ]; then
> +            echo "Please check for disk space and re-run"
> +            exit 1
> +        else
> +            ##search for an unused loop dev
> +            LOOP_DEV=$(losetup -f)
> +            if [ $? -ne 0 ]; then
> +                echo "no unused loop device is found"
> +                exit 1

There may be embeded systems without the loopback driver in kernel and
we should work on these too. So rather than aborting here, we should
disable the testcases in question.

> +            else
> +                ##attach the created file to loop dev.
> +                losetup $LOOP_DEV ${TMP}/test.img &>/dev/null
> +                if [ $? -ne 0 ]; then
> +                     echo "losetup failed to create block device"
> +                     exit 1
> +                else
> +                    ##format the block dev with ext4 filesystem.
> +                    mkfs.ext4 $LOOP_DEV &>/dev/null
> +                    #set the values in alltests which require block device.
> +                     DEVICE=$LOOP_DEV
> +                     DEVICE_FS_TYPE="ext4"
> +                    sed -i "s|DEVICE|$DEVICE|"  ${TMP}/alltests
> +                     RC=$?
> +                fi
> +            fi
> +          fi
>       fi
> 
> -    if [ $? -ne 0 ]; then
> +    if [ $RC -ne 0 ]; then
>               echo "FATAL: error during prcessing alltests file by sed"
>               exit 1
>       fi
> -
> +
>       if [ -n "$DEVICE" ]; then
>           mnt_pnt=`mktemp -d "${TMP}/mnt_pnt.XXXXXX"`
>           if [ -n "$DEVICE_FS_TYPE" ]; then
> @@ -973,6 +999,8 @@ main()
> 
>   cleanup()
>   {
> +    [ -e "${TMP}/test.img" ] && rm -f ${TMP}/test.img
> +    [ "$LOOP_DEV" ] && losetup -d $LOOP_DEV
>       rm -rf ${TMP}
>   }

Also please send a signed patch in unified diff format next time (git
can create these for your).

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] syscalls/mount0* and inotify03 tests are getting skipped from runltp
       [not found]           ` <515C5D28.3050604@linux.vnet.ibm.com>
@ 2013-04-04 11:59             ` chrubis
  0 siblings, 0 replies; 5+ messages in thread
From: chrubis @ 2013-04-04 11:59 UTC (permalink / raw)
  To: Ramesh; +Cc: ltp-list

Hi!
>   ltp-full-20130109/runltp |   48 
> ++++++++++++++++++++++++++++++++++++++++++---
>   1 files changed, 44 insertions(+), 4 deletions(-)
> 
> diff --git a/ltp-full-20130109/runltp b/ltp-full-20130109/runltp
> index 04cc690..f0f0c95 100755
> --- a/ltp-full-20130109/runltp
> +++ b/ltp-full-20130109/runltp
> @@ -681,13 +681,20 @@ main()
> 
>       if [ -n "$DEVICE" ]; then
>           sed -i "s|DEVICE|$DEVICE|"  ${TMP}/alltests
> +    RC=$?
>       else
> -        echo "remove test cases which require the block device."
> -        echo "You can specify it with option -b"
> -        sed -i "/DEVICE/d"  ${TMP}/alltests
> +    create_block
> +    if [ $? -eq 0 ]; then
> +        sed -i "s|DEVICE|$DEVICE|"  ${TMP}/alltests
> +        RC=$?
> +    else
> +        echo "remove test cases which require the block device."
> +        echo "You can specify it with option -b"
> +        sed -i "/DEVICE/d"  ${TMP}/alltests

We should update the message here a little to let the user know that

1) no device was speficied on command line

2) the loopback device could not be created

3) tests that needs the device are disabled

> +        RC=$?
>       fi
> 
> -    if [ $? -ne 0 ]; then
> +    if [ $RC -ne 0 ]; then
>               echo "FATAL: error during prcessing alltests file by sed"
                                           ^
              Could you please also fix this typo

>               exit 1
>       fi
> @@ -971,8 +978,41 @@ main()
>       exit $VALUE
>   }
> 
> +create_block()
> +{
> +    #create a block device with ext4 filesystem.
> +    dd if=/dev/zero of=${TMP}/test.img bs=10 count=10MB &>/dev/null

Still not right, this will create roughly 100MB file (the count and
the block size get multiplied). The correct one for 10MB would be:

dd if=/dev/zero of=${TMP}/test.img bs=1kB count=10240

(the 1kB blocks are about the optimal size for write and we request
 10240 of them)

> +    if [ $? -ne 0 ]; then
> +        echo "Please check for disk space and re-run"

Please be more verbose here about what has gone wrong. Something like:

"Failed to create loopback device image, plese check disk space and
re-run."

> +        return 1
> +    else
> +        ##search for an unused loop dev
> +        LOOP_DEV=$(losetup -f)
> +        if [ $? -ne 0 ]; then
> +            echo "no unused loop device is found"
> +            return 1
> +        else
> +            ##attach the created file to loop dev.
> +            losetup $LOOP_DEV ${TMP}/test.img &>/dev/null
> +            if [ $? -ne 0 ]; then
> +                echo "losetup failed to create block device"
> +                return 1
> +            else
> +                ##format the block dev with ext3 filesystem.
> +                mkfs.ext4 $LOOP_DEV &>/dev/null

The comment here disagrees with the actual code, i.e. ext3 vs ext4.

I would just remove it as it's pretty clear what the line does without
it.

And you should check the return value from the mkfs just in case.

> +                #set the values in alltests which require block device.
> +                DEVICE=$LOOP_DEV
> +                DEVICE_FS_TYPE="ext4"
> +                return 0
> +            fi
> +        fi
> +    fi
> +}
> +
>   cleanup()
>   {
> +    [ -e "${TEMP}/test.img" ] && rm -f ${TEMP}/test.img
> +    [ "$LOOP_DEV" ] && losetup -d $LOOP_DEV
>       rm -rf ${TMP}
>   }

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2013-04-04 11:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-26 17:55 [LTP] syscalls/mount0* and inotify03 tests are getting skipped from runltp Ramesh
2013-03-26 19:47 ` chrubis
     [not found]   ` <51529266.2080906@linux.vnet.ibm.com>
2013-03-27 10:28     ` chrubis
     [not found]       ` <515C133C.6030803@linux.vnet.ibm.com>
2013-04-03 11:47         ` chrubis
     [not found]           ` <515C5D28.3050604@linux.vnet.ibm.com>
2013-04-04 11:59             ` chrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox