~ubuntu-branches/debian/squeeze/erlang/squeeze

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-05-07 15:07:37 UTC
  • mfrom: (1.2.1 upstream) (5.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20090507150737-i4yb5elwinm7r0hc
Tags: 1:13.b-dfsg1-1
* Removed another bunch of non-free RFCs from original tarball
  (closes: #527053).
* Fixed build-dependencies list by adding missing comma. This requires
  libsctp-dev again. Also, added libsctp1 dependency to erlang-base and
  erlang-base-hipe packages because the shared library is loaded via
  dlopen now and cannot be added using dh_slibdeps (closes: #526682).
* Weakened dependency of erlang-webtool on erlang-observer to recommends
  to avoid circular dependencies (closes: #526627).
* Added solaris-i386 to HiPE enabled architectures.
* Made script sources in /usr/lib/erlang/erts-*/bin directory executable,
  which is more convenient if a user wants to create a target Erlang system.
* Shortened extended description line for erlang-dev package to make it
  fit 80x25 terminals.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
%%<copyright>
2
 
%% <year>2003-2008</year>
3
 
%% <holder>Ericsson AB, All Rights Reserved</holder>
4
 
%%</copyright>
5
 
%%<legalnotice>
 
1
%% 
 
2
%% %CopyrightBegin%
 
3
%% 
 
4
%% Copyright Ericsson AB 2003-2009. 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
 
%%
17
 
%% The Initial Developer of the Original Code is Ericsson AB.
18
 
%%</legalnotice>
19
 
%%
20
 
%% Test: ts:run(snmp, snmp_agent_test, [batch]).
21
 
%%
 
16
%% 
 
17
%% %CopyrightEnd%
 
18
%% 
 
19
 
22
20
-module(snmp_agent_test).
23
21
 
24
22
%% TODO
85
83
               end).
86
84
 
87
85
 
88
 
all(suite) -> {req,
89
 
               [
90
 
                mnesia, 
91
 
                distribution,
92
 
                {local_slave_nodes, 2}, 
93
 
                {time, 360}
94
 
               ],
95
 
               [{conf, init_all, cases(), finish_all}]}.
 
86
all(suite) -> 
 
87
    {req,
 
88
     [
 
89
      mnesia, 
 
90
      distribution,
 
91
      {local_slave_nodes, 2}, 
 
92
      {time, 360}
 
93
     ],
 
94
     [{conf, init_all, cases(), finish_all}]}.
96
95
 
97
96
 
98
97
init_per_testcase(otp_7157_test = _Case, Config) when is_list(Config) ->
186
185
%%%-----------------------------------------------------------------
187
186
 
188
187
init_all(Conf) ->
 
188
    ?DISPLAY_SUITE_INFO(), 
189
189
    snmp_agent_test_lib:init_all(Conf).
190
190
 
191
191
finish_all(Conf) ->
619
619
msd_size_check(X)     -> ?P(msd_size_check), ms_size_check(X).
620
620
msm_size_check(X)     -> ?P(msm_size_check), ms_size_check(X).
621
621
 
622
 
msd_varm_mib_start(X) -> ?P(msd_varm_mib_start), varm_mib_start(X).
623
 
msm_varm_mib_start(X) -> ?P(msm_varm_mib_start), varm_mib_start(X).
 
622
msd_varm_mib_start(X) -> 
 
623
    ?P(msd_varm_mib_start), 
 
624
    varm_mib_start(X).
 
625
 
 
626
msm_varm_mib_start(X) -> 
 
627
    %% <CONDITIONAL-SKIP>
 
628
    Skippable = [win32],
 
629
    Condition = fun() -> ?OS_BASED_SKIP(Skippable) end,
 
630
    ?NON_PC_TC_MAYBE_SKIP(X, Condition),
 
631
    %% </CONDITIONAL-SKIP>
 
632
 
 
633
    ?P(msm_varm_mib_start), 
 
634
    varm_mib_start(X).
624
635
 
625
636
ms_size_check(suite) -> [];
626
637
ms_size_check(Config) when list(Config) ->
1088
1099
    delete_files(C1),
1089
1100
    lists:keydelete(vsn, 1, C1).
1090
1101
 
1091
 
test_multi_threaded(suite) -> {req, [], {conf, init_mt, mt_cases(), finish_mt}}.
 
1102
test_multi_threaded(suite) -> 
 
1103
    {req, [], {conf, init_mt, mt_cases(), finish_mt}}.
1092
1104
 
1093
1105
mt_cases() ->
1094
1106
    [multi_threaded, mt_trap].
1097
1109
    SaNode = ?config(snmp_sa, Config),
1098
1110
    create_tables(SaNode),
1099
1111
    AgentDir = ?config(agent_dir, Config),
1100
 
    MgrDir = ?config(mgr_dir, Config),
1101
 
    Ip = ?config(ip, Config),
1102
 
    ?line ok = config([v2], MgrDir, AgentDir, tuple_to_list(Ip), tuple_to_list(Ip)),
 
1112
    MgrDir   = ?config(mgr_dir, Config),
 
1113
    Ip       = ?config(ip, Config),
 
1114
    ?line ok = 
 
1115
        config([v2], MgrDir, AgentDir, tuple_to_list(Ip), tuple_to_list(Ip)),
1103
1116
    [{vsn, v2} | start_multi_threaded_agent(Config)].
1104
1117
 
1105
1118
finish_mt(Config) when list(Config) ->
1545
1558
    
1546
1559
subagent_2(X) -> ?P(subagent_2), subagent(X).
1547
1560
 
1548
 
subagent_3(X) -> ?P(subagent_3), subagent(X).
 
1561
subagent_3(X) -> 
 
1562
    %% <CONDITIONAL-SKIP>
 
1563
    Skippable = [{unix, [darwin]}],
 
1564
    Condition = fun() -> ?OS_BASED_SKIP(Skippable) end,
 
1565
    ?NON_PC_TC_MAYBE_SKIP(X, Condition),
 
1566
    %% </CONDITIONAL-SKIP>
 
1567
 
 
1568
    ?P(subagent_3), 
 
1569
    subagent(X).
1549
1570
 
1550
1571
 
1551
1572
mnesia(suite) -> [];
1729
1750
v1_trap(suite) -> [];
1730
1751
v1_trap(Config) when list(Config) ->
1731
1752
    ?P(v1_trap), 
 
1753
    trap1(Config).
 
1754
 
 
1755
trap1(Config) ->
1732
1756
    {SaNode, _MgrNode, _MibDir} = init_case(Config),
1733
1757
 
1734
1758
    ?P1("start subagent..."),
1762
1786
v2_trap(suite) -> [];
1763
1787
v2_trap(Config) when list(Config) ->
1764
1788
    ?P(v2_trap), 
 
1789
    trap2(Config).
 
1790
 
 
1791
trap2(Config) ->
1765
1792
    {SaNode, _MgrNode, _MibDir} = init_case(Config),
1766
1793
 
1767
1794
    ?P1("start subagent..."),
1794
1821
    ?P1("stop subagent..."),
1795
1822
    ?line stop_subagent(SA).
1796
1823
 
1797
 
v3_trap(X) ->
 
1824
v3_trap(suite) -> [];
 
1825
v3_trap(Config) when is_list(Config) ->
 
1826
    %% <CONDITIONAL-SKIP>
 
1827
    Skippable = [{unix, [darwin]}],
 
1828
    Condition = fun() -> ?OS_BASED_SKIP(Skippable) end,
 
1829
    ?NON_PC_TC_MAYBE_SKIP(Config, Condition),
 
1830
    %% </CONDITIONAL-SKIP>
 
1831
 
1798
1832
    ?P(v3_trap), 
1799
 
    v2_trap(X).
 
1833
    trap2(Config).
1800
1834
 
1801
1835
v2_inform(suite) ->
1802
1836
    {req, [], {conf, init_v2_inform, [v2_inform_i], finish_v2_inform}}.
1826
1860
v2_inform_i(suite) -> [];
1827
1861
v2_inform_i(Config) when list(Config) ->
1828
1862
    ?P(v2_inform_i), 
 
1863
    inform_i(Config).
 
1864
 
 
1865
inform_i(Config) ->
1829
1866
    init_case(Config),
1830
1867
 
1831
1868
    MA = whereis(snmp_master_agent),
1845
1882
    ?line unload_master("TestTrap"),
1846
1883
    ?line unload_master("TestTrapv2").
1847
1884
 
1848
 
v3_inform_i(X) -> ?P(v3_inform_i), v2_inform_i(X).
 
1885
v3_inform_i(X) -> 
 
1886
    %% <CONDITIONAL-SKIP>
 
1887
    Skippable = [{unix, [darwin]}],
 
1888
    Condition = fun() -> ?OS_BASED_SKIP(Skippable) end,
 
1889
    ?NON_PC_TC_MAYBE_SKIP(X, Condition),
 
1890
    %% </CONDITIONAL-SKIP>
 
1891
 
 
1892
    ?P(v3_inform_i), 
 
1893
    inform_i(X).
1849
1894
 
1850
1895
 
1851
1896
sa_error(suite) -> [];
1875
1920
    ?P1("stop subagent..."),
1876
1921
    stop_subagent(SA).
1877
1922
 
1878
 
sa_error_2(X) -> ?P(sa_error_2), sa_error(X).
1879
 
 
1880
 
sa_error_3(X) -> ?P(sa_error_3), sa_error(X).
 
1923
sa_error_2(X) -> 
 
1924
    ?P(sa_error_2), 
 
1925
    sa_error(X).
 
1926
 
 
1927
sa_error_3(X) -> 
 
1928
    %% <CONDITIONAL-SKIP>
 
1929
    Skippable = [{unix, [darwin]}],
 
1930
    Condition = fun() -> ?OS_BASED_SKIP(Skippable) end,
 
1931
    ?NON_PC_TC_MAYBE_SKIP(X, Condition),
 
1932
    %% </CONDITIONAL-SKIP>
 
1933
 
 
1934
    ?P(sa_error_3), 
 
1935
    sa_error(X).
1881
1936
 
1882
1937
 
1883
1938
next_across_sa(suite) -> [];
1884
 
next_across_sa(Config) when list(Config) ->
 
1939
next_across_sa(Config) when is_list(Config) ->
1885
1940
    ?P(next_across_sa), 
1886
1941
    {SaNode, _MgrNode, MibDir} = init_case(Config),
1887
1942
    MA = whereis(snmp_master_agent),
1917
1972
    ?P1("stop subagent (2)..."),
1918
1973
    stop_subagent(SA2).
1919
1974
 
1920
 
next_across_sa_2(X) -> ?P(next_across_sa_2), next_across_sa(X).
1921
 
 
1922
 
next_across_sa_3(X) -> ?P(next_across_sa_3), next_across_sa(X).
 
1975
next_across_sa_2(X) -> 
 
1976
    ?P(next_across_sa_2), 
 
1977
    next_across_sa(X).
 
1978
 
 
1979
next_across_sa_3(X) -> 
 
1980
    %% <CONDITIONAL-SKIP>
 
1981
    Skippable = [{unix, [darwin]}],
 
1982
    Condition = fun() -> ?OS_BASED_SKIP(Skippable) end,
 
1983
    ?NON_PC_TC_MAYBE_SKIP(X, Condition),
 
1984
    %% </CONDITIONAL-SKIP>
 
1985
 
 
1986
    ?P(next_across_sa_3), 
 
1987
    next_across_sa(X).
1923
1988
 
1924
1989
 
1925
1990
undo(suite) -> [];
1964
2029
    ?P1("stop subagent..."), 
1965
2030
    stop_subagent(SA).
1966
2031
 
1967
 
undo_2(X) -> ?P(undo_2), undo(X).
1968
 
 
1969
 
undo_3(X) -> ?P(undo_3), undo(X).
 
2032
undo_2(X) -> 
 
2033
    ?P(undo_2), 
 
2034
    undo(X).
 
2035
 
 
2036
undo_3(X) -> 
 
2037
    %% <CONDITIONAL-SKIP>
 
2038
    Skippable = [{unix, [darwin]}],
 
2039
    Condition = fun() -> ?OS_BASED_SKIP(Skippable) end,
 
2040
    ?NON_PC_TC_MAYBE_SKIP(X, Condition),
 
2041
    %% </CONDITIONAL-SKIP>
 
2042
 
 
2043
    ?P(undo_3), 
 
2044
    undo(X).
1970
2045
 
1971
2046
%% Req. Test2
1972
2047
v1_processing(suite) -> [];
4032
4107
%% Req. SNMPv2-MIB
4033
4108
snmpv2_mib_3(suite) -> [];
4034
4109
snmpv2_mib_3(Config) when list(Config) ->
 
4110
    %% <CONDITIONAL-SKIP>
 
4111
    Skippable = [{unix, [darwin]}],
 
4112
    Condition = fun() -> ?OS_BASED_SKIP(Skippable) end,
 
4113
    ?NON_PC_TC_MAYBE_SKIP(Config, Condition),
 
4114
    %% </CONDITIONAL-SKIP>
 
4115
 
4035
4116
    ?P(snmpv2_mib_3), 
4036
4117
    init_case(Config),
4037
4118
 
4177
4258
%%-----------------------------------------------------------------
4178
4259
snmp_mpd_mib_3(suite) -> [];
4179
4260
snmp_mpd_mib_3(Config) when list(Config) ->
 
4261
    %% <CONDITIONAL-SKIP>
 
4262
    Skippable = [{unix, [darwin]}],
 
4263
    Condition = fun() -> ?OS_BASED_SKIP(Skippable) end,
 
4264
    ?NON_PC_TC_MAYBE_SKIP(Config, Condition),
 
4265
    %% </CONDITIONAL-SKIP>
 
4266
 
4180
4267
    ?P(snmp_mpd_mib_3), 
4181
4268
    init_case(Config),
4182
4269
    UnknownPDUHs = try_test(snmp_mpd_mib_a),
4285
4372
    ?line unload_master("Test2"),
4286
4373
    ?line unload_master("SNMP-VIEW-BASED-ACM-MIB").
4287
4374
 
4288
 
snmp_view_based_acm_mib_2(X) -> ?P(snmp_view_based_acm_mib_2), 
4289
 
                                snmp_view_based_acm_mib(X).
4290
 
 
4291
 
snmp_view_based_acm_mib_3(X) -> ?P(snmp_view_based_acm_mib_3), 
4292
 
                                snmp_view_based_acm_mib(X).
 
4375
snmp_view_based_acm_mib_2(X) -> 
 
4376
    ?P(snmp_view_based_acm_mib_2), 
 
4377
    snmp_view_based_acm_mib(X).
 
4378
 
 
4379
snmp_view_based_acm_mib_3(X) -> 
 
4380
    %% <CONDITIONAL-SKIP>
 
4381
    Skippable = [{unix, [darwin]}],
 
4382
    Condition = fun() -> ?OS_BASED_SKIP(Skippable) end,
 
4383
    ?NON_PC_TC_MAYBE_SKIP(X, Condition),
 
4384
    %% </CONDITIONAL-SKIP>
 
4385
 
 
4386
    ?P(snmp_view_based_acm_mib_3), 
 
4387
    snmp_view_based_acm_mib(X).
4293
4388
 
4294
4389
snmp_view_based_acm_mib() ->
4295
4390
    snmpa:verbosity(net_if,trace),
4462
4557
%%-----------------------------------------------------------------
4463
4558
snmp_user_based_sm_mib_3(suite) -> [];
4464
4559
snmp_user_based_sm_mib_3(Config) when list(Config) ->
 
4560
    %% <CONDITIONAL-SKIP>
 
4561
    Skippable = [{unix, [darwin]}],
 
4562
    Condition = fun() -> ?OS_BASED_SKIP(Skippable) end,
 
4563
    ?NON_PC_TC_MAYBE_SKIP(Config, Condition),
 
4564
    %% </CONDITIONAL-SKIP>
 
4565
 
4465
4566
    ?P(snmp_user_based_sm_mib_3), 
4466
4567
    init_case(Config),
4467
4568
 
5048
5149
 
5049
5150
otp_1131_2(X) -> ?P(otp_1131_2), otp_1131(X).
5050
5151
 
5051
 
otp_1131_3(X) -> ?P(otp_1131_3), otp_1131(X).
 
5152
otp_1131_3(X) -> 
 
5153
    %% <CONDITIONAL-SKIP>
 
5154
    Skippable = [{unix, [darwin]}],
 
5155
    Condition = fun() -> ?OS_BASED_SKIP(Skippable) end,
 
5156
    ?NON_PC_TC_MAYBE_SKIP(X, Condition),
 
5157
    %% </CONDITIONAL-SKIP>
 
5158
 
 
5159
    ?P(otp_1131_3), 
 
5160
    otp_1131(X).
5052
5161
 
5053
5162
otp_1131() ->
5054
5163
    io:format("Testing bug reported in ticket OTP-1131...~n"),
5518
5627
               [otp_7157_test], 
5519
5628
               finish_otp_7157}}.
5520
5629
 
5521
 
init_otp_7157(Config) when list(Config) ->
 
5630
init_otp_7157(Config) when is_list(Config) ->
 
5631
    %% <CONDITIONAL-SKIP>
 
5632
    Skippable = [win32],
 
5633
    Condition = fun() -> ?OS_BASED_SKIP(Skippable) end,
 
5634
    ?NON_PC_TC_MAYBE_SKIP(Config, Condition),
 
5635
    %% </CONDITIONAL-SKIP>
 
5636
 
5522
5637
    ?DBG("init_otp_7157 -> entry with"
5523
5638
           "~n   Config: ~p", [Config]),
5524
5639
    ?line AgentDir = ?config(agent_dir, Config),