瀏覽代碼

test: add a test case for emqx_machine:node_status

Zaiming (Stone) Shi 3 年之前
父節點
當前提交
d89975c6ee
共有 2 個文件被更改,包括 11 次插入1 次删除
  1. 1 1
      apps/emqx_machine/src/emqx_machine.app.src
  2. 10 0
      apps/emqx_machine/test/emqx_machine_SUITE.erl

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

@@ -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]},

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

@@ -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)
+    ).