8d419f
From 895cc5ef78f91ed542d8be6a057033b7992ad91e Mon Sep 17 00:00:00 2001
8d419f
From: Frantisek Sumsal <frantisek@sumsal.cz>
8d419f
Date: Fri, 17 Jun 2022 17:28:13 +0200
8d419f
Subject: [PATCH] test: run the custom check hooks before common checks
8d419f
8d419f
since we delete the guest journals as part of the save_journal() step in
8d419f
check_result_common(), making journal inaccessible from the custom check
8d419f
hooks.
8d419f
8d419f
(cherry picked from commit 35d2d2e61c7695b87a4ee3dc54d065f4de95f260)
8d419f
8d419f
Related: #2087652
8d419f
---
8d419f
 test/test-functions | 16 ++++++++--------
8d419f
 1 file changed, 8 insertions(+), 8 deletions(-)
8d419f
8d419f
diff --git a/test/test-functions b/test/test-functions
8d419f
index 93ab32b68d..1306dcf260 100644
8d419f
--- a/test/test-functions
8d419f
+++ b/test/test-functions
8d419f
@@ -1433,10 +1433,7 @@ check_result_nspawn() {
8d419f
     local workspace="${1:?}"
8d419f
     local ret
8d419f
 
8d419f
-    check_result_common "${workspace}"
8d419f
-    ret=$?
8d419f
-
8d419f
-    # Run additional test-specific checks if defined by check_result_nspawn_hook()
8d419f
+    # Run a test-specific checks if defined by check_result_nspawn_hook()
8d419f
     if declare -F check_result_nspawn_hook >/dev/null; then
8d419f
         if ! check_result_nspawn_hook "${workspace}"; then
8d419f
             derror "check_result_nspawn_hook() returned with EC > 0"
8d419f
@@ -1444,6 +1441,9 @@ check_result_nspawn() {
8d419f
         fi
8d419f
     fi
8d419f
 
8d419f
+    check_result_common "${workspace}"
8d419f
+    ret=$?
8d419f
+
8d419f
     _umount_dir "${initdir:?}"
8d419f
 
8d419f
     return $ret
8d419f
@@ -1454,10 +1454,7 @@ check_result_qemu() {
8d419f
     local ret
8d419f
     mount_initdir
8d419f
 
8d419f
-    check_result_common "${initdir:?}"
8d419f
-    ret=$?
8d419f
-
8d419f
-    # Run additional test-specific checks if defined by check_result_qemu_hook()
8d419f
+    # Run a test-specific checks if defined by check_result_qemu_hook()
8d419f
     if declare -F check_result_qemu_hook >/dev/null; then
8d419f
         if ! check_result_qemu_hook "${initdir:?}"; then
8d419f
             derror "check_result_qemu_hook() returned with EC > 0"
8d419f
@@ -1465,6 +1462,9 @@ check_result_qemu() {
8d419f
         fi
8d419f
     fi
8d419f
 
8d419f
+    check_result_common "${initdir:?}"
8d419f
+    ret=$?
8d419f
+
8d419f
     _umount_dir "${initdir:?}"
8d419f
 
8d419f
     return $ret