vmcheck: move vmbuild and vmoverlay to scripts
That way we can make use of libvm instead of relying on vagrant. Closes: #394 Approved by: cgwalters
This commit is contained in:
parent
194c2bf5cd
commit
52b325970d
@ -1,11 +1,15 @@
|
|||||||
include $(top_srcdir)/buildutil/glib-tap.mk
|
include $(top_srcdir)/buildutil/glib-tap.mk
|
||||||
|
|
||||||
AM_TESTS_ENVIRONMENT = \
|
BASE_TESTS_ENVIRONMENT = \
|
||||||
UNINSTALLEDTESTS=1 \
|
|
||||||
builddir=$(abs_builddir) \
|
builddir=$(abs_builddir) \
|
||||||
topsrcdir=$(abs_top_srcdir) \
|
topsrcdir=$(abs_top_srcdir) \
|
||||||
commondir=$(abs_top_srcdir)/tests/common
|
commondir=$(abs_top_srcdir)/tests/common
|
||||||
|
|
||||||
|
|
||||||
|
AM_TESTS_ENVIRONMENT = \
|
||||||
|
UNINSTALLEDTESTS=1 \
|
||||||
|
$(BASE_TESTS_ENVIRONMENT)
|
||||||
|
|
||||||
# we consume libhif as a submodule, but we may not have installed it yet (and we
|
# we consume libhif as a submodule, but we may not have installed it yet (and we
|
||||||
# don't want it to fall back to the system libhif if it's also installed)
|
# don't want it to fall back to the system libhif if it's also installed)
|
||||||
AM_TESTS_ENVIRONMENT += \
|
AM_TESTS_ENVIRONMENT += \
|
||||||
@ -90,39 +94,28 @@ check-local:
|
|||||||
|
|
||||||
vmbuild:
|
vmbuild:
|
||||||
@if [ -z "$(SKIP_VMBUILD)" ]; then \
|
@if [ -z "$(SKIP_VMBUILD)" ]; then \
|
||||||
vagrant up && \
|
env $(BASE_TESTS_ENVIRONMENT) \
|
||||||
( [ -z "$(VMCLEAN)" ] || vagrant ssh -c "rm -rf sync" ) && \
|
tests/utils/vmbuild.sh; \
|
||||||
vagrant rsync && \
|
|
||||||
vagrant ssh -c "cd sync/vagrant && \
|
|
||||||
make install VERSION=$$(git describe)" && \
|
|
||||||
( vagrant ssh -c "sudo systemctl reboot" || : ) && \
|
|
||||||
sleep 2; \
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
vmoverlay:
|
vmoverlay:
|
||||||
vagrant up && \
|
@env $(BASE_TESTS_ENVIRONMENT) \
|
||||||
( [ -z "$(VMCLEAN)" ] || vagrant ssh -c "rm -rf sync" ) && \
|
tests/utils/vmoverlay.sh
|
||||||
vagrant rsync && \
|
|
||||||
vagrant ssh -c "cd sync/vagrant && make ofsinstall" && \
|
|
||||||
vagrant ssh -c "systemctl daemon-reload && \
|
|
||||||
systemctl restart rpm-ostreed"
|
|
||||||
|
|
||||||
vmshell: vmbuild
|
vmshell: vmbuild
|
||||||
vagrant ssh
|
sleep 2
|
||||||
|
ssh -F ssh-config vmcheck
|
||||||
|
|
||||||
# set up test environment to somewhat resemble uninstalled tests
|
# set up test environment to somewhat resemble uninstalled tests
|
||||||
vmcheck: vmbuild tests/common/compose/yum/repo/repodata/repomd.xml
|
vmcheck: vmbuild tests/common/compose/yum/repo/repodata/repomd.xml
|
||||||
@env VMTESTS=1 \
|
@env VMTESTS=1 $(BASE_TESTS_ENVIRONMENT) \
|
||||||
builddir="$(abs_builddir)" \
|
sh tests/vmcheck/test.sh
|
||||||
topsrcdir="$(abs_top_srcdir)" \
|
|
||||||
commondir="$(abs_top_srcdir)/tests/common" \
|
|
||||||
sh tests/vmcheck/test.sh
|
|
||||||
|
|
||||||
testenv:
|
testenv:
|
||||||
@echo "===== ENTERING TESTENV ====="
|
@echo "===== ENTERING TESTENV ====="
|
||||||
test_tmpdir=$$(mktemp -d test.XXXXXX) && \
|
test_tmpdir=$$(mktemp -d test.XXXXXX) && \
|
||||||
cd $$test_tmpdir && \
|
cd $$test_tmpdir && \
|
||||||
env $(AM_TESTS_ENVIRONMENT) TESTENV=1 \
|
env $(BASE_TESTS_ENVIRONMENT) TESTENV=1 \
|
||||||
sh ../tests/utils/setup-session.sh bash && \
|
sh ../tests/utils/setup-session.sh bash && \
|
||||||
cd .. && \
|
cd .. && \
|
||||||
rm -rf $$test_tmpdir
|
rm -rf $$test_tmpdir
|
||||||
|
15
tests/utils/vmbuild.sh
Executable file
15
tests/utils/vmbuild.sh
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
source ${commondir}/libvm.sh
|
||||||
|
|
||||||
|
# create ssh-config if needed and export cmds
|
||||||
|
vm_setup
|
||||||
|
|
||||||
|
if [ -n "${VMCLEAN:-}" ]; then
|
||||||
|
vm_cmd rm -rf sync
|
||||||
|
fi
|
||||||
|
|
||||||
|
vm_rsync
|
||||||
|
vm_cmd make -C sync/vagrant install VERSION=$(git describe)
|
||||||
|
vm_reboot
|
16
tests/utils/vmoverlay.sh
Executable file
16
tests/utils/vmoverlay.sh
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
source ${commondir}/libvm.sh
|
||||||
|
|
||||||
|
# create ssh-config if needed and export cmds
|
||||||
|
vm_setup
|
||||||
|
|
||||||
|
if [ -n "${VMCLEAN:-}" ]; then
|
||||||
|
vm_cmd rm -rf sync
|
||||||
|
fi
|
||||||
|
|
||||||
|
vm_rsync
|
||||||
|
vm_cmd make -C sync/vagrant ofsinstall
|
||||||
|
vm_cmd systemctl daemon-reload
|
||||||
|
vm_cmd systemctl restart rpm-ostreed
|
Loading…
Reference in New Issue
Block a user