diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ssh/test/ssh_basic_SUITE.erl | 37 |
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. |