mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-13 13:26:01 +03:00
tests: Prints test number on segfault
This commit is contained in:
parent
9b40a045bb
commit
e6bdadeb69
2
CHANGES
2
CHANGES
@ -1,6 +1,8 @@
|
||||
v3.x.y - YYYY-MMM-DD (to be released)
|
||||
-------------------------------------
|
||||
|
||||
- Regression: Mark the test as failed in case of segfault.
|
||||
[@zimmerle]
|
||||
- Regex key selection should not be case-sensitive
|
||||
[Issue #2296, #2107, #2297 - @michaelgranzow-avi, @victorhora,
|
||||
@airween, @martinhsv, @zimmerle]
|
||||
|
@ -211,7 +211,7 @@ void perform_unit_test(ModSecurityTest<RegressionTest> *test,
|
||||
*/
|
||||
if (test->m_automake_output) {
|
||||
std::cout << ":test-result: FAIL " << filename \
|
||||
<< ":" << t->name << std::endl;
|
||||
<< ":" << t->name << ":" << *count << std::endl;
|
||||
} else {
|
||||
std::cout << KRED << "failed!" << RESET << std::endl;
|
||||
}
|
||||
@ -254,7 +254,7 @@ void perform_unit_test(ModSecurityTest<RegressionTest> *test,
|
||||
/* Parser error was expected, but with a different content */
|
||||
if (test->m_automake_output) {
|
||||
std::cout << ":test-result: FAIL " << filename \
|
||||
<< ":" << t->name << std::endl;
|
||||
<< ":" << t->name << ":" << *count << std::endl;
|
||||
} else {
|
||||
std::cout << KRED << "failed!" << RESET << std::endl;
|
||||
}
|
||||
@ -280,7 +280,7 @@ void perform_unit_test(ModSecurityTest<RegressionTest> *test,
|
||||
if (t->parser_error.empty() == false) {
|
||||
if (test->m_automake_output) {
|
||||
std::cout << ":test-result: FAIL " << filename \
|
||||
<< ":" << t->name << std::endl;
|
||||
<< ":" << t->name << ":" << *count << std::endl;
|
||||
} else {
|
||||
std::cout << KRED << "failed!" << RESET << std::endl;
|
||||
std::cout << KWHT << "Expected a parser error." \
|
||||
@ -387,7 +387,7 @@ end:
|
||||
if (!d->contains(t->debug_log)) {
|
||||
if (test->m_automake_output) {
|
||||
std::cout << ":test-result: FAIL " << filename \
|
||||
<< ":" << t->name << std::endl;
|
||||
<< ":" << t->name << ":" << *count << std::endl;
|
||||
} else {
|
||||
std::cout << KRED << "failed!" << RESET << std::endl;
|
||||
}
|
||||
@ -399,7 +399,7 @@ end:
|
||||
} else if (r.status != t->http_code) {
|
||||
if (test->m_automake_output) {
|
||||
std::cout << ":test-result: FAIL " << filename \
|
||||
<< ":" << t->name << std::endl;
|
||||
<< ":" << t->name << ":" << *count << std::endl;
|
||||
} else {
|
||||
std::cout << KRED << "failed!" << RESET << std::endl;
|
||||
}
|
||||
@ -423,7 +423,7 @@ end:
|
||||
&& !contains(getAuditLogContent(modsec_transaction->m_rules->m_auditLog->m_path1), t->audit_log)) {
|
||||
if (test->m_automake_output) {
|
||||
std::cout << ":test-result: FAIL " << filename \
|
||||
<< ":" << t->name << std::endl;
|
||||
<< ":" << t->name << ":" << *count << std::endl;
|
||||
} else {
|
||||
std::cout << KRED << "failed!" << RESET << std::endl;
|
||||
}
|
||||
|
@ -30,10 +30,10 @@ else
|
||||
RET=$?
|
||||
if [ $RET -eq 127 ]
|
||||
then
|
||||
echo ":test-result: SKIP: json is not enabled. (unit/$RET) ../$FILE"
|
||||
echo ":test-result: SKIP: json is not enabled. (unit/$RET) ../$FILE:$i"
|
||||
elif [ $RET -ne 0 ]
|
||||
then
|
||||
echo ":test-result: FAIL possible segfault: (unit/$RET) ../$FILE"
|
||||
echo ":test-result: FAIL possible segfault: (unit/$RET) ../$FILE:$i"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user