]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
unittests/template: Register template unittests 6436/head
authorJeff Lucovsky <jeff@lucovsky.org>
Thu, 29 Apr 2021 12:55:45 +0000 (08:55 -0400)
committerVictor Julien <victor@inliniac.net>
Sat, 2 Oct 2021 08:46:08 +0000 (10:46 +0200)
src/app-layer-template.c
src/detect-template-buffer.c

index 234d7affbd2cc211e4eba097c2ea6fe0092586ba..2a9e37203052b9583eb993a9e2b1a4480ee1bd26 100644 (file)
@@ -472,9 +472,12 @@ void RegisterTemplateParsers(void)
     const char *proto_name = "template";
 
     /* TEMPLATE_START_REMOVE */
+#ifndef UNITTESTS
+    /* Ensure template registration for unittests */
     if (ConfGetNode("app-layer.protocols.template") == NULL) {
         return;
     }
+#endif
     /* TEMPLATE_END_REMOVE */
     /* Check if Template TCP detection is enabled. If it does not exist in
      * the configuration file then it will be enabled by default. */
index c294bb1fe695f0d18fa9713eca4973171b0a8777..4e5bcd66e6186e88f90667d1dd17739ac7807721 100644 (file)
@@ -53,9 +53,12 @@ static int g_template_buffer_id = 0;
 void DetectTemplateBufferRegister(void)
 {
     /* TEMPLATE_START_REMOVE */
+#ifndef UNITTESTS
+    /* Ensure registration when running unittests */
     if (ConfGetNode("app-layer.protocols.template") == NULL) {
         return;
     }
+#endif
     /* TEMPLATE_END_REMOVE */
     sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].name = "template_buffer";
     sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].desc =