diff --git a/Makefile-tests.am b/Makefile-tests.am index 48c5c70c..1ee07aa4 100644 --- a/Makefile-tests.am +++ b/Makefile-tests.am @@ -69,6 +69,19 @@ check-local: @echo " *** NOTE ***" @echo " *** NOTE ***" +vmbuild: + vagrant up # provision if not already done + vagrant rsync + vagrant ssh -c "cd sync/tests/vmcheck && make install VERSION=$$(git describe)" + vagrant ssh -c "sudo systemctl reboot" || : + +vmcheck: vmbuild + true # start test harness here + +vmshell: vmbuild + sleep 3 # give time to VM to close ssh port + vagrant ssh + testenv: @echo "===== ENTERING TESTENV =====" test_tmpdir=$$(mktemp -d test.XXXXXX) && \ diff --git a/tests/vmcheck/Makefile b/tests/vmcheck/Makefile index 58f6f519..f5267ba1 100644 --- a/tests/vmcheck/Makefile +++ b/tests/vmcheck/Makefile @@ -10,15 +10,12 @@ buildimg: sudo docker build -t $(BUILDER_IMG) -f Dockerfile.builder . build: - $(BUILDER_RUN) /bin/sh -c \ - 'if ! test -f configure; then env NOCONFIGURE=1 ./autogen.sh; fi' - $(BUILDER_RUN) /bin/sh -c \ - 'if ! test -f Makefile; then ./configure --prefix=/usr --libdir=/usr/lib64; fi' - $(BUILDER_RUN) /bin/sh -c make -j 4 + $(BUILDER_RUN) ./autogen.sh --prefix=/usr --libdir=/usr/lib64 + $(BUILDER_RUN) make -j 4 install: build sudo sh checkout.sh $(BUILDER_ARGS) -v /etc:/host/etc \ -v /ostree/repo/tmp/vmcheck.ro/usr:/host/usr \ $(BUILDER_IMG) sudo make install DESTDIR=/host - sudo sh commit_and_deploy.sh + sudo VERSION=$(VERSION) sh commit_and_deploy.sh diff --git a/tests/vmcheck/commit_and_deploy.sh b/tests/vmcheck/commit_and_deploy.sh index 842e545e..dd305a99 100644 --- a/tests/vmcheck/commit_and_deploy.sh +++ b/tests/vmcheck/commit_and_deploy.sh @@ -4,8 +4,13 @@ set -euo pipefail cd /ostree/repo/tmp umount vmcheck.ro -# would be nice to use --add-metadata-string=version=$(git describe) or so here, -# but we don't even have git! +cmd="ostree commit -b vmcheck -s '' \ + --tree=dir=vmcheck \ + --link-checkout-speedup" -ostree commit -b vmcheck -s '' --tree=dir=vmcheck --link-checkout-speedup +if [ -n "${VERSION:-}" ]; then + cmd="$cmd --add-metadata-string=version=$VERSION" +fi + +eval $cmd ostree admin deploy vmcheck