]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: run the custom check hooks before common checks
authorFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 17 Jun 2022 15:28:13 +0000 (17:28 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 17 Jun 2022 15:28:13 +0000 (17:28 +0200)
since we delete the guest journals as part of the save_journal() step in
check_result_common(), making journal inaccessible from the custom check
hooks.

test/test-functions

index d26225913c175eb751aa7f86489cf59c0e8daae7..b3844f246c6d93c3fb6dd824944aa16c14c0a2a5 100644 (file)
@@ -1502,10 +1502,7 @@ check_result_nspawn() {
     local workspace="${1:?}"
     local ret
 
-    check_result_common "${workspace}"
-    ret=$?
-
-    # Run additional test-specific checks if defined by check_result_nspawn_hook()
+    # Run a test-specific checks if defined by check_result_nspawn_hook()
     if declare -F check_result_nspawn_hook >/dev/null; then
         if ! check_result_nspawn_hook "${workspace}"; then
             derror "check_result_nspawn_hook() returned with EC > 0"
@@ -1513,6 +1510,9 @@ check_result_nspawn() {
         fi
     fi
 
+    check_result_common "${workspace}"
+    ret=$?
+
     _umount_dir "${initdir:?}"
 
     return $ret
@@ -1523,10 +1523,7 @@ check_result_qemu() {
     local ret
     mount_initdir
 
-    check_result_common "${initdir:?}"
-    ret=$?
-
-    # Run additional test-specific checks if defined by check_result_qemu_hook()
+    # Run a test-specific checks if defined by check_result_qemu_hook()
     if declare -F check_result_qemu_hook >/dev/null; then
         if ! check_result_qemu_hook "${initdir:?}"; then
             derror "check_result_qemu_hook() returned with EC > 0"
@@ -1534,6 +1531,9 @@ check_result_qemu() {
         fi
     fi
 
+    check_result_common "${initdir:?}"
+    ret=$?
+
     _umount_dir "${initdir:?}"
 
     return $ret