vernemq / vmq_mzbench

An MQTT loadtest and usage scenario tool for VerneMQ and other MQTT systems.
Apache License 2.0
42 stars 44 forks source link

How to run with user/pass #14

Closed sonecabr closed 7 years ago

sonecabr commented 7 years ago

its possible to set the username and password on test scenario to run with secured mqtt brokers?

ioolkos commented 7 years ago

Hey @sonecabr thanks for looking into vmq_mzbench.

Yes, you can actually use all options you see in the client init function: https://github.com/erlio/vernemq/blob/master/apps/vmq_commons/src/gen_emqtt.erl#L288

That is, you can use them in a connect command in your scenario file, sth like this:

 connect([t(host, "127.0.0.1"),
                    t(port,8883),
                    t(client,fixed_client_id("pool1", worker_id())),
                    t(username, "test"),
                    t(password, "test"),
                    t(clean_session,true),
                    t(keepalive_interval,60),
                    t(proto_version,4), t(reconnect_timeout,15), t(transport, t(ssl, [t(reuse_sessions, false)]))])

typed from the back of my head... check for typos ;)

sonecabr commented 7 years ago

Many thanks @ioolkos !