summaryrefslogtreecommitdiffstats
path: root/pigeonhole/tests/extensions/include/execute.svtest
diff options
context:
space:
mode:
Diffstat (limited to 'pigeonhole/tests/extensions/include/execute.svtest')
-rw-r--r--pigeonhole/tests/extensions/include/execute.svtest68
1 files changed, 68 insertions, 0 deletions
diff --git a/pigeonhole/tests/extensions/include/execute.svtest b/pigeonhole/tests/extensions/include/execute.svtest
new file mode 100644
index 0000000..734ac66
--- /dev/null
+++ b/pigeonhole/tests/extensions/include/execute.svtest
@@ -0,0 +1,68 @@
+require "vnd.dovecot.testsuite";
+require "include";
+require "variables";
+
+test_set "message" text:
+From: idiot@example.com
+To: idiot@example.org
+Subject: Frop!
+
+Frop.
+.
+;
+
+test "Actions Fileinto" {
+ test_mailbox_create "aaaa";
+ test_mailbox_create "bbbb";
+
+ if not test_script_compile "execute/actions-fileinto.sieve" {
+ test_fail "failed to compile sieve script";
+ }
+
+ test_binary_save "actions-fileinto";
+ test_binary_load "actions-fileinto";
+
+ if not test_script_run {
+ test_fail "failed to execute sieve script";
+ }
+
+ if not test_result_execute {
+ test_fail "failed to execute result";
+ }
+
+ test_message :folder "aaaa" 0;
+
+ if not header "subject" "Frop!" {
+ test_fail "fileinto \"aaaa\" not executed.";
+ }
+
+ test_message :folder "bbbb" 0;
+
+ if not header "subject" "Frop!" {
+ test_fail "fileinto \"bbbb\" not executed.";
+ }
+}
+
+test "Namespace - file" {
+ if not test_script_compile "execute/namespace.sieve" {
+ test_fail "failed to compile sub-test";
+ }
+
+ if not test_script_run {
+ test_fail "failed to execute sub-test";
+ }
+}
+
+test "Namespace - dict" {
+ test_config_set "sieve" "dict:file:${tst.path}/included/namespace.dict";
+ test_config_set "sieve_global" "dict:file:${tst.path}/included-global/namespace.dict";
+ test_config_reload :extension "include";
+
+ if not test_script_compile "execute/namespace.sieve" {
+ test_fail "failed to compile sub-test";
+ }
+
+ if not test_script_run {
+ test_fail "failed to execute sub-test";
+ }
+}