]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/ftpbounce: remove obsolete tests
authorVictor Julien <vjulien@oisf.net>
Fri, 17 Mar 2023 13:40:02 +0000 (14:40 +0100)
committerVictor Julien <vjulien@oisf.net>
Sat, 15 Apr 2023 05:02:49 +0000 (07:02 +0200)
src/detect-ftpbounce.c

index 5c399e9847b556c22c37ac5463ab6a6d9fd3bf9a..6fe9457c25c5ebfd4e63ac37ff70390c816b47c2 100644 (file)
@@ -52,9 +52,6 @@ static int DetectFtpbounceALMatch(DetectEngineThreadCtx *,
         const Signature *, const SigMatchCtx *);
 
 static int DetectFtpbounceSetup(DetectEngineCtx *, Signature *, const char *);
-#ifdef UNITTESTS
-static void DetectFtpbounceRegisterTests(void);
-#endif
 static int g_ftp_request_list_id = 0;
 
 /**
@@ -67,9 +64,6 @@ void DetectFtpbounceRegister(void)
     sigmatch_table[DETECT_FTPBOUNCE].desc = "detect FTP bounce attacks";
     sigmatch_table[DETECT_FTPBOUNCE].Setup = DetectFtpbounceSetup;
     sigmatch_table[DETECT_FTPBOUNCE].AppLayerTxMatch = DetectFtpbounceALMatch;
-#ifdef UNITTESTS
-    sigmatch_table[DETECT_FTPBOUNCE].RegisterTests = DetectFtpbounceRegisterTests;
-#endif
     sigmatch_table[DETECT_FTPBOUNCE].url = "/rules/ftp-keywords.html#ftpbounce";
     sigmatch_table[DETECT_FTPBOUNCE].flags = SIGMATCH_NOOPT;
 
@@ -239,33 +233,3 @@ int DetectFtpbounceSetup(DetectEngineCtx *de_ctx, Signature *s, const char *ftpb
     SigMatchAppendSMToList(s, sm, g_ftp_request_list_id);
     SCReturnInt(0);
 }
-
-#ifdef UNITTESTS
-#include "detect-engine-alert.h"
-
-/**
- * \test DetectFtpbounceTestSetup01 is a test for the Setup ftpbounce
- */
-static int DetectFtpbounceTestSetup01(void)
-{
-    DetectEngineCtx *de_ctx = NULL;
-    Signature *s = SigAlloc();
-    FAIL_IF (s == NULL);
-
-    /* ftpbounce doesn't accept options so the str is NULL */
-    FAIL_IF_NOT(DetectFtpbounceSetup(de_ctx, s, NULL) == 0);
-    FAIL_IF(s->sm_lists[g_ftp_request_list_id] == NULL);
-    FAIL_IF_NOT(s->sm_lists[g_ftp_request_list_id]->type & DETECT_FTPBOUNCE);
-
-    SigFree(de_ctx, s);
-    PASS;
-}
-
-/**
- * \brief this function registers unit tests for DetectFtpbounce
- */
-static void DetectFtpbounceRegisterTests(void)
-{
-    UtRegisterTest("DetectFtpbounceTestSetup01", DetectFtpbounceTestSetup01);
-}
-#endif /* UNITTESTS */