aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test/code_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-05-02 09:03:47 +0200
committerBjörn Gustavsson <[email protected]>2016-05-02 09:03:47 +0200
commit2f9408fbd12c9a91a48f2157f075a369b99b66a5 (patch)
tree2ec3acb67653b68ab3eb1b9b076f69e59392f7ba /lib/kernel/test/code_SUITE.erl
parenta8667f3fcdd4ee1f59f4826d148dd0838680eda9 (diff)
parentb2eebcb97bdaec6d4520c6f016a3c2d626cf0625 (diff)
downloadotp-2f9408fbd12c9a91a48f2157f075a369b99b66a5.tar.gz
otp-2f9408fbd12c9a91a48f2157f075a369b99b66a5.tar.bz2
otp-2f9408fbd12c9a91a48f2157f075a369b99b66a5.zip
Merge branch 'bjorn/kernel/clean-up-code_server'
* bjorn/kernel/clean-up-code_server: Introduce is_dir/1 to test for a directory Introduce split_base/1 to split into name and version string Eliminate one call to filename:split/1 Refactor get_name/1 Clean up make_path() Avoid calling absname/1 on an absolute path Clean up processing of archive files Simplify and speed up del_ebin/1 code_SUITE: Enhance test of archive files
Diffstat (limited to 'lib/kernel/test/code_SUITE.erl')
-rw-r--r--lib/kernel/test/code_SUITE.erl20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl
index 7f9718a354..383eab94fe 100644
--- a/lib/kernel/test/code_SUITE.erl
+++ b/lib/kernel/test/code_SUITE.erl
@@ -1023,6 +1023,12 @@ do_code_archive(Config, Root, StripVsn) when is_list(Config) ->
{ok, _} = zip:create(Archive, [Base],
[{compress, []}, {cwd, PrivDir}]),
+ %% Create a directory and a file outside of the archive.
+ OtherFile = filename:join([RootDir,VsnBase,"other","other.txt"]),
+ OtherContents = ?MODULE:module_info(md5),
+ filelib:ensure_dir(OtherFile),
+ ok = file:write_file(OtherFile, OtherContents),
+
%% Set up ERL_LIBS and start a slave node.
{ok, Node} =
test_server:start_node(code_archive, slave,
@@ -1037,13 +1043,25 @@ do_code_archive(Config, Root, StripVsn) when is_list(Config) ->
%% Start the app
ok = rpc:call(Node, application, start, [App]),
+ %% Get the lib dir for the app.
+ AppLibDir = rpc:call(Node, code, lib_dir, [App]),
+ io:format("AppLibDir: ~p\n", [AppLibDir]),
+ AppLibDir = filename:join(RootDir, VsnBase),
+
%% Access the app priv dir
AppPrivDir = rpc:call(Node, code, priv_dir, [App]),
AppPrivFile = filename:join([AppPrivDir, "code_archive.txt"]),
io:format("AppPrivFile: ~p\n", [AppPrivFile]),
- {ok, _Bin, _Path} =
+ {ok, _Bin, _} =
rpc:call(Node, erl_prim_loader, get_file, [AppPrivFile]),
+ %% Read back the other text file.
+ OtherDirPath = rpc:call(Node, code, lib_dir, [App,other]),
+ OtherFilePath = filename:join(OtherDirPath, "other.txt"),
+ io:format("OtherFilePath: ~p\n", [OtherFilePath]),
+ {ok, OtherContents, _} =
+ rpc:call(Node, erl_prim_loader, get_file, [OtherFilePath]),
+
%% Use the app
Tab = code_archive_tab,
Key = foo,