Skip to content

Commit

Permalink
Fixes #25998: Broken policies test (#6065)
Browse files Browse the repository at this point in the history
  • Loading branch information
amousset authored Dec 3, 2024
1 parent 210e05c commit 3131863
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
4 changes: 1 addition & 3 deletions policies/rudderc/tests/cases/general/escaping/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@
</SECTION>
<SECTION name="cache_prefix=&quot;zapache-$UID-${STATUS_URL//[^a-zA-Z0-9_-]/_}&quot; " id="a86ce2e5-d5b6-45cc-87e8-c11cca71d978" component="true" multivalued="true">
<REPORTKEYS>
<VALUE id="a86ce2e5-d5b6-45cc-87e8-c11cca71d978">
cache_prefix=&quot;zapache-$UID-${STATUS_URL//[^a-zA-Z0-9_-]/_}&quot;
</VALUE>
<VALUE id="a86ce2e5-d5b6-45cc-87e8-c11cca71d978">cache_prefix=&quot;zapache-$UID-${STATUS_URL//[^a-zA-Z0-9_-]/_}&quot; </VALUE>
</REPORTKEYS>
</SECTION>
</SECTIONS>
Expand Down
15 changes: 12 additions & 3 deletions policies/rudderc/tests/cases/general/escaping/technique.cf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ bundle agent escaping(server) {
", "a86ce2e5-d5b6-45cc-87e8-c11cca71d977", @{args}, "${class_prefix}", "${sys.host} . | / ${sys.${host}} ' '' ''' $ $$ \" \"\" \\ \\\\😋aà3
", "if(Get-Service \"Zabbix agent\") { write-output \"exists\" }", "", "");

"a86ce2e5-d5b6-45cc-87e8-c11cca71d978_${report_data.directive_id}" usebundle => call_escaping_a86ce2e5_d5b6_45cc_87e8_c11cca71d978("cache_prefix=\"zapache-$UID-${STATUS_URL//[^a-zA-Z0-9_-]/_}\" ", "cache_prefix=\"zapache-$UID-${STATUS_URL//[^a-zA-Z0-9_-]/_}\" ", "a86ce2e5-d5b6-45cc-87e8-c11cca71d978", @{args}, "${class_prefix}", "cache_prefix=\"zapache-$UID-${STATUS_URL//[^a-zA-Z0-9_-]/_}\" ", "plop", "", "");
"index_${local_index}_2" usebundle => call_escaping_a86ce2e5_d5b6_45cc_87e8_c11cca71d978("cache_prefix=\"zapache-$UID-${STATUS_URL//[^a-zA-Z0-9_-]/_}\" ", "cache_prefix=\"zapache-$UID-${STATUS_URL//[^a-zA-Z0-9_-]/_}\" ", "a86ce2e5-d5b6-45cc-87e8-c11cca71d978", @{args}, "${class_prefix}", "cache_prefix=\"zapache-$UID-${STATUS_URL//[^a-zA-Z0-9_-]/_}\" ", "plop", "", "");

}
bundle agent call_escaping_a86ce2e5_d5b6_45cc_87e8_c11cca71d966(c_name, c_key, report_id, args, class_prefix, method_call_condition, name, version, architecture, provider) {
Expand Down Expand Up @@ -73,8 +73,17 @@ bundle agent call_escaping_a86ce2e5_d5b6_45cc_87e8_c11cca71d977(c_name, c_key, r
}
bundle agent call_escaping_a86ce2e5_d5b6_45cc_87e8_c11cca71d978(c_name, c_key, report_id, args, class_prefix, name, version, architecture, provider) {

vars:
"report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")),
unless => "rudder_increment_guard";
"local_index" int => ${report_data.index},
unless => "rudder_increment_guard";

classes:
"rudder_increment_guard" expression => "any";

methods:
"a86ce2e5-d5b6-45cc-87e8-c11cca71d978_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}");
"a86ce2e5-d5b6-45cc-87e8-c11cca71d978_${report_data.directive_id}_${c_key}" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}");
"index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}");
"index_${local_index}_1" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}");

}

0 comments on commit 3131863

Please sign in to comment.