test: add a test case for emqx_machine:node_status

This commit is contained in:
Zaiming (Stone) Shi 2023-01-18 08:20:56 +01:00
parent 51cd83e70f
commit d89975c6ee
2 changed files with 11 additions and 1 deletions

View File

@ -3,7 +3,7 @@
{id, "emqx_machine"},
{description, "The EMQX Machine"},
% strict semver, bump manually!
{vsn, "0.2.2"},
{vsn, "0.2.3"},
{modules, []},
{registered, []},
{applications, [kernel, stdlib, emqx_ctl]},

View File

@ -103,3 +103,13 @@ t_custom_shard_transports(_Config) ->
emqx_machine:start(),
?assertEqual(distr, mria_config:shard_transport(Shard)),
ok.
t_node_status(_Config) ->
JSON = emqx_machine:node_status(),
?assertMatch(
#{
<<"backend">> := _,
<<"role">> := <<"core">>
},
jsx:decode(JSON)
).