diff --git a/tests/common/libvm.sh b/tests/common/libvm.sh index 0749bddd..6f36ec3a 100644 --- a/tests/common/libvm.sh +++ b/tests/common/libvm.sh @@ -418,10 +418,17 @@ vm_wait_content_after_cursor() { EOF } +# Minor helper that makes sure to get quoting right +vm_get_journal_after_cursor() { + from_cursor=$1; shift + to_file=$1; shift + # add an extra helping of quotes for hungry ssh + vm_cmd journalctl --after-cursor "'$from_cursor'" > $to_file +} + vm_assert_journal_has_content() { from_cursor=$1; shift - # add an extra helping of quotes for hungry ssh - vm_cmd journalctl --after-cursor "'$from_cursor'" > tmp-journal.txt + vm_get_journal_after_cursor $from_cursor tmp-journal.txt assert_file_has_content tmp-journal.txt "$@" rm -f tmp-journal.txt } diff --git a/tests/vmcheck/test-autoupdate-check.sh b/tests/vmcheck/test-autoupdate-check.sh index 3c2ea65c..7575c8bd 100755 --- a/tests/vmcheck/test-autoupdate-check.sh +++ b/tests/vmcheck/test-autoupdate-check.sh @@ -98,7 +98,7 @@ vm_wait_content_after_cursor $cursor 'Txn AutomaticUpdateTrigger.*successful' vm_rpmostree status -v > out.txt assert_not_file_has_content out.txt "AvailableUpdate" # And check the unit name https://github.com/projectatomic/rpm-ostree/pull/1368 -vm_cmd journalctl -u rpm-ostreed --after-cursor ${cursor} > journal.txt +vm_get_journal_after_cursor $cursor journal.txt assert_file_has_content journal.txt 'client(id:cli.*unit:rpm-ostreed-automatic.service' rm -f journal.txt