[gfs2-utils] 02/02: tests: Add an option to clean up the testvol file
unconditionally
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch andyp-testsuite
in repository gfs2-utils.
commit 7cc736581cd86c537500c6167cbbf707273c9650
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Fri Feb 25 16:36:07 2022 +0000
tests: Add an option to clean up the testvol file unconditionally
Failed tests skip cleanup, so if the final test doesn't remove the
testvol then it is left around in the test environment. For CI we want
to remove it so provide a --always-clean-testvol option which cleans up
unconditionally in an EXIT trap routine.
This can be used via 'make check TOPTS=--always-clean-testvol'
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
tests/atlocal.in | 9 +++++++++
tests/testsuite.at | 3 +++
2 files changed, 12 insertions(+)
diff --git a/tests/atlocal.in b/tests/atlocal.in
index 04ab40e9..eed58b10 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -6,3 +6,12 @@ gfs_max_blocks()
{
printf $((GFS_TGT_SZ*1073741824/$1))
}
+
+gfs_tgt_cleanup()
+{
+ if $1; then
+ rm -f $GFS_TGT
+ fi
+}
+
+trap 'gfs_tgt_cleanup $at_arg_always_clean_testvol' EXIT
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 6a625e5d..4dc4fa43 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -47,6 +47,9 @@ AT_CHECK([test x"$ENABLE_UNIT_TESTS" = "xyes" || exit 77])])
# Test suite begins here
AT_INIT([])
AT_COLOR_TESTS
+AT_ARG_OPTION([always-clean-testvol],
+ [AS_HELP_STRING([--always-clean-testvol],
+ [Remove the test file whether tests succeed or not])])
m4_include([mkfs.at])
m4_include([fsck.at])
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
2 years, 1 month
[gfs2-utils] 01/02: tests: Regenerate testvol where needed
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch andyp-testsuite
in repository gfs2-utils.
commit eab8bbe8829e195dbbed6ad65bf4cd064759eed0
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Fri Feb 25 12:55:39 2022 +0000
tests: Regenerate testvol where needed
Some tests depend on previous tests creating the testvol file so they
cannot be run individually. Recreate it for each test that requires it.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
tests/mkfs.at | 6 ++++++
tests/testsuite.at | 2 +-
tests/tune.at | 2 ++
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/tests/mkfs.at b/tests/mkfs.at
index 6d6d3bd1..09a3ed29 100644
--- a/tests/mkfs.at
+++ b/tests/mkfs.at
@@ -27,12 +27,14 @@ AT_CLEANUP
AT_SETUP([Quota change file size validation])
AT_KEYWORDS(mkfs.gfs2 mkfs)
+GFS_TGT_REGEN
AT_CHECK([$GFS_MKFS -p lock_nolock -c 0 $GFS_TGT], 255, [ignore], [ignore])
AT_CHECK([$GFS_MKFS -p lock_nolock -c 65 $GFS_TGT], 255, [ignore], [ignore])
AT_CLEANUP
AT_SETUP([Format version validation])
AT_KEYWORDS(mkfs.gfs2 mkfs)
+GFS_TGT_REGEN
AT_CHECK([$GFS_MKFS -p lock_nolock -o format=-1 $GFS_TGT], 255, [ignore], [ignore])
AT_CHECK([$GFS_MKFS -p lock_nolock -o format=0 $GFS_TGT], 255, [ignore], [ignore])
AT_CHECK([$GFS_MKFS -p lock_nolock -o format=1800 $GFS_TGT], 255, [ignore], [ignore])
@@ -123,6 +125,7 @@ AT_CLEANUP
AT_SETUP([Device i/o limits handling])
AT_KEYWORDS(mkfs.gfs2 mkfs)
+GFS_TGT_REGEN
AT_CHECK([$GFS_MKFS -p lock_nolock -o test_topology=0:0:0:0:0 $GFS_TGT], 0, [ignore], [ignore])
AT_CHECK([$GFS_MKFS -p lock_nolock -o test_topology=0:512:512:512:512 $GFS_TGT], 0, [ignore], [ignore])
AT_CHECK([gfs2_edit -p sb field sb_bsize $GFS_TGT | tr -d '\n' ], 0, [4096], [ignore])
@@ -134,6 +137,7 @@ AT_CLEANUP
AT_SETUP([Resource group alignment])
AT_KEYWORDS(mkfs.gfs2 mkfs)
+GFS_TGT_REGEN
AT_CHECK([$GFS_MKFS -p lock_nolock -o test_topology=0:512:65536:393216:512 $GFS_TGT], 0, [ignore], [ignore])
# Check rgrp alignment to minimum_io_size: 65536 / 4096 == 16
AT_CHECK([gfs2_edit -p rindex $GFS_TGT | grep ri_addr | awk '{print $2, $2 % 16; if ($2 % 16 != 0) { exit 1 }}'], 0, [ignore], [ignore])
@@ -143,6 +147,7 @@ AT_CLEANUP
AT_SETUP([Values of rg_skip])
AT_KEYWORDS(mkfs.gfs2 mkfs)
+GFS_TGT_REGEN
AT_CHECK([$GFS_MKFS -p lock_nolock -r 2048 $GFS_TGT], 0, [ignore], [ignore])
AT_CHECK(GFS_RUN_OR_SKIP([rgskipcheck.sh $GFS_TGT]), 0, [ignore], [ignore])
AT_CHECK([$GFS_MKFS -p lock_nolock -r 1024 $GFS_TGT], 0, [ignore], [ignore])
@@ -159,6 +164,7 @@ AT_CLEANUP
AT_SETUP([Values of rg_data0, rg_data, rg_bitbytes])
AT_KEYWORDS(mkfs.gfs2 mkfs)
+GFS_TGT_REGEN
AT_CHECK([$GFS_MKFS -p lock_nolock -r 2048 $GFS_TGT], 0, [ignore], [ignore])
AT_CHECK(GFS_RUN_OR_SKIP([rgrifieldscheck.sh $GFS_TGT]), 0, [ignore], [ignore])
AT_CHECK([$GFS_MKFS -p lock_nolock -r 1024 $GFS_TGT], 0, [ignore], [ignore])
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 1c1dc9e5..6a625e5d 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -7,7 +7,7 @@ m4_define([GFS_TGT_REGEN],
AT_SKIP_IF([test ! -f ${GFS_TGT}])])
# Regenerate the sparse file used for testing, with a given size, and skip the test if it fails
-# Usage: GFS_TGT_REGEN(<size>)
+# Usage: GFS_TGT_SIZE(<size>)
m4_define([GFS_TGT_SIZE],
[AT_CHECK([rm -f $GFS_TGT && truncate -s $1 ${GFS_TGT}], [ignore], [ignore], [ignore])
AT_SKIP_IF([test ! -f ${GFS_TGT}])])
diff --git a/tests/tune.at b/tests/tune.at
index 4f0ecd79..e477b61e 100644
--- a/tests/tune.at
+++ b/tests/tune.at
@@ -3,6 +3,7 @@ AT_BANNER([tunegfs2 tests])
AT_SETUP([Format version])
AT_KEYWORDS(tunegfs2 tune)
+GFS_TGT_REGEN
AT_CHECK([$GFS_MKFS -p lock_nolock -o format=1802 $GFS_TGT], 0, [ignore], [ignore])
# Exit code 65 == EX_DATAERR (sysexits.h)
AT_CHECK([tunegfs2 -r 0 $GFS_TGT], 65, [ignore], [ignore])
@@ -26,6 +27,7 @@ AT_CLEANUP
AT_SETUP([Expected output])
AT_KEYWORDS(tunegfs2 tune)
+GFS_TGT_REGEN
AT_CHECK([echo -n "File system volume name: cluster:fsname
File system UUID: e90815fc-087b-460c-b8a5-8edc8a2ed691
File system magic number: 0x1161970
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
2 years, 1 month