]> git.proxmox.com Git - pve-installer.git/commitdiff
buildsys: setup proper test environment for testsuite
authorChristoph Heiss <c.heiss@proxmox.com>
Wed, 6 Dec 2023 11:34:54 +0000 (12:34 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 24 Feb 2024 17:00:17 +0000 (18:00 +0100)
Some test to come will need a proper environment.

`prepare-test-env` can also be generally useful while developing to
quickly set up a new test environment as needed.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Makefile

index fea09c55c8bd69e957160ec9e73c15313a24eea6..f0c361b96d60bda6ae215b5b8c47efd332c3cce5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -77,8 +77,15 @@ $(DSC): $(BUILDDIR)
 sbuild: $(DSC)
        sbuild $(DSC)
 
+.PHONY: prepare-test-env
+prepare-test-env: cd-info.test country.dat test.img
+       rm -rf testdir
+       mkdir -p testdir/var/lib/proxmox-installer/
+       cp -v country.dat testdir/var/lib/proxmox-installer/
+       ./proxmox-low-level-installer -t test.img dump-env
+
 .PHONY: test
-test:
+test: prepare-test-env
        $(MAKE) -C test check
        $(CARGO) test --workspace $(CARGO_BUILD_ARGS)