test: apply review comments
This commit is contained in:
parent
68592373e3
commit
e76682d368
|
@ -75,7 +75,7 @@
|
||||||
-ifdef(TEST).
|
-ifdef(TEST).
|
||||||
-spec parse(string() | binary()) -> {ok, license()} | {error, term()}.
|
-spec parse(string() | binary()) -> {ok, license()} | {error, term()}.
|
||||||
parse(Content) ->
|
parse(Content) ->
|
||||||
PubKey = persistent_term:get({emqx_license_parser_test, pubkey}, ?PUBKEY),
|
PubKey = persistent_term:get(emqx_license_test_pubkey, ?PUBKEY),
|
||||||
parse(Content, PubKey).
|
parse(Content, PubKey).
|
||||||
-else.
|
-else.
|
||||||
-spec parse(string() | binary()) -> {ok, license()} | {error, term()}.
|
-spec parse(string() | binary()) -> {ok, license()} | {error, term()}.
|
||||||
|
|
|
@ -142,7 +142,7 @@ setup_test(TestCase, Config) when
|
||||||
RawConfig = #{<<"type">> => file, <<"file">> => LicensePath},
|
RawConfig = #{<<"type">> => file, <<"file">> => LicensePath},
|
||||||
emqx_config:put_raw([<<"license">>], RawConfig),
|
emqx_config:put_raw([<<"license">>], RawConfig),
|
||||||
ok = persistent_term:put(
|
ok = persistent_term:put(
|
||||||
{emqx_license_parser_test, pubkey},
|
emqx_license_test_pubkey,
|
||||||
emqx_license_test_lib:public_key_pem()
|
emqx_license_test_lib:public_key_pem()
|
||||||
),
|
),
|
||||||
ok;
|
ok;
|
||||||
|
|
|
@ -30,7 +30,7 @@ end_per_suite(_) ->
|
||||||
emqx_config:put([license], Config),
|
emqx_config:put([license], Config),
|
||||||
RawConfig = #{<<"type">> => file, <<"file">> => emqx_license_test_lib:default_license()},
|
RawConfig = #{<<"type">> => file, <<"file">> => emqx_license_test_lib:default_license()},
|
||||||
emqx_config:put_raw([<<"license">>], RawConfig),
|
emqx_config:put_raw([<<"license">>], RawConfig),
|
||||||
persistent_term:erase({emqx_license_parser_test, pubkey}),
|
persistent_term:erase(emqx_license_test_pubkey),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
set_special_configs(emqx_dashboard) ->
|
set_special_configs(emqx_dashboard) ->
|
||||||
|
@ -42,7 +42,7 @@ set_special_configs(emqx_license) ->
|
||||||
RawConfig = #{<<"type">> => key, <<"key">> => LicenseKey},
|
RawConfig = #{<<"type">> => key, <<"key">> => LicenseKey},
|
||||||
emqx_config:put_raw([<<"license">>], RawConfig),
|
emqx_config:put_raw([<<"license">>], RawConfig),
|
||||||
ok = persistent_term:put(
|
ok = persistent_term:put(
|
||||||
{emqx_license_parser_test, pubkey},
|
emqx_license_test_pubkey,
|
||||||
emqx_license_test_lib:public_key_pem()
|
emqx_license_test_lib:public_key_pem()
|
||||||
),
|
),
|
||||||
ok;
|
ok;
|
||||||
|
|
Loading…
Reference in New Issue