From d60075c5e70a7fd1e9681fa834b16510e6a9a43e Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 15 Sep 2004 05:57:50 +0000 Subject: [PATCH] Tests from UDFQA ported to FSQA. simple attr tests for EAs. --- 097 | 259 +++++++++ 097.out.udf | 132 +++++ 097.out.xfs | 132 +++++ 098 | 278 +++++++++ 098.out | 1594 +++++++++++++++++++++++++++++++++++++++++++++++++++ 099 | 344 +++++++++++ 099.out | 215 +++++++ 100 | 92 +++ 100.out | 1 + 101 | 66 +++ 101.out | 19 + 102 | 63 ++ 102.out | 2 + README | 3 +- common.attr | 78 +-- common.rc | 122 +++- group | 45 +- 17 files changed, 3378 insertions(+), 67 deletions(-) create mode 100755 097 create mode 100644 097.out.udf create mode 100644 097.out.xfs create mode 100755 098 create mode 100644 098.out create mode 100755 099 create mode 100644 099.out create mode 100755 100 create mode 100644 100.out create mode 100755 101 create mode 100644 101.out create mode 100755 102 create mode 100644 102.out diff --git a/097 b/097 new file mode 100755 index 00000000..fb95d2f7 --- /dev/null +++ b/097 @@ -0,0 +1,259 @@ +#! /bin/sh +# FS QA Test No. 097. Modifed from UDFQA test 033. +# +# simple attr tests for EAs: +# - set +# - get +# - list +# - remove +# Basic testing. +# +#----------------------------------------------------------------------- +# Copyright (c) 2000-2004 Silicon Graphics, Inc. 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; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will 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 to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA +# +# Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane, +# Mountain View, CA 94043, USA, or: http://www.sgi.com +#----------------------------------------------------------------------- +# +# creator +owner=ajones@sgi.com + +seq=`basename $0` +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +TARGET_DIR= +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + rm -f $tmp.* + cd $TARGET_DIR + rm -f foo +} + +_umount_and_mount() +{ + cd / + umount $TARGET_DIR + if [ "$FSTYP" == "xfs" ]; then + _test_mount + else + _scratch_mount + fi + + cd $TARGET_DIR +} + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter + +# link correct .out file +# This is done bacause udf and xfs print attrs in different orders. +rm -rf $seq.out +if [ "$FSTYP" == "xfs" ]; then + ln -s $seq.out.xfs $seq.out +else + ln -s $seq.out.udf $seq.out +fi + +# real QA test starts here +_supported_fs udf xfs +_supported_os IRIX + +_require_scratch +_setup_testdir + +TARGET_DIR=$SCRATCH_MNT +[ "$FSTYP" == "xfs" ] && TARGET_DIR=$TEST_DIR +cd $TARGET_DIR + +echo "create file foo" +touch foo + +echo "should be no EAs for foo:" +attr -l foo + +echo "set EA :" +attr -s noise -V woof foo + +echo "set EA :" +attr -s colour -V blue foo + +echo "set EA :" +attr -s size -V small foo + +echo "list the EAs for foo: noise, colour, size" +attr -l foo + +echo "check the list again for foo" +attr -l foo + +echo "unmount the FS and see if EAs are persistent" +_umount_and_mount + +echo "check the list again for foo after umount/mount" +attr -l foo + +echo "get the value of the noise EA" +attr -g noise foo + +echo "get the value of the colour EA which was removed earlier" +attr -g colour foo + +echo "get the value of the size EA" +attr -g size foo + +echo "remove the colour EA on foo" +attr -r colour foo + +echo "list EAs for foo: noise, size" +attr -l foo + +echo "get the value of the noise EA" +attr -g noise foo + +echo "get the value of the colour EA which was removed earlier" +attr -g colour foo + +echo "get the value of the size EA" +attr -g size foo + +echo "list all the EAs again: noise, size" +attr -l foo + +echo "change the value of the size EA from small to huge" +attr -s size -V huge foo + +echo "get the size EA which should now have value huge" +attr -g size foo + +echo "list EAs: noise, size" +attr -l foo + +echo "remove the size EA from foo" +attr -r size foo + +echo "list EAs: noise (size EA has been removed)" +attr -l foo + +echo "get the noise EA: woof" +attr -g noise foo + +echo "try removing non-existent EA named woof" +attr -r woof foo + +echo "try removing already removed EA size" +attr -r size foo + +echo "list EAs: noise" +attr -l foo + +echo "try removing already removed EA colour" +attr -r colour foo + +echo "list EAs: noise" +attr -l foo + +echo "remove remaining EA noise" +attr -r noise foo + +echo "list EAs: should be no EAs left now" +attr -l foo + +echo "unmount the FS and see if EAs are persistent" +_umount_and_mount + +echo "list EAs: should still be no EAs left" +attr -l foo + +echo "" +echo "*** Test out the root namespace ***" +echo "" + +echo "set EA :" +attr -R -s colour -V marone foo + +echo "set EA :" +attr -s colour -V beige foo + +echo "set EA :" +attr -s vomit -V pizza foo + +echo "set EA :" +attr -R -s noise -V whack foo + +echo "list root EAs: :" +attr -R -l foo + +echo "list user EAs: :" +attr -l foo + +echo "get root EA colour: marone" +attr -R -g colour foo + +echo "get root EA noise: whack" +attr -R -g noise foo + +echo "get root EA vomit which is a user EA => find nothing" +attr -R -g vomit foo + +echo "" +echo "unmount the FS and see if EAs are persistent" +echo "" +_umount_and_mount + +echo "get root EA colour: marone" +attr -R -g colour foo + +echo "get root EA noise: whack" +attr -R -g noise foo + +echo "get user EA vomit: pizza" +attr -g vomit foo + +echo "remove the root colour EA" +attr -R -r colour foo + +echo "list root EAs: :" +attr -R -l foo + +echo "list user EAs: :" +attr -l foo + +echo "remove the final root EA noise" +attr -R -r noise foo + +echo "list root EAs: none" +attr -R -l foo + +cd / +_cleanup_testdir + +# Check the filesystem +_check_scratch_fs + +# optional stuff if your test has verbose output to help resolve problems +#echo +#echo "If failure, check $seq.full (this) and $seq.full.ok (reference)" + +# success, all done +status=0 +exit diff --git a/097.out.udf b/097.out.udf new file mode 100644 index 00000000..1d36ff76 --- /dev/null +++ b/097.out.udf @@ -0,0 +1,132 @@ +QA output created by 097 +create file foo +should be no EAs for foo: +set EA : +Attribute "noise" set to a 4 byte value for foo: +woof +set EA : +Attribute "colour" set to a 4 byte value for foo: +blue +set EA : +Attribute "size" set to a 5 byte value for foo: +small +list the EAs for foo: noise, colour, size +Attribute "noise" has a 4 byte value for foo +Attribute "colour" has a 4 byte value for foo +Attribute "size" has a 5 byte value for foo +check the list again for foo +Attribute "noise" has a 4 byte value for foo +Attribute "colour" has a 4 byte value for foo +Attribute "size" has a 5 byte value for foo +unmount the FS and see if EAs are persistent +check the list again for foo after umount/mount +Attribute "noise" has a 4 byte value for foo +Attribute "colour" has a 4 byte value for foo +Attribute "size" has a 5 byte value for foo +get the value of the noise EA +Attribute "noise" had a 4 byte value for foo: +woof +get the value of the colour EA which was removed earlier +Attribute "colour" had a 4 byte value for foo: +blue +get the value of the size EA +Attribute "size" had a 5 byte value for foo: +small +remove the colour EA on foo +list EAs for foo: noise, size +Attribute "noise" has a 4 byte value for foo +Attribute "size" has a 5 byte value for foo +get the value of the noise EA +Attribute "noise" had a 4 byte value for foo: +woof +get the value of the colour EA which was removed earlier +attr_get: Attribute not found +Could not get "colour" for foo +get the value of the size EA +Attribute "size" had a 5 byte value for foo: +small +list all the EAs again: noise, size +Attribute "noise" has a 4 byte value for foo +Attribute "size" has a 5 byte value for foo +change the value of the size EA from small to huge +Attribute "size" set to a 4 byte value for foo: +huge +get the size EA which should now have value huge +Attribute "size" had a 4 byte value for foo: +huge +list EAs: noise, size +Attribute "noise" has a 4 byte value for foo +Attribute "size" has a 4 byte value for foo +remove the size EA from foo +list EAs: noise (size EA has been removed) +Attribute "noise" has a 4 byte value for foo +get the noise EA: woof +Attribute "noise" had a 4 byte value for foo: +woof +try removing non-existent EA named woof +attr_remove: Attribute not found +Could not remove "woof" for foo +try removing already removed EA size +attr_remove: Attribute not found +Could not remove "size" for foo +list EAs: noise +Attribute "noise" has a 4 byte value for foo +try removing already removed EA colour +attr_remove: Attribute not found +Could not remove "colour" for foo +list EAs: noise +Attribute "noise" has a 4 byte value for foo +remove remaining EA noise +list EAs: should be no EAs left now +unmount the FS and see if EAs are persistent +list EAs: should still be no EAs left + +*** Test out the root namespace *** + +set EA : +Attribute "colour" set to a 6 byte value for foo: +marone +set EA : +Attribute "colour" set to a 5 byte value for foo: +beige +set EA : +Attribute "vomit" set to a 5 byte value for foo: +pizza +set EA : +Attribute "noise" set to a 5 byte value for foo: +whack +list root EAs: : +Attribute "colour" has a 6 byte value for foo +Attribute "noise" has a 5 byte value for foo +list user EAs: : +Attribute "colour" has a 5 byte value for foo +Attribute "vomit" has a 5 byte value for foo +get root EA colour: marone +Attribute "colour" had a 6 byte value for foo: +marone +get root EA noise: whack +Attribute "noise" had a 5 byte value for foo: +whack +get root EA vomit which is a user EA => find nothing +attr_get: Attribute not found +Could not get "vomit" for foo + +unmount the FS and see if EAs are persistent + +get root EA colour: marone +Attribute "colour" had a 6 byte value for foo: +marone +get root EA noise: whack +Attribute "noise" had a 5 byte value for foo: +whack +get user EA vomit: pizza +Attribute "vomit" had a 5 byte value for foo: +pizza +remove the root colour EA +list root EAs: : +Attribute "noise" has a 5 byte value for foo +list user EAs: : +Attribute "colour" has a 5 byte value for foo +Attribute "vomit" has a 5 byte value for foo +remove the final root EA noise +list root EAs: none diff --git a/097.out.xfs b/097.out.xfs new file mode 100644 index 00000000..0024bf23 --- /dev/null +++ b/097.out.xfs @@ -0,0 +1,132 @@ +QA output created by 097 +create file foo +should be no EAs for foo: +set EA : +Attribute "noise" set to a 4 byte value for foo: +woof +set EA : +Attribute "colour" set to a 4 byte value for foo: +blue +set EA : +Attribute "size" set to a 5 byte value for foo: +small +list the EAs for foo: noise, colour, size +Attribute "size" has a 5 byte value for foo +Attribute "noise" has a 4 byte value for foo +Attribute "colour" has a 4 byte value for foo +check the list again for foo +Attribute "size" has a 5 byte value for foo +Attribute "noise" has a 4 byte value for foo +Attribute "colour" has a 4 byte value for foo +unmount the FS and see if EAs are persistent +check the list again for foo after umount/mount +Attribute "size" has a 5 byte value for foo +Attribute "noise" has a 4 byte value for foo +Attribute "colour" has a 4 byte value for foo +get the value of the noise EA +Attribute "noise" had a 4 byte value for foo: +woof +get the value of the colour EA which was removed earlier +Attribute "colour" had a 4 byte value for foo: +blue +get the value of the size EA +Attribute "size" had a 5 byte value for foo: +small +remove the colour EA on foo +list EAs for foo: noise, size +Attribute "size" has a 5 byte value for foo +Attribute "noise" has a 4 byte value for foo +get the value of the noise EA +Attribute "noise" had a 4 byte value for foo: +woof +get the value of the colour EA which was removed earlier +attr_get: Attribute not found +Could not get "colour" for foo +get the value of the size EA +Attribute "size" had a 5 byte value for foo: +small +list all the EAs again: noise, size +Attribute "size" has a 5 byte value for foo +Attribute "noise" has a 4 byte value for foo +change the value of the size EA from small to huge +Attribute "size" set to a 4 byte value for foo: +huge +get the size EA which should now have value huge +Attribute "size" had a 4 byte value for foo: +huge +list EAs: noise, size +Attribute "noise" has a 4 byte value for foo +Attribute "size" has a 4 byte value for foo +remove the size EA from foo +list EAs: noise (size EA has been removed) +Attribute "noise" has a 4 byte value for foo +get the noise EA: woof +Attribute "noise" had a 4 byte value for foo: +woof +try removing non-existent EA named woof +attr_remove: Attribute not found +Could not remove "woof" for foo +try removing already removed EA size +attr_remove: Attribute not found +Could not remove "size" for foo +list EAs: noise +Attribute "noise" has a 4 byte value for foo +try removing already removed EA colour +attr_remove: Attribute not found +Could not remove "colour" for foo +list EAs: noise +Attribute "noise" has a 4 byte value for foo +remove remaining EA noise +list EAs: should be no EAs left now +unmount the FS and see if EAs are persistent +list EAs: should still be no EAs left + +*** Test out the root namespace *** + +set EA : +Attribute "colour" set to a 6 byte value for foo: +marone +set EA : +Attribute "colour" set to a 5 byte value for foo: +beige +set EA : +Attribute "vomit" set to a 5 byte value for foo: +pizza +set EA : +Attribute "noise" set to a 5 byte value for foo: +whack +list root EAs: : +Attribute "noise" has a 5 byte value for foo +Attribute "colour" has a 6 byte value for foo +list user EAs: : +Attribute "vomit" has a 5 byte value for foo +Attribute "colour" has a 5 byte value for foo +get root EA colour: marone +Attribute "colour" had a 6 byte value for foo: +marone +get root EA noise: whack +Attribute "noise" had a 5 byte value for foo: +whack +get root EA vomit which is a user EA => find nothing +attr_get: Attribute not found +Could not get "vomit" for foo + +unmount the FS and see if EAs are persistent + +get root EA colour: marone +Attribute "colour" had a 6 byte value for foo: +marone +get root EA noise: whack +Attribute "noise" had a 5 byte value for foo: +whack +get user EA vomit: pizza +Attribute "vomit" had a 5 byte value for foo: +pizza +remove the root colour EA +list root EAs: : +Attribute "noise" has a 5 byte value for foo +list user EAs: : +Attribute "vomit" has a 5 byte value for foo +Attribute "colour" has a 5 byte value for foo +remove the final root EA noise +list root EAs: none diff --git a/098 b/098 new file mode 100755 index 00000000..e959f6a0 --- /dev/null +++ b/098 @@ -0,0 +1,278 @@ +#! /bin/sh +# FS QA Test No. 098. Modified from UDFQA test 035 +# +# simple attr tests for EAs: +# - set +# - get +# - list +# - remove +# Basic testing. +# + udf_db checks. +# (033 + udf_db) +# +#----------------------------------------------------------------------- +# Copyright (c) 2000-2004 Silicon Graphics, Inc. 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; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will 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 to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA +# +# Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane, +# Mountain View, CA 94043, USA, or: http://www.sgi.com +#----------------------------------------------------------------------- +# +# creator +owner=ajones@sgi.com + +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() +{ + rm -f $tmp.* +} + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter + +_db_filter() +{ + awk ' + /foo +cat foo + +echo "should be no EAs for foo:" +attr -l foo + +echo "set EA :" +attr -s noise -V woof foo + +echo "set EA :" +attr -s colour -V blue foo + +echo "set EA :" +attr -s size -V small foo + +echo "list the EAs for foo: noise, colour, size" +attr -l foo + +echo "check the list again for foo" +attr -l foo + +echo "unmount the FS and see if EAs are persistent" +_umount_check_mount + +echo "check the list again for foo after umount/mount" +attr -l foo + +echo "get the value of the noise EA" +attr -g noise foo + +echo "get the value of the colour EA which was removed earlier" +attr -g colour foo + +echo "get the value of the size EA" +attr -g size foo + +echo "remove the colour EA on foo" +attr -r colour foo + +echo "list EAs for foo: noise, size" +attr -l foo + +echo "get the value of the noise EA" +attr -g noise foo + +echo "get the value of the colour EA which was removed earlier" +attr -g colour foo + +echo "get the value of the size EA" +attr -g size foo + +echo "list all the EAs again: noise, size" +attr -l foo + +echo "change the value of the size EA from small to huge" +attr -s size -V huge foo + +echo "get the size EA which should now have value huge" +attr -g size foo + +echo "list EAs: noise, size" +attr -l foo + +echo "remove the size EA from foo" +attr -r size foo + +echo "list EAs: noise (size EA has been removed)" +attr -l foo + +echo "get the noise EA: woof" +attr -g noise foo + +echo "try removing non-existent EA named woof" +attr -r woof foo + +echo "try removing already removed EA size" +attr -r size foo + +echo "list EAs: noise" +attr -l foo + +echo "try removing already removed EA colour" +attr -r colour foo + +echo "list EAs: noise" +attr -l foo + +echo "remove remaining EA noise" +attr -r noise foo + +echo "list EAs: should be no EAs left now" +attr -l foo + +echo "unmount the FS and see if EAs are persistent" +_umount_check_mount + +echo "list EAs: should still be no EAs left" +attr -l foo + +echo "" +echo "*** Test out the root namespace ***" +echo "" + +echo "set EA :" +attr -R -s colour -V marone foo + +echo "set EA :" +attr -s colour -V beige foo + +echo "set EA :" +attr -s vomit -V pizza foo + +echo "set EA :" +attr -R -s noise -V whack foo + +echo "list root EAs: :" +attr -R -l foo + +echo "list user EAs: :" +attr -l foo + +echo "get root EA colour: marone" +attr -R -g colour foo + +echo "get root EA noise: whack" +attr -R -g noise foo + +echo "get root EA vomit which is a user EA => find nothing" +attr -R -g vomit foo + +echo "" +echo "unmount the FS and see if EAs are persistent" +echo "" +_umount_check_mount + +echo "get root EA colour: marone" +attr -R -g colour foo + +echo "get root EA noise: whack" +attr -R -g noise foo + +echo "get user EA vomit: pizza" +attr -g vomit foo + +echo "remove the root colour EA" +attr -R -r colour foo + +echo "list root EAs: :" +attr -R -l foo + +echo "list user EAs: :" +attr -l foo + +echo "remove the final root EA noise" +attr -R -r noise foo + +echo "list root EAs: none" +attr -R -l foo + +cd / +umount $SCRATCH_MNT + +udf_db -f $SCRATCH_DEV | _db_filter + +# Checks the udf filesystem +_check_udf_filesystem $SCRATCH_DEV + +_scratch_mount +cd $SCRATCH_MNT + +echo "delete the file foo - which will delete the associated streams" +rm foo + +cd / +umount $SCRATCH_MNT + +udf_db -f $SCRATCH_DEV | _db_filter + +# Checks the udf filesystem +_check_udf_filesystem $SCRATCH_DEV + +# optional stuff if your test has verbose output to help resolve problems +#echo +#echo "If failure, check $seq.full (this) and $seq.full.ok (reference)" + +# success, all done +status=0 +exit diff --git a/098.out b/098.out new file mode 100644 index 00000000..63772a0a --- /dev/null +++ b/098.out @@ -0,0 +1,1594 @@ +QA output created by 098 +create file foo +file_contents +should be no EAs for foo: +set EA : +Attribute "noise" set to a 4 byte value for foo: +woof +set EA : +Attribute "colour" set to a 4 byte value for foo: +blue +set EA : +Attribute "size" set to a 5 byte value for foo: +small +list the EAs for foo: noise, colour, size +Attribute "noise" has a 4 byte value for foo +Attribute "colour" has a 4 byte value for foo +Attribute "size" has a 5 byte value for foo +check the list again for foo +Attribute "noise" has a 4 byte value for foo +Attribute "colour" has a 4 byte value for foo +Attribute "size" has a 5 byte value for foo +unmount the FS and see if EAs are persistent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 77 6F 6F 66 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 62 6C 75 65 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 73 6D 6C 6C + + + + + + 66 69 6C 65 5F 63 6F 6E 74 65 6E 74 73 A + + + + + +check the list again for foo after umount/mount +Attribute "noise" has a 4 byte value for foo +Attribute "colour" has a 4 byte value for foo +Attribute "size" has a 5 byte value for foo +get the value of the noise EA +Attribute "noise" had a 4 byte value for foo: +woof +get the value of the colour EA which was removed earlier +Attribute "colour" had a 4 byte value for foo: +blue +get the value of the size EA +Attribute "size" had a 5 byte value for foo: +small +remove the colour EA on foo +list EAs for foo: noise, size +Attribute "noise" has a 4 byte value for foo +Attribute "size" has a 5 byte value for foo +get the value of the noise EA +Attribute "noise" had a 4 byte value for foo: +woof +get the value of the colour EA which was removed earlier +attr_get: Attribute not found +Could not get "colour" for foo +get the value of the size EA +Attribute "size" had a 5 byte value for foo: +small +list all the EAs again: noise, size +Attribute "noise" has a 4 byte value for foo +Attribute "size" has a 5 byte value for foo +change the value of the size EA from small to huge +Attribute "size" set to a 4 byte value for foo: +huge +get the size EA which should now have value huge +Attribute "size" had a 4 byte value for foo: +huge +list EAs: noise, size +Attribute "noise" has a 4 byte value for foo +Attribute "size" has a 4 byte value for foo +remove the size EA from foo +list EAs: noise (size EA has been removed) +Attribute "noise" has a 4 byte value for foo +get the noise EA: woof +Attribute "noise" had a 4 byte value for foo: +woof +try removing non-existent EA named woof +attr_remove: Attribute not found +Could not remove "woof" for foo +try removing already removed EA size +attr_remove: Attribute not found +Could not remove "size" for foo +list EAs: noise +Attribute "noise" has a 4 byte value for foo +try removing already removed EA colour +attr_remove: Attribute not found +Could not remove "colour" for foo +list EAs: noise +Attribute "noise" has a 4 byte value for foo +remove remaining EA noise +list EAs: should be no EAs left now +unmount the FS and see if EAs are persistent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 66 69 6C 65 5F 63 6F 6E 74 65 6E 74 73 A + + + + + +list EAs: should still be no EAs left + +*** Test out the root namespace *** + +set EA : +Attribute "colour" set to a 6 byte value for foo: +marone +set EA : +Attribute "colour" set to a 5 byte value for foo: +beige +set EA : +Attribute "vomit" set to a 5 byte value for foo: +pizza +set EA : +Attribute "noise" set to a 5 byte value for foo: +whack +list root EAs: : +Attribute "colour" has a 6 byte value for foo +Attribute "noise" has a 5 byte value for foo +list user EAs: : +Attribute "colour" has a 5 byte value for foo +Attribute "vomit" has a 5 byte value for foo +get root EA colour: marone +Attribute "colour" had a 6 byte value for foo: +marone +get root EA noise: whack +Attribute "noise" had a 5 byte value for foo: +whack +get root EA vomit which is a user EA => find nothing +attr_get: Attribute not found +Could not get "vomit" for foo + +unmount the FS and see if EAs are persistent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 6D 61 72 6F 6E 65 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 62 65 67 65 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 70 69 7A 61 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 77 68 63 6B + + + + + + 66 69 6C 65 5F 63 6F 6E 74 65 6E 74 73 A + + + + + +get root EA colour: marone +Attribute "colour" had a 6 byte value for foo: +marone +get root EA noise: whack +Attribute "noise" had a 5 byte value for foo: +whack +get user EA vomit: pizza +Attribute "vomit" had a 5 byte value for foo: +pizza +remove the root colour EA +list root EAs: : +Attribute "noise" has a 5 byte value for foo +list user EAs: : +Attribute "colour" has a 5 byte value for foo +Attribute "vomit" has a 5 byte value for foo +remove the final root EA noise +list root EAs: none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 62 65 67 65 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 70 69 7A 61 + + + + + + + + + + + + + + + + + + + + + + + + + + 66 69 6C 65 5F 63 6F 6E 74 65 6E 74 73 A + + + + + +delete the file foo - which will delete the associated streams + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/099 b/099 new file mode 100755 index 00000000..74fe486c --- /dev/null +++ b/099 @@ -0,0 +1,344 @@ +#! /bin/sh +# FS QA Test No. 099. Modified from UDFQA test 036. +# +# ACL test +#----------------------------------------------------------------------- +# Copyright (c) 2000-2004 Silicon Graphics, Inc. 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; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will 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 to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA +# +# Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane, +# Mountain View, CA 94043, USA, or: http://www.sgi.com +#----------------------------------------------------------------------- +#_acl_list +# modifier +owner=ajones@sgi.com + +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 + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter +. ./common.attr + +runas=$here/src/runas + +TARGET_DIR=$SCRATCH_MNT +[ "$FSTYP" == "xfs" ] && TARGET_DIR=$TEST_DIR + +_cleanup() +{ + rm -f $tmp.* + cd $TARGET_DIR + rm -rf $seq.dir1 + cd / +} + +# ----- +# minimal access ACL has ACEs: USER_OBJ, GROUP_OBJ, OTHER_OBJ +# This is set with chacl(1) and can be changed by chmod(1). +# +# Test that this is being set for ACL and for std unix permissions +# Test that we can get back the same ACL. +# Test std permissions for rwx. +# ----- +# +# Test out default ACLs and that the ACL is being PASSed +# onto the children of the dir. +# +# ----- +# Test out access check for extended ACLs. +# -> 3 extra ACEs: MASK, GROUP, USER +# -> the GROUP compares with egid of process _and_ the supplementary +# groups (as found in /etc/group) +# +# Test that mask works for USER, GROUP, GROUP_OBJ +# Test that the ACE type priority is working +# -> this would be done by simultaneously matching on ACEs +# -> interesting if it allows user to specify ACEs in any order +# +rm -f $seq.full + +#------------------------------------------------------- +# real QA test starts here +_supported_fs xfs udf +_supported_os IRIX + +_acl_setup_ids +_acl_requirements +[ -x $runas ] || _notrun "$runas executable not found" + +# get dir +#export FILE_SYS=xfs +_require_scratch +_setup_testdir + +cd $TARGET_DIR +rm -rf $seq.dir1 # in case file is left over from previous runs. +mkdir $seq.dir1 +cd $seq.dir1 + +echo "" +echo "=== Test minimal ACE ===" + +echo "Setup file" +# Note: as this is a shell script, +# will need read and execute permission set +# in order to execute it. +touch file1 +cat <file1 +#!/bin/sh +echo "Test was executed" +EOF +chmod u=rwx file1 +chmod g=rw- file1 +chmod o=r-- file1 +chown $acl1.$acl2 file1 +_acl_ls file1 + +echo "" +echo "--- Test get and set of ACL ---" +echo "Note: IRIX interface gave an empty ACL - Linux outputs an ACL" +_acl_list file1 +echo "Try using single colon separator" +echo "Note: IRIX interface FAILs because of single colon - Linux one allows it" +chacl u::r--,g::rwx,o:rw- file1 2>&1 +echo "Expect to PASS" +chacl u::r--,g::rwx,o::rw- file1 2>&1 +_acl_list file1 + +echo "" +echo "--- Test sync of ACL with std permissions ---" +_acl_ls file1 +chmod u+w file1 +_acl_ls file1 +_acl_list file1 + +echo "" +echo "--- Test owner permissions ---" +chacl u::r-x,g::---,o::--- file1 2>&1 +_acl_list file1 +# change to owner +echo "Expect to PASS" +$runas -u $acl1 -g $acl1 ./file1 2>&1 +echo "Expect to FAIL" +$runas -u $acl2 -g $acl2 ./file1 2>&1 + +echo "" +echo "--- Test group permissions ---" +chacl u::---,g::r-x,o::--- file1 2>&1 +_acl_list file1 +echo "Expect to FAIL - acl1 is owner" +$runas -u $acl1 -g $acl1 ./file1 2>&1 +echo "Expect to PASS - acl2 matches group" +$runas -u $acl2 -g $acl2 ./file1 2>&1 +echo "Expect to PASS - acl2 matches sup group" +$runas -u $acl2 -g $acl3 -s $acl2 ./file1 2>&1 +echo "Expect to FAIL - acl3 is not in group" +$runas -u $acl3 -g $acl3 ./file1 2>&1 + +echo "" +echo "--- Test other permissions ---" +chacl u::---,g::---,o::r-x file1 2>&1 +_acl_list file1 +echo "Expect to FAIL - acl1 is owner" +$runas -u $acl1 -g $acl1 ./file1 2>&1 +echo "Expect to FAIL - acl2 is in group" +$runas -u $acl2 -g $acl2 ./file1 2>&1 +echo "Expect to FAIL - acl2 is in sup. group" +$runas -u $acl2 -g $acl3 -s $acl2 ./file1 2>&1 +echo "Expect to PASS - acl3 is not owner or in group" +$runas -u $acl3 -g $acl3 ./file1 2>&1 + +#------------------------------------------------------- + +echo "" +echo "=== Test Extended ACLs ===" + +echo "" +echo "--- Test adding a USER ACE ---" +echo "Expect to FAIL as no MASK provided" +chacl u::---,g::---,o::---,u:$acl2:r-x file1 2>&1 | _acl_filter_id +echo "Ensure that ACL has not been changed" +_acl_list file1 +echo "Expect to PASS - USER ACE matches user" +chacl u::---,g::---,o::---,u:$acl2:r-x,m::rwx file1 2>&1 +_acl_list file1 +$runas -u $acl2 -g $acl2 ./file1 2>&1 +echo "Expect to FAIL - USER ACE does not match user" +$runas -u $acl3 -g $acl3 ./file1 2>&1 + +echo "" +echo "--- Test adding a GROUP ACE ---" +echo "Expect to FAIL as no MASK provided" +chacl u::---,g::---,o::---,g:$acl2:r-x file1 2>&1 | _acl_filter_id +echo "Ensure that ACL has not been changed" +_acl_list file1 +chacl u::---,g::---,o::---,g:$acl2:r-x,m::rwx file1 2>&1 +_acl_list file1 | _acl_filter_id +echo "Expect to PASS - GROUP ACE matches group" +$runas -u $acl2 -g $acl2 ./file1 2>&1 +echo "Expect to PASS - GROUP ACE matches sup group" +$runas -u $acl2 -g $acl1 -s $acl2 ./file1 2>&1 +echo "Expect to FAIL - GROUP ACE does not match group" +$runas -u $acl3 -g $acl3 ./file1 2>&1 + +#------------------------------------------------------- + +echo "" +echo "--- Test MASK ---" + +# group +chacl u::---,g::---,o::---,g:$acl2:r-x,m::-w- file1 2>&1 +_acl_list file1 +echo "Expect to FAIL as MASK prohibits execution" +$runas -u $acl2 -g $acl2 ./file1 2>&1 + +# user +chacl u::---,g::---,o::---,u:$acl2:r-x,m::-w- file1 2>&1 +echo "Expect to FAIL as MASK prohibits execution" +$runas -u $acl2 -g $acl2 ./file1 2>&1 + +# user +chacl u::---,g::---,o::---,u:$acl2:r-x,m::r-x file1 2>&1 +echo "Expect to PASS as MASK allows execution" +$runas -u $acl2 -g $acl2 ./file1 2>&1 + +#------------------------------------------------------- + +echo "" +echo "--- Test ACE priority ---" + +chacl o::rwx,g::rwx,u:$acl1:rwx,u::---,m::rwx file1 2>&1 +echo "Expect to FAIL as should match on owner" +$runas -u $acl1 -g $acl2 ./file1 2>&1 + +chacl o::---,g::---,u:$acl2:rwx,u::---,m::rwx file1 2>&1 +echo "Expect to PASS as should match on user" +$runas -u $acl2 -g $acl2 ./file1 2>&1 + + +#------------------------------------------------------- + +echo "" +echo "=== Test can read ACLs without access permissions ===" +# This was a bug in kernel code where syscred wasn't being used +# to override the capabilities +chacl o::---,g::---,u::--- file1 2>&1 +_acl_list file1 + +#------------------------------------------------------- + +echo "" +echo "=== Test Default ACLs ===" +# make test clearer by testing with and without umask +umask 0 + +mkdir acldir +chacl -b "u::rwx,g::rwx,o::rwx" "u::r-x,g::r--,o::---" acldir 2>&1 +_acl_list acldir +cd acldir + +touch file2 +_acl_ls file2 +_acl_list file2 + +#ensure that umask is not having an effect +#so set it and see +umask 722 +touch file3 +_acl_ls file3 +_acl_list file3 + +cd .. +umask 022 + + +#------------------------------------------------------- + +echo "" +echo "=== Removing ACLs ===" +_acl_list file1 +_acl_list acldir +_acl_list acldir/file2 +echo "Remove ACLs..." +chacl -R file1 +chacl -B acldir +chacl -R acldir/file2 +echo "Note: IRIX interface would mean empty ACLs - Linux would show mode ACLs" +_acl_list file1 +_acl_list acldir +_acl_list acldir/file2 + +#------------------------------------------------------- + +echo "" +echo "=== Test out error messages for ACL text parsing ===" + +touch file1 +set -x +chacl u file1 +chacl u: file1 +chacl u:rumpledumpleunknownuser file1 +chacl u:rumpledumpleunknownuser: file1 +chacl g:rumpledumpleunknowngrp file1 +chacl g:rumpledumpleunknowngrp: file1 +chacl o:user1:rwx file1 +chacl m:user1:rwx file1 +chacl a::rwx file1 +set +x + +#------------------------------------------------------- + +echo "" +echo "=== Test out large ACLs ===" +touch largeaclfile +XFS_ACL_MAX_ENTRIES=25 +num_aces_pre=`expr $XFS_ACL_MAX_ENTRIES - 1` +num_aces_post=`expr $XFS_ACL_MAX_ENTRIES + 1` + +acl1=`_create_n_aces $num_aces_pre` +acl2=`_create_n_aces $XFS_ACL_MAX_ENTRIES` +acl3=`_create_n_aces $num_aces_post` + +echo "1 below xfs acl max" +chacl $acl1 largeaclfile +_acl_list largeaclfile | _filter_aces + +echo "xfs acl max" +chacl $acl2 largeaclfile +_acl_list largeaclfile | _filter_aces + +echo "1 above xfs acl max" +chacl $acl3 largeaclfile +_acl_list largeaclfile | _filter_aces + +#------------------------------------------------------- + +if [ "$FSTYP" == "udf" ]; then + cd / + umount $TARGET_DIR + # Check the filesystem + _check_scratch_fs +fi +# success, all done +status=0 +exit diff --git a/099.out b/099.out new file mode 100644 index 00000000..3f4f663f --- /dev/null +++ b/099.out @@ -0,0 +1,215 @@ +QA output created by 099 + +=== Test minimal ACE === +Setup file +-rwxrw-r-- id1 id2 file1 + +--- Test get and set of ACL --- +Note: IRIX interface gave an empty ACL - Linux outputs an ACL +file1 [] +Try using single colon separator +Note: IRIX interface FAILs because of single colon - Linux one allows it +chacl: "u::r--,g::rwx,o:rw-" is an invalid ACL specification. +Expect to PASS +file1 [u::r--,g::rwx,o::rw-] + +--- Test sync of ACL with std permissions --- +-r--rwxrw-+ id1 id2 file1 +-rw-rwxrw-+ id1 id2 file1 +file1 [u::rw-,g::rwx,o::rw-] + +--- Test owner permissions --- +file1 [u::r-x,g::---,o::---] +Expect to PASS +Test was executed +Expect to FAIL +./file1: Permission denied + +--- Test group permissions --- +file1 [u::---,g::r-x,o::---] +Expect to FAIL - acl1 is owner +./file1: Permission denied +Expect to PASS - acl2 matches group +Test was executed +Expect to PASS - acl2 matches sup group +Test was executed +Expect to FAIL - acl3 is not in group +./file1: Permission denied + +--- Test other permissions --- +file1 [u::---,g::---,o::r-x] +Expect to FAIL - acl1 is owner +./file1: Permission denied +Expect to FAIL - acl2 is in group +./file1: Permission denied +Expect to FAIL - acl2 is in sup. group +./file1: Permission denied +Expect to PASS - acl3 is not owner or in group +Test was executed + +=== Test Extended ACLs === + +--- Test adding a USER ACE --- +Expect to FAIL as no MASK provided +chacl: error setting access acl on "file1":Invalid argument +Ensure that ACL has not been changed +file1 [u::---,g::---,o::r-x] +Expect to PASS - USER ACE matches user +file1 [u::---,g::---,o::---,u:id2:r-x,m::rwx] +Test was executed +Expect to FAIL - USER ACE does not match user +./file1: Permission denied + +--- Test adding a GROUP ACE --- +Expect to FAIL as no MASK provided +chacl: error setting access acl on "file1":Invalid argument +Ensure that ACL has not been changed +file1 [u::---,g::---,o::---,u:id2:r-x,m::rwx] +file1 [u::---,g::---,o::---,g:id2:r-x,m::rwx] +Expect to PASS - GROUP ACE matches group +Test was executed +Expect to PASS - GROUP ACE matches sup group +Test was executed +Expect to FAIL - GROUP ACE does not match group +./file1: Permission denied + +--- Test MASK --- +file1 [u::---,g::---,o::---,g:id2:r-x,m::-w-] +Expect to FAIL as MASK prohibits execution +./file1: Permission denied +Expect to FAIL as MASK prohibits execution +./file1: Permission denied +Expect to PASS as MASK allows execution +Test was executed + +--- Test ACE priority --- +Expect to FAIL as should match on owner +./file1: Permission denied +Expect to PASS as should match on user +Test was executed + +=== Test can read ACLs without access permissions === +file1 [o::---,g::---,u::---] + +=== Test Default ACLs === +acldir [u::rwx,g::rwx,o::rwx/u::r-x,g::r--,o::---] +-r--r-----+ 0 0 file2 +file2 [u::r--,g::r--,o::---] +-r--r-----+ 0 0 file3 +file3 [u::r--,g::r--,o::---] + +=== Removing ACLs === +file1 [o::---,g::---,u::---] +acldir [u::rwx,g::rwx,o::rwx/u::r-x,g::r--,o::---] +acldir/file2 [u::r--,g::r--,o::---] +Remove ACLs... +Note: IRIX interface would mean empty ACLs - Linux would show mode ACLs +file1 [] +acldir [] +acldir/file2 [] + +=== Test out error messages for ACL text parsing === ++ chacl u file1 +chacl: "u" is an invalid ACL specification. ++ chacl u: file1 +chacl: "u:" is an invalid ACL specification. ++ chacl u:rumpledumpleunknownuser file1 +chacl: "u:rumpledumpleunknownuser" is an invalid ACL specification. ++ chacl u:rumpledumpleunknownuser: file1 +chacl: "u:rumpledumpleunknownuser:" is an invalid ACL specification. ++ chacl g:rumpledumpleunknowngrp file1 +chacl: "g:rumpledumpleunknowngrp" is an invalid ACL specification. ++ chacl g:rumpledumpleunknowngrp: file1 +chacl: "g:rumpledumpleunknowngrp:" is an invalid ACL specification. ++ chacl o:user1:rwx file1 +chacl: "o:user1:rwx" is an invalid ACL specification. ++ chacl m:user1:rwx file1 +chacl: "m:user1:rwx" is an invalid ACL specification. ++ chacl a::rwx file1 +chacl: "a::rwx" is an invalid ACL specification. + +=== Test out large ACLs === +1 below xfs acl max +largeaclfile +user::rwx +group::rwx +other::rwx +mask::rwx +user:20:rwx +user:19:rwx +user:18:rwx +user:17:rwx +user:16:rwx +user:15:rwx +user:14:rwx +user:13:rwx +user:12:rwx +user:11:rwx +user:10:rwx +user:9:rwx +user:8:rwx +user:7:rwx +user:6:rwx +user:5:rwx +user:4:rwx +user:3:rwx +user:2:rwx +user:1:rwx + +xfs acl max +largeaclfile +user::rwx +group::rwx +other::rwx +mask::rwx +user:21:rwx +user:20:rwx +user:19:rwx +user:18:rwx +user:17:rwx +user:16:rwx +user:15:rwx +user:14:rwx +user:13:rwx +user:12:rwx +user:11:rwx +user:10:rwx +user:9:rwx +user:8:rwx +user:7:rwx +user:6:rwx +user:5:rwx +user:4:rwx +user:3:rwx +user:2:rwx +user:1:rwx + +1 above xfs acl max +chacl: error setting access acl on "largeaclfile":Error 0 +largeaclfile +user::rwx +group::rwx +other::rwx +mask::rwx +user:21:rwx +user:20:rwx +user:19:rwx +user:18:rwx +user:17:rwx +user:16:rwx +user:15:rwx +user:14:rwx +user:13:rwx +user:12:rwx +user:11:rwx +user:10:rwx +user:9:rwx +user:8:rwx +user:7:rwx +user:6:rwx +user:5:rwx +user:4:rwx +user:3:rwx +user:2:rwx +user:1:rwx + diff --git a/100 b/100 new file mode 100755 index 00000000..0b7787fa --- /dev/null +++ b/100 @@ -0,0 +1,92 @@ +#! /bin/sh +# FS QA Test No. 093. Modified from UDF QA test 030. +# +# Test whether a tarred directory structure can be untarred onto +# a UDF file system. +# +#----------------------------------------------------------------------- +# Copyright (c) 2000-2004 Silicon Graphics, Inc. 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; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will 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 to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA +# +# Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane, +# Mountain View, CA 94043, USA, or: http://www.sgi.com +#----------------------------------------------------------------------- +# +# creator +owner=ajones@sgi.com + +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 + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter + +_cleanup() +{ + rm -f $tmp.* $testfile +} + +# real QA test starts here +_supported_fs xfs udf nfs +_supported_os IRIX Linux + +# Use _populate_fs() in common.rc to create a directory structure. +TEMP_DIR=/tmp +TAR_FILE=temp.tar +NDIRS=3 +NFILES=6 +DEPTH=5 +POPULATED_DIR=$TEMP_DIR/populate_root +SIZE=10 + +rm -f $seq.full + +# Clean up if file exist from prevous run +rm -rf $POPULATED_DIR +rm -f $TEMP_DIR/$TAR_FILE + +# Create the new directory structure +_populate_fs -n $NDIRS -f $NFILES -d $DEPTH -r $POPULATED_DIR -s $SIZE >>$here/$seq.full 2>&1 + +# Then tar up the directory structure +tar -cvf $TEMP_DIR/$TAR_FILE $POPULATED_DIR >>$here/$seq.full 2>&1 + +# create f/s +_require_scratch +_setup_testdir + +# untar on f/s +cd $testdir +tar -xRvf $TEMP_DIR/$TAR_FILE >>$here/$seq.full 2>&1 +cd $here + + +# use diff -qr to compare +ls -R -l ${testdir}${POPULATED_DIR} >>$here/$seq.full 2>&1 +diff -qr $POPULATED_DIR ${testdir}${POPULATED_DIR} + +cd / +_cleanup_testdir +_check_scratch_fs + +status=0 +exit diff --git a/100.out b/100.out new file mode 100644 index 00000000..b6572c46 --- /dev/null +++ b/100.out @@ -0,0 +1 @@ +QA output created by 100 diff --git a/101 b/101 new file mode 100755 index 00000000..67e0bdc8 --- /dev/null +++ b/101 @@ -0,0 +1,66 @@ +#! /bin/sh +# FS QA Test No. 101. Modified from UDFQA test 029. +# +# This tests mkfs_udf with -s [SIZE] option. +# +#----------------------------------------------------------------------- +# Copyright (c) 2000-2004 Silicon Graphics, Inc. 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; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will 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 to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA +# +# Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane, +# Mountain View, CA 94043, USA, or: http://www.sgi.com +#----------------------------------------------------------------------- +# +# creator +owner=ajones@sgi.com + +seq=`basename $0` +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +FS_SIZE=2048 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + rm -f $tmp.* +} + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter + +# real QA test starts here +_supported_fs udf +_supported_os IRIX + +MKFS_OPTIONS="-s $FS_SIZE" + +_require_scratch +_setup_udf_scratchdir +umount $SCRATCH_MNT + +# Inspect the space bitmap +echo bitmap | udf_db -c - $SCRATCH_DEV + +# Run udf_test +_check_udf_filesystem $SCRATCH_DEV $FS_SIZE + +# success, all done +status=0 +exit diff --git a/101.out b/101.out new file mode 100644 index 00000000..1ca59a8c --- /dev/null +++ b/101.out @@ -0,0 +1,19 @@ +QA output created by 101 + + + + + + + + + + + + + + + 0-3 [4]: 0 + 4-1499 [1496]: 1 + + diff --git a/102 b/102 new file mode 100755 index 00000000..1d9a73f6 --- /dev/null +++ b/102 @@ -0,0 +1,63 @@ +#! /bin/sh +# FS QA Test No. 102 +# +# This tests mkfs_udf/mkudffs and the device detection code +# Modified from UDFQA test 031. +# +#----------------------------------------------------------------------- +# Copyright (c) 2000-2004 Silicon Graphics, Inc. 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; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will 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 to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA +# +# Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane, +# Mountain View, CA 94043, USA, or: http://www.sgi.com +#----------------------------------------------------------------------- +# +# creator +owner=ajones@sgi.com + +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() +{ + rm -f $tmp.* + cd / + _cleanup_testdir +} +# get standard environment, filters and checks +. ./common.rc +. ./common.filter + +# real QA test starts here +_supported_fs udf +_supported_os Linux IRIX + +_require_scratch +_setup_udf_scratchdir + +# Checks the udf filesystem +_check_udf_filesystem $SCRATCH_DEV + +echo "Finished" + +# success, all done +status=0 +exit diff --git a/102.out b/102.out new file mode 100644 index 00000000..bce1a19d --- /dev/null +++ b/102.out @@ -0,0 +1,2 @@ +QA output created by 102 +Finished diff --git a/README b/README index dc12ac8a..7dfb0aa1 100644 --- a/README +++ b/README @@ -23,7 +23,8 @@ Preparing system for tests (IRIX and Linux): mkfs_udf and udf_db for IRIX and mkudffs for Linux. Also download and build the Philips UDF Verification Software from http://www.extra.research.philips.com/udf/, then copy the udf_test - binary to xfstests/src/. + binary to xfstests/src/. If you wish to disable UDF verification test + set the environment variable DISABLE_UDF_TEST to 1. - create two partitions to use for testing diff --git a/common.attr b/common.attr index c3b3578d..2b333efb 100644 --- a/common.attr +++ b/common.attr @@ -1,37 +1,24 @@ ##/bin/sh - +#----------------------------------------------------------------------- +# Copyright (c) 2000-2004 Silicon Graphics, Inc. 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; either version 2 of the License, or +# (at your option) any later version. # -# Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of version 2 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. -# -# Further, this software is distributed without any warranty that it is -# free of the rightful claim of any third person regarding infringement -# or the like. Any license provided herein, whether implied or -# otherwise, applies only to this software file. Patent licenses, if -# any, provided herein do not apply to combinations of this program with -# other software, or any other product whatsoever. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write the Free Software Foundation, Inc., 59 -# Temple Place - Suite 330, Boston MA 02111-1307, USA. -# -# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, -# Mountain View, CA 94043, or: -# -# http://www.sgi.com -# -# For further information regarding this notice, see: -# -# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +# This program is distributed in the hope that it will 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 to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA +# +# Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane, +# Mountain View, CA 94043, USA, or: http://www.sgi.com +#----------------------------------------------------------------------- # common extended attribute and ACL support # pick three unused user/group ids, store them as $acl[1-3] @@ -80,7 +67,7 @@ _acl_list() _file1=$1 if [ $HOSTOS = "IRIX" ]; then - ls -D $_file1 | _acl_filter_id + ls -dD $_file1 | _acl_filter_id else chacl -l $_file1 | _acl_filter_id fi @@ -137,5 +124,32 @@ _acl_requirements() fi } +# filter user ace names to user ids +# +_filter_aces() +{ + tr '\[' '\012' |\ + tr ']' '\012' |\ + tr ',' '\012' |\ + $AWK_PROG ' + BEGIN { + FS=":" + while ( getline <"/etc/passwd" > 0 ) { + idlist[$1] = $3 + } + } + /^u/ { if ($2 in idlist) sub($2, idlist[$2]); print; next} + {print} + ' |\ + sed -e 's/u:/user:/' -e 's/g:/group:/' -e 's/o:/other:/' -e 's/m:/mask:/' +} + +_list_acl() +{ + file=$1 + + ls -dD $file | _acl_filter_id +} + # make sure this script returns success /bin/true diff --git a/common.rc b/common.rc index 482802c0..e7ec4790 100644 --- a/common.rc +++ b/common.rc @@ -764,13 +764,20 @@ _check_xfs_filesystem() return 0 } +# Filter the knowen errors the UDF Verifier reports. +_udf_test_known_error_filter() +{ + egrep -v "PVD 60 Error: Interchange Level: 1, Maximum Interchange Level: 0|FSD 28 Error: Interchange Level: 1, Maximum Interchange Level: 1,|PVD 72 Warning: Volume Set Identifier: \"\*IRIX UDF\",|Warning: [0-9]+ unused blocks NOT marked as unallocated." + +} + _check_udf_filesystem() { [ "$DISABLE_UDF_TEST" == "1" ] && return if [ $# -ne 1 -a $# -ne 2 ] then - echo "Usage: _check_fs device [last_block]" 1>&2 + echo "Usage: _check_udf_filesystem device [last_block]" 1>&2 exit 1 fi @@ -791,17 +798,13 @@ _check_udf_filesystem() OPT_ARG="-lastvalidblock $LAST_BLOCK" fi - # Output messages format: - # Error messages contain : "Error:" or "error:" - # Warning messages contain : "Warning:" or "warning:" - # Attention messages contain : "Note:" or "note:" - # Message continuation lines start with a "-" character. - rm -f $seq.checkfs sleep 1 # Due to a problem with time stamps in udf_test - $here/src/udf_test $OPT_ARG $device | tee $here/$seq.checkfs | \ - egrep -i "error:|warning:|Error count:|Warning count:" | \ - egrep -v "Error count: 0|Warning count: 0" + $here/src/udf_test $OPT_ARG $device | tee $here/$seq.checkfs | egrep "Error|Warning" | \ + _udf_test_known_error_filter | \ + egrep -iv "Error count:.*[0-9]+.*total occurrences:.*[0-9]+|Warning count:.*[0-9]+.*total occurrences:.*[0-9]+" | \ + sed "s/^.*$/Warning UDF Verifier reported errors see $seq.checkfs./g" + } _check_test_fs() @@ -900,7 +903,7 @@ _setup_xfs_testdir() testdir=$TEST_DIR } -_setup_udf_testdir() +_setup_udf_scratchdir() { [ "$FSTYP" != "udf" ] \ && _fail "setup_udf_testdir: \$FSTYP is not udf" @@ -926,10 +929,10 @@ _setup_udf_testdir() testdir=$SCRATCH_MNT } -_setup_nfs_testdir() +_setup_nfs_scratchdir() { [ "$FSTYP" != "nfs" ] \ - && _fail "setup_udf_testdir: \$FSTYP is not nfs" + && _fail "setup_nfs_testdir: \$FSTYP is not nfs" [ -z "$SCRATCH_DEV" ] \ && _notrun "this test requires a valid host fs for \$SCRATCH_DEV" [ -z "$SCRATCH_MNT" ] \ @@ -938,7 +941,7 @@ _setup_nfs_testdir() # mounted? if _mount | grep -q $SCRATCH_DEV then - # if it's mounted, make sure its on $TEST_RW_DIR + # if it's mounted, make sure its on $SCRATCH_MNT if ! _mount | grep $SCRATCH_DEV | grep -q $SCRATCH_MNT then _fail "\$SCRATCH_DEV is mounted but not on \$SCRATCH_MNT - aborting" @@ -952,6 +955,11 @@ _setup_nfs_testdir() testdir=$SCRATCH_MNT } +# +# Warning for UDF and NFS this function calls _setup_udf_scratchdir and +# _setup_udf_scratchdir. This is done because testdir is a persistent +# XFS only partition. +# _setup_testdir() { case $FSTYP in @@ -959,10 +967,10 @@ _setup_testdir() _setup_xfs_testdir ;; udf) - _setup_udf_testdir + _setup_udf_scratchdir ;; nfs*) - _setup_nfs_testdir + _setup_nfs_scratchdir ;; *) _fail "\$FSTYP is not xfs, udf or nfs" @@ -1045,5 +1053,87 @@ _link_out_file() fi } +# Populate a filesystem with inodes for performance experiments +# +# usage: populate [-v] [-n ndirs] [-f nfiles] [-d depth] [-r root] [-s size] +# + +_die() +{ + echo $@ + exit 1 +} + +_nfiles() +{ + f=0 + while [ $f -lt $1 ] + do + file=f$f + touch $file + if [ $size -gt 0 ]; then + dd if=/dev/zero of=$file bs=1024 count=$size + fi + f=`expr $f + 1` + done +} + +# takes dirname, depth +_descend() +{ + dirname=$1; depth=$2 + mkdir $dirname || die "mkdir $dirname failed" + cd $dirname + + _nfiles $files # files for this dir + + [ $depth -eq 0 ] && return + deep=`expr $depth - 1` # go 1 down + + [ $verbose = true ] && echo "descending, depth from leaves = $deep" + + d=0 + while [ $d -lt $dirs ] + do + _descend d$d $deep & + d=`expr $d + 1` + wait + done +} + + +_populate_fs() +{ + + here=`pwd` + dirs=5 # ndirs in each subdir till leaves + size=0 # sizeof files in K + files=100 # num files in _each_ subdir + depth=2 # depth of tree from root to leaves + verbose=false + root=root # path of initial root of directory tree + + while getopts "d:f:n:r:s:v" c + do + case $c in + d) depth=$OPTARG;; + n) dirs=$OPTARG;; + f) files=$OPTARG;; + s) size=$OPTARG;; + v) verbose=true;; + r) root=$OPTARG;; + esac + done + + + _descend $root $depth + wait + + cd $here + + [ $verbose = true ] && echo done + +} + # make sure this script returns success /bin/true diff --git a/group b/group index 2d233e13..c32cd0b0 100644 --- a/group +++ b/group @@ -69,28 +69,31 @@ auto dxm@sgi.com # ioctl - tests which use ioctl commands (directly/indirectly) ioctl nathans@sgi.com +# udf filesystem +udf ajones@sgi.com + # test-group association ... one line per test # -001 rw dir auto -002 metadata auto +001 rw dir udf auto +002 metadata udf auto 003 db auto 004 db auto -005 dir auto -006 dir auto -007 dir auto +005 dir udf auto +006 dir udf auto +007 dir udf auto 008 rw ioctl auto 009 rw ioctl auto -010 other auto -011 dir auto +010 other udf auto +011 dir udf auto 012 rw auto -013 other ioctl auto -014 rw auto +013 other ioctl udf auto +014 rw udf auto 015 other auto 016 rw auto 017 other auto 018 log logprint v2log auto 019 mkfs auto -020 metadata attr auto +020 metadata attr udf auto 021 db attr auto 022 dump ioctl auto 023 dump ioctl auto @@ -121,7 +124,7 @@ ioctl nathans@sgi.com 048 other auto 049 rw auto 050 quota auto -051 acl auto +051 acl udf auto 052 quota db auto 053 acl repair auto 054 quota auto @@ -132,21 +135,21 @@ ioctl nathans@sgi.com 059 dump ioctl 060 dump ioctl 061 dump ioctl auto -062 attr auto +062 attr udf auto 063 dump auto 064 dump 065 dump auto 066 dump ioctl auto 067 acl attr auto 068 other -069 rw auto -070 attr auto +069 rw udf auto +070 attr udf auto 071 rw auto 072 rw auto 073 copy auto -074 rw auto -075 rw auto -076 metadata rw +074 rw udf auto +075 rw udf auto +076 metadata rw udf 077 acl attr auto 078 growfs auto 079 acl attr ioctl metadata auto @@ -163,7 +166,13 @@ ioctl nathans@sgi.com 090 rw 091 rw 092 other auto -093 attr cap auto +093 attr cap udf auto 094 metadata dir ioctl auto 095 log v2log auto 096 mkfs v2log auto +097 udf auto +098 udf auto +099 udf auto +100 udf auto +101 udf auto +102 udf auto -- 2.39.5