From 226ef6c01ab2b18e5a824d45782451a5c6ecbc63 Mon Sep 17 00:00:00 2001 From: Juliana Fajardini Date: Tue, 10 Feb 2026 11:04:46 -0300 Subject: [PATCH] build-scopes: add QA_SIMULATION mode For qa-simulation scenarios, especially for testing purposes. Task #7885 (cherry picked from commit 5edb5a5d1a9190c4936cb7b4cfbd835eb365d31f) (cherry picked from commit f7cb04bfff9bdf10ea75a8cdcd35d9e018e6b188) --- configure.ac | 9 +++++++++ src/suricata.c | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/configure.ac b/configure.ac index b27c18dfee..2a4e9fc0dc 100644 --- a/configure.ac +++ b/configure.ac @@ -502,6 +502,14 @@ ]) AM_CONDITIONAL([DEBUG_VALIDATION], [test "x$enable_debug_validation" = "xyes"]) + # enable qa-simulation mode -- disabled by default + AC_ARG_ENABLE(qa-simulation, + AS_HELP_STRING([--enable-qa-simulation], [Enable qa-simulation mode]), [enable_qa_simulation=$enableval],[enable_qa_simulation=no]) + AS_IF([test "x$enable_qa_simulation" = "xyes"], [ + AC_DEFINE([QA_SIMULATION],[1],[Enable qa-simulation mode]) + ]) + AM_CONDITIONAL([QA_SIMULATION], [test "x$enable_qa_simulation" = "xyes"]) + # profiling support AC_ARG_ENABLE(profiling, AS_HELP_STRING([--enable-profiling], [Enable performance profiling]),[enable_profiling=$enableval],[enable_profiling=no]) @@ -2734,6 +2742,7 @@ Development settings: Unit tests enabled: ${enable_unittests} Debug output enabled: ${enable_debug} Debug validation enabled: ${enable_debug_validation} + QA-simulation enabled: ${enable_qa_simulation} Fuzz targets enabled: ${enable_fuzztargets} Generic build parameters: diff --git a/src/suricata.c b/src/suricata.c index 4f6af7fe06..da3dc2d900 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -692,6 +692,7 @@ static void PrintBuildInfo(void) { const char *bits; const char *endian; + /* If all current features are enabled, features string would be 341 characters long */ char features[2048] = ""; const char *tls; @@ -702,6 +703,9 @@ static void PrintBuildInfo(void) #ifdef DEBUG_VALIDATION strlcat(features, "DEBUG_VALIDATION ", sizeof(features)); #endif +#ifdef QA_SIMULATION + strlcat(features, "QA_SIMULATION ", sizeof(features)); +#endif #ifdef UNITTESTS strlcat(features, "UNITTESTS ", sizeof(features)); #endif