[pmg-devel] [PATCH pmg-api 2/3] tests: make test nature explicit
Stoiko Ivanov
s.ivanov at proxmox.com
Fri Jan 2 21:32:00 CET 2026
Most of the tests in PMG's test-suite are integration tests in nature
- they create a database, set the default ruleset and compare it, or
run tests against a running pmgpolicy daemon.
The two test-suites that are closer to unit-tests are test_utils.pl
and ./test_sa_channel_parser.pl.
This patch refactors the Makefile (and drops a few commented out
lines) to make this distinction explicit, in preparation for only
running unit-tests in restricted build-environments (e.g. sbuild).
No functional change intended.
Suggested-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
src/tests/Makefile | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/src/tests/Makefile b/src/tests/Makefile
index 68f77e4d..3d5b0179 100644
--- a/src/tests/Makefile
+++ b/src/tests/Makefile
@@ -1,26 +1,25 @@
-#export TESTDB = "Proxmox_testdb"
-
export PERLLIB = ..
all:
.PHONY: check
-check: test-utils
+check: test-utils test-sa-channel integration-tests
+
+.PHONY: test-utils
+test-utils:
+ ./test_utils.pl
+
+.PHONY: test-sa-channel
+test-sa-channel:
+ ./test_sa_channel_parser.pl
+
+.PHONY: integration-tests
+integration-tests:
./create_testdb.pl
./init_testdb.pl
./print_testdb.pl > testdb.txt.new
diff -u testdb.txt testdb.txt.new
./test_greylist.pl
- ./test_sa_channel_parser.pl
-
-# test_config.pl \
-# test_mimetype.pl \
-# test_proxy.pl \
-# test_unpack.pl
-
-.PHONY: test-utils
-test-utils:
- ./test_utils.pl
clean:
rm -rf *~ proxytest_report.out test.cfg testdb.txt.new
--
2.47.3
More information about the pmg-devel
mailing list