aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/test
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2015-06-10 12:48:14 +0200
committerHans Nilsson <[email protected]>2015-06-15 12:04:11 +0200
commitcf063cb5a3fe51319a483929a632b4b774136262 (patch)
tree22a7cd5ee915e9d1d6d5c75d9e9047fe20a9255c /lib/ssh/test
parent9ba9728528f309933fd95aa92f748682dd5204f2 (diff)
downloadotp-cf063cb5a3fe51319a483929a632b4b774136262.tar.gz
otp-cf063cb5a3fe51319a483929a632b4b774136262.tar.bz2
otp-cf063cb5a3fe51319a483929a632b4b774136262.zip
ssh: fix bad ssh_basic_SUITE dir_options group
Diffstat (limited to 'lib/ssh/test')
-rw-r--r--lib/ssh/test/ssh_basic_SUITE.erl37
1 files changed, 27 insertions, 10 deletions
diff --git a/lib/ssh/test/ssh_basic_SUITE.erl b/lib/ssh/test/ssh_basic_SUITE.erl
index 2ff6aac3b6..e62feb6857 100644
--- a/lib/ssh/test/ssh_basic_SUITE.erl
+++ b/lib/ssh/test/ssh_basic_SUITE.erl
@@ -154,19 +154,36 @@ init_per_group(dir_options, Config) ->
%% Make readable file:
File_readable = filename:join(PrivDir, "file"),
ok = file:write_file(File_readable, <<>>),
+
%% Check:
case {file:read_file_info(Dir_unreadable),
file:read_file_info(File_readable)} of
- {{ok, #file_info{type=directory, access=Md}},
- {ok, #file_info{type=regular, access=Mf}}} when Md=/=read, Md=/=read_write,
- Mf=/=read, Mf=/=read_write ->
- %% Save:
- [{unreadable_dir, Dir_unreadable},
- {readable_file, File_readable}
- | Config];
- X ->
- ct:log("#file_info : ~p",[X]),
- {skip, "File or dir mode settings failed"}
+ {{ok, Id=#file_info{type=directory, access=Md}},
+ {ok, If=#file_info{type=regular, access=Mf}}} ->
+ AccessOK =
+ case {Md, Mf} of
+ {read, _} -> false;
+ {read_write, _} -> false;
+ {_, read} -> true;
+ {_, read_write} -> true;
+ _ -> false
+ end,
+
+ case AccessOK of
+ true ->
+ %% Save:
+ [{unreadable_dir, Dir_unreadable},
+ {readable_file, File_readable}
+ | Config];
+ false ->
+ ct:log("File#file_info : ~p~n"
+ "Dir#file_info : ~p",[If,Id]),
+ {skip, "File or dir mode settings failed"}
+ end;
+
+ NotDirFile ->
+ ct:log("{Dir,File} -> ~p",[NotDirFile]),
+ {skip, "File/Dir creation failed"}
end;
init_per_group(_, Config) ->
Config.