[gfs2-utils] branch main updated: fsck.gfs2-tester: Improve
restoremeta error handling
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch main
in repository gfs2-utils.
The following commit(s) were added to refs/heads/main by this push:
new 064983c7 fsck.gfs2-tester: Improve restoremeta error handling
064983c7 is described below
commit 064983c761a0527beab350701422d205f4ea9d1f
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Tue Aug 8 12:08:06 2023 +0100
fsck.gfs2-tester: Improve restoremeta error handling
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
tests/fsck.gfs2-tester.sh | 25 ++++++++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/tests/fsck.gfs2-tester.sh b/tests/fsck.gfs2-tester.sh
index 41414226..8a1354ef 100755
--- a/tests/fsck.gfs2-tester.sh
+++ b/tests/fsck.gfs2-tester.sh
@@ -57,9 +57,16 @@ function log_failure()
log_result Fail
}
+function rmdev()
+{
+ [ "$truncate_size" != "0" ] && rm -vf "$device"
+ return 0
+}
+
function _truncate()
{
[ "$truncate_size" != "0" ] && truncate -s "$truncate_size" "$device"
+ return 0
}
function test_restore()
@@ -67,7 +74,7 @@ function test_restore()
local mdata=$1
(
- rm -vf "$device" &&
+ rmdev &&
_truncate &&
$GFS2EDIT restoremeta $mdata $device
) &>> "$logfile"
@@ -78,7 +85,13 @@ function test_clean()
local mdata="$1"
log_start clean "$mdata"
- test_restore "$mdata" || return $?
+ test_restore "$mdata"
+ rc=$?
+ if [ $rc -ne 0 ]; then
+ log "restoremeta finished with result $rc"
+ log_failure clean "$mdata"
+ return $rc
+ fi
echo "Running: $FSCK -n $device" >> "$logfile"
$FSCK -n "$device" &>> "$logfile"
rc=$?
@@ -95,7 +108,13 @@ function test_dirty()
local mdata=$1
log_start dirty "$mdata"
- test_restore "$mdata" || return $?
+ test_restore "$mdata"
+ rc=$?
+ if [ $rc -ne 0 ]; then
+ log "restoremeta finished with result $rc"
+ log_failure dirty "$mdata"
+ return $rc
+ fi
echo "Running: $FSCK -y $device" >> "$logfile"
$FSCK -y "$device" &>> "$logfile"
rc=$?
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
9 months