"end\n"
"return 0\n";
char sig[] = "alert http any any -> any any (flow:to_server; lua:unittest; sid:1;)";
- int result = 0;
uint8_t httpbuf1[] =
"POST / HTTP/1.1\r\n"
"Host: www.emergingthreats.net\r\n\r\n";
uint32_t httplen1 = sizeof(httpbuf1) - 1; /* minus the \0 */
uint32_t httplen2 = sizeof(httpbuf2) - 1; /* minus the \0 */
TcpSession ssn;
- Packet *p1 = NULL;
- Packet *p2 = NULL;
Flow f;
- Signature *s = NULL;
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx;
memset(&f, 0, sizeof(f));
memset(&ssn, 0, sizeof(ssn));
- p1 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
- p2 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
+ Packet *p1 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
+ Packet *p2 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
FLOW_INITIALIZE(&f);
f.protoctx = (void *)&ssn;
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
- if (de_ctx == NULL) {
- goto end;
- }
+ FAIL_IF_NULL(de_ctx);
de_ctx->flags |= DE_QUIET;
- s = DetectEngineAppendSig(de_ctx, sig);
- if (s == NULL) {
- printf("sig parse failed: ");
- goto end;
- }
+ Signature *s = DetectEngineAppendSig(de_ctx, sig);
+ FAIL_IF_NULL(s);
SigGroupBuild(de_ctx);
DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx);
int r = AppLayerParserParse(
NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1);
- if (r != 0) {
- printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r);
- goto end;
- }
+ FAIL_IF(r != 0);
HtpState *http_state = f.alstate;
- if (http_state == NULL) {
- printf("no http state: ");
- goto end;
- }
+ FAIL_IF_NULL(http_state);
/* do detect for p1 */
SCLogDebug("inspecting p1");
SigMatchSignatures(&th_v, de_ctx, det_ctx, p1);
- if ((PacketAlertCheck(p1, 1))) {
- printf("sid 1 didn't match on p1 but should have: ");
- goto end;
- }
+ FAIL_IF(PacketAlertCheck(p1, 1));
r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2);
- if (r != 0) {
- printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r);
- goto end;
- }
+ FAIL_IF(r != 0);
+
/* do detect for p2 */
SCLogDebug("inspecting p2");
SigMatchSignatures(&th_v, de_ctx, det_ctx, p2);
- if (!(PacketAlertCheck(p2, 1))) {
- printf("sid 1 didn't match on p2 but should have: ");
- goto end;
- }
+ FAIL_IF_NOT(PacketAlertCheck(p2, 1));
FlowVar *fv = FlowVarGet(&f, 1);
- if (fv == NULL) {
- printf("no flowvar: ");
- goto end;
- }
-
- if (fv->data.fv_str.value_len != 1) {
- printf("%u != %u: ", fv->data.fv_str.value_len, 1);
- goto end;
- }
+ FAIL_IF_NULL(fv);
- if (memcmp(fv->data.fv_str.value, "2", 1) != 0) {
- PrintRawDataFp(stdout, fv->data.fv_str.value, fv->data.fv_str.value_len);
+ FAIL_IF(fv->data.fv_str.value_len != 1);
- printf("buffer mismatch: ");
- goto end;
- }
+ FAIL_IF(memcmp(fv->data.fv_str.value, "2", 1) != 0);
- result = 1;
-end:
- if (alp_tctx != NULL)
- AppLayerParserThreadCtxFree(alp_tctx);
- if (de_ctx != NULL)
- DetectEngineCtxFree(de_ctx);
+ AppLayerParserThreadCtxFree(alp_tctx);
+ DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
- return result;
+ PASS;
}
static int LuaMatchTest01a(void)
"end\n"
"return 0\n";
char sig[] = "alert http any any -> any any (flow:to_server; lua:unittest; sid:1;)";
- int result = 0;
uint8_t httpbuf1[] = "POST / HTTP/1.1\r\n"
"Host: www.emergingthreats.net\r\n\r\n";
uint8_t httpbuf2[] = "POST / HTTP/1.1\r\n"
uint32_t httplen1 = sizeof(httpbuf1) - 1; /* minus the \0 */
uint32_t httplen2 = sizeof(httpbuf2) - 1; /* minus the \0 */
TcpSession ssn;
- Packet *p1 = NULL;
- Packet *p2 = NULL;
Flow f;
- Signature *s = NULL;
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx;
memset(&f, 0, sizeof(f));
memset(&ssn, 0, sizeof(ssn));
- p1 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
- p2 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
+ Packet *p1 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
+ Packet *p2 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
FLOW_INITIALIZE(&f);
f.protoctx = (void *)&ssn;
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
- if (de_ctx == NULL) {
- goto end;
- }
+ FAIL_IF_NULL(de_ctx);
de_ctx->flags |= DE_QUIET;
- s = DetectEngineAppendSig(de_ctx, sig);
- if (s == NULL) {
- printf("sig parse failed: ");
- goto end;
- }
+ Signature *s = DetectEngineAppendSig(de_ctx, sig);
+ FAIL_IF_NULL(s);
SigGroupBuild(de_ctx);
DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx);
int r = AppLayerParserParse(
NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1);
- if (r != 0) {
- printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r);
- goto end;
- }
+ FAIL_IF(r != 0);
+
HtpState *http_state = f.alstate;
- if (http_state == NULL) {
- printf("no http state: ");
- goto end;
- }
+ FAIL_IF_NULL(http_state);
/* do detect for p1 */
SCLogDebug("inspecting p1");
SigMatchSignatures(&th_v, de_ctx, det_ctx, p1);
- if ((PacketAlertCheck(p1, 1))) {
- printf("sid 1 didn't match on p1 but should have: ");
- goto end;
- }
+ FAIL_IF(PacketAlertCheck(p1, 1));
r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2);
- if (r != 0) {
- printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r);
- goto end;
- }
+ FAIL_IF(r != 0);
/* do detect for p2 */
SCLogDebug("inspecting p2");
SigMatchSignatures(&th_v, de_ctx, det_ctx, p2);
- if (!(PacketAlertCheck(p2, 1))) {
- printf("sid 1 didn't match on p2 but should have: ");
- goto end;
- }
+ FAIL_IF_NOT(PacketAlertCheck(p2, 1));
FlowVar *fv = FlowVarGet(&f, 1);
- if (fv == NULL) {
- printf("no flowvar: ");
- goto end;
- }
-
- if (fv->data.fv_str.value_len != 1) {
- printf("%u != %u: ", fv->data.fv_str.value_len, 1);
- goto end;
- }
+ FAIL_IF_NULL(fv);
- if (memcmp(fv->data.fv_str.value, "2", 1) != 0) {
- PrintRawDataFp(stdout, fv->data.fv_str.value, fv->data.fv_str.value_len);
+ FAIL_IF(fv->data.fv_str.value_len != 1);
- printf("buffer mismatch: ");
- goto end;
- }
+ FAIL_IF(memcmp(fv->data.fv_str.value, "2", 1) != 0);
- result = 1;
-end:
- if (alp_tctx != NULL)
- AppLayerParserThreadCtxFree(alp_tctx);
- if (de_ctx != NULL)
- DetectEngineCtxFree(de_ctx);
+ AppLayerParserThreadCtxFree(alp_tctx);
+ DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
- return result;
+ PASS;
}
/** \test payload buffer */
"end\n"
"return 0\n";
char sig[] = "alert tcp any any -> any any (flow:to_server; lua:unittest; sid:1;)";
- int result = 0;
uint8_t httpbuf1[] = "POST / HTTP/1.1\r\n"
"Host: www.emergingthreats.net\r\n\r\n";
uint8_t httpbuf2[] = "POST / HTTP/1.1\r\n"
uint32_t httplen1 = sizeof(httpbuf1) - 1; /* minus the \0 */
uint32_t httplen2 = sizeof(httpbuf2) - 1; /* minus the \0 */
TcpSession ssn;
- Packet *p1 = NULL;
- Packet *p2 = NULL;
Flow f;
- Signature *s = NULL;
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx;
memset(&f, 0, sizeof(f));
memset(&ssn, 0, sizeof(ssn));
- p1 = UTHBuildPacket(httpbuf1, httplen1, IPPROTO_TCP);
- p2 = UTHBuildPacket(httpbuf2, httplen2, IPPROTO_TCP);
+ Packet *p1 = UTHBuildPacket(httpbuf1, httplen1, IPPROTO_TCP);
+ Packet *p2 = UTHBuildPacket(httpbuf2, httplen2, IPPROTO_TCP);
FLOW_INITIALIZE(&f);
f.protoctx = (void *)&ssn;
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
- if (de_ctx == NULL) {
- goto end;
- }
+ FAIL_IF_NULL(de_ctx);
de_ctx->flags |= DE_QUIET;
- s = DetectEngineAppendSig(de_ctx, sig);
- if (s == NULL) {
- printf("sig parse failed: ");
- goto end;
- }
+ Signature *s = DetectEngineAppendSig(de_ctx, sig);
+ FAIL_IF_NULL(s);
SigGroupBuild(de_ctx);
DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx);
/* do detect for p1 */
SigMatchSignatures(&th_v, de_ctx, det_ctx, p1);
- if ((PacketAlertCheck(p1, 1))) {
- printf("sid 1 didn't match on p1 but should have: ");
- goto end;
- }
+ FAIL_IF(PacketAlertCheck(p1, 1));
/* do detect for p2 */
SigMatchSignatures(&th_v, de_ctx, det_ctx, p2);
- if (!(PacketAlertCheck(p2, 1))) {
- printf("sid 1 didn't match on p2 but should have: ");
- goto end;
- }
+ FAIL_IF_NOT(PacketAlertCheck(p2, 1));
FlowVar *fv = FlowVarGet(&f, 1);
- if (fv == NULL) {
- printf("no flowvar: ");
- goto end;
- }
+ FAIL_IF_NULL(fv);
- if (fv->data.fv_str.value_len != 1) {
- printf("%u != %u: ", fv->data.fv_str.value_len, 1);
- goto end;
- }
-
- if (memcmp(fv->data.fv_str.value, "2", 1) != 0) {
- PrintRawDataFp(stdout, fv->data.fv_str.value, fv->data.fv_str.value_len);
+ FAIL_IF(fv->data.fv_str.value_len != 1);
- printf("buffer mismatch: ");
- goto end;
- }
+ FAIL_IF(memcmp(fv->data.fv_str.value, "2", 1) != 0);
- result = 1;
-end:
- if (de_ctx != NULL)
- DetectEngineCtxFree(de_ctx);
+ DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
- return result;
+ PASS;
}
/** \test payload buffer */
"end\n"
"return 0\n";
char sig[] = "alert tcp any any -> any any (flow:to_server; lua:unittest; sid:1;)";
- int result = 0;
uint8_t httpbuf1[] = "POST / HTTP/1.1\r\n"
"Host: www.emergingthreats.net\r\n\r\n";
uint8_t httpbuf2[] = "POST / HTTP/1.1\r\n"
uint32_t httplen1 = sizeof(httpbuf1) - 1; /* minus the \0 */
uint32_t httplen2 = sizeof(httpbuf2) - 1; /* minus the \0 */
TcpSession ssn;
- Packet *p1 = NULL;
- Packet *p2 = NULL;
Flow f;
- Signature *s = NULL;
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx;
memset(&f, 0, sizeof(f));
memset(&ssn, 0, sizeof(ssn));
- p1 = UTHBuildPacket(httpbuf1, httplen1, IPPROTO_TCP);
- p2 = UTHBuildPacket(httpbuf2, httplen2, IPPROTO_TCP);
+ Packet *p1 = UTHBuildPacket(httpbuf1, httplen1, IPPROTO_TCP);
+ Packet *p2 = UTHBuildPacket(httpbuf2, httplen2, IPPROTO_TCP);
FLOW_INITIALIZE(&f);
f.protoctx = (void *)&ssn;
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
- if (de_ctx == NULL) {
- goto end;
- }
+ FAIL_IF_NULL(de_ctx);
de_ctx->flags |= DE_QUIET;
- s = DetectEngineAppendSig(de_ctx, sig);
- if (s == NULL) {
- printf("sig parse failed: ");
- goto end;
- }
+ Signature *s = DetectEngineAppendSig(de_ctx, sig);
+ FAIL_IF_NULL(s);
SigGroupBuild(de_ctx);
DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx);
/* do detect for p1 */
SigMatchSignatures(&th_v, de_ctx, det_ctx, p1);
-
- if ((PacketAlertCheck(p1, 1))) {
- printf("sid 1 didn't match on p1 but should have: ");
- goto end;
- }
+ FAIL_IF(PacketAlertCheck(p1, 1));
/* do detect for p2 */
SigMatchSignatures(&th_v, de_ctx, det_ctx, p2);
- if (!(PacketAlertCheck(p2, 1))) {
- printf("sid 1 didn't match on p2 but should have: ");
- goto end;
- }
+ FAIL_IF_NOT(PacketAlertCheck(p2, 1));
FlowVar *fv = FlowVarGet(&f, 1);
- if (fv == NULL) {
- printf("no flowvar: ");
- goto end;
- }
+ FAIL_IF_NULL(fv);
- if (fv->data.fv_str.value_len != 1) {
- printf("%u != %u: ", fv->data.fv_str.value_len, 1);
- goto end;
- }
+ FAIL_IF(fv->data.fv_str.value_len != 1);
- if (memcmp(fv->data.fv_str.value, "2", 1) != 0) {
- PrintRawDataFp(stdout, fv->data.fv_str.value, fv->data.fv_str.value_len);
+ FAIL_IF(memcmp(fv->data.fv_str.value, "2", 1) != 0);
- printf("buffer mismatch: ");
- goto end;
- }
-
- result = 1;
-end:
- if (de_ctx != NULL)
- DetectEngineCtxFree(de_ctx);
+ DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
- return result;
+ PASS;
}
/** \test packet buffer */
"end\n"
"return 0\n";
char sig[] = "alert tcp any any -> any any (flow:to_server; lua:unittest; sid:1;)";
- int result = 0;
uint8_t httpbuf1[] = "POST / HTTP/1.1\r\n"
"Host: www.emergingthreats.net\r\n\r\n";
uint8_t httpbuf2[] = "POST / HTTP/1.1\r\n"
uint32_t httplen1 = sizeof(httpbuf1) - 1; /* minus the \0 */
uint32_t httplen2 = sizeof(httpbuf2) - 1; /* minus the \0 */
TcpSession ssn;
- Packet *p1 = NULL;
- Packet *p2 = NULL;
Flow f;
- Signature *s = NULL;
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx;
memset(&f, 0, sizeof(f));
memset(&ssn, 0, sizeof(ssn));
- p1 = UTHBuildPacket(httpbuf1, httplen1, IPPROTO_TCP);
- p2 = UTHBuildPacket(httpbuf2, httplen2, IPPROTO_TCP);
+ Packet *p1 = UTHBuildPacket(httpbuf1, httplen1, IPPROTO_TCP);
+ Packet *p2 = UTHBuildPacket(httpbuf2, httplen2, IPPROTO_TCP);
FLOW_INITIALIZE(&f);
f.protoctx = (void *)&ssn;
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
- if (de_ctx == NULL) {
- goto end;
- }
+ FAIL_IF_NULL(de_ctx);
de_ctx->flags |= DE_QUIET;
- s = DetectEngineAppendSig(de_ctx, sig);
- if (s == NULL) {
- printf("sig parse failed: ");
- goto end;
- }
+ Signature *s = DetectEngineAppendSig(de_ctx, sig);
+ FAIL_IF_NULL(s);
SigGroupBuild(de_ctx);
DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx);
/* do detect for p1 */
SigMatchSignatures(&th_v, de_ctx, det_ctx, p1);
-
- if ((PacketAlertCheck(p1, 1))) {
- printf("sid 1 didn't match on p1 but should have: ");
- goto end;
- }
+ FAIL_IF(PacketAlertCheck(p1, 1));
/* do detect for p2 */
SigMatchSignatures(&th_v, de_ctx, det_ctx, p2);
- if (!(PacketAlertCheck(p2, 1))) {
- printf("sid 1 didn't match on p2 but should have: ");
- goto end;
- }
+ FAIL_IF_NOT(PacketAlertCheck(p2, 1));
FlowVar *fv = FlowVarGet(&f, 1);
- if (fv == NULL) {
- printf("no flowvar: ");
- goto end;
- }
+ FAIL_IF_NULL(fv);
- if (fv->data.fv_str.value_len != 1) {
- printf("%u != %u: ", fv->data.fv_str.value_len, 1);
- goto end;
- }
-
- if (memcmp(fv->data.fv_str.value, "2", 1) != 0) {
- PrintRawDataFp(stdout, fv->data.fv_str.value, fv->data.fv_str.value_len);
+ FAIL_IF(fv->data.fv_str.value_len != 1);
- printf("buffer mismatch: ");
- goto end;
- }
+ FAIL_IF(memcmp(fv->data.fv_str.value, "2", 1) != 0);
- result = 1;
-end:
- if (de_ctx != NULL)
- DetectEngineCtxFree(de_ctx);
+ DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
- return result;
+ PASS;
}
/** \test packet buffer */
"end\n"
"return 0\n";
char sig[] = "alert tcp any any -> any any (flow:to_server; lua:unittest; sid:1;)";
- int result = 0;
uint8_t httpbuf1[] = "POST / HTTP/1.1\r\n"
"Host: www.emergingthreats.net\r\n\r\n";
uint8_t httpbuf2[] = "POST / HTTP/1.1\r\n"
uint32_t httplen1 = sizeof(httpbuf1) - 1; /* minus the \0 */
uint32_t httplen2 = sizeof(httpbuf2) - 1; /* minus the \0 */
TcpSession ssn;
- Packet *p1 = NULL;
- Packet *p2 = NULL;
Flow f;
- Signature *s = NULL;
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx;
memset(&f, 0, sizeof(f));
memset(&ssn, 0, sizeof(ssn));
- p1 = UTHBuildPacket(httpbuf1, httplen1, IPPROTO_TCP);
- p2 = UTHBuildPacket(httpbuf2, httplen2, IPPROTO_TCP);
+ Packet *p1 = UTHBuildPacket(httpbuf1, httplen1, IPPROTO_TCP);
+ Packet *p2 = UTHBuildPacket(httpbuf2, httplen2, IPPROTO_TCP);
FLOW_INITIALIZE(&f);
f.protoctx = (void *)&ssn;
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
- if (de_ctx == NULL) {
- goto end;
- }
+ FAIL_IF_NULL(de_ctx);
de_ctx->flags |= DE_QUIET;
- s = DetectEngineAppendSig(de_ctx, sig);
- if (s == NULL) {
- printf("sig parse failed: ");
- goto end;
- }
+ Signature *s = DetectEngineAppendSig(de_ctx, sig);
+ FAIL_IF_NULL(s);
SigGroupBuild(de_ctx);
DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx);
/* do detect for p1 */
SigMatchSignatures(&th_v, de_ctx, det_ctx, p1);
-
- if ((PacketAlertCheck(p1, 1))) {
- printf("sid 1 didn't match on p1 but should have: ");
- goto end;
- }
+ FAIL_IF(PacketAlertCheck(p1, 1));
/* do detect for p2 */
SigMatchSignatures(&th_v, de_ctx, det_ctx, p2);
-
- if (!(PacketAlertCheck(p2, 1))) {
- printf("sid 1 didn't match on p2 but should have: ");
- goto end;
- }
+ FAIL_IF_NOT(PacketAlertCheck(p2, 1));
FlowVar *fv = FlowVarGet(&f, 1);
- if (fv == NULL) {
- printf("no flowvar: ");
- goto end;
- }
+ FAIL_IF_NULL(fv);
- if (fv->data.fv_str.value_len != 1) {
- printf("%u != %u: ", fv->data.fv_str.value_len, 1);
- goto end;
- }
-
- if (memcmp(fv->data.fv_str.value, "2", 1) != 0) {
- PrintRawDataFp(stdout, fv->data.fv_str.value, fv->data.fv_str.value_len);
+ FAIL_IF(fv->data.fv_str.value_len != 1);
- printf("buffer mismatch: ");
- goto end;
- }
+ FAIL_IF(memcmp(fv->data.fv_str.value, "2", 1) != 0);
- result = 1;
-end:
- if (de_ctx != NULL)
- DetectEngineCtxFree(de_ctx);
+ DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
- return result;
+ PASS;
}
/** \test http buffer, flowints */
"end\n"
"return 0\n";
char sig[] = "alert http any any -> any any (flow:to_server; lua:unittest; sid:1;)";
- int result = 0;
uint8_t httpbuf1[] = "POST / HTTP/1.1\r\n"
"Host: www.emergingthreats.net\r\n\r\n";
uint8_t httpbuf2[] = "POST / HTTP/1.1\r\n"
uint32_t httplen1 = sizeof(httpbuf1) - 1; /* minus the \0 */
uint32_t httplen2 = sizeof(httpbuf2) - 1; /* minus the \0 */
TcpSession ssn;
- Packet *p1 = NULL;
- Packet *p2 = NULL;
Flow f;
- Signature *s = NULL;
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx;
memset(&f, 0, sizeof(f));
memset(&ssn, 0, sizeof(ssn));
- p1 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
- p2 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
+ Packet *p1 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
+ Packet *p2 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
FLOW_INITIALIZE(&f);
f.protoctx = (void *)&ssn;
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
- if (de_ctx == NULL) {
- goto end;
- }
+ FAIL_IF_NULL(de_ctx);
de_ctx->flags |= DE_QUIET;
- s = DetectEngineAppendSig(de_ctx, sig);
- if (s == NULL) {
- printf("sig parse failed: ");
- goto end;
- }
+ Signature *s = DetectEngineAppendSig(de_ctx, sig);
+ FAIL_IF_NULL(s);
SigGroupBuild(de_ctx);
DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx);
int r = AppLayerParserParse(
NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1);
- if (r != 0) {
- printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r);
- goto end;
- }
+ FAIL_IF(r != 0);
HtpState *http_state = f.alstate;
- if (http_state == NULL) {
- printf("no http state: ");
- goto end;
- }
+ FAIL_IF_NULL(http_state);
/* do detect for p1 */
SCLogInfo("p1");
SigMatchSignatures(&th_v, de_ctx, det_ctx, p1);
- if (PacketAlertCheck(p1, 1)) {
- printf("sid 1 matched on p1 but should not have: ");
- goto end;
- }
+ FAIL_IF(PacketAlertCheck(p1, 1));
r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2);
- if (r != 0) {
- printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r);
- goto end;
- }
+ FAIL_IF(r != 0);
/* do detect for p2 */
SCLogInfo("p2");
SigMatchSignatures(&th_v, de_ctx, det_ctx, p2);
- if (!(PacketAlertCheck(p2, 1))) {
- printf("sid 1 didn't match on p2 but should have: ");
- goto end;
- }
+ FAIL_IF_NOT(PacketAlertCheck(p2, 1));
FlowVar *fv = FlowVarGet(&f, 1);
- if (fv == NULL) {
- printf("no flowvar: ");
- goto end;
- }
+ FAIL_IF_NULL(fv);
- if (fv->data.fv_int.value != 2) {
- printf("%u != %u: ", fv->data.fv_int.value, 2);
- goto end;
- }
+ FAIL_IF(fv->data.fv_int.value != 2);
- result = 1;
-end:
- if (alp_tctx != NULL)
- AppLayerParserThreadCtxFree(alp_tctx);
- if (de_ctx != NULL)
- DetectEngineCtxFree(de_ctx);
+ AppLayerParserThreadCtxFree(alp_tctx);
+ DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
- return result;
+ PASS;
}
/** \test http buffer, flowints */
"end\n"
"return 0\n";
char sig[] = "alert http any any -> any any (flow:to_server; lua:unittest; sid:1;)";
- int result = 0;
uint8_t httpbuf1[] =
"POST / HTTP/1.1\r\n"
"Host: www.emergingthreats.net\r\n\r\n";
uint32_t httplen1 = sizeof(httpbuf1) - 1; /* minus the \0 */
uint32_t httplen2 = sizeof(httpbuf2) - 1; /* minus the \0 */
TcpSession ssn;
- Packet *p1 = NULL;
- Packet *p2 = NULL;
Flow f;
- Signature *s = NULL;
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx;
memset(&f, 0, sizeof(f));
memset(&ssn, 0, sizeof(ssn));
- p1 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
- p2 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
+ Packet *p1 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
+ Packet *p2 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
FLOW_INITIALIZE(&f);
f.protoctx = (void *)&ssn;
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
- if (de_ctx == NULL) {
- goto end;
- }
+ FAIL_IF_NULL(de_ctx);
de_ctx->flags |= DE_QUIET;
- s = DetectEngineAppendSig(de_ctx, sig);
- if (s == NULL) {
- printf("sig parse failed: ");
- goto end;
- }
+ Signature *s = DetectEngineAppendSig(de_ctx, sig);
+ FAIL_IF_NULL(s);
SigGroupBuild(de_ctx);
DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx);
int r = AppLayerParserParse(
NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1);
- if (r != 0) {
- printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r);
- goto end;
- }
+ FAIL_IF(r != 0);
HtpState *http_state = f.alstate;
- if (http_state == NULL) {
- printf("no http state: ");
- goto end;
- }
+ FAIL_IF_NULL(http_state);
/* do detect for p1 */
SCLogInfo("p1");
SigMatchSignatures(&th_v, de_ctx, det_ctx, p1);
- if (PacketAlertCheck(p1, 1)) {
- printf("sid 1 matched on p1 but should not have: ");
- goto end;
- }
+ FAIL_IF(PacketAlertCheck(p1, 1));
r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2);
- if (r != 0) {
- printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r);
- goto end;
- }
+ FAIL_IF(r != 0);
/* do detect for p2 */
SCLogInfo("p2");
SigMatchSignatures(&th_v, de_ctx, det_ctx, p2);
- if (!(PacketAlertCheck(p2, 1))) {
- printf("sid 1 didn't match on p2 but should have: ");
- goto end;
- }
+ FAIL_IF_NOT(PacketAlertCheck(p2, 1));
FlowVar *fv = FlowVarGet(&f, 1);
- if (fv == NULL) {
- printf("no flowvar: ");
- goto end;
- }
+ FAIL_IF_NULL(fv);
- if (fv->data.fv_int.value != 2) {
- printf("%u != %u: ", fv->data.fv_int.value, 2);
- goto end;
- }
+ FAIL_IF(fv->data.fv_int.value != 2);
- result = 1;
-end:
- if (alp_tctx != NULL)
- AppLayerParserThreadCtxFree(alp_tctx);
- if (de_ctx != NULL)
- DetectEngineCtxFree(de_ctx);
+ AppLayerParserThreadCtxFree(alp_tctx);
+ DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
- return result;
+ PASS;
}
/** \test http buffer, flowints */
"end\n"
"return 0\n";
char sig[] = "alert http any any -> any any (flow:to_server; lua:unittest; sid:1;)";
- int result = 0;
uint8_t httpbuf1[] =
"POST / HTTP/1.1\r\n"
"Host: www.emergingthreats.net\r\n\r\n";
uint32_t httplen1 = sizeof(httpbuf1) - 1; /* minus the \0 */
uint32_t httplen2 = sizeof(httpbuf2) - 1; /* minus the \0 */
TcpSession ssn;
- Packet *p1 = NULL;
- Packet *p2 = NULL;
Flow f;
- Signature *s = NULL;
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx;
memset(&f, 0, sizeof(f));
memset(&ssn, 0, sizeof(ssn));
- p1 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
- p2 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
+ Packet *p1 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
+ Packet *p2 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
FLOW_INITIALIZE(&f);
f.protoctx = (void *)&ssn;
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
- if (de_ctx == NULL) {
- goto end;
- }
+ FAIL_IF_NULL(de_ctx);
de_ctx->flags |= DE_QUIET;
- s = DetectEngineAppendSig(de_ctx, sig);
- if (s == NULL) {
- printf("sig parse failed: ");
- goto end;
- }
+ Signature *s = DetectEngineAppendSig(de_ctx, sig);
+ FAIL_IF_NULL(s);
SigGroupBuild(de_ctx);
DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx);
int r = AppLayerParserParse(
NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1);
- if (r != 0) {
- printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r);
- goto end;
- }
+ FAIL_IF(r != 0);
HtpState *http_state = f.alstate;
- if (http_state == NULL) {
- printf("no http state: ");
- goto end;
- }
+ FAIL_IF_NULL(http_state);
/* do detect for p1 */
SCLogInfo("p1");
SigMatchSignatures(&th_v, de_ctx, det_ctx, p1);
- if (PacketAlertCheck(p1, 1)) {
- printf("sid 1 matched on p1 but should not have: ");
- goto end;
- }
+ FAIL_IF(PacketAlertCheck(p1, 1));
r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2);
- if (r != 0) {
- printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r);
- goto end;
- }
+ FAIL_IF(r != 0);
/* do detect for p2 */
SCLogInfo("p2");
SigMatchSignatures(&th_v, de_ctx, det_ctx, p2);
- if (!(PacketAlertCheck(p2, 1))) {
- printf("sid 1 didn't match on p2 but should have: ");
- goto end;
- }
+ FAIL_IF_NOT(PacketAlertCheck(p2, 1));
FlowVar *fv = FlowVarGet(&f, 1);
- if (fv == NULL) {
- printf("no flowvar: ");
- goto end;
- }
+ FAIL_IF_NULL(fv);
- if (fv->data.fv_int.value != 2) {
- printf("%u != %u: ", fv->data.fv_int.value, 2);
- goto end;
- }
+ FAIL_IF(fv->data.fv_int.value != 2);
- result = 1;
-end:
- if (alp_tctx != NULL)
- AppLayerParserThreadCtxFree(alp_tctx);
- if (de_ctx != NULL)
- DetectEngineCtxFree(de_ctx);
+ AppLayerParserThreadCtxFree(alp_tctx);
+ DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
- return result;
+ PASS;
}
/** \test http buffer, flowints */
"end\n"
"return 0\n";
char sig[] = "alert http any any -> any any (flow:to_server; lua:unittest; sid:1;)";
- int result = 0;
uint8_t httpbuf1[] =
"POST / HTTP/1.1\r\n"
"Host: www.emergingthreats.net\r\n\r\n";
uint32_t httplen1 = sizeof(httpbuf1) - 1; /* minus the \0 */
uint32_t httplen2 = sizeof(httpbuf2) - 1; /* minus the \0 */
TcpSession ssn;
- Packet *p1 = NULL;
- Packet *p2 = NULL;
Flow f;
- Signature *s = NULL;
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx;
memset(&f, 0, sizeof(f));
memset(&ssn, 0, sizeof(ssn));
- p1 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
- p2 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
+ Packet *p1 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
+ Packet *p2 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
FLOW_INITIALIZE(&f);
f.protoctx = (void *)&ssn;
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
- if (de_ctx == NULL) {
- goto end;
- }
+ FAIL_IF_NULL(de_ctx);
de_ctx->flags |= DE_QUIET;
- s = DetectEngineAppendSig(de_ctx, sig);
- if (s == NULL) {
- printf("sig parse failed: ");
- goto end;
- }
+ Signature *s = DetectEngineAppendSig(de_ctx, sig);
+ FAIL_IF_NULL(s);
SigGroupBuild(de_ctx);
DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx);
int r = AppLayerParserParse(
NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1);
- if (r != 0) {
- printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r);
- goto end;
- }
+ FAIL_IF(r != 0);
HtpState *http_state = f.alstate;
- if (http_state == NULL) {
- printf("no http state: ");
- goto end;
- }
+ FAIL_IF_NULL(http_state);
/* do detect for p1 */
SCLogInfo("p1");
SigMatchSignatures(&th_v, de_ctx, det_ctx, p1);
- if (PacketAlertCheck(p1, 1)) {
- printf("sid 1 matched on p1 but should not have: ");
- goto end;
- }
+ FAIL_IF(PacketAlertCheck(p1, 1));
r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2);
- if (r != 0) {
- printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r);
- goto end;
- }
+ FAIL_IF(r != 0);
/* do detect for p2 */
SCLogInfo("p2");
SigMatchSignatures(&th_v, de_ctx, det_ctx, p2);
- if (!(PacketAlertCheck(p2, 1))) {
- printf("sid 1 didn't match on p2 but should have: ");
- goto end;
- }
+ FAIL_IF_NOT(PacketAlertCheck(p2, 1));
FlowVar *fv = FlowVarGet(&f, 1);
- if (fv == NULL) {
- printf("no flowvar: ");
- goto end;
- }
+ FAIL_IF_NULL(fv);
- if (fv->data.fv_int.value != 2) {
- printf("%u != %u: ", fv->data.fv_int.value, 2);
- goto end;
- }
+ FAIL_IF(fv->data.fv_int.value != 2);
- result = 1;
-end:
- if (alp_tctx != NULL)
- AppLayerParserThreadCtxFree(alp_tctx);
- if (de_ctx != NULL)
- DetectEngineCtxFree(de_ctx);
+ AppLayerParserThreadCtxFree(alp_tctx);
+ DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
- return result;
+ PASS;
}
/** \test http buffer, flowints */
"end\n"
"return 0\n";
char sig[] = "alert http any any -> any any (flow:to_server; lua:unittest; sid:1;)";
- int result = 0;
uint8_t httpbuf1[] =
"POST / HTTP/1.1\r\n"
"Host: www.emergingthreats.net\r\n\r\n";
uint32_t httplen1 = sizeof(httpbuf1) - 1; /* minus the \0 */
uint32_t httplen2 = sizeof(httpbuf2) - 1; /* minus the \0 */
TcpSession ssn;
- Packet *p1 = NULL;
- Packet *p2 = NULL;
Flow f;
- Signature *s = NULL;
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx;
memset(&f, 0, sizeof(f));
memset(&ssn, 0, sizeof(ssn));
- p1 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
- p2 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
+ Packet *p1 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
+ Packet *p2 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
FLOW_INITIALIZE(&f);
f.protoctx = (void *)&ssn;
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
- if (de_ctx == NULL) {
- goto end;
- }
+ FAIL_IF_NULL(de_ctx);
de_ctx->flags |= DE_QUIET;
- s = DetectEngineAppendSig(de_ctx, sig);
- if (s == NULL) {
- printf("sig parse failed: ");
- goto end;
- }
+ Signature *s = DetectEngineAppendSig(de_ctx, sig);
+ FAIL_IF_NULL(s);
SigGroupBuild(de_ctx);
DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx);
int r = AppLayerParserParse(
NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1);
- if (r != 0) {
- printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r);
- goto end;
- }
+ FAIL_IF(r != 0);
HtpState *http_state = f.alstate;
- if (http_state == NULL) {
- printf("no http state: ");
- goto end;
- }
+ FAIL_IF_NULL(http_state);
/* do detect for p1 */
SCLogInfo("p1");
SigMatchSignatures(&th_v, de_ctx, det_ctx, p1);
- if (PacketAlertCheck(p1, 1)) {
- printf("sid 1 matched on p1 but should not have: ");
- goto end;
- }
+ FAIL_IF(PacketAlertCheck(p1, 1));
r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2);
- if (r != 0) {
- printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r);
- goto end;
- }
+ FAIL_IF(r != 0);
/* do detect for p2 */
SCLogInfo("p2");
SigMatchSignatures(&th_v, de_ctx, det_ctx, p2);
- if (!(PacketAlertCheck(p2, 1))) {
- printf("sid 1 didn't match on p2 but should have: ");
- goto end;
- }
+ FAIL_IF_NOT(PacketAlertCheck(p2, 1));
FlowVar *fv = FlowVarGet(&f, 1);
- if (fv == NULL) {
- printf("no flowvar: ");
- goto end;
- }
+ FAIL_IF_NULL(fv);
- if (fv->data.fv_int.value != 0) {
- printf("%u != %u: ", fv->data.fv_int.value, 0);
- goto end;
- }
+ FAIL_IF(fv->data.fv_int.value != 0);
- result = 1;
-end:
- if (alp_tctx != NULL)
- AppLayerParserThreadCtxFree(alp_tctx);
- if (de_ctx != NULL)
- DetectEngineCtxFree(de_ctx);
+ AppLayerParserThreadCtxFree(alp_tctx);
+ DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
- return result;
+ PASS;
}
/** \test http buffer, flowints */
"end\n"
"return 0\n";
char sig[] = "alert http any any -> any any (flow:to_server; lua:unittest; sid:1;)";
- int result = 0;
uint8_t httpbuf1[] =
"POST / HTTP/1.1\r\n"
"Host: www.emergingthreats.net\r\n\r\n";
uint32_t httplen1 = sizeof(httpbuf1) - 1; /* minus the \0 */
uint32_t httplen2 = sizeof(httpbuf2) - 1; /* minus the \0 */
TcpSession ssn;
- Packet *p1 = NULL;
- Packet *p2 = NULL;
Flow f;
- Signature *s = NULL;
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx;
memset(&f, 0, sizeof(f));
memset(&ssn, 0, sizeof(ssn));
- p1 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
- p2 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
+ Packet *p1 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
+ Packet *p2 = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
FLOW_INITIALIZE(&f);
f.protoctx = (void *)&ssn;
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
- if (de_ctx == NULL) {
- goto end;
- }
+ FAIL_IF_NULL(de_ctx);
de_ctx->flags |= DE_QUIET;
- s = DetectEngineAppendSig(de_ctx, sig);
- if (s == NULL) {
- printf("sig parse failed: ");
- goto end;
- }
+ Signature *s = DetectEngineAppendSig(de_ctx, sig);
+ FAIL_IF_NULL(s);
SigGroupBuild(de_ctx);
DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx);
int r = AppLayerParserParse(
NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1);
- if (r != 0) {
- printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r);
- goto end;
- }
+ FAIL_IF(r != 0);
HtpState *http_state = f.alstate;
- if (http_state == NULL) {
- printf("no http state: ");
- goto end;
- }
+ FAIL_IF_NULL(http_state);
/* do detect for p1 */
SCLogInfo("p1");
SigMatchSignatures(&th_v, de_ctx, det_ctx, p1);
- if (PacketAlertCheck(p1, 1)) {
- printf("sid 1 matched on p1 but should not have: ");
- goto end;
- }
+ FAIL_IF(PacketAlertCheck(p1, 1));
r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2);
- if (r != 0) {
- printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r);
- goto end;
- }
+ FAIL_IF(r != 0);
/* do detect for p2 */
SCLogInfo("p2");
SigMatchSignatures(&th_v, de_ctx, det_ctx, p2);
- if (!(PacketAlertCheck(p2, 1))) {
- printf("sid 1 didn't match on p2 but should have: ");
- goto end;
- }
+ FAIL_IF_NOT(PacketAlertCheck(p2, 1));
FlowVar *fv = FlowVarGet(&f, 1);
- if (fv == NULL) {
- printf("no flowvar: ");
- goto end;
- }
+ FAIL_IF_NULL(fv);
- if (fv->data.fv_int.value != 0) {
- printf("%u != %u: ", fv->data.fv_int.value, 0);
- goto end;
- }
+ FAIL_IF(fv->data.fv_int.value != 0);
- result = 1;
-end:
- if (alp_tctx != NULL)
- AppLayerParserThreadCtxFree(alp_tctx);
- if (de_ctx != NULL)
- DetectEngineCtxFree(de_ctx);
+ AppLayerParserThreadCtxFree(alp_tctx);
+ DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
- return result;
+ PASS;
}
void DetectLuaRegisterTests(void)