mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-13 21:36:00 +03:00
Fix test issue-1831.json on LMDB
When LMDB is enabled, ModSecurity stores its persistent variables in "./modsec-shared-collections" file. Since this file wasn't cleared between tests, tests behaved differently on "in-memory per-process" and LMDB backend. This test never worked in LMDB configuration. It hasn't been discovered until now because Travis CI didn't test LMDB configuration when test was introduced.
This commit is contained in:
parent
37cf60b8d2
commit
bd6a02d69b
@ -15,6 +15,8 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include <ctime>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
@ -136,6 +138,12 @@ void perform_unit_test(ModSecurityTest<RegressionTest> *test,
|
||||
continue;
|
||||
}
|
||||
|
||||
#ifdef WITH_LMDB
|
||||
// some tests (e.g. issue-1831.json) don't like it when data persists between runs
|
||||
unlink("./modsec-shared-collections");
|
||||
unlink("./modsec-shared-collections-lock");
|
||||
#endif
|
||||
|
||||
modsec = new modsecurity::ModSecurity();
|
||||
modsec->setConnectorInformation("ModSecurity-regression v0.0.1-alpha" \
|
||||
" (ModSecurity regression test utility)");
|
||||
|
Loading…
x
Reference in New Issue
Block a user