diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2021-04-26 19:22:42 +0200 |
---|---|---|
committer | Frantisek Sumsal <frantisek@sumsal.cz> | 2021-04-26 19:24:41 +0200 |
commit | 6695c41c31063f64de1204c8a247d33edd10599a (patch) | |
tree | 48810cb00b21981c1027a43b08e95a979a50ded6 /test | |
parent | c4cd6205e0f89ea482b338f41e70d3594a7d5e37 (diff) | |
download | systemd-6695c41c31063f64de1204c8a247d33edd10599a.tar.gz |
test: add a couple of hooks for the check_result_*() functions
So we don't have to duplicate the whole functions if we need to inject
some test-specific checks.
Diffstat (limited to 'test')
-rw-r--r-- | test/test-functions | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test-functions b/test/test-functions index 16bb4fa847..8bae7a9911 100644 --- a/test/test-functions +++ b/test/test-functions @@ -1174,6 +1174,14 @@ check_result_nspawn() { check_result_common "${workspace}" ret=$? + # Run additional 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; then + derror "check_result_nspawn_hook() returned with EC > 0" + ret=4 + fi + fi + _umount_dir "${initdir:?}" return $ret @@ -1189,6 +1197,14 @@ check_result_qemu() { _umount_dir "${initdir:?}" + # Run additional 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; then + derror "check_result_qemu_hook() returned with EC > 0" + ret=4 + fi + fi + return $ret } |