xfs
[Top] [All Lists]

Re: Draft Snapshot Regression Test

To: Greg Freemyer <freemyer@xxxxxxxxxxxxxxxxx>
Subject: Re: Draft Snapshot Regression Test
From: Nathan Scott <nathans@xxxxxxx>
Date: Thu, 29 Aug 2002 17:58:21 +1000
Cc: xfs mailing list <linux-xfs@xxxxxxxxxxx>
In-reply-to: <20020828232349.TILF8089.imf02bis.bellsouth.net@TAZ2>
References: <20020828232349.TILF8089.imf02bis.bellsouth.net@TAZ2>
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.4i
hi Greg,

On Wed, Aug 28, 2002 at 07:20:49PM -0400, Greg Freemyer wrote:
> 
> Nathan,
> 
> I think I have a working snapshot regression test.

Cool.  Should have mentioned this before - have you tried
running this via the "check" script?, ie.
# cd cmd/xfstests
# ./check 068

this is how it would run as part of auto-qa - will need an
output file which has the expected output from a "passing"
run (ie. 068.out) like the other tests.

Some other suggestions for your script follow...

> owner=freemyer@xxxxxxxxxxxxxxxxx
> 
> seq=`basename $0`
> echo "QA output created by $seq"
> 
> DELAY_BETWEEN_ITERATIONS=20
> ITERATIONS=30
> VG=/dev/VGscratch
> #SCRATCH_DEV=/dev/xxxx          # Only needed if running by hand
> #SCRATCH_MNT=/scratch           # Only needed if running by hand

These would be setup by "check" if running by hand, which
uses the common.config (I think) file.

>         umount /scratch_snap
>         rmdir /scratch_snap

Might be better to do this in /tmp/scratch_snap?

>         umount $SCRATCH_MNT
> 
>         lvremove -f $VG/scratch_snap
>         lvremove -f $VG/scratch
> 
> if [ -e /scratch_snap ]; then _notrun "This test requires that /scratch_snap 
> not exist."; fi

Could then rmdir it here instead of this step.

> mkdir /scratch_snap
> 
> #Verify we have the lvm user tools
> LVM=`rpm -qa | grep 'lvm-'`

Thats not so good - makes it dependent on rpm - better to do
something like:

[ -x /sbin/lvcreate ] || _notrun "LVM lvcreate utility is not installed"
[ -x /sbin/lvremove ] || _notrun "LVM lvremove utility is not installed"

> #Verify we have the a lvm enabled kernel
> # TODO (This assumes lvm is a module.  What if it is linked?  I don't know 
> how to check that.
> lsmod | grep lvm-mod;
> if [ $? != 0 ]; then _notrun "This test requires the LVM kernel module be 
> present"; fi

A better approach here would be to grep for lvm in /proc/devices,
this would work for module/non-module builds.

> # Mount the LV
> mkdir /$SCRATCH_MNT > /dev/null 2&>1
> mount $VG/scratch /$SCRATCH_MNT

need the leading '/' here?

> while [ -f $tmp.running ]
> do
>     dd if=$SCRATCH_MNT/dummy of=$SCRATCH_MNT/junk bs=64k > /dev/null 2>&1
>     rm $SCRATCH_MNT/junk        # This forces metadata updates the next time 
> around
>     sync
> done &

This loop still looks strange to me... (the dd is forever, so why rm
and sync?)... but possibly its meant to be so.

cheers.

-- 
Nathan


<Prev in Thread] Current Thread [Next in Thread>