diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2019-11-09 03:13:45 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2019-11-13 06:23:56 +0100 |
commit | 67440844c422ee30b31df9a46a7f99ac0e833add (patch) | |
tree | 989381e5b94d5939dafdd1e99c7db2ada95355ec /tests/02-delete | |
parent | b9da6cc7ecf71026d1023dc3354b820c7518426e (diff) |
Refactor and improve test suite.
Diffstat (limited to 'tests/02-delete')
-rw-r--r-- | tests/02-delete/local.conf | 6 | ||||
-rw-r--r-- | tests/02-delete/remote.conf | 6 | ||||
-rw-r--r-- | tests/02-delete/run | 67 |
3 files changed, 0 insertions, 79 deletions
diff --git a/tests/02-delete/local.conf b/tests/02-delete/local.conf deleted file mode 100644 index 93497d9..0000000 --- a/tests/02-delete/local.conf +++ /dev/null @@ -1,6 +0,0 @@ -namespace inbox { - separator = . - location = maildir:~/inbox:LAYOUT=index - inbox = yes - list = yes -} diff --git a/tests/02-delete/remote.conf b/tests/02-delete/remote.conf deleted file mode 100644 index cc6781d..0000000 --- a/tests/02-delete/remote.conf +++ /dev/null @@ -1,6 +0,0 @@ -namespace inbox { - separator = ^ - location = maildir:~/inbox:LAYOUT=index - inbox = yes - list = yes -} diff --git a/tests/02-delete/run b/tests/02-delete/run deleted file mode 100644 index f63c52c..0000000 --- a/tests/02-delete/run +++ /dev/null @@ -1,67 +0,0 @@ -doveadm -u "local" mailbox create "foo.bar" "foo.bar.baz" - -for m in "foo.bar" "foo.bar.baz" "INBOX"; do - sample_message | deliver -u "local" -- -m "$m" -done - -interimap -check_mailbox_list -check_mailboxes_status "foo.bar" "foo.bar.baz" "INBOX" -sqlite3 "$XDG_DATA_HOME/interimap/remote.db" >"$TMPDIR/dump.sql" <<-EOF - .dump -EOF - -# delete non-existent mailbox is a no-op -interimap --target="local,remote" --target="database" --delete "nonexistent" - -check_mailbox_list -check_mailboxes_status "foo.bar" "foo.bar.baz" "INBOX" -sqlite3 "$XDG_DATA_HOME/interimap/remote.db" >"$TMPDIR/dump2.sql" <<-EOF - .dump -EOF -diff -u --label="a/dump.sql" --label="b/dump.sql" \ - "$TMPDIR/dump.sql" "$TMPDIR/dump2.sql" - -# foo.bar will become \NoSelect in local, per RFC 3501: "It is permitted -# to delete a name that has inferior hierarchical names and does not -# have the \Noselect mailbox name attribute. In this case, all messages -# in that mailbox are removed, and the name will acquire the \Noselect -# mailbox name attribute." -interimap --target="local" --delete "foo.bar" - -check_mailbox_list -check_mailboxes_status "foo.bar.baz" "INBOX" - -sqlite3 "$XDG_DATA_HOME/interimap/remote.db" >"$TMPDIR/dump2.sql" <<-EOF - .dump -EOF -diff -u --label="a/dump.sql" --label="b/dump.sql" "$TMPDIR/dump.sql" "$TMPDIR/dump2.sql" - -! doveadm -u "local" mailbox status uidvalidity "foo.bar" # gone - doveadm -u "remote" mailbox status uidvalidity "foo^bar" - -sqlite3 "$XDG_DATA_HOME/interimap/remote.db" >"$TMPDIR/mailboxes.csv" <<-EOF - SELECT idx, mailbox - FROM mailboxes - WHERE mailbox != x'$(printf "%s\\0%s" "foo" "bar" | xxd -ps)' -EOF - - -# now delete from the remote server and the database -interimap --delete "foo.bar" - -! doveadm -u "local" mailbox status uidvalidity "foo.bar" -! doveadm -u "remote" mailbox status uidvalidity "foo^bar" - -sqlite3 "$XDG_DATA_HOME/interimap/remote.db" >"$TMPDIR/mailboxes2.csv" <<-EOF - SELECT idx, mailbox - FROM mailboxes - WHERE mailbox != x'$(printf "%s\\0%s" "foo" "bar" | xxd -ps)' -EOF -diff -u --label="a/mailboxes.csv" --label="b/mailboxes.csv" \ - "$TMPDIR/mailboxes.csv" "$TMPDIR/mailboxes2.csv" - -check_mailbox_list -check_mailboxes_status "foo.bar.baz" "INBOX" - -# vim: set filetype=sh : |