aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2016-07-01 11:16:42 +0200
committerLukas Larsson <[email protected]>2016-07-05 09:46:13 +0200
commita93036e0cd9c3620ece4bfcb56c6b0c44abf9a58 (patch)
treefc0bb326fd851f56f0d0b4259a264b39f7dd1753
parent412d7dfcfb667bb2b329b8e35c929c2b5abcc2b1 (diff)
downloadotp-a93036e0cd9c3620ece4bfcb56c6b0c44abf9a58.tar.gz
otp-a93036e0cd9c3620ece4bfcb56c6b0c44abf9a58.tar.bz2
otp-a93036e0cd9c3620ece4bfcb56c6b0c44abf9a58.zip
erts: Add port_SUITE:cd invalid dir testcase
-rw-r--r--erts/emulator/test/port_SUITE.erl27
1 files changed, 24 insertions, 3 deletions
diff --git a/erts/emulator/test/port_SUITE.erl b/erts/emulator/test/port_SUITE.erl
index 6115071b79..a683307722 100644
--- a/erts/emulator/test/port_SUITE.erl
+++ b/erts/emulator/test/port_SUITE.erl
@@ -1037,8 +1037,7 @@ cd(Config) when is_list(Config) ->
Cmd = Program ++ " -pz " ++ DataDir ++
" -noshell -s port_test pwd -s erlang halt",
_ = open_port({spawn, Cmd},
- [{cd, TestDir},
- {line, 256}]),
+ [{cd, TestDir}, {line, 256}]),
receive
{_, {data, {eol, String}}} ->
case filename_equal(String, TestDir) of
@@ -1064,7 +1063,29 @@ cd(Config) when is_list(Config) ->
Other3 ->
ct:fail({env, Other3})
end,
- ok.
+
+ InvalidDir = filename:join(DataDir, "invaliddir"),
+ try open_port({spawn, Cmd},
+ [{cd, InvalidDir}, exit_status, {line, 256}]) of
+ _ ->
+ receive
+ {_, {exit_status, _}} ->
+ ok;
+ Other4 ->
+ ct:fail({env, Other4})
+ end
+ catch error:eacces ->
+ %% This happens on Windows
+ ok
+ end,
+
+ %% Check that there are no lingering messages
+ receive
+ Other5 ->
+ ct:fail({env, Other5})
+ after 10 ->
+ ok
+ end.
%% Test that an emulator that has set it's cwd to
%% something other then when it started, can use