2016-07-15 20:34:47 +03:00
BASE_TESTS_ENVIRONMENT = \
2016-06-06 19:46:48 +03:00
builddir=$(abs_builddir) \
topsrcdir=$(abs_top_srcdir) \
commondir=$(abs_top_srcdir)/tests/common
2016-02-10 13:42:57 +03:00
2016-07-15 20:34:47 +03:00
AM_TESTS_ENVIRONMENT = \
UNINSTALLEDTESTS=1 \
$(BASE_TESTS_ENVIRONMENT)
2016-08-03 21:30:17 +03:00
# we consume libdnf as a submodule, but we may not have installed it yet (and we
2016-07-04 22:42:31 +03:00
# don't want it to fall back to the system libhif if it's also installed)
AM_TESTS_ENVIRONMENT += \
2017-07-13 23:39:01 +03:00
LD_LIBRARY_PATH=$(abs_builddir)/libdnf-build/libdnf:$$(cd $(top_builddir)/.libs && pwd)$${LD_LIBRARY_PATH:+:$${LD_LIBRARY_PATH}} \
GI_TYPELIB_PATH=$$(cd $(top_builddir) && pwd)$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH} \
2016-07-04 22:42:31 +03:00
$(NULL)
2017-01-17 21:29:48 +03:00
if BUILDOPT_ASAN
2017-09-21 23:59:28 +03:00
AM_TESTS_ENVIRONMENT += BUILDOPT_ASAN=yes ASAN_OPTIONS=detect_leaks=false
2017-01-17 21:29:48 +03:00
endif
2016-07-04 22:42:31 +03:00
2021-02-23 23:47:53 +03:00
GITIGNOREFILES += ssh-config vmcheck-logs/ test-compose-logs/ .cosa/
2018-03-08 23:56:05 +03:00
2016-06-06 19:08:29 +03:00
uninstalled_test_scripts = \
2014-12-18 04:26:31 +03:00
$(NULL)
2015-03-28 15:47:25 +03:00
2017-12-15 20:01:46 +03:00
uninstalled_test_extra_programs = \
dbus-run-session \
$(NULL)
2016-02-10 13:42:57 +03:00
2016-06-06 19:46:48 +03:00
dbus_run_session_SOURCES = tests/utils/dbus-run-session.c
2015-09-08 18:06:25 +03:00
2017-06-29 17:11:25 +03:00
check-local:
2015-03-28 15:47:25 +03:00
@echo " *** NOTE ***"
2021-02-23 23:47:53 +03:00
@echo " \"make check\" only runs unit tests, which have limited coverage currently."
@echo " See HACKING.md for more information about VM-based integration testing."
2015-03-28 15:47:25 +03:00
@echo " *** NOTE ***"
2016-02-26 19:31:33 +03:00
2017-09-01 20:33:36 +03:00
.PHONY: vmsync vmoverlay vmcheck testenv
2016-06-15 00:12:17 +03:00
2017-09-01 20:33:36 +03:00
vmsync:
2017-11-29 01:02:23 +03:00
@set -e; if [ -z "$(SKIP_INSTALL)" ]; then \
2017-09-30 23:29:38 +03:00
env $(BASE_TESTS_ENVIRONMENT) ./tests/vmcheck/install.sh; \
fi; \
2017-09-01 20:33:36 +03:00
env $(BASE_TESTS_ENVIRONMENT) ./tests/vmcheck/sync.sh
2019-12-13 20:19:56 +03:00
vmoverlay:
Rework vmcheck to use `kola spawn`, move off of PAPR
There's a lot going on here, but essentially:
1. We change the `vmcheck` model so that it always operates on an
immutable base image. It takes that image and dynamically launches a
separate VM for each test using `kola spawn`. This means we can drop
a lot of hacks around re-using the same VMs.
2. Following from 1., `vmoverlay` now takes as input a base image,
overlays the built rpm-ostree bits, then creates a new base image. Of
course, we don't have to do this in CI, because we build FCOS with
the freshly built RPMs (so it uses `SKIP_VMOVERLAY=1`). `vmoverlay`
then will be more for the developer case where one doesn't want to
iterate via `cosa build` to test rpm-ostree changes. I say "will"
because the functionality doesn't exist yet; I'd like to enhance
`cosa dev-overlay` to do this. (Note `vmsync` should still works just
as before too.)
3. `vmcheck` can be run without building the tree first, as
`tests/vmcheck.sh`. The `make vmcheck` target still exists though for
finger compatibility and better meshing with `vmoverlay` in the
developer case.
What's really nice about using kola spawn is that it takes care of a lot
of things for us, such as the qemu command, journal and console
gathering, and SSH.
Similarly to the compose testsuites, we're using parallel here to run
multiple vmcheck tests at once. (On developer laptops, we cap
parallelism at `$(nproc) - 1`).
2019-12-13 20:23:41 +03:00
@set -e; \
if [ -z "$(SKIP_INSTALL)" ] && [ -z "$(SKIP_VMOVERLAY)" ]; then \
env $(BASE_TESTS_ENVIRONMENT) ./tests/vmcheck/install.sh; \
fi; \
env $(BASE_TESTS_ENVIRONMENT) ./tests/vmcheck/overlay.sh;
# One can run the vmcheck.sh script directly. The make target is useful for local
# development so that e.g. we automatically overlay.
2017-06-29 17:11:25 +03:00
vmcheck: vmoverlay
Rework vmcheck to use `kola spawn`, move off of PAPR
There's a lot going on here, but essentially:
1. We change the `vmcheck` model so that it always operates on an
immutable base image. It takes that image and dynamically launches a
separate VM for each test using `kola spawn`. This means we can drop
a lot of hacks around re-using the same VMs.
2. Following from 1., `vmoverlay` now takes as input a base image,
overlays the built rpm-ostree bits, then creates a new base image. Of
course, we don't have to do this in CI, because we build FCOS with
the freshly built RPMs (so it uses `SKIP_VMOVERLAY=1`). `vmoverlay`
then will be more for the developer case where one doesn't want to
iterate via `cosa build` to test rpm-ostree changes. I say "will"
because the functionality doesn't exist yet; I'd like to enhance
`cosa dev-overlay` to do this. (Note `vmsync` should still works just
as before too.)
3. `vmcheck` can be run without building the tree first, as
`tests/vmcheck.sh`. The `make vmcheck` target still exists though for
finger compatibility and better meshing with `vmoverlay` in the
developer case.
What's really nice about using kola spawn is that it takes care of a lot
of things for us, such as the qemu command, journal and console
gathering, and SSH.
Similarly to the compose testsuites, we're using parallel here to run
multiple vmcheck tests at once. (On developer laptops, we cap
parallelism at `$(nproc) - 1`).
2019-12-13 20:23:41 +03:00
@tests/vmcheck.sh
2016-06-21 19:37:02 +03:00
2016-02-26 19:31:33 +03:00
testenv:
@echo "===== ENTERING TESTENV ====="
test_tmpdir=$$(mktemp -d test.XXXXXX) && \
cd $$test_tmpdir && \
2016-08-18 00:03:54 +03:00
env $(BASE_TESTS_ENVIRONMENT) PATH=$(abs_builddir):$$PATH TESTENV=1 \
2016-06-15 23:02:36 +03:00
sh ../tests/utils/setup-session.sh bash && \
2016-02-26 19:31:33 +03:00
cd .. && \
rm -rf $$test_tmpdir
@echo "===== LEAVING TESTENV ====="