Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remote-config: rename FEATURES test to ASM_FEATURES #565

Merged
merged 15 commits into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,8 @@ jobs:
# env:
# DD_API_KEY: ${{ secrets.DD_API_KEY }}

- name: Run REMOTE_CONFIG_MOCKED_BACKEND_FEATURES scenario
run: ./run.sh REMOTE_CONFIG_MOCKED_BACKEND_FEATURES
- name: Run REMOTE_CONFIG_MOCKED_BACKEND_ASM_FEATURES scenario
run: ./run.sh REMOTE_CONFIG_MOCKED_BACKEND_ASM_FEATURES
env:
DD_API_KEY: ${{ secrets.DD_API_KEY }}

Expand All @@ -485,8 +485,8 @@ jobs:
env:
DD_API_KEY: ${{ secrets.DD_API_KEY }}

- name: Run REMOTE_CONFIG_MOCKED_BACKEND_FEATURES_NOCACHE scenario
run: ./run.sh REMOTE_CONFIG_MOCKED_BACKEND_FEATURES_NOCACHE
- name: Run REMOTE_CONFIG_MOCKED_BACKEND_ASM_FEATURES_NOCACHE scenario
run: ./run.sh REMOTE_CONFIG_MOCKED_BACKEND_ASM_FEATURES_NOCACHE
env:
DD_API_KEY: ${{ secrets.DD_API_KEY }}

Expand Down
42 changes: 23 additions & 19 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ fi

CONTAINERS=(weblog agent runner agent_proxy library_proxy)
interfaces=(agent library backend)
WEBLOG_ENV="DD_APPSEC_ENABLED=true\n"

export SYSTEMTESTS_SCENARIO=${1:-DEFAULT}
export SYSTEMTESTS_VARIATION=${2:-DEFAULT}
Expand Down Expand Up @@ -52,27 +53,27 @@ elif [ $SYSTEMTESTS_SCENARIO = "UDS" ]; then # Typical features but with UDS as
elif [ $SYSTEMTESTS_SCENARIO = "SAMPLING" ]; then
export RUNNER_ARGS=scenarios/sampling_rates.py
export SYSTEMTESTS_LOG_FOLDER=logs_sampling_rate
WEBLOG_ENV="DD_TRACE_SAMPLE_RATE=0.5"
WEBLOG_ENV+="DD_TRACE_SAMPLE_RATE=0.5"

elif [ $SYSTEMTESTS_SCENARIO = "APPSEC_MISSING_RULES" ]; then
export RUNNER_ARGS=scenarios/appsec/test_customconf.py::Test_MissingRules
export SYSTEMTESTS_LOG_FOLDER=logs_missing_appsec_rules
WEBLOG_ENV="DD_APPSEC_RULES=/donotexists"
WEBLOG_ENV+="DD_APPSEC_RULES=/donotexists"

elif [ $SYSTEMTESTS_SCENARIO = "APPSEC_CORRUPTED_RULES" ]; then
export RUNNER_ARGS=scenarios/appsec/test_customconf.py::Test_CorruptedRules
export SYSTEMTESTS_LOG_FOLDER=logs_corrupted_appsec_rules
WEBLOG_ENV="DD_APPSEC_RULES=/appsec_corrupted_rules.yml"
WEBLOG_ENV+="DD_APPSEC_RULES=/appsec_corrupted_rules.yml"

elif [ $SYSTEMTESTS_SCENARIO = "APPSEC_CUSTOM_RULES" ]; then
export RUNNER_ARGS="scenarios/appsec/test_customconf.py::Test_ConfRuleSet scenarios/appsec/test_customconf.py::Test_NoLimitOnWafRules scenarios/appsec/waf/test_addresses.py scenarios/appsec/test_traces.py scenarios/appsec/test_conf.py::Test_ConfigurationVariables::test_appsec_rules"
export SYSTEMTESTS_LOG_FOLDER=logs_custom_appsec_rules
WEBLOG_ENV="DD_APPSEC_RULES=/appsec_custom_rules.json"
WEBLOG_ENV+="DD_APPSEC_RULES=/appsec_custom_rules.json"

elif [ $SYSTEMTESTS_SCENARIO = "APPSEC_RULES_MONITORING_WITH_ERRORS" ]; then
export RUNNER_ARGS="scenarios/appsec/waf/test_reports.py"
export SYSTEMTESTS_LOG_FOLDER=logs_rules_monitoring_with_errors
WEBLOG_ENV="DD_APPSEC_RULES=/appsec_custom_rules_with_errors.json"
WEBLOG_ENV+="DD_APPSEC_RULES=/appsec_custom_rules_with_errors.json"

elif [ $SYSTEMTESTS_SCENARIO = "PROFILING" ]; then
export RUNNER_ARGS=scenarios/test_profiling.py
Expand All @@ -98,61 +99,64 @@ elif [ $SYSTEMTESTS_SCENARIO = "APPSEC_LOW_WAF_TIMEOUT" ]; then
# disable appsec
export RUNNER_ARGS=scenarios/appsec/test_conf.py::Test_ConfigurationVariables::test_waf_timeout
export SYSTEMTESTS_LOG_FOLDER=logs_low_waf_timeout
WEBLOG_ENV="DD_APPSEC_WAF_TIMEOUT=1"
WEBLOG_ENV+="DD_APPSEC_WAF_TIMEOUT=1"

elif [ $SYSTEMTESTS_SCENARIO = "APPSEC_CUSTOM_OBFUSCATION" ]; then
export RUNNER_ARGS="scenarios/appsec/test_conf.py::Test_ConfigurationVariables::test_obfuscation_parameter_key scenarios/appsec/test_conf.py::Test_ConfigurationVariables::test_obfuscation_parameter_value"
export SYSTEMTESTS_LOG_FOLDER=logs_appsec_custom_obfuscation
WEBLOG_ENV="DD_APPSEC_OBFUSCATION_PARAMETER_KEY_REGEXP=hide-key\nDD_APPSEC_OBFUSCATION_PARAMETER_VALUE_REGEXP=.*hide_value"
WEBLOG_ENV+="DD_APPSEC_OBFUSCATION_PARAMETER_KEY_REGEXP=hide-key\nDD_APPSEC_OBFUSCATION_PARAMETER_VALUE_REGEXP=.*hide_value"

elif [ $SYSTEMTESTS_SCENARIO = "APPSEC_RATE_LIMITER" ]; then
export RUNNER_ARGS="scenarios/appsec/test_rate_limiter.py"
export SYSTEMTESTS_LOG_FOLDER=logs_appsec_rate_limiter
WEBLOG_ENV="DD_APPSEC_TRACE_RATE_LIMIT=1"
WEBLOG_ENV+="DD_APPSEC_TRACE_RATE_LIMIT=1"

elif [ $SYSTEMTESTS_SCENARIO = "LIBRARY_CONF_CUSTOM_HEADERS_SHORT" ]; then
export RUNNER_ARGS="scenarios/test_library_conf.py::Test_HeaderTagsShortFormat"
export SYSTEMTESTS_LOG_FOLDER=logs_library_conf_custom_headers_short
DD_TRACE_HEADER_TAGS=$(docker run system_tests/weblog env | grep DD_TRACE_HEADER_TAGS | cut -d'=' -f2)
WEBLOG_ENV="DD_TRACE_HEADER_TAGS=$DD_TRACE_HEADER_TAGS,header-tag1,header-tag2"
WEBLOG_ENV+="DD_TRACE_HEADER_TAGS=$DD_TRACE_HEADER_TAGS,header-tag1,header-tag2"

elif [ $SYSTEMTESTS_SCENARIO = "LIBRARY_CONF_CUSTOM_HEADERS_LONG" ]; then
export RUNNER_ARGS="scenarios/test_library_conf.py::Test_HeaderTagsLongFormat"
export SYSTEMTESTS_LOG_FOLDER=logs_library_conf_custom_headers_long
DD_TRACE_HEADER_TAGS=$(docker run system_tests/weblog env | grep DD_TRACE_HEADER_TAGS | cut -d'=' -f2)
WEBLOG_ENV="DD_TRACE_HEADER_TAGS=$DD_TRACE_HEADER_TAGS,header-tag1:custom.header-tag1,header-tag2:custom.header-tag2"
WEBLOG_ENV+="DD_TRACE_HEADER_TAGS=$DD_TRACE_HEADER_TAGS,header-tag1:custom.header-tag1,header-tag2:custom.header-tag2"

elif [ $SYSTEMTESTS_SCENARIO = "APPSEC_IP_BLOCKING" ]; then
export RUNNER_ARGS="scenarios/appsec/test_ip_blocking.py::Test_AppSecIPBlocking"
export SYSTEMTESTS_LOG_FOLDER=logs_appsec_ip_blocking
export SYSTEMTESTS_LIBRARY_PROXY_STATE='{"mock_remote_config_backend": "ASM_DATA"}'

elif [ $SYSTEMTESTS_SCENARIO = "REMOTE_CONFIG_MOCKED_BACKEND_FEATURES" ]; then
elif [ $SYSTEMTESTS_SCENARIO = "REMOTE_CONFIG_MOCKED_BACKEND_ASM_FEATURES" ]; then
export RUNNER_ARGS="scenarios/remote_config/test_remote_configuration.py::Test_RemoteConfigurationUpdateSequenceFeatures"
export SYSTEMTESTS_LOG_FOLDER=logs_remote_config_mocked_backend_features
export SYSTEMTESTS_LIBRARY_PROXY_STATE='{"mock_remote_config_backend": "FEATURES"}'
export SYSTEMTESTS_LOG_FOLDER=logs_remote_config_mocked_backend_asm_features
export SYSTEMTESTS_LIBRARY_PROXY_STATE='{"mock_remote_config_backend": "ASM_FEATURES"}'
# Override WEBLOG_ENV to remove DD_APPSEC_ENABLED=true
WEBLOG_ENV=""

elif [ $SYSTEMTESTS_SCENARIO = "REMOTE_CONFIG_MOCKED_BACKEND_LIVE_DEBUGGING" ]; then
export RUNNER_ARGS="scenarios/remote_config/test_remote_configuration.py::Test_RemoteConfigurationUpdateSequenceLiveDebugging"
export SYSTEMTESTS_LOG_FOLDER=logs_remote_config_mocked_backend_live_debugging
export SYSTEMTESTS_LIBRARY_PROXY_STATE='{"mock_remote_config_backend": "LIVE_DEBUGGING"}'
WEBLOG_ENV="DD_DYNAMIC_INSTRUMENTATION_ENABLED=1\nDD_DEBUGGER_ENABLED=1\nDD_REMOTE_CONFIG_ENABLED=true\nDD_INTERNAL_RCM_POLL_INTERVAL=1000"
WEBLOG_ENV+="DD_DYNAMIC_INSTRUMENTATION_ENABLED=1\nDD_DEBUGGER_ENABLED=1\nDD_REMOTE_CONFIG_ENABLED=true\nDD_INTERNAL_RCM_POLL_INTERVAL=1000"

elif [ $SYSTEMTESTS_SCENARIO = "REMOTE_CONFIG_MOCKED_BACKEND_ASM_DD" ]; then
export RUNNER_ARGS="scenarios/remote_config/test_remote_configuration.py::Test_RemoteConfigurationUpdateSequenceASMDD"
export SYSTEMTESTS_LOG_FOLDER=logs_remote_config_mocked_backend_asm_dd
export SYSTEMTESTS_LIBRARY_PROXY_STATE='{"mock_remote_config_backend": "ASM_DD"}'

elif [ $SYSTEMTESTS_SCENARIO = "REMOTE_CONFIG_MOCKED_BACKEND_FEATURES_NOCACHE" ]; then
elif [ $SYSTEMTESTS_SCENARIO = "REMOTE_CONFIG_MOCKED_BACKEND_ASM_FEATURES_NOCACHE" ]; then
export RUNNER_ARGS="scenarios/remote_config/test_remote_configuration.py::Test_RemoteConfigurationUpdateSequenceFeaturesNoCache"
export SYSTEMTESTS_LOG_FOLDER=logs_remote_config_mocked_backend_features_nocache
export SYSTEMTESTS_LIBRARY_PROXY_STATE='{"mock_remote_config_backend": "FEATURES_NO_CACHE"}'
export SYSTEMTESTS_LOG_FOLDER=logs_remote_config_mocked_backend_asm_features_nocache
export SYSTEMTESTS_LIBRARY_PROXY_STATE='{"mock_remote_config_backend": "ASM_FEATURES_NO_CACHE"}'
WEBLOG_ENV=""

elif [ $SYSTEMTESTS_SCENARIO = "REMOTE_CONFIG_MOCKED_BACKEND_LIVE_DEBUGGING_NOCACHE" ]; then
export RUNNER_ARGS="scenarios/remote_config/test_remote_configuration.py::Test_RemoteConfigurationUpdateSequenceLiveDebuggingNoCache"
export SYSTEMTESTS_LOG_FOLDER=logs_remote_config_mocked_backend_live_debugging_nocache
export SYSTEMTESTS_LIBRARY_PROXY_STATE='{"mock_remote_config_backend": "LIVE_DEBUGGING_NO_CACHE"}'
WEBLOG_ENV="DD_DYNAMIC_INSTRUMENTATION_ENABLED=1\nDD_DEBUGGER_ENABLED=1\nDD_REMOTE_CONFIG_ENABLED=true"
WEBLOG_ENV+="DD_DYNAMIC_INSTRUMENTATION_ENABLED=1\nDD_DEBUGGER_ENABLED=1\nDD_REMOTE_CONFIG_ENABLED=true"

elif [ $SYSTEMTESTS_SCENARIO = "REMOTE_CONFIG_MOCKED_BACKEND_ASM_DD_NOCACHE" ]; then
export RUNNER_ARGS="scenarios/remote_config/test_remote_configuration.py::Test_RemoteConfigurationUpdateSequenceASMDDNoCache"
Expand All @@ -162,7 +166,7 @@ elif [ $SYSTEMTESTS_SCENARIO = "REMOTE_CONFIG_MOCKED_BACKEND_ASM_DD_NOCACHE" ];
elif [ $SYSTEMTESTS_SCENARIO = "TRACE_PROPAGATION_STYLE_W3C" ]; then
export RUNNER_ARGS="scenarios/test_distributed.py"
export SYSTEMTESTS_LOG_FOLDER=logs_trace_propagation_style_w3c
WEBLOG_ENV="DD_TRACE_PROPAGATION_STYLE_INJECT=W3C\nDD_TRACE_PROPAGATION_STYLE_EXTRACT=W3C"
WEBLOG_ENV+="DD_TRACE_PROPAGATION_STYLE_INJECT=W3C\nDD_TRACE_PROPAGATION_STYLE_EXTRACT=W3C"

elif [ $SYSTEMTESTS_SCENARIO = "INTEGRATIONS" ]; then
export RUNNER_ARGS="scenarios/integrations"
Expand Down
Loading