From c6cf833602aa60f90470c16f08c28ad1327ec281 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Sat, 13 Mar 2021 16:05:25 +0100 Subject: [PATCH 1/2] Add a test which verifies we can create and retrieve rule with unicode characters in the ref / name. --- .../actions/chains/test_quickstart_rules.yaml | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/packs/tests/actions/chains/test_quickstart_rules.yaml b/packs/tests/actions/chains/test_quickstart_rules.yaml index 4e1d6f6..6ee3bbb 100644 --- a/packs/tests/actions/chains/test_quickstart_rules.yaml +++ b/packs/tests/actions/chains/test_quickstart_rules.yaml @@ -1,6 +1,7 @@ --- vars: tested_rule: examples.sample_rule_with_webhook + tested_rule_unicode: "examples.sample_rule_with_webhook_你好" chain: - @@ -27,6 +28,28 @@ chain: ST2_API_URL: "{{protocol}}://{{hostname}}:9101" ST2_AUTH_TOKEN: "{{token}}" cmd: "st2 rule delete {{ tested_rule }} " + on-success: test_create_rule_unicode_name + - + name: test_create_rule_unicode_name + ref: core.local + params: + env: + ST2_BASE_URL: "{{protocol}}://{{hostname}}" + ST2_AUTH_URL: "{{protocol}}://{{hostname}}:9100" + ST2_API_URL: "{{protocol}}://{{hostname}}:9101" + ST2_AUTH_TOKEN: "{{token}}" + cmd: "st2 rule create /usr/share/doc/st2/examples/rules/sample_rule_with_webhook_unicode_name.yaml -j | grep name" + on-success: test_get_rule_unicode_name + - + name: test_get_rule_unicode_name + ref: core.local + params: + env: + ST2_BASE_URL: "{{protocol}}://{{hostname}}" + ST2_AUTH_URL: "{{protocol}}://{{hostname}}:9100" + ST2_API_URL: "{{protocol}}://{{hostname}}:9101" + ST2_AUTH_TOKEN: "{{token}}" + cmd: "st2 rule get {{ tested_rule_unicode }} -j | grep name" on-success: test_create_rule - name: test_create_rule From 6eefcea19f8a449091cc16d5c78adb407a755cee Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Sat, 13 Mar 2021 17:14:57 +0100 Subject: [PATCH 2/2] Update rule name. --- packs/tests/actions/chains/test_quickstart_rules.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packs/tests/actions/chains/test_quickstart_rules.yaml b/packs/tests/actions/chains/test_quickstart_rules.yaml index 6ee3bbb..6ea0ba6 100644 --- a/packs/tests/actions/chains/test_quickstart_rules.yaml +++ b/packs/tests/actions/chains/test_quickstart_rules.yaml @@ -1,7 +1,7 @@ --- vars: tested_rule: examples.sample_rule_with_webhook - tested_rule_unicode: "examples.sample_rule_with_webhook_你好" + tested_rule_unicode: "examples.unicode_rule_with_webhook_你好" chain: -