~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to lib/snmp/test/snmp_manager_user_test.erl

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
%% 
2
2
%% %CopyrightBegin%
3
 
%% 
4
 
%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
5
 
%% 
 
3
%%
 
4
%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
 
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
8
8
%% compliance with the License. You should have received a copy of the
9
9
%% Erlang Public License along with this software. If not, it can be
10
10
%% retrieved online at http://www.erlang.org/.
11
 
%% 
 
11
%%
12
12
%% Software distributed under the License is distributed on an "AS IS"
13
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
14
%% the License for the specific language governing rights and limitations
15
15
%% under the License.
16
 
%% 
 
16
%%
17
17
%% %CopyrightEnd%
18
18
%% 
19
19
 
26
26
%%----------------------------------------------------------------------
27
27
%% Include files
28
28
%%----------------------------------------------------------------------
29
 
-include("test_server.hrl").
 
29
-include_lib("test_server/include/test_server.hrl").
30
30
-include("snmp_test_lib.hrl").
31
31
 
32
32
 
36
36
%% -compile(export_all).
37
37
 
38
38
-export([
39
 
         all/1,
40
 
         init_per_testcase/2, fin_per_testcase/2,
41
 
         
42
 
         register_user/1, 
 
39
all/0,groups/0,init_per_group/2,end_per_group/2,
 
40
         init_per_testcase/2, end_per_testcase/2,
 
41
         
 
42
         
43
43
         simple_register_and_unregister1/1,
44
44
         simple_register_and_unregister2/1,
45
45
         simple_register_and_unregister3/1,
62
62
         register_monitor_request_and_crash3/1,
63
63
         register_monitor_request_and_crash4/1, 
64
64
 
65
 
         tickets/1,
 
65
        
66
66
         otp7902/1
67
67
 
68
68
        ]).
123
123
     {manager_log_dir,  MgrLogDir} | Config].
124
124
 
125
125
 
126
 
fin_per_testcase(Case, Config) when is_list(Config) ->
127
 
    p("fin_per_testcase -> Case: ~p", [Case]),
 
126
end_per_testcase(Case, Config) when is_list(Config) ->
 
127
    p("end_per_testcase -> Case: ~p", [Case]),
128
128
%     MgrTopDir = ?config(manager_dir, Config),
129
129
%     ?DEL_DIR(MgrTopDir),
130
130
    Config.
134
134
%% Test case definitions
135
135
%%======================================================================
136
136
 
137
 
all(suite) ->
138
 
    [
139
 
     register_user,
140
 
     tickets
141
 
    ].
142
 
 
143
 
register_user(suite) ->
144
 
    [
145
 
     simple_register_and_unregister1,
146
 
     simple_register_and_unregister2,
147
 
     simple_register_and_unregister3,
148
 
     register_and_crash1,
149
 
     register_and_crash2,
150
 
     register_and_crash3,
151
 
     register_request_and_crash1,
152
 
     register_request_and_crash2,
153
 
     register_request_and_crash3,
154
 
     simple_register_monitor_and_unregister1,
155
 
     simple_register_monitor_and_unregister2,
156
 
     simple_register_monitor_and_unregister3,
157
 
     register_monitor_and_crash1,
158
 
     register_monitor_and_crash2,
159
 
     register_monitor_and_crash3,
160
 
     register_monitor_and_crash4,
161
 
     register_monitor_and_crash5,
162
 
     register_monitor_request_and_crash1,
163
 
     register_monitor_request_and_crash2,
164
 
     register_monitor_request_and_crash3,
165
 
     register_monitor_request_and_crash4
166
 
    ].
167
 
 
168
 
 
169
 
tickets(suite) ->
170
 
    [
171
 
     otp7902
172
 
    ].
 
137
all() -> 
 
138
[{group, register_user}, {group, tickets}].
 
139
 
 
140
groups() -> 
 
141
    [{register_user, [],
 
142
  [simple_register_and_unregister1,
 
143
   simple_register_and_unregister2,
 
144
   simple_register_and_unregister3, register_and_crash1,
 
145
   register_and_crash2, register_and_crash3,
 
146
   register_request_and_crash1,
 
147
   register_request_and_crash2,
 
148
   register_request_and_crash3,
 
149
   simple_register_monitor_and_unregister1,
 
150
   simple_register_monitor_and_unregister2,
 
151
   simple_register_monitor_and_unregister3,
 
152
   register_monitor_and_crash1,
 
153
   register_monitor_and_crash2,
 
154
   register_monitor_and_crash3,
 
155
   register_monitor_and_crash4,
 
156
   register_monitor_and_crash5,
 
157
   register_monitor_request_and_crash1,
 
158
   register_monitor_request_and_crash2,
 
159
   register_monitor_request_and_crash3,
 
160
   register_monitor_request_and_crash4]},
 
161
 {tickets, [], [otp7902]}].
 
162
 
 
163
init_per_group(_GroupName, Config) ->
 
164
        Config.
 
165
 
 
166
end_per_group(_GroupName, Config) ->
 
167
        Config.
 
168
 
 
169
 
 
170
 
 
171
 
173
172
 
174
173
 
175
174
%%======================================================================
822
821
    "Start a single user process, "
823
822
        "register-monitor one user and register one user, "
824
823
        "crash the single user process.";
825
 
register_monitor_and_crash3(Conf) when is_list(Conf) ->
 
824
register_monitor_and_crash3(Conf) when is_list(Conf) -> 
 
825
    process_flag(trap_exit, true),
826
826
    put(tname,rlac3),
 
827
 
 
828
    %% <CONDITIONAL-SKIP>
 
829
    %% The point of this is to catch machines running 
 
830
    %% SLES9 (2.6.5)
 
831
    LinuxVersionVerify = 
 
832
        fun() ->
 
833
                case os:cmd("uname -m") of
 
834
                    "i686" ++ _ ->
 
835
%%                      io:format("found an i686 machine, "
 
836
%%                                "now check version~n", []),
 
837
                        case os:version() of
 
838
                            {2, 6, Rev} when Rev >= 16 ->
 
839
                                true;
 
840
                            {2, Min, _} when Min > 6 ->
 
841
                                true;
 
842
                            {Maj, _, _} when Maj > 2 ->
 
843
                                true;
 
844
                            _ ->
 
845
                                false
 
846
                        end;
 
847
                    _ ->
 
848
                        true
 
849
                end
 
850
        end,
 
851
    Skippable = [{unix, [{linux, LinuxVersionVerify}]}],
 
852
    Condition = fun() -> ?OS_BASED_SKIP(Skippable) end,
 
853
    ?NON_PC_TC_MAYBE_SKIP(Conf, Condition),
 
854
    %% </CONDITIONAL-SKIP>
 
855
 
827
856
    p("start"),
828
 
    process_flag(trap_exit, true),
829
857
 
830
858
    ConfDir = ?config(manager_conf_dir, Conf),
831
859
    DbDir = ?config(manager_db_dir, Conf),