code format
This commit is contained in:
parent
4aed3abb5e
commit
b9220490bf
|
@ -53,7 +53,7 @@ groups() ->
|
|||
[{protocol, [sequence],
|
||||
[mqtt_connect,
|
||||
mqtt_ssl_oneway,
|
||||
mqtt_ssl_mutway]},
|
||||
mqtt_ssl_twoway]},
|
||||
{pubsub, [sequence],
|
||||
[subscribe_unsubscribe,
|
||||
publish, pubsub,
|
||||
|
@ -144,7 +144,6 @@ mqtt_ssl_oneway(_) ->
|
|||
{client_id, <<"ssloneway">>}, ssl]),
|
||||
timer:sleep(100),
|
||||
emqttc:subscribe(SslOneWay, <<"topic">>, qos1),
|
||||
|
||||
{ok, Pub} = emqttc:start_link([{host, "localhost"},
|
||||
{client_id, <<"pub">>}]),
|
||||
receive {publish, _Topic, RM} ->
|
||||
|
@ -154,14 +153,13 @@ mqtt_ssl_oneway(_) ->
|
|||
emqttc:disconnect(SslOneWay),
|
||||
emqttc:disconnect(Pub).
|
||||
|
||||
mqtt_ssl_mutway(Config) ->
|
||||
mqtt_ssl_twoway(Config) ->
|
||||
emqttd_cluster:prepare(),
|
||||
DataDir = proplists:get_value(data_dir, Config),
|
||||
EmqConfig = proplists:get_value(config, Config),
|
||||
Vals = change_opts(ssl_mut, DataDir, proplists:get_value(emqttd, EmqConfig)),
|
||||
[application:set_env(emqttd, Par, Value) || {Par, Value} <- Vals],
|
||||
emqttd_cluster:reboot(),
|
||||
|
||||
ClientSSl = [{Key, filename:join([DataDir, File])} ||
|
||||
{Key, File} <- ?MQTT_SSL_CLIENT ],
|
||||
{ok, SslMutWay} = emqttc:start_link([{host, "localhost"},
|
||||
|
@ -643,6 +641,7 @@ slave(emqttd, Node) ->
|
|||
slave(node, Node) ->
|
||||
{ok, N} = slave:start(host(), Node, "-pa ../../ebin -pa ../../deps/*/ebin"),
|
||||
N.
|
||||
|
||||
emqttd_config(DataDir) ->
|
||||
Schema = cuttlefish_schema:files([filename:join([DataDir, "emqttd.schema"])]),
|
||||
Conf = conf_parse:file(filename:join([DataDir, "emqttd.conf"])),
|
||||
|
@ -650,7 +649,8 @@ emqttd_config(DataDir) ->
|
|||
|
||||
change_opts(SslType, DataDir, Vals) ->
|
||||
Listeners = proplists:get_value(listeners, Vals),
|
||||
NewListeners = lists:foldl(fun({Protocol, Port, Opts} = Listener, Acc) ->
|
||||
NewListeners =
|
||||
lists:foldl(fun({Protocol, Port, Opts} = Listener, Acc) ->
|
||||
case Protocol of
|
||||
ssl ->
|
||||
SslOpts = proplists:get_value(ssl, Opts),
|
||||
|
|
Loading…
Reference in New Issue