From dee92bb8b8033e9e07873ac00bd384bef05ac7f8 Mon Sep 17 00:00:00 2001 From: firest Date: Mon, 8 Aug 2022 18:01:29 +0800 Subject: [PATCH] fix(mgmt): fix status api test case error --- apps/emqx_management/test/emqx_mgmt_api_status_SUITE.erl | 2 +- apps/emqx_management/test/emqx_mgmt_api_test_util.erl | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/emqx_management/test/emqx_mgmt_api_status_SUITE.erl b/apps/emqx_management/test/emqx_mgmt_api_status_SUITE.erl index 3e7f77a31..b725e37b2 100644 --- a/apps/emqx_management/test/emqx_mgmt_api_status_SUITE.erl +++ b/apps/emqx_management/test/emqx_mgmt_api_status_SUITE.erl @@ -31,7 +31,7 @@ end_per_suite(_) -> emqx_mgmt_api_test_util:end_suite(). t_status(_Config) -> - Path = emqx_mgmt_api_test_util:api_path(["status"]), + Path = emqx_mgmt_api_test_util:api_path_without_base_path(["/status"]), Status = io_lib:format("Node ~ts is ~ts~nemqx is ~ts", [node(), started, running]), {ok, Status} = emqx_mgmt_api_test_util:request_api(get, Path), ok. diff --git a/apps/emqx_management/test/emqx_mgmt_api_test_util.erl b/apps/emqx_management/test/emqx_mgmt_api_test_util.erl index 1bdf584e5..a8b04dc80 100644 --- a/apps/emqx_management/test/emqx_mgmt_api_test_util.erl +++ b/apps/emqx_management/test/emqx_mgmt_api_test_util.erl @@ -110,6 +110,9 @@ build_http_header(X) -> api_path(Parts) -> ?SERVER ++ filename:join([?BASE_PATH | Parts]). +api_path_without_base_path(Parts) -> + ?SERVER ++ filename:join([Parts]). + %% Usage: %% upload_request(<<"site.com/api/upload">>, <<"path/to/file.png">>, %% <<"upload">>, <<"image/png">>, [], <<"some-token">>)