From edc11581b76ce9745c69b64bd0ea7c85069c2dff Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 29 Oct 2025 08:28:07 +0100 Subject: [PATCH] make: do not rely on git to reset the file The approach works but creates an error using the tools.git "make test" target. It would be nicer to not operate on the actual config.xml that is checked in, but that's something for later as tests need more of their own path use (and tmp directory). --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 0b2c2fe649..f485069256 100644 --- a/Makefile +++ b/Makefile @@ -362,15 +362,19 @@ migrate: validate: @${PLUGINCTL} -v +# XXX we should stop treating AclConfig dir as the test's actual /conf dir +TEST_NO_CLOBBER= ${TESTDIR}/app/models/OPNsense/ACL/AclConfig/config.xml + test: .if exists(${TESTDIR}) @if [ "$$(${VERSIONBIN} -v)" != "${CORE_PKGVERSION}" ]; then \ echo "Installed version does not match, expected ${CORE_PKGVERSION}"; \ exit 1; \ fi - @cd ${TESTDIR} && phpunit || true; rm -rf ${TESTDIR}/.phpunit.result.cache \ + @cd ${TESTDIR} && cp ${TEST_NO_CLOBBER} ${TEST_NO_CLOBBER}.save && \ + phpunit || true; rm -rf ${TESTDIR}/.phpunit.result.cache \ ${TESTDIR}/app/models/OPNsense/ACL/AclConfig/backup; \ - ${GIT} checkout -f ${TESTDIR}/app/models/OPNsense/ACL/AclConfig/config.xml + mv ${TEST_NO_CLOBBER}.save ${TEST_NO_CLOBBER} .endif clean: clean-pkgdir clean-wrksrc clean-mfcdir checkout