aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2021-02-14 09:55:42 -0400
committerDavid Bremner <david@tethera.net>2021-03-27 09:26:14 -0300
commit2e9ee47072e161e85d2ac60515d1c922ea881e40 (patch)
tree9620d3b970b7217f9f286b8baafcecf19266e632 /test
parente81dc2072f22996a07e82b9b9b2eac826410e5a7 (diff)
lib/config: set default for primary user email
This is mainly copying code from the CLI into the lib. The CLI copy will be deleted in a later commit.
Diffstat (limited to 'test')
-rwxr-xr-xtest/T590-libconfig.sh7
-rw-r--r--test/test-lib.sh6
2 files changed, 7 insertions, 6 deletions
diff --git a/test/T590-libconfig.sh b/test/T590-libconfig.sh
index 2c6e726c..292778d5 100755
--- a/test/T590-libconfig.sh
+++ b/test/T590-libconfig.sh
@@ -397,7 +397,7 @@ MAIL_DIR/.notmuch/backups
inbox;unread
NULL
true
-NULL
+USERNAME@FQDN
NULL
USER_FULL_NAME
== stderr ==
@@ -626,9 +626,6 @@ EOF
test_begin_subtest "notmuch_database_get_config (ndlc)"
-echo NOTMUCH_CONFIG=$NOTMUCH_CONFIG
-echo NOTMUCH_PROFILE=$NOTMUCH_PROFILE
-echo HOME=$HOME
cat c_head2 - c_tail <<'EOF' | test_C ${MAIL_DIR} %NULL% %NULL%
{
EXPECT0(notmuch_database_get_config (db, "test.key1", &val));
@@ -742,7 +739,7 @@ MAIL_DIR/.notmuch/backups
inbox;unread
NULL
true
-NULL
+USERNAME@FQDN
NULL
USER_FULL_NAME
== stderr ==
diff --git a/test/test-lib.sh b/test/test-lib.sh
index fa2e401e..1f438042 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -107,6 +107,9 @@ unset GREP_OPTIONS
# For emacsclient
unset ALTERNATE_EDITOR
+# for reproducibility
+unset EMAIL
+
add_gnupg_home ()
{
[ -e "${GNUPGHOME}/gpg.conf" ] && return
@@ -697,8 +700,9 @@ notmuch_built_with_sanitize ()
notmuch_passwd_sanitize ()
{
local user=$(id -un)
+ local fqdn=$(hostname -f)
local full_name=$(getent passwd $user | cut -d: -f 5 | cut -d, -f1)
- sed "s/$full_name/USER_FULL_NAME/"
+ sed -e "s/$user/USERNAME/" -e "s/$fqdn/FQDN/" -e "s/$full_name/USER_FULL_NAME/"
}
notmuch_config_sanitize ()