summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorILYA Khlopotov <iilyak@apache.org>2017-07-18 08:19:26 -0700
committerILYA Khlopotov <iilyak@apache.org>2017-07-18 08:28:41 -0700
commit3e14510b4578c846f01fb4bb1e461dad75af29e9 (patch)
treee005ce4a0c78af149b514b797cb11620019a7c10
parent3523bab304cc031b9fcc150080ff539d9f76dabb (diff)
downloadcouchdb-3e14510b4578c846f01fb4bb1e461dad75af29e9.tar.gz
Use hashed password when we create admin in test
couch_server is responsible for calling hash_admin_passwords whenever "admin" section of config changes. However as you can see it from [here](https://github.com/apache/couchdb/blob/master/src/couch/src/couch_server.erl#L219) the call is asynchronous. This means that our test cases might fail when we try to using admin user while admin password is not yet hashed. COUCHDB-3367
-rw-r--r--src/chttpd/test/chttpd_security_tests.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/chttpd/test/chttpd_security_tests.erl b/src/chttpd/test/chttpd_security_tests.erl
index 4c2f973d5..bcd04c22e 100644
--- a/src/chttpd/test/chttpd_security_tests.erl
+++ b/src/chttpd/test/chttpd_security_tests.erl
@@ -33,7 +33,8 @@
-define(FIXTURE_TXT, ?ABS_PATH(?FILE)).
setup() ->
- ok = config:set("admins", ?USER, ?PASS, _Persist=false),
+ Hashed = couch_passwords:hash_admin_password(?PASS),
+ ok = config:set("admins", ?USER, ?b2l(Hashed), _Persist=false),
UserDb = <<"_users">>,
TmpDb = ?tempdb(),
ok = config:set("couch_httpd_auth", "authentication_db", ?b2l(UserDb)),