public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfstests: test dump/restore of 32-bit projids
  2012-08-27  0:20 [PATCH] xfsdump: save & restore " Eric Sandeen
@ 2012-08-27  3:27 ` Eric Sandeen
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Sandeen @ 2012-08-27  3:27 UTC (permalink / raw)
  To: Eric Sandeen
  Cc: Bill Kendall, =?UTF-8?B?QXJrYWRpdXN6IE1pxZtraWV3aWM=?=,
	Boris Ranto, xfs-oss

Test that xfsdump/xfsrestore properly restores more than the
bottom 16 bits of a 32-bit projid.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---

diff --git a/285 b/285
new file mode 100755
index 0000000..2804e5d
--- /dev/null
+++ b/285
@@ -0,0 +1,81 @@
+#! /bin/bash
+# FS QA Test No. 285
+#
+# Test projid32: persist 32 bit projids thorugh dump/restore
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2012 Eric Sandeen.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#-----------------------------------------------------------------------
+#
+# creator
+owner=sandeen@sandeen.net
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+    cd /
+    rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.dump
+. ./common.quota
+
+_require_scratch
+_require_xfs_quota
+
+# real QA test starts here
+
+_supported_fs xfs
+_supported_os IRIX Linux
+
+_scratch_mkfs_xfs -i projid32bit=1 >> $seq.full || _fail "mkfs failed"
+
+export MOUNT_OPTIONS="-opquota"
+_qmount
+_require_prjquota $SCRATCH_DEV
+
+# > 16 bit project ID
+PROJID=2123456789
+
+# Put a project quota on a dir
+mkdir $SCRATCH_MNT/dir
+xfs_quota -x -c "project -s -p $SCRATCH_MNT/dir $PROJID" $SCRATCH_MNT >> $seq.full || _fail "dir pquota failed"
+
+# Dump it then restore it to a fresh fs, and check the projid
+rm -f $tmp.dumpfile
+xfsdump -L label -M media -f $tmp.dumpfile $SCRATCH_MNT >> $seq.full || _fail "dump failed"
+umount $SCRATCH_DEV
+
+_scratch_mkfs_xfs -i projid32bit=1 >> $seq.full || _fail "re-mkfs failed"
+_qmount
+xfsrestore -f $tmp.dumpfile $SCRATCH_MNT >> $seq.full || _fail "restore failed"
+
+# check (-c) that we got the correct project ID back post-restore
+xfs_quota -x -c "project -s -c -p $SCRATCH_MNT/dir $PROJID" $SCRATCH_MNT
+
+# success, all done
+status=0
+exit
diff --git a/285.out b/285.out
new file mode 100644
index 0000000..daf4e4c
--- /dev/null
+++ b/285.out
@@ -0,0 +1,3 @@
+QA output created by 285
+Checking project 2123456790 (path /mnt/scratch/dir)...
+Processed 1 (/etc/projects and cmdline) paths for project 2123456790 with recursion depth infinite (-1).
diff --git a/group b/group
index 104ed35..bbc74fe 100644
--- a/group
+++ b/group
@@ -403,3 +403,4 @@ deprecated
 282 dump ioctl auto quick
 283 dump ioctl auto quick
 284 auto
+285 auto dump quota

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests: test dump/restore of 32-bit projids
@ 2012-08-27  9:52 Boris Ranto
  2012-08-27 17:24 ` Eric Sandeen
  0 siblings, 1 reply; 3+ messages in thread
From: Boris Ranto @ 2012-08-27  9:52 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Bill Kendall, xfs-oss


[-- Attachment #1.1: Type: text/plain, Size: 3517 bytes --]

On Sun, 2012-08-26 at 22:27 -0500, Eric Sandeen wrote:
>Test that xfsdump/xfsrestore properly restores more than the
> bottom 16 bits of a 32-bit projid.
>
> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
> ---
>
> diff --git a/285 b/285
> new file mode 100755
> index 0000000..2804e5d
> --- /dev/null
> +++ b/285
> @@ -0,0 +1,81 @@
> +#! /bin/bash
> +# FS QA Test No. 285
> +#
> +# Test projid32: persist 32 bit projids thorugh dump/restore
> +#
> +#-----------------------------------------------------------------------
> +# Copyright (c) 2012 Eric Sandeen.  All Rights Reserved.
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> +# published by the Free Software Foundation.
> +#
> +# This program is distributed in the hope that it would be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write the Free Software Foundation,
> +# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> +#-----------------------------------------------------------------------
> +#
> +# creator
> +owner=sandeen@sandeen.net
> +
> +seq=`basename $0`
> +echo "QA output created by $seq"
> +
> +here=`pwd`
> +tmp=/tmp/$$
> +status=1    # failure is the default!
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +_cleanup()
> +{
> +    cd /
> +    rm -f $tmp.*
> +}
> +
> +# get standard environment, filters and checks
> +. ./common.rc
> +. ./common.filter
> +. ./common.dump
> +. ./common.quota
> +
> +_require_scratch
> +_require_xfs_quota
> +
> +# real QA test starts here
> +
> +_supported_fs xfs
> +_supported_os IRIX Linux
> +
> +_scratch_mkfs_xfs -i projid32bit=1 >> $seq.full || _fail "mkfs failed"
> +
> +export MOUNT_OPTIONS="-opquota"
> +_qmount
> +_require_prjquota $SCRATCH_DEV
> +
> +# > 16 bit project ID
> +PROJID=2123456789
> +
> +# Put a project quota on a dir
> +mkdir $SCRATCH_MNT/dir
> +xfs_quota -x -c "project -s -p $SCRATCH_MNT/dir $PROJID" $SCRATCH_MNT >>
$seq.full || _fail "dir pquota failed"
> +
> +# Dump it then restore it to a fresh fs, and check the projid
> +rm -f $tmp.dumpfile
> +xfsdump -L label -M media -f $tmp.dumpfile $SCRATCH_MNT >> $seq.full ||
_fail "dump failed"
> +umount $SCRATCH_DEV
> +
> +_scratch_mkfs_xfs -i projid32bit=1 >> $seq.full || _fail "re-mkfs failed"
> +_qmount
> +xfsrestore -f $tmp.dumpfile $SCRATCH_MNT >> $seq.full || _fail "restore
failed"
> +
> +# check (-c) that we got the correct project ID back post-restore
> +xfs_quota -x -c "project -s -c -p $SCRATCH_MNT/dir $PROJID" $SCRATCH_MNT
> +
> +# success, all done
> +status=0
> +exit
> diff --git a/285.out b/285.out
> new file mode 100644
> index 0000000..daf4e4c
> --- /dev/null
> +++ b/285.out
> @@ -0,0 +1,3 @@
> +QA output created by 285
> +Checking project 2123456790 (path /mnt/scratch/dir)...
> +Processed 1 (/etc/projects and cmdline) paths for project 2123456790
with recursion depth infinite (-1).
> diff --git a/group b/group
> index 104ed35..bbc74fe 100644
> --- a/group
> +++ b/group
> @@ -403,3 +403,4 @@ deprecated
>  282 dump ioctl auto quick
>  283 dump ioctl auto quick
>  284 auto
> +285 auto dump quota
>
>

I've been working on a xfstests projid32bit test case, too. It covers this
area + few others. I'll post that one, soon.

[-- Attachment #1.2: Type: text/html, Size: 4473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 121 bytes --]

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests: test dump/restore of 32-bit projids
  2012-08-27  9:52 [PATCH] xfstests: test dump/restore of 32-bit projids Boris Ranto
@ 2012-08-27 17:24 ` Eric Sandeen
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Sandeen @ 2012-08-27 17:24 UTC (permalink / raw)
  To: Boris Ranto; +Cc: Bill Kendall, xfs-oss

On 8/27/12 4:52 AM, Boris Ranto wrote:
> On Sun, 2012-08-26 at 22:27 -0500, Eric Sandeen wrote:
>>Test that xfsdump/xfsrestore properly restores more than the
>> bottom 16 bits of a 32-bit projid.
>>
>> Signed-off-by: Eric Sandeen <sandeen@sandeen.net <mailto:sandeen@sandeen.net>>
>> ---

...

> I've been working on a xfstests projid32bit test case, too. It covers this area + few others. I'll post that one, soon.

Ok, if yours tests more we should just use it when it's ready, I think.

Thanks,
-Eric

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

end of thread, other threads:[~2012-08-27 17:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-27  9:52 [PATCH] xfstests: test dump/restore of 32-bit projids Boris Ranto
2012-08-27 17:24 ` Eric Sandeen
  -- strict thread matches above, loose matches on Subject: below --
2012-08-27  0:20 [PATCH] xfsdump: save & restore " Eric Sandeen
2012-08-27  3:27 ` [PATCH] xfstests: test dump/restore of " Eric Sandeen

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