test(mongo): add test case for w_mode option
This commit is contained in:
parent
c33eb84cb6
commit
821b50a961
|
@ -82,7 +82,8 @@ t_create_invalid(_Config) ->
|
|||
InvalidConfigs =
|
||||
[
|
||||
AuthConfig#{mongo_type => <<"unknown">>},
|
||||
AuthConfig#{selector => <<"{ \"username\": \"${username}\" }">>}
|
||||
AuthConfig#{selector => <<"{ \"username\": \"${username}\" }">>},
|
||||
AuthConfig#{w_mode => <<"unknown">>}
|
||||
],
|
||||
|
||||
lists:foreach(
|
||||
|
@ -247,6 +248,7 @@ raw_mongo_auth_config() ->
|
|||
database => <<"mqtt">>,
|
||||
collection => <<"users">>,
|
||||
server => mongo_server(),
|
||||
w_mode => <<"unsafe">>,
|
||||
|
||||
selector => #{<<"username">> => <<"${username}">>},
|
||||
password_hash_field => <<"password_hash">>,
|
||||
|
|
|
@ -160,6 +160,7 @@ raw_mongo_auth_config(SpecificSSLOpts) ->
|
|||
database => <<"mqtt">>,
|
||||
collection => <<"users">>,
|
||||
server => mongo_server(),
|
||||
w_mode => <<"unsafe">>,
|
||||
|
||||
selector => #{<<"username">> => <<"${username}">>},
|
||||
password_hash_field => <<"password_hash">>,
|
||||
|
|
|
@ -73,6 +73,7 @@ set_special_configs(_App) ->
|
|||
<<"enable">> => true,
|
||||
<<"mongo_type">> => <<"single">>,
|
||||
<<"server">> => <<"127.0.0.1:27017">>,
|
||||
<<"w_mode">> => <<"unsafe">>,
|
||||
<<"pool_size">> => 1,
|
||||
<<"database">> => <<"mqtt">>,
|
||||
<<"ssl">> => #{<<"enable">> => false},
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
<<"enable">> => true,
|
||||
<<"mongo_type">> => <<"single">>,
|
||||
<<"server">> => <<?MONGO_SINGLE_HOST>>,
|
||||
<<"w_mode">> => <<"unsafe">>,
|
||||
<<"pool_size">> => 1,
|
||||
<<"database">> => <<"mqtt">>,
|
||||
<<"ssl">> => #{<<"enable">> => false},
|
||||
|
|
Loading…
Reference in New Issue