test: test authz against 'single' mogodb
This commit is contained in:
parent
6c99b64e4c
commit
7b478817bd
|
@ -38,8 +38,8 @@
|
||||||
}).
|
}).
|
||||||
-define(SOURCE2, #{<<"type">> => <<"mongodb">>,
|
-define(SOURCE2, #{<<"type">> => <<"mongodb">>,
|
||||||
<<"enable">> => true,
|
<<"enable">> => true,
|
||||||
<<"mongo_type">> => <<"sharded">>,
|
<<"mongo_type">> => <<"single">>,
|
||||||
<<"servers">> => <<"127.0.0.1:27017,192.168.0.1:27017">>,
|
<<"server">> => <<"127.0.0.1:27017">>,
|
||||||
<<"pool_size">> => 1,
|
<<"pool_size">> => 1,
|
||||||
<<"database">> => <<"mqtt">>,
|
<<"database">> => <<"mqtt">>,
|
||||||
<<"ssl">> => #{<<"enable">> => false},
|
<<"ssl">> => #{<<"enable">> => false},
|
||||||
|
@ -160,6 +160,13 @@ end_per_testcase(_, _Config) -> ok.
|
||||||
%%------------------------------------------------------------------------------
|
%%------------------------------------------------------------------------------
|
||||||
%% Testcases
|
%% Testcases
|
||||||
%%------------------------------------------------------------------------------
|
%%------------------------------------------------------------------------------
|
||||||
|
t_mongodb_connectivity(_) ->
|
||||||
|
Type = single,
|
||||||
|
Hosts = ["127.0.0.1:27017", "192.168.0.1:27017"],
|
||||||
|
TopologyOpts = [{pool_size, 1}],
|
||||||
|
WorkerOpts = [{database, <<"mqtt">>}, {ssl, false}],
|
||||||
|
{ok, Pid} = mongo_api:connect(Type, Hosts, TopologyOpts, WorkerOpts),
|
||||||
|
?assertEqual(undefined, mongo_api:find_one(Pid, <<"foo">>, #{<<"key">> => 123}, #{})).
|
||||||
|
|
||||||
t_api(_) ->
|
t_api(_) ->
|
||||||
{ok, 200, Result1} = request(get, uri(["authorization", "sources"]), []),
|
{ok, 200, Result1} = request(get, uri(["authorization", "sources"]), []),
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
-export([ lookup/1
|
-export([ lookup/1
|
||||||
, get_metrics/1
|
, get_metrics/1
|
||||||
, list_all/0
|
, list_all/0
|
||||||
, make_test_id/0
|
|
||||||
]).
|
]).
|
||||||
|
|
||||||
-export([ hash_call/2
|
-export([ hash_call/2
|
||||||
|
|
Loading…
Reference in New Issue