Move `check_log` to `test/test-functions`, name it `check_qemu_log`, and
do not require to specify the success message (which will be the same
for all tests).
echo "$port"
}
-check_log() {
- local msg="$1"
- local logfile="$2"
-
- if ! grep -q "${msg}" "${logfile}"; then
- echo >&2 "E: Message '${msg}' not found in QEMU log output '${logfile}'."
- return 1
- fi
-}
-
client_run() {
local test_name="$1"
local append="$2"
-netdev "user,id=lan0,net=10.0.2.0/24,dhcpstart=10.0.2.15" \
-append "$append $TEST_KERNEL_CMDLINE" \
-initrd "$TESTDIR/initramfs.testing" | tee "$TESTDIR/qemu.log"
- check_log '^All OK' "$TESTDIR/qemu.log"
+ check_qemu_log "$TESTDIR/qemu.log"
client_test_end
}
"$DRACUT" "$@"
}
+# Check QEMU logs for success marker
+check_qemu_log() {
+ local logfile="$1"
+
+ if ! grep -q "^All OK" "${logfile}"; then
+ echo >&2 "E: Message 'All OK' not found in QEMU log output '${logfile}'."
+ return 1
+ fi
+}
+
# Log the start of a client test.
client_test_start() {
local test_name="$1"