From 3a9ea42887ef1f9a6d781959eeaf8fb0e015be83 Mon Sep 17 00:00:00 2001
From: Stephan Bosch <stephan.bosch@dovecot.fi>
Date: Fri, 5 Jan 2018 21:40:33 +0100
Subject: [PATCH] tests: extprograms plugin: execute extension: Add test for
 large output from program.

---
 tests/plugins/extprograms/bin/big             |  8 ++++++++
 .../extprograms/execute/execute.svtest        | 19 +++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100755 tests/plugins/extprograms/bin/big

diff --git a/tests/plugins/extprograms/bin/big b/tests/plugins/extprograms/bin/big
new file mode 100755
index 000000000..ce1df51f1
--- /dev/null
+++ b/tests/plugins/extprograms/bin/big
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+N="0123456701234567012345670123456701234567012345670123456701234567"
+N="$N$N$N$N$N$N$N$N$N$N$N$N$N$N$N$N"
+echo -n "$N$N"
+
+exit 0
+
diff --git a/tests/plugins/extprograms/execute/execute.svtest b/tests/plugins/extprograms/execute/execute.svtest
index e326f3bfe..f16af11d4 100644
--- a/tests/plugins/extprograms/execute/execute.svtest
+++ b/tests/plugins/extprograms/execute/execute.svtest
@@ -156,3 +156,22 @@ test "Execute - LF" {
 		test_fail "wrong string returned: '${out}'";
 	}
 }
+
+set "D" "0123456701234567012345670123456701234567012345670123456701234567";
+set "D" "${D}${D}${D}${D}${D}${D}${D}${D}${D}${D}${D}${D}${D}${D}${D}${D}";
+set "data" "${D}${D}";
+
+test_config_set "sieve_execute_input_eol" "crlf";
+test_config_reload :extension "vnd.dovecot.execute";
+test_result_reset;
+set "out" "";
+
+test "Execute - big" {
+	execute
+		:output "out"
+		"big";
+
+	if not string "${out}" "${data}" {
+		test_fail "wrong string returned: '${out}'";
+	}
+}
-- 
GitLab