Skip to content

Commit

Permalink
test(helper): create separate config for fingerprints
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Rulleau <[email protected]>
  • Loading branch information
Leiyks committed Nov 19, 2024
1 parent ab78a5b commit 5816afa
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 362 deletions.
17 changes: 16 additions & 1 deletion appsec/tests/helper/client_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1771,7 +1771,22 @@ TEST(ClientTest, RequestShutdownWithFingerprints)

client c(smanager, std::unique_ptr<mock::broker>(broker));

set_extension_configuration_to(broker, c, EXTENSION_CONFIGURATION_ENABLED);
// Set Extension Configuration
{
auto fn = create_sample_rules_ok_with_fingerprint();
network::client_init::request msg;
msg.pid = 1729;
msg.enabled_configuration = true;
msg.runtime_version = "1.0";
msg.client_version = "2.0";
msg.engine_settings.rules_file = fn;
msg.engine_settings.waf_timeout_us = 1000000;
msg.engine_settings.schema_extraction.enabled = false;
msg.engine_settings.schema_extraction.sample_rate = 1;

msg.enabled_configuration = EXTENSION_CONFIGURATION_ENABLED;
send_client_init(broker, c, std::move(msg));
}

// Request Init
{
Expand Down
1 change: 1 addition & 0 deletions appsec/tests/helper/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ using namespace std::literals;
using namespace std::chrono_literals;

std::string create_sample_rules_ok();
std::string create_sample_rules_ok_with_fingerprint();
std::string create_sample_rules_invalid();
Loading

0 comments on commit 5816afa

Please sign in to comment.