mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +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:
@@ -15,6 +15,8 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -136,6 +138,12 @@ void perform_unit_test(ModSecurityTest<RegressionTest> *test,
|
|||||||
continue;
|
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 = new modsecurity::ModSecurity();
|
||||||
modsec->setConnectorInformation("ModSecurity-regression v0.0.1-alpha" \
|
modsec->setConnectorInformation("ModSecurity-regression v0.0.1-alpha" \
|
||||||
" (ModSecurity regression test utility)");
|
" (ModSecurity regression test utility)");
|
||||||
|
Reference in New Issue
Block a user