unittests/enip: Register ENIP unittests

pull/6436/head
Jeff Lucovsky 5 years ago committed by Victor Julien
parent 8a50edbd10
commit 6e149cdec3

@ -1,4 +1,4 @@
/* Copyright (C) 2015 Open Information Security Foundation
/* Copyright (C) 2015-2021 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
@ -291,13 +291,32 @@ int DetectEngineInspectENIP(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_
#include "util-unittest.h"
#include "util-unittest-helper.h"
static uint8_t listIdentity[] = {/* List ID */ 0x00, 0x63,
/* Length */ 0x00, 0x00,
/* Session */ 0x00, 0x00, 0x00, 0x00,
/* Status */ 0x00, 0x00, 0x00, 0x00,
/* Delay*/ 0x00,
/* Context */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* Quantity of coils */ 0x00, 0x00, 0x00, 0x00,};
static uint8_t listIdentity[] = {
/* List ID */ 0x63,
0x00,
/* Length */ 0x00,
0x00,
/* Session */ 0x00,
0x00,
0x00,
0x00,
/* Status */ 0x00,
0x00,
0x00,
0x00,
/* Delay*/ 0x00,
/* Context */ 0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
/* Quantity of coils */ 0x00,
0x00,
0x00,
0x00,
0x00,
};
/** \test Test code function. */
static int DetectEngineInspectENIPTest01(void)
@ -335,8 +354,8 @@ static int DetectEngineInspectENIPTest01(void)
de_ctx->flags |= DE_QUIET;
s = de_ctx->sig_list = SigInit(de_ctx, "alert enip any any -> any any "
"(msg:\"Testing enip command\"; "
"enipcommand:99 ; sid:1;)");
"(msg:\"Testing enip command\"; "
"enip_command:99 ; sid:1;)");
FAIL_IF_NULL(s);
SigGroupBuild(de_ctx);

@ -37,6 +37,7 @@
#include "detect-engine-dcepayload.h"
#include "detect-engine-state.h"
#include "detect-engine-tag.h"
#include "detect-engine-enip.h"
#include "detect-fast-pattern.h"
#include "flow.h"
#include "flow-timeout.h"
@ -181,6 +182,7 @@ static void RegisterUnittests(void)
#endif
DeStateRegisterTests();
MemcmpRegisterTests();
DetectEngineInspectENIPRegisterTests();
DetectEngineRegisterTests();
SCLogRegisterTests();
MagicRegisterTests();

Loading…
Cancel
Save