aboutsummaryrefslogtreecommitdiffstats
path: root/tests/03-sync-mailbox-list-ref
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2019-05-27 00:40:24 +0200
committerGuilhem Moulin <guilhem@fripost.org>2019-05-27 00:40:24 +0200
commite86590ad6858d0d597278393b8de2923dfed4084 (patch)
treefae8916cc9a81107460df6af0baa26af6d2e0727 /tests/03-sync-mailbox-list-ref
parent6b9e183ea2abbe5137c7551eb8c5184eea51571e (diff)
parent8e379c62a48d68cd5ab2a32c6fc9244b1ae94084 (diff)
Merge branch 'master' into HEAD
Diffstat (limited to 'tests/03-sync-mailbox-list-ref')
-rw-r--r--tests/03-sync-mailbox-list-ref/local.conf6
-rw-r--r--tests/03-sync-mailbox-list-ref/remote.conf6
-rw-r--r--tests/03-sync-mailbox-list-ref/run28
3 files changed, 40 insertions, 0 deletions
diff --git a/tests/03-sync-mailbox-list-ref/local.conf b/tests/03-sync-mailbox-list-ref/local.conf
new file mode 100644
index 0000000..6eccf43
--- /dev/null
+++ b/tests/03-sync-mailbox-list-ref/local.conf
@@ -0,0 +1,6 @@
+namespace inbox {
+ separator = /
+ location = maildir:~/inbox:LAYOUT=index
+ inbox = yes
+ list = yes
+}
diff --git a/tests/03-sync-mailbox-list-ref/remote.conf b/tests/03-sync-mailbox-list-ref/remote.conf
new file mode 100644
index 0000000..61e3d0d
--- /dev/null
+++ b/tests/03-sync-mailbox-list-ref/remote.conf
@@ -0,0 +1,6 @@
+namespace inbox {
+ separator = "\\"
+ location = maildir:~/inbox:LAYOUT=index
+ inbox = yes
+ list = yes
+}
diff --git a/tests/03-sync-mailbox-list-ref/run b/tests/03-sync-mailbox-list-ref/run
new file mode 100644
index 0000000..3ead25d
--- /dev/null
+++ b/tests/03-sync-mailbox-list-ref/run
@@ -0,0 +1,28 @@
+# Note: implementation-dependent as the reference name is not a level of
+# mailbox hierarchy nor ends with the hierarchy delimiter
+sed -ri 's#^\[local\]$#&\nlist-reference = foo#; s#^\[remote\]$#&\nlist-reference = bar#' \
+ "$XDG_CONFIG_HOME/interimap/config"
+
+# create a bunch of mailboxes in and out the respective list # references
+doveadm -u "local" mailbox create "foo" "foobar" "foo/bar/baz" "foo/baz" "bar"
+doveadm -u "remote" mailbox create "foo"
+
+# deliver somemessages to these mailboxes
+for m in "foo" "foobar" "foo/bar/baz" "foo/baz" "bar"; do
+ sample_message | deliver -u "local" -- -m "$m"
+done
+sample_message | deliver -u "remote" -- -m "foo"
+
+interimap
+
+# check that the mailbox lists match
+diff -u --label="local/mailboxes" --label="remote/mailboxes" \
+ <( doveadm -u "local" mailbox list | sed -n "s/^foo//p" | sort ) \
+ <( doveadm -u "remote" mailbox list | sed -n "s/^bar//p" | tr '\\' '/' | sort )
+
+for m in "" "bar" "/bar/baz" "/baz"; do
+ blob="x'$(printf "%s" "$m" | tr "/" "\\0" | xxd -c256 -ps)'"
+ check_mailbox_status2 "$blob" "foo$m" "remote" "bar${m//\//\\}"
+done
+
+# vim: set filetype=sh :