From f7548d6d28c313cf80e6f3ef89aed16a19815df1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 11:51:24 +0200 Subject: Adding upstream version 1:2.3.19.1+dfsg1. Signed-off-by: Daniel Baumann --- pigeonhole/tests/extensions/include/execute.svtest | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 pigeonhole/tests/extensions/include/execute.svtest (limited to 'pigeonhole/tests/extensions/include/execute.svtest') 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"; + } +} -- cgit v1.2.3