Skip to content

Commit

Permalink
snmp: remove community keyword unit test
Browse files Browse the repository at this point in the history
Ticket: 3725

This test was moved to suricata-verify snmp-community
  • Loading branch information
catenacyber authored and victorjulien committed May 5, 2024
1 parent 1297d96 commit ce4119a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 130 deletions.
1 change: 0 additions & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,6 @@ EXTRA_DIST = \
tests/detect-http-stat-msg.c \
tests/detect-http-uri.c \
tests/detect-http-user-agent.c \
tests/detect-snmp-community.c \
tests/detect-ssl-state.c \
tests/detect-ssl-version.c \
tests/detect-template-buffer.c \
Expand Down
19 changes: 3 additions & 16 deletions src/detect-snmp-community.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,17 @@
static int DetectSNMPCommunitySetup(DetectEngineCtx *, Signature *,
const char *);
static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
const DetectEngineTransforms *transforms,
Flow *f, const uint8_t flow_flags,
void *txv, const int list_id);
#ifdef UNITTESTS
static void DetectSNMPCommunityRegisterTests(void);
#endif
const DetectEngineTransforms *transforms, Flow *f, const uint8_t flow_flags, void *txv,
const int list_id);
static int g_snmp_rust_id = 0;

void DetectSNMPCommunityRegister(void)
{
sigmatch_table[DETECT_AL_SNMP_COMMUNITY].name = "snmp.community";
sigmatch_table[DETECT_AL_SNMP_COMMUNITY].desc =
"SNMP content modifier to match on the SNMP community";
sigmatch_table[DETECT_AL_SNMP_COMMUNITY].Setup =
DetectSNMPCommunitySetup;
#ifdef UNITTESTS
sigmatch_table[DETECT_AL_SNMP_COMMUNITY].RegisterTests = DetectSNMPCommunityRegisterTests;
#endif
sigmatch_table[DETECT_AL_SNMP_COMMUNITY].Setup = DetectSNMPCommunitySetup;
sigmatch_table[DETECT_AL_SNMP_COMMUNITY].url = "/rules/snmp-keywords.html#snmp-community";

sigmatch_table[DETECT_AL_SNMP_COMMUNITY].flags |= SIGMATCH_NOOPT|SIGMATCH_INFO_STICKY_BUFFER;

/* register inspect engines */
Expand Down Expand Up @@ -108,7 +99,3 @@ static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,

return buffer;
}

#ifdef UNITTESTS
#include "tests/detect-snmp-community.c"
#endif /* UNITTESTS */
113 changes: 0 additions & 113 deletions src/tests/detect-snmp-community.c

This file was deleted.

0 comments on commit ce4119a

Please sign in to comment.