Skip to content

Commit 3a086e8

Browse files
rabbitmqadmin v1 suite: nuke an environment-sensitive test
(cherry picked from commit bc8c5fc6ab7805a7627771bef70e0f4208da264a)
1 parent 7b42dd7 commit 3a086e8

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

deps/rabbitmq_management/test/rabbit_mgmt_rabbitmqadmin_SUITE.erl

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ groups() ->
2020
help,
2121
host,
2222
base_uri,
23-
config_file,
2423
user,
2524
fmt_long,
2625
fmt_kvp,
@@ -78,16 +77,9 @@ init_per_group(_, Config) ->
7877
end_per_group(_, Config) ->
7978
Config.
8079

81-
init_per_testcase(config_file, Config) ->
82-
Home = os:getenv("HOME"),
83-
os:putenv("HOME", ?config(priv_dir, Config)),
84-
rabbit_ct_helpers:set_config(Config, {env_home, Home});
8580
init_per_testcase(Testcase, Config) ->
8681
rabbit_ct_helpers:testcase_started(Config, Testcase).
8782

88-
end_per_testcase(config_file, Config) ->
89-
Home = rabbit_ct_helpers:get_config(Config, env_home),
90-
os:putenv("HOME", Home);
9183
end_per_testcase(Testcase, Config) ->
9284
rabbit_ct_helpers:testcase_finished(Config, Testcase).
9385

@@ -121,33 +113,6 @@ base_uri(Config) ->
121113
"list", "exchanges"]).
122114

123115

124-
config_file(Config) ->
125-
MgmtPort = integer_to_list(http_api_port(Config)),
126-
{_DefConf, TestConf} = write_test_config(Config),
127-
128-
%% try using a non-existent config file
129-
?assertMatch({error, _, _}, run(Config, ["--config", "/tmp/no-such-config-file", "show", "overview"])),
130-
%% use a config file section with a reachable endpoint and correct credentials
131-
?assertMatch({ok, _}, run(Config, ["--config", TestConf, "--node", "reachable", "show", "overview"])),
132-
133-
%% Default node in the config file uses an unreachable endpoint. Note that
134-
%% the function that drives rabbitmqadmin will specify a --port and that will override
135-
%% the config file value.
136-
?assertMatch({error, _, _}, run(Config, ["--config", TestConf, "show", "overview"])),
137-
138-
%% overrides hostname and port using --base-uri
139-
BaseURI = rabbit_misc:format("http://localhost:~ts", [MgmtPort]),
140-
?assertMatch({ok, _}, run(Config, ["--config", TestConf, "--base-uri", BaseURI, "show", "overview"])),
141-
142-
%% overrides --host and --port on the command line
143-
?assertMatch({ok, _}, run(Config, ["--config", TestConf, "--node", "default", "--host", "localhost", "--port", MgmtPort, "show", "overview"])),
144-
145-
?assertMatch({ok, _}, run(Config, ["show", "overview"])),
146-
?assertMatch({error, _, _}, run(Config, ["--node", "bad_credentials", "show", "overview"])),
147-
%% overrides --username and --password on the command line with correct credentials
148-
?assertMatch({ok, _}, run(Config, ["--node", "bad_credentials", "--username", "guest", "--password", "guest", "show", "overview"])),
149-
%% overrides --username and --password on the command line with incorrect credentials
150-
?assertMatch({error, _, _}, run(Config, ["--node", "bad_credentials", "--username", "gu3st", "--password", "guesTTTT", "show", "overview"])).
151116

152117
user(Config) ->
153118
?assertMatch({ok, _}, run(Config, ["--user", "guest", "--password", "guest", "show", "overview"])),

0 commit comments

Comments
 (0)