Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=97b1a767122... Commit: 97b1a767122320d752c3a3bfa6b037f8ce004dd5 Parent: 863e28ec19f92d772aae87d71ed0b202e2ce18c2 Author: Andrew Price anprice@redhat.com AuthorDate: Tue Mar 29 12:07:16 2016 +0100 Committer: Andrew Price anprice@redhat.com CommitterDate: Tue Mar 29 12:17:40 2016 +0100
gfs2-utils tests: Add fsck.gfs2 rgrp/rindex repair tests
Add some tests which exercise fsck.gfs2's resource group and rindex repair code. Two of the tests currently fail (more work to do there) so they're left commented out.
Adds a GFS_NUKERG_CHECK macro to make writing tests like these simpler.
Signed-off-by: Andrew Price anprice@redhat.com --- tests/fsck.at | 20 ++++++++++++++++++++ tests/testsuite.at | 11 ++++++++++- 2 files changed, 30 insertions(+), 1 deletions(-)
diff --git a/tests/fsck.at b/tests/fsck.at index 4d25f40..5e49985 100644 --- a/tests/fsck.at +++ b/tests/fsck.at @@ -14,3 +14,23 @@ AT_SETUP([Fix invalid goal blocks]) AT_KEYWORDS(fsck.gfs2 fsck) GFS_LANG_CHECK([mkfs.gfs2 -O -p lock_nolock $GFS_TGT], [set '/' { di_goal_meta: 0 }]) AT_CLEANUP + +AT_SETUP([Fix bad resource group #0]) +AT_KEYWORDS(fsck.gfs2 fsck) +GFS_NUKERG_CHECK([mkfs.gfs2 -O -p lock_nolock $GFS_TGT], [-r 0]) +AT_CLEANUP + +#AT_SETUP([Fix bad resource group #1]) +#AT_KEYWORDS(fsck.gfs2 fsck) +#GFS_NUKERG_CHECK([mkfs.gfs2 -O -p lock_nolock $GFS_TGT], [-r 1]) +#AT_CLEANUP + +#AT_SETUP([Fix bad rindex entry #0]) +#AT_KEYWORDS(fsck.gfs2 fsck) +#GFS_NUKERG_CHECK([mkfs.gfs2 -O -p lock_nolock $GFS_TGT], [-i 0]) +#AT_CLEANUP + +AT_SETUP([Fix bad rindex entry #1]) +AT_KEYWORDS(fsck.gfs2 fsck) +GFS_NUKERG_CHECK([mkfs.gfs2 -O -p lock_nolock $GFS_TGT], [-i 1]) +AT_CLEANUP diff --git a/tests/testsuite.at b/tests/testsuite.at index 0422b02..cc1bd54 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -12,7 +12,7 @@ AT_CHECK($1, 0, [ignore], [ignore]) AT_CHECK([fsck.gfs2 -n $GFS_TGT], 0, [ignore], [ignore])])
# Regenerate, mkfs, modify fs with gfs2l, fsck -# Usage: GFS_TGT_REGEN ([<mkfs.gfs2 command>], [<gfs2l script>]) +# Usage: GFS_LANG_CHECK ([<mkfs.gfs2 command>], [<gfs2l script>]) m4_define([GFS_LANG_CHECK], [GFS_TGT_REGEN AT_CHECK($1, 0, [ignore], [ignore]) @@ -20,6 +20,15 @@ AT_CHECK([echo "$2" | gfs2l ${GFS_TGT}], 0, [ignore], [ignore]) AT_CHECK([fsck.gfs2 -y $GFS_TGT], 1, [ignore], [ignore]) AT_CHECK([fsck.gfs2 -n $GFS_TGT], 0, [ignore], [ignore])])
+# Regenerate, mkfs, modify fs with nukerg, fsck +# Usage: GFS_NUKERG_CHECK ([<mkfs.gfs2 command>], [<gfs2l script>]) +m4_define([GFS_NUKERG_CHECK], +[GFS_TGT_REGEN +AT_CHECK($1, 0, [ignore], [ignore]) +AT_CHECK([nukerg $2 $GFS_TGT], 0, [ignore], [ignore]) +AT_CHECK([fsck.gfs2 -y $GFS_TGT], 1, [ignore], [ignore]) +AT_CHECK([fsck.gfs2 -n $GFS_TGT], 0, [ignore], [ignore])]) + # Set up a unit test, skipping if unit tests are disabled # Usage: GFS_UNIT_TEST ([name], [keywords]) m4_define([GFS_UNIT_TEST],
cluster-commits@lists.stg.fedorahosted.org