aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Sloughter <[email protected]>2017-01-03 13:31:59 -0800
committerGitHub <[email protected]>2017-01-03 13:31:59 -0800
commit40f97435ac373242e084b6c042e103b8169799df (patch)
treeee1ac30d0a9e48d26d058778785386c043061e02
parent6ab0a497ffbd60d80b364c3d5b45ea82328e634b (diff)
parent4e0a7e80605b3ebd85da7712039938af99674f76 (diff)
downloadrelx-40f97435ac373242e084b6c042e103b8169799df.tar.gz
relx-40f97435ac373242e084b6c042e103b8169799df.tar.bz2
relx-40f97435ac373242e084b6c042e103b8169799df.zip
Merge pull request #557 from lrascao/feature/longname_release_test
Add test coverage for long node name releases
-rw-r--r--.travis.yml3
-rw-r--r--test/rlx_extended_bin_SUITE.erl42
2 files changed, 44 insertions, 1 deletions
diff --git a/.travis.yml b/.travis.yml
index e1e06be..ce1ef9b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,5 @@
language: erlang
+sudo: required
otp_release:
- 19.1
- 18.3
@@ -12,6 +13,8 @@ script: "./rebar3 update && ./rebar3 ct"
branches:
only:
- master
+addons:
+ hostname: travis.dev
notifications:
email:
diff --git a/test/rlx_extended_bin_SUITE.erl b/test/rlx_extended_bin_SUITE.erl
index ee77d14..78be728 100644
--- a/test/rlx_extended_bin_SUITE.erl
+++ b/test/rlx_extended_bin_SUITE.erl
@@ -24,6 +24,7 @@
all/0,
ping/1,
shortname_ping/1,
+ longname_ping/1,
attach/1,
pid/1,
restart/1,
@@ -63,7 +64,7 @@ init_per_testcase(_, Config) ->
{state, State1} | Config].
all() ->
- [ping, shortname_ping, attach, pid, restart, reboot, escript,
+ [ping, shortname_ping, longname_ping, attach, pid, restart, reboot, escript,
remote_console, replace_os_vars, replace_os_vars_dev_mode, replace_os_vars_twice,
custom_start_script_hooks, builtin_wait_for_vm_start_script_hook,
builtin_pid_start_script_hook, builtin_wait_for_process_start_script_hook,
@@ -141,6 +142,45 @@ shortname_ping(Config) ->
%% a ping should fail after stopping a node
{error, 1, _} = sh(filename:join([OutputDir, "foo", "bin", "foo ping"])).
+longname_ping(Config) ->
+ LibDir1 = proplists:get_value(lib1, Config),
+
+ rlx_test_utils:create_app(LibDir1, "goal_app", "0.0.1", [stdlib,kernel], []),
+
+ ConfigFile = filename:join([LibDir1, "relx.config"]),
+ VmArgs = filename:join([LibDir1, "vm.args"]),
+
+ rlx_test_utils:write_config(ConfigFile,
+ [{release, {foo, "0.0.1"},
+ [goal_app]},
+ {lib_dirs, [filename:join(LibDir1, "*")]},
+ {vm_args, VmArgs},
+ {generate_start_script, true},
+ {extended_start_script, true}
+ ]),
+
+ ec_file:write(VmArgs, "-name foo\n\n"
+ "-setcookie cookie\n"),
+
+ OutputDir = filename:join([proplists:get_value(priv_dir, Config),
+ rlx_test_utils:create_random_name("relx-output")]),
+
+ {ok, _State} = relx:do([{relname, foo},
+ {relvsn, "0.0.1"},
+ {goals, []},
+ {lib_dirs, [LibDir1]},
+ {log_level, 3},
+ {output_dir, OutputDir},
+ {config, ConfigFile}], ["release"]),
+
+ %% now start/stop the release to make sure the extended script is working
+ {ok, _} = sh(filename:join([OutputDir, "foo", "bin", "foo start"])),
+ timer:sleep(2000),
+ {ok, "pong"} = sh(filename:join([OutputDir, "foo", "bin", "foo ping"])),
+ {ok, _} = sh(filename:join([OutputDir, "foo", "bin", "foo stop"])),
+ %% a ping should fail after stopping a node
+ {error, 1, _} = sh(filename:join([OutputDir, "foo", "bin", "foo ping"])).
+
attach(Config) ->
LibDir1 = proplists:get_value(lib1, Config),