test: Fix vm.install to be idempotent

Clean build-results from the VM so that `make vm` can be run without
resetting.

Also be more verbose to catch rpm errors.
This commit is contained in:
Lars Karlitski 2019-05-21 17:17:15 +02:00 committed by Martin Pitt
parent 303a69bcbd
commit 40e9c54cbb

View File

@ -8,10 +8,11 @@ partprobe
pvresize /dev/vda2 pvresize /dev/vda2
lvresize fedora/root -l+100%FREE -r lvresize fedora/root -l+100%FREE -r
rm -rf build-results
su builder -c "/usr/bin/mock --no-clean --resultdir build-results --rebuild $SRPM" su builder -c "/usr/bin/mock --no-clean --resultdir build-results --rebuild $SRPM"
packages=$(find build-results -name '*.rpm' -not -name '*.src.rpm') packages=$(find build-results -name '*.rpm' -not -name '*.src.rpm')
rpm -e $(basename -a ${packages[@]} | sed 's/-[0-9].*.rpm$//') || true rpm -e --verbose $(basename -a ${packages[@]} | sed 's/-[0-9].*.rpm$//') || true
yum install -y beakerlib $packages yum install -y beakerlib $packages
systemctl enable lorax-composer.socket systemctl enable lorax-composer.socket