Procházet zdrojové kódy

test: add a test case for emqx_machine:node_status

Zaiming (Stone) Shi před 3 roky
rodič
revize
d89975c6ee

+ 1 - 1
apps/emqx_machine/src/emqx_machine.app.src

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

+ 10 - 0
apps/emqx_machine/test/emqx_machine_SUITE.erl

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