vmcheck: handle livefs reruns stronger

Make sure that we wipe out any leftover configuration files from a
previous run before layering the test pkg, or we'll get false positive.
Also make sure to correctly clean up the VM in the case the livefs test
errors out.

Closes: #859
Approved by: cgwalters
This commit is contained in:
Jonathan Lebon 2017-07-04 10:06:53 -07:00 committed by Atomic Bot
parent 970a20974b
commit 3b0b9fb98a
2 changed files with 8 additions and 1 deletions

View File

@ -64,6 +64,11 @@ vm_build_rpm test-livefs-with-etc \
/etc/%{name}/*
/etc/opt/%{name}*"
# make sure there are no config files already present
vm_cmd rm -rf /etc/test-livefs-with-etc \
/etc/test-livefs-with-etc.conf \
/etc/opt/test-livefs-with-etc-opt.conf
vm_rpmostree install /tmp/vmcheck/yumrepo/packages/x86_64/test-livefs-with-etc-1.0-1.x86_64.rpm
assert_livefs_ok
vm_rpmostree ex livefs

View File

@ -142,8 +142,10 @@ for tf in $(find . -name 'test-*.sh' | sort); do
# go back to the original vmcheck deployment if needed
csum_cur=$(vm_get_booted_csum)
unlocked_cur=$(vm_get_booted_deployment_info unlocked)
live_csum=$(vm_get_booted_deployment_info live-replaced)
if [[ $csum_orig != $csum_cur ]] || \
[[ $unlocked_cur != none ]]; then
[[ $unlocked_cur != none ]] || \
[ -n "${live_csum}" ]; then
# redeploy under the name 'vmcheck' so that tests can
# never modify the vmcheck_orig ref itself
vm_cmd ostree admin deploy vmcheck &>> ${LOG}