~clint-fewbar/ubuntu/precise/erlang/merge-15b

« back to all changes in this revision

Viewing changes to lib/erl_interface/test/ei_connect_SUITE.erl

  • Committer: Package Import Robot
  • Author(s): Sergei Golovan
  • Date: 2011-12-15 19:20:10 UTC
  • mfrom: (1.1.18) (3.5.15 sid)
  • mto: (3.5.16 sid)
  • mto: This revision was merged to the branch mainline in revision 33.
  • Revision ID: package-import@ubuntu.com-20111215192010-jnxcfe3tbrpp0big
Tags: 1:15.b-dfsg-1
* New upstream release.
* Upload to experimental because this release breaks external drivers
  API along with ABI, so several applications are to be fixed.
* Removed SSL patch because the old SSL implementation is removed from
  the upstream distribution.
* Removed never used patch which added native code to erlang beam files.
* Removed the erlang-docbuilder binary package because the docbuilder
  application was dropped by upstream.
* Documented dropping ${erlang-docbuilder:Depends} substvar in
  erlang-depends(1) manpage.
* Made erlang-base and erlang-base-hipe provide virtual package
  erlang-abi-15.b (the number means the first erlang version, which
  provides current ABI).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
%%
2
2
%% %CopyrightBegin%
3
3
%% 
4
 
%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
 
4
%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
5
5
%% 
6
6
%% The contents of this file are subject to the Erlang Public License,
7
7
%% Version 1.1, (the "License"); you may not use this file except in
20
20
%%
21
21
-module(ei_connect_SUITE).
22
22
 
23
 
-include("test_server.hrl").
 
23
-include_lib("test_server/include/test_server.hrl").
24
24
-include("ei_connect_SUITE_data/ei_connect_test_cases.hrl").
25
25
 
26
26
-export([
27
 
        all/1, 
28
 
        init_per_testcase/2, 
29
 
        fin_per_testcase/2,
30
 
 
31
 
        ei_send/1, 
32
 
        ei_reg_send/1, 
33
 
        ei_rpc/1, 
34
 
        rpc_test/1, 
35
 
        ei_send_funs/1,
36
 
        ei_threaded_send/1,
37
 
        ei_set_get_tracelevel/1
 
27
         all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, 
 
28
         init_per_group/2,end_per_group/2, 
 
29
         init_per_testcase/2, 
 
30
         end_per_testcase/2,
 
31
         
 
32
         ei_send/1, 
 
33
         ei_reg_send/1, 
 
34
         ei_format_pid/1,
 
35
         ei_rpc/1, 
 
36
         rpc_test/1, 
 
37
         ei_send_funs/1,
 
38
         ei_threaded_send/1,
 
39
         ei_set_get_tracelevel/1
38
40
        ]).
39
41
 
40
42
-import(runner, [get_term/1,send_term/2]).
41
43
 
42
 
all(suite) -> [ ei_send, 
43
 
                ei_reg_send, 
44
 
                ei_rpc, 
45
 
                ei_send_funs, 
46
 
                ei_threaded_send,
47
 
                ei_set_get_tracelevel].
 
44
suite() -> [{ct_hooks,[ts_install_cth]}].
 
45
 
 
46
all() -> 
 
47
    [ei_send, ei_reg_send, ei_rpc, ei_format_pid, ei_send_funs,
 
48
     ei_threaded_send, ei_set_get_tracelevel].
 
49
 
 
50
groups() -> 
 
51
    [].
 
52
 
 
53
init_per_suite(Config) ->
 
54
    Config.
 
55
 
 
56
end_per_suite(_Config) ->
 
57
    ok.
 
58
 
 
59
init_per_group(_GroupName, Config) ->
 
60
    Config.
 
61
 
 
62
end_per_group(_GroupName, Config) ->
 
63
    Config.
48
64
 
49
65
init_per_testcase(_Case, Config) ->
50
66
    Dog = ?t:timetrap(?t:minutes(0.25)),
51
67
    [{watchdog, Dog}|Config].
52
68
 
53
 
fin_per_testcase(_Case, Config) ->
 
69
end_per_testcase(_Case, Config) ->
54
70
    Dog = ?config(watchdog, Config),
55
71
    test_server:timetrap_cancel(Dog),
56
72
    ok.
67
83
    ?line runner:recv_eot(P),
68
84
    ok.
69
85
 
 
86
ei_format_pid(Config) when is_list(Config) ->
 
87
    ?line S = self(),
 
88
    ?line P = runner:start(?interpret),
 
89
    ?line 0 = ei_connect_init(P, 42, erlang:get_cookie(), 0),
 
90
    ?line {ok,Fd} = ei_connect(P, node()),
 
91
 
 
92
    ?line ok = ei_format_pid(P, Fd, S),
 
93
    ?line receive S -> ok end,
 
94
 
 
95
    ?line runner:send_eot(P),
 
96
    ?line runner:recv_eot(P),
 
97
    ok.
 
98
 
70
99
ei_send_funs(Config) when is_list(Config) ->
71
100
    ?line P = runner:start(?interpret),
72
101
    ?line 0 = ei_connect_init(P, 42, erlang:get_cookie(), 0),
189
218
    send_command(P, ei_send, [Fd,To,Msg]),
190
219
    get_send_result(P).
191
220
 
 
221
ei_format_pid(P, Fd, To) ->
 
222
    send_command(P, ei_format_pid, [Fd, To]),
 
223
    get_send_result(P).
 
224
 
192
225
ei_send_funs(P, Fd, To, Msg) ->
193
226
    send_command(P, ei_send_funs, [Fd,To,Msg]),
194
227
    get_send_result(P).