mirror of
https://github.com/systemd/systemd.git
synced 2024-11-24 10:43:35 +08:00
test: use check_result_common()
The TEST-24 has been silently timing out for quite a while in the C8S job, as the check_result_qemu() override lacked some error checks, whoopsie.
This commit is contained in:
parent
cdece7e30a
commit
e6faf0ee22
@ -17,24 +17,19 @@ KERNEL_APPEND+=" rd.luks=1 luks.name=$PART_UUID=$DM_NAME luks.key=$PART_UUID=/ke
|
|||||||
QEMU_OPTIONS+=" -drive format=raw,cache=unsafe,file=${STATEDIR:?}/keydev.img"
|
QEMU_OPTIONS+=" -drive format=raw,cache=unsafe,file=${STATEDIR:?}/keydev.img"
|
||||||
|
|
||||||
check_result_qemu() {
|
check_result_qemu() {
|
||||||
local ret=1
|
local ret
|
||||||
|
|
||||||
mount_initdir
|
mount_initdir
|
||||||
[[ -e "${initdir:?}/testok" ]] && ret=0
|
|
||||||
[[ -f "$initdir/failed" ]] && cp -a "$initdir/failed" "${TESTDIR:?}"
|
|
||||||
|
|
||||||
cryptsetup luksOpen "${LOOPDEV:?}p2" "${DM_NAME:?}" <"$TESTDIR/keyfile"
|
cryptsetup luksOpen "${LOOPDEV:?}p2" "${DM_NAME:?}" <"$TESTDIR/keyfile"
|
||||||
mount "/dev/mapper/$DM_NAME" "$initdir/var"
|
mount "/dev/mapper/$DM_NAME" "$initdir/var"
|
||||||
save_journal "$initdir/var/log/journal"
|
|
||||||
check_coverage_reports "${initdir:?}" || ret=5
|
check_result_common "${initdir:?}" && ret=0 || ret=$?
|
||||||
|
|
||||||
_umount_dir "$initdir/var"
|
_umount_dir "$initdir/var"
|
||||||
_umount_dir "$initdir"
|
_umount_dir "$initdir"
|
||||||
cryptsetup luksClose "/dev/mapper/$DM_NAME"
|
cryptsetup luksClose "/dev/mapper/$DM_NAME"
|
||||||
|
|
||||||
[[ -f "$TESTDIR/failed" ]] && cat "$TESTDIR/failed"
|
|
||||||
echo "${JOURNAL_LIST:-No journals were saved}"
|
|
||||||
|
|
||||||
test -s "$TESTDIR/failed" && ret=1
|
|
||||||
return $ret
|
return $ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user