From fff9a14a57c4956ef5bd856662af491b8ea18023 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Fri, 6 Oct 2017 13:31:26 +0000 Subject: [PATCH] fixup! tests/vmcheck: add test for refresh-md and --cache-only --- tests/vmcheck/test-basic.sh | 21 ++++++--------------- tests/vmcheck/test.sh | 3 +++ 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/tests/vmcheck/test-basic.sh b/tests/vmcheck/test-basic.sh index be290a24c4..e67cee2c1f 100755 --- a/tests/vmcheck/test-basic.sh +++ b/tests/vmcheck/test-basic.sh @@ -154,20 +154,12 @@ assert_file_has_content err.txt "run.*journalctl.*for more information" vm_assert_journal_has_content $cursor 'rpm-ostree(bad-post.post).*a bad post' echo "ok script output prefixed in journal" -# check makecache/-C functionality +# check refresh-md/-C functionality # local repos are always cached, so let's start up an http server for the same # vmcheck repo start_http_repo() { - # just use a runtime service unit - cat > vmcheck-httpd.service << EOF -[Service] -# use py2 for CentOS -ExecStart=/usr/bin/python -m SimpleHTTPServer 8888 -WorkingDirectory=/tmp -EOF - vm_send /run/systemd/system vmcheck-httpd.service - vm_cmd systemctl start vmcheck-httpd.service + vm_cmd systemd-run --unit vmcheck-httpd python -m SimpleHTTPServer 8888 cat > vmcheck-http.repo << EOF [vmcheck-http] name=vmcheck-http @@ -181,25 +173,24 @@ EOF stop_http_repo() { vm_cmd systemctl stop vmcheck-httpd.service - vm_cmd rm -f /run/systemd/system/vmcheck-httpd.service } start_http_repo vm_rpmostree cleanup -rpmb vm_cmd rm -f /etc/yum.repos.d/vmcheck.repo vm_build_rpm_repo_mode skip makecache-old-pkg -vm_rpmostree makecache +vm_rpmostree refresh-md vm_build_rpm_repo_mode skip makecache-new-pkg -vm_rpmostree makecache # shouldn't do anything since it hasn't expired yet +vm_rpmostree refresh-md # shouldn't do anything since it hasn't expired yet if ! vm_rpmostree install -C makecache-old-pkg --dry-run; then assert_not_reached "failed to dry-run install old pkg from cached rpmmd" fi if vm_rpmostree install -C makecache-new-pkg --dry-run; then assert_not_reached "successfully dry-run installed new pkg from cached rpmmd?" fi -vm_rpmostree makecache -f +vm_rpmostree refresh-md -f if ! vm_rpmostree install -C makecache-new-pkg --dry-run; then assert_not_reached "failed to dry-run install new pkg from cached rpmmd?" fi stop_http_repo -echo "ok makecache and --cache-only" +echo "ok refresh-md and --cache-only" diff --git a/tests/vmcheck/test.sh b/tests/vmcheck/test.sh index bd3ac1bcbe..5f301afe0f 100755 --- a/tests/vmcheck/test.sh +++ b/tests/vmcheck/test.sh @@ -167,6 +167,9 @@ for tf in $(find . -name 'test-*.sh' | sort); do # and put back our tmp repo vm_cmd rm /etc/yum.repos.d -rf vm_cmd cp -r /etc/yum.repos.d{.tmp,} + + # and clean up our test repo + vm_cmd rm -rf /tmp/vmcheck done