aboutsummaryrefslogtreecommitdiff
path: root/test/T055-path-config.sh
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2022-07-25 21:04:21 -0400
committerDavid Bremner <david@tethera.net>2022-09-03 08:24:43 -0300
commit44c9338061ed64797b21b847ce29bcacd7f72886 (patch)
tree668f88300aa20a32101c0c46eab65f57ce0f6566 /test/T055-path-config.sh
parent687866111a0e1df1a365d07f629c4768281ec00d (diff)
test/path-config: set database.mail_root but not database.path
The failing "create database" test replicates a bug reported by Sean Whitton [1]. The other two failures also look related to the database being (re)created in the wrong place. [1]: id:87y1wqkw13.fsf@athena.silentflame.com.
Diffstat (limited to 'test/T055-path-config.sh')
-rwxr-xr-xtest/T055-path-config.sh30
1 files changed, 24 insertions, 6 deletions
diff --git a/test/T055-path-config.sh b/test/T055-path-config.sh
index 45545d88..149aa6a1 100755
--- a/test/T055-path-config.sh
+++ b/test/T055-path-config.sh
@@ -92,7 +92,20 @@ xdg_config () {
notmuch --config=${CONFIG_PATH} config set database.path
}
-for config in traditional split XDG XDG+profile symlink home_mail maildir_env; do
+mailroot_only_config () {
+ local dir
+
+ backup_config
+ notmuch config set database.mail_root ${TMP_DIRECTORY}/mail
+ notmuch config set database.path
+ DATABASE_PATH="${HOME}/.local/share/notmuch/default"
+ rm -rf $DATABASE_PATH
+ mkdir -p $DATABASE_PATH
+ XAPIAN_PATH="${DATABASE_PATH}/xapian"
+ mv mail/.notmuch/xapian $DATABASE_PATH
+}
+
+for config in traditional split XDG XDG+profile symlink home_mail maildir_env mailroot_only; do
#start each set of tests with an known set of messages
add_email_corpus
@@ -122,6 +135,9 @@ for config in traditional split XDG XDG+profile symlink home_mail maildir_env; d
maildir_env)
maildir_env_config
;;
+ mailroot_only)
+ mailroot_only_config
+ ;;
esac
test_begin_subtest "count ($config)"
@@ -314,11 +330,6 @@ user.primary_email
EOF
test_expect_equal_file EXPECTED OUTPUT
- test_begin_subtest "create database ($config)"
- rm -r ${XAPIAN_PATH}
- notmuch new
- test_expect_equal "$(xapian-metadata get ${XAPIAN_PATH} version)" 3
-
case $config in
XDG*)
test_begin_subtest "Set shadowed config value in database ($config)"
@@ -355,6 +366,13 @@ Added 1 new message to the database.
thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Do not ignore, very important (inbox unread)
EOF
test_expect_equal_file EXPECTED OUTPUT
+ ;&
+ mailroot_only)
+ test_begin_subtest "create database parent dir ($config)"
+ test_subtest_known_broken
+ rm -r ${DATABASE_PATH}
+ notmuch new
+ test_expect_equal "$(xapian-metadata get ${XAPIAN_PATH} version)" 3
;;
*)
backup_database