aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test/file_SUITE.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2013-06-04 11:06:18 +0200
committerSiri Hansen <[email protected]>2013-06-04 11:06:18 +0200
commita58a2987ab699b452dd1c95dca62147a827e7c7f (patch)
tree3377b88c5e204ab49bf88cabf4d9525955d4349d /lib/kernel/test/file_SUITE.erl
parentc2151dec9f14707ccaba72cb065824ee61c064a5 (diff)
parente0e8b6d2c016d62c8ada8664ec4ba1ce291979d0 (diff)
downloadotp-a58a2987ab699b452dd1c95dca62147a827e7c7f.tar.gz
otp-a58a2987ab699b452dd1c95dca62147a827e7c7f.tar.bz2
otp-a58a2987ab699b452dd1c95dca62147a827e7c7f.zip
Merge branch 'siri/cuddle-with-tests' into maint
* siri/cuddle-with-tests: Delete 'icky' dirs and symlinks after kernel tests [ct_netconfc] Improve error printout Fix interactive_shell_SUITE to handle node name with quotes
Diffstat (limited to 'lib/kernel/test/file_SUITE.erl')
-rw-r--r--lib/kernel/test/file_SUITE.erl17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl
index 4218cfa646..e4c8f0ffaf 100644
--- a/lib/kernel/test/file_SUITE.erl
+++ b/lib/kernel/test/file_SUITE.erl
@@ -2651,6 +2651,8 @@ symlinks(Config) when is_list(Config) ->
?line #file_info{links=1, type=symlink} = Info2,
?line {ok, Name} = ?FILE_MODULE:read_link(Alias),
{ok, Name} = ?FILE_MODULE:read_link_all(Alias),
+ %% If all is good, delete dir again (avoid hanging dir on windows)
+ rm_rf(?FILE_MODULE,NewDir),
ok
end,
@@ -4304,3 +4306,18 @@ disc_free(Path) ->
memsize() ->
{Tot,_Used,_} = memsup:get_memory_data(),
Tot.
+
+%%%-----------------------------------------------------------------
+%%% Utilities
+rm_rf(Mod,Dir) ->
+ case Mod:read_link_info(Dir) of
+ {ok, #file_info{type = directory}} ->
+ {ok, Content} = Mod:list_dir_all(Dir),
+ [ rm_rf(Mod,filename:join(Dir,C)) || C <- Content ],
+ Mod:del_dir(Dir),
+ ok;
+ {ok, #file_info{}} ->
+ Mod:delete(Dir);
+ _ ->
+ ok
+ end.