From 0c86f27f70a46e2c28bd70ac8d4406fb8ceaf5dd Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Mon, 6 Dec 2010 14:27:25 +0100 Subject: Added print operations for tables vacmSecurityToGroupTable and vacmViewTreeFamilyTable. There is still vacmAccessTable and vacmContextTable. --- lib/snmp/src/agent/snmp_target_mib.erl | 9 +-- lib/snmp/src/agent/snmp_view_based_acm_mib.erl | 86 ++++++++++++++++++++++++++ lib/snmp/vsn.mk | 2 +- 3 files changed, 90 insertions(+), 7 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/src/agent/snmp_target_mib.erl b/lib/snmp/src/agent/snmp_target_mib.erl index 3c32d1f59f..033dfdd92e 100644 --- a/lib/snmp/src/agent/snmp_target_mib.erl +++ b/lib/snmp/src/agent/snmp_target_mib.erl @@ -591,12 +591,9 @@ snmpTargetAddrTable(print) -> ?'snmpTargetAddrRowStatus_active' -> active; _ -> undefined end, - Prefix, - element(?snmpTargetAddrEngineId, Row), - Prefix, - element(?snmpTargetAddrTMask, Row), - Prefix, - element(?snmpTargetAddrMMS, Row)])) + Prefix, element(?snmpTargetAddrEngineId, Row), + Prefix, element(?snmpTargetAddrTMask, Row), + Prefix, element(?snmpTargetAddrMMS, Row)])) end, snmpa_mib_lib:print_table(Table, DB, FOI, PrintRow); %% Op == new | delete diff --git a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl index 657207b36e..9aff0f9810 100644 --- a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl +++ b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl @@ -348,6 +348,49 @@ vacmContextTable(Op, Arg1, Arg2) -> snmp_framework_mib:intContextTable(Op, Arg1, Arg2). +vacmSecurityToGroupTable(print) -> + Table = vacmSecurityToGroupTable, + DB = db(Table), + FOI = foi(Table), + PrintRow = + fun(Prefix, Row) -> + lists:flatten( + io_lib:format("~sSecurityModel: ~p (~w)" + "~sSecurityName: ~p" + "~sGroupName: ~p" + "~sStorageType: ~p (~w)" + "~sStatus: ~p (~w)", + [Prefix, element(?vacmSecurityModel, Row), + case element(?vacmSecurityModel, Row) of + ?SEC_ANY -> any; + ?SEC_V1 -> v1; + ?SEC_V2C -> v2c; + ?SEC_USM -> usm; + _ -> undefined + end, + Prefix, element(?vacmSecurityName, Row), + Prefix, element(?vacmGroupName, Row), + Prefix, element(?vacmSecurityToGroupStorageType, Row), + case element(?vacmSecurityToGroupStorageType, Row) of + ?'vacmSecurityToGroupStorageType_readOnly' -> readOnly; + ?'vacmSecurityToGroupStorageType_permanent' -> permanent; + ?'vacmSecurityToGroupStorageType_nonVolatile' -> nonVolatile; + ?'vacmSecurityToGroupStorageType_volatile' -> volatile; + ?'vacmSecurityToGroupStorageType_other' -> other; + _ -> undefined + end, + Prefix, element(?vacmSecurityToGroupStatus, Row), + case element(?vacmSecurityToGroupStatus, Row) of + ?'vacmSecurityToGroupStatus_destroy' -> destroy; + ?'vacmSecurityToGroupStatus_createAndWait' -> createAndWait; + ?'vacmSecurityToGroupStatus_createAndGo' -> createAndGo; + ?'vacmSecurityToGroupStatus_notReady' -> notReady; + ?'vacmSecurityToGroupStatus_notInService' -> notInService; + ?'vacmSecurityToGroupStatus_active' -> active; + _ -> undefined + end])) + end, + snmpa_mib_lib:print_table(Table, DB, FOI, PrintRow); vacmSecurityToGroupTable(Op) -> snmp_generic:table_func(Op, db(vacmSecurityToGroupTable)). @@ -719,6 +762,49 @@ vacmViewSpinLock(set, NewVal) -> {vacmViewSpinLock, volatile}). +vacmViewTreeFamilyTable(print) -> + Table = vacmViewTreeFamilyTable, + DB = db(Table), + FOI = foi(Table), + PrintRow = + fun(Prefix, Row) -> + lists:flatten( + io_lib:format("~sViewName: ~p" + "~sSubtree: ~p" + "~sMask: ~p" + "~sType: ~p (~w)" + "~sStorageType: ~p (~w)" + "~sStatus: ~p (~w)", + [Prefix, element(?vacmViewTreeFamilyViewName, Row), + Prefix, element(?vacmViewTreeFamilySubtree, Row), + Prefix, element(?vacmViewTreeFamilyMask, Row), + Prefix, element(?vacmViewTreeFamilyType, Row), + case element(?vacmViewTreeFamilyType, Row) of + ?vacmViewTreeFamilyType_included -> included; + ?vacmViewTreeFamilyType_excluded -> excluded; + _ -> undefined + end, + Prefix, element(?vacmViewTreeFamilyStorageType, Row), + case element(?vacmViewTreeFamilyStorageType, Row) of + ?vacmViewTreeFamilyStorageType_readOnly -> readOnly; + ?vacmViewTreeFamilyStorageType_permanent -> permanent; + ?vacmViewTreeFamilyStorageType_nonVolatile -> nonVolatile; + ?vacmViewTreeFamilyStorageType_volatile -> volatile; + ?vacmViewTreeFamilyStorageType_other -> other; + _ -> undefined + end, + Prefix, element(?vacmViewTreeFamilyStatus, Row), + case element(?vacmViewTreeFamilyStatus, Row) of + ?vacmViewTreeFamilyStatus_destroy -> destroy; + ?vacmViewTreeFamilyStatus_createAndWait -> createAndWait; + ?vacmViewTreeFamilyStatus_createAndGo -> createAndGo; + ?vacmViewTreeFamilyStatus_notReady -> notReady; + ?vacmViewTreeFamilyStatus_notInService -> notInService; + ?vacmViewTreeFamilyStatus_active -> active; + _ -> undefined + end])) + end, + snmpa_mib_lib:print_table(Table, DB, FOI, PrintRow); vacmViewTreeFamilyTable(Op) -> snmp_generic:table_func(Op, db(vacmViewTreeFamilyTable)). vacmViewTreeFamilyTable(get_next, RowIndex, Cols) -> diff --git a/lib/snmp/vsn.mk b/lib/snmp/vsn.mk index 1229b12ae2..ac9a192f5d 100644 --- a/lib/snmp/vsn.mk +++ b/lib/snmp/vsn.mk @@ -1,3 +1,3 @@ -SNMP_VSN = 4.18 +SNMP_VSN = 4.19 PRE_VSN = APP_VSN = "snmp-$(SNMP_VSN)$(PRE_VSN)" -- cgit v1.2.3 From fc649b12007a5d9a895c9bbcc4a3ede76085e35d Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Mon, 6 Dec 2010 16:02:57 +0100 Subject: For the table vacmAccessTable, when performing the is_set_ok and set opteration(s), all values of the vacmAccessSecurityModel column was incorrectly translated to "any". --- lib/snmp/doc/src/notes.xml | 74 ++++++++++++++++++++++---- lib/snmp/src/agent/snmp_view_based_acm_mib.erl | 12 ++--- lib/snmp/src/app/snmp.appup.src | 10 ++++ lib/snmp/vsn.mk | 21 +++++++- 4 files changed, 99 insertions(+), 18 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 493e7aa092..ae429d0751 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -32,23 +32,75 @@ notes.xml -
SNMP 4.18 +
+ SNMP Development Toolkit 4.18.1 +

Version 4.18.1 supports code replacement in runtime from/to + version 4.18, 4.17.1 and 4.17.

+ +
+ Improvements and new features +

-

+
+ +
+ Reported Fixed Bugs and Malfunctions + + +

[agent] For the table vacmAccessTable, + when performing a is_set_ok or a set opteration, + all values of the vacmAccessSecurityModel column was + incorrectly translated to any.

+ +

Own Id: OTP-8980

+
+
+
+ +
+ Incompatibilities +

-

+
+
+ + +
+ SNMP Development Toolkit 4.18 +

Version 4.18 supports code replacement in runtime from/to + version 4.17.1 and 4.17.

+ +
+ Improvements and new features + + +

Prepared for R14B release.

+
+
+
Fixed Bugs and Malfunctions - +

-

+ +
+ +
+ Incompatibilities +

-

+
-
-
+
SNMP Development Toolkit 4.17.1

Version 4.17.1 supports code replacement in runtime from/to version 4.17, 4.16.2, 4.16.1, 4.16, 4.15, 4.14 and 4.13.5.

@@ -62,8 +114,8 @@ Reported Fixed Bugs and Malfunctions -

When the function FilterMod:accept_recv/2 - returned false the SNMP agent stopped collecting messages from UDP.

+

[agent] When the function FilterMod:accept_recv/2 returned false + the SNMP agent stopped collecting messages from UDP.

Own Id: OTP-8761

diff --git a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl index 657207b36e..c0bc727c68 100644 --- a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl +++ b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl @@ -402,13 +402,13 @@ verify_vacmSecurityToGroupTable_cols([{Col, Val0}|Cols], Acc) -> verify_vacmSecurityToGroupTable_col(?vacmSecurityModel, Model) -> case Model of any -> ?SEC_ANY; - v1 -> ?SEC_ANY; - v2c -> ?SEC_ANY; - usm -> ?SEC_ANY; + v1 -> ?SEC_V1; + v2c -> ?SEC_V2C; + usm -> ?SEC_USM; ?SEC_ANY -> ?SEC_ANY; - ?SEC_V1 -> ?SEC_ANY; - ?SEC_V2C -> ?SEC_ANY; - ?SEC_USM -> ?SEC_ANY; + ?SEC_V1 -> ?SEC_V1; + ?SEC_V2C -> ?SEC_V2C; + ?SEC_USM -> ?SEC_USM; _ -> ?vlog("verification of vacmSecurityModel(~w) ~p failed", [?vacmSecurityModel, Model]), diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src index 2375e3df70..03a0044908 100644 --- a/lib/snmp/src/app/snmp.appup.src +++ b/lib/snmp/src/app/snmp.appup.src @@ -22,6 +22,11 @@ %% ----- U p g r a d e ------------------------------------------------------- [ + {"4.18", + [ + {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []} + ] + }, {"4.17.1", [ {load_module, snmp_community_mib, soft_purge, soft_purge, []}, @@ -66,6 +71,11 @@ %% ------D o w n g r a d e --------------------------------------------------- [ + {"4.18", + [ + {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []} + ] + }, {"4.17.1", [ {load_module, snmp_community_mib, soft_purge, soft_purge, []}, diff --git a/lib/snmp/vsn.mk b/lib/snmp/vsn.mk index 1229b12ae2..67cc05687d 100644 --- a/lib/snmp/vsn.mk +++ b/lib/snmp/vsn.mk @@ -1,3 +1,22 @@ -SNMP_VSN = 4.18 +#-*-makefile-*- ; force emacs to enter makefile-mode + +# %CopyrightBegin% +# +# Copyright Ericsson AB 1997-2010. All Rights Reserved. +# +# The contents of this file are subject to the Erlang Public License, +# Version 1.1, (the "License"); you may not use this file except in +# compliance with the License. You should have received a copy of the +# Erlang Public License along with this software. If not, it can be +# retrieved online at http://www.erlang.org/. +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +# the License for the specific language governing rights and limitations +# under the License. +# +# %CopyrightEnd% + +SNMP_VSN = 4.18.1 PRE_VSN = APP_VSN = "snmp-$(SNMP_VSN)$(PRE_VSN)" -- cgit v1.2.3 From 5d01e37654bda53b0c81a654936abbaeb0e2f7d9 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Mon, 6 Dec 2010 16:07:00 +0100 Subject: For the table vacmAccessTable, when performing the is_set_ok and set opteration(s), all values of the vacmAccessSecurityModel column was incorrectly translated to "any". --- lib/snmp/doc/src/notes.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index ae429d0751..f3bb9d25ea 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -47,8 +47,8 @@

[agent] For the table vacmAccessTable, - when performing a is_set_ok or a set opteration, - all values of the vacmAccessSecurityModel column was + when performing the is_set_ok and set opteration(s), + all values of the vacmAccessSecurityModel column was incorrectly translated to any.

+ +
SNMP 4.18
Fixed Bugs and Malfunctions -

- When the function FilterMod:accept_recv/2 returned false - the SNMP agent stopped collecting messages from UDP.

-

- Own Id: OTP-8761

+

Prepared for R14B.

-
+
-
+
SNMP Development Toolkit 4.17.1

Version 4.17.1 supports code replacement in runtime from/to version 4.17, 4.16.2, 4.16.1, 4.16, 4.15, 4.14 and 4.13.5.

diff --git a/lib/snmp/doc/src/snmp_view_based_acm_mib.xml b/lib/snmp/doc/src/snmp_view_based_acm_mib.xml index ffea256608..d595f6b93b 100644 --- a/lib/snmp/doc/src/snmp_view_based_acm_mib.xml +++ b/lib/snmp/doc/src/snmp_view_based_acm_mib.xml @@ -4,7 +4,7 @@
- 19992009 + 19992010 Ericsson AB. All Rights Reserved. @@ -38,7 +38,10 @@ SNMP-VIEW-BASED-ACM-MIB, and functions for configuring the database.

The configuration files are described in the SNMP User's Manual.

+ + + configure(ConfDir) -> void() @@ -48,27 +51,24 @@

This function is called from the supervisor at system - start-up. -

+ start-up.

Inserts all data in the configuration files into the - database and destroys all old rows with StorageType - volatile. The rows created from the configuration file - will have StorageType nonVolatile. -

-

All snmp counters are set to zero. -

+ database and destroys all old rows with StorageType + volatile. The rows created from the configuration file + will have StorageType nonVolatile.

+

All snmp counters are set to zero.

If an error is found in the configuration file, it is - reported using the function config_err/2 of the error - report module, and the function fails with the reason - configuration_error. -

+ reported using the function config_err/2 of the error + report module, and the function fails with the reason + configuration_error.

ConfDir is a string which points to the directory - where the configuration files are found. -

-

The configuration file read is: vacm.conf. -

+ where the configuration files are found.

+

The configuration file read is: vacm.conf.

+ +
+ reconfigure(ConfDir) -> void() Configure the SNMP-VIEW-BASED-ACM-MIB @@ -88,18 +88,20 @@

All snmp counters are set to zero.

If an error is found in the configuration file, it is - reported using the function config_err/2 of the error - report module, and the function fails with the reason + reported using the function + config_err/2 + of the error report module, and the function fails with the reason configuration_error.

ConfDir is a string which points to the directory where the configuration files are found.

-

The configuration file read is: vacm.conf. - -

+

The configuration file read is: vacm.conf.

+ +
+ add_sec2group(SecModel, SecName, GroupName) -> Ret Add one security to group definition @@ -113,10 +115,13 @@

Adds a security to group definition to the agent config. - Equivalent to one vacmSecurityToGroup-line in the vacm.conf file.

+ Equivalent to one vacmSecurityToGroup-line in the + vacm.conf file.

+
+ delete_sec2group(Key) -> Ret Delete one security to group definition @@ -127,9 +132,11 @@

Delete a security to group definition from the agent config.

+
+ add_access(GroupName, Prefix, SecModel, SecLevel, Match, RV, WV, NV) -> Ret Add one access definition @@ -148,10 +155,12 @@

Adds a access definition to the agent config. - Equivalent to one vacmAccess-line in the vacm.conf file.

- + Equivalent to one vacmAccess-line in the vacm.conf file.

+ +
+ delete_access(Key) -> Ret Delete one access definition @@ -161,10 +170,12 @@ Reason = term() -

Delete a access definition from the agent config.

- +

Delete a access definition from the agent config.

+ +
+ add_view_tree_fam(ViewIndex, SubTree, Status, Mask) -> Ret Add one view tree family definition @@ -178,11 +189,14 @@ Reason = term() -

Adds a view tree family definition to the agent config. - Equivalent to one vacmViewTreeFamily-line in the vacm.conf file.

- +

Adds a view tree family definition to the agent config. + Equivalent to one vacmViewTreeFamily-line in the + vacm.conf file.

+ +
+ delete_view_tree_fam(Key) -> Ret Delete one view tree family definition diff --git a/lib/snmp/doc/src/snmpa_error.xml b/lib/snmp/doc/src/snmpa_error.xml index a7312e8b24..4dbafdfbb7 100644 --- a/lib/snmp/doc/src/snmpa_error.xml +++ b/lib/snmp/doc/src/snmpa_error.xml @@ -4,7 +4,7 @@
- 20022009 + 20022010 Ericsson AB. All Rights Reserved. @@ -51,6 +51,8 @@ error_report_mod, see configuration parameters.

+ + @@ -67,8 +69,11 @@

Format and Args are as in io:format(Format, Args).

+ +
+ user_err(Format, Args) -> void() Called if a user related error occurs diff --git a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl index 657207b36e..5e188c74c5 100644 --- a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl +++ b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl @@ -181,6 +181,8 @@ init_tabs(Sec2Group, Access, View) -> snmpa_local_db:table_delete(db(vacmSecurityToGroupTable)), snmpa_local_db:table_create(db(vacmSecurityToGroupTable)), init_sec2group_table(Sec2Group), + ?vdebug("create vacm access table",[]), + snmpa_vacm:cleanup(), init_access_table(Access), ?vdebug("create vacm view-tree-family table",[]), snmpa_local_db:table_delete(db(vacmViewTreeFamilyTable)), diff --git a/lib/snmp/src/agent/snmpa_vacm.erl b/lib/snmp/src/agent/snmpa_vacm.erl index 2eacea4301..91cecfcd1e 100644 --- a/lib/snmp/src/agent/snmpa_vacm.erl +++ b/lib/snmp/src/agent/snmpa_vacm.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -21,7 +21,7 @@ -export([get_mib_view/5]). -export([init/1, init/2, backup/1]). -export([delete/1, get_row/1, get_next_row/1, insert/1, insert/2, - dump_table/0]). + cleanup/0, dump_table/0]). -include("SNMPv2-TC.hrl"). -include("SNMP-VIEW-BASED-ACM-MIB.hrl"). @@ -256,6 +256,10 @@ delete(Key) -> ets:delete(snmpa_vacm, Key), dump_table(). + +cleanup() -> + ets:delete_all_objects(snmpa_vacm). + dump_table(true) -> dump_table(); dump_table(_) -> diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src index 2375e3df70..fafbf79bb7 100644 --- a/lib/snmp/src/app/snmp.appup.src +++ b/lib/snmp/src/app/snmp.appup.src @@ -22,6 +22,12 @@ %% ----- U p g r a d e ------------------------------------------------------- [ + {"4.18", + [ + {load_module, snmpa_vacm, soft_purge, soft_purge, []}, + {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, [snmpa_vacm]} + ] + }, {"4.17.1", [ {load_module, snmp_community_mib, soft_purge, soft_purge, []}, @@ -66,6 +72,12 @@ %% ------D o w n g r a d e --------------------------------------------------- [ + {"4.18", + [ + {load_module, snmpa_vacm, soft_purge, soft_purge, []}, + {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, [snmpa_vacm]} + ] + }, {"4.17.1", [ {load_module, snmp_community_mib, soft_purge, soft_purge, []}, diff --git a/lib/snmp/vsn.mk b/lib/snmp/vsn.mk index 1229b12ae2..67cc05687d 100644 --- a/lib/snmp/vsn.mk +++ b/lib/snmp/vsn.mk @@ -1,3 +1,22 @@ -SNMP_VSN = 4.18 +#-*-makefile-*- ; force emacs to enter makefile-mode + +# %CopyrightBegin% +# +# Copyright Ericsson AB 1997-2010. All Rights Reserved. +# +# The contents of this file are subject to the Erlang Public License, +# Version 1.1, (the "License"); you may not use this file except in +# compliance with the License. You should have received a copy of the +# Erlang Public License along with this software. If not, it can be +# retrieved online at http://www.erlang.org/. +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +# the License for the specific language governing rights and limitations +# under the License. +# +# %CopyrightEnd% + +SNMP_VSN = 4.18.1 PRE_VSN = APP_VSN = "snmp-$(SNMP_VSN)$(PRE_VSN)" -- cgit v1.2.3 From e67b8b37c5aabe83f8872fcf71e865591af5552b Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 8 Dec 2010 16:05:42 +0100 Subject: Added preliminary veariable support. --- lib/snmp/src/agent/snmp_view_based_acm_mib.erl | 6 ++ lib/snmp/src/agent/snmpa.erl | 103 ++++++++++++++++++++----- 2 files changed, 89 insertions(+), 20 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl index f91262ab57..f98b799631 100644 --- a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl +++ b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl @@ -781,6 +781,12 @@ split_cols([Col | Cols], PreCols) when Col =< 3 -> split_cols(Cols, PreCols) -> {PreCols, Cols}. +vacmViewSpinLock(print) -> + case vacmViewSpinLock(get) of + {value, Val} -> io:format("vacmViewSpinLock => ~p~n", [Val]); + Error -> io:format("vacmViewSpinLock => ERROR: ~p~n", [Error]) + end; + vacmViewSpinLock(new) -> snmp_generic:variable_func(new, {vacmViewSpinLock, volatile}), {A1,A2,A3} = erlang:now(), diff --git a/lib/snmp/src/agent/snmpa.erl b/lib/snmp/src/agent/snmpa.erl index f109741759..88417b19fe 100644 --- a/lib/snmp/src/agent/snmpa.erl +++ b/lib/snmp/src/agent/snmpa.erl @@ -105,7 +105,7 @@ set_request_limit/1, set_request_limit/2 ]). --export([print_tables/0, print_tables/1]). +-export([print_mib_info/0, print_mib_tables/0, print_mib_variables/0]). -include("snmpa_atl.hrl"). @@ -285,31 +285,94 @@ whereis_mib(Agent, Mib) when is_atom(Mib) -> %% - -print_tables() -> - Tables = [ - {snmp_view_based_acm_mib, [vacmAccessTable, - vacmSecurityToGroupTable, - vacmViewTreeFamilyTable]}, - {snmp_target_mib, [snmpTargetAddrTable, snmpTargetParamsTable]}, - {snmp_community_mib, [snmpCommunityTable]}, - {snmp_notification_mib, [snmpNotifyTable]}, - {snmp_user_based_sm_mib, [usmUserTable]} - ], - print_tables(Tables). - -print_tables([]) -> - ok; -print_tables([{Mod, Tables}|MibTables]) when is_atom(Mod) andalso is_list(Tables) -> +mibs_info() -> + [ + {snmp_view_based_acm_mib, + [ + vacmAccessTable, + vacmSecurityToGroupTable, + vacmViewTreeFamilyTable + ], + [ + vacmViewSpinLock + ]}, + {snmp_target_mib, + [ + snmpTargetAddrTable, + snmpTargetParamsTable + ], + [ + snmpTargetSpinLock + ]}, + {snmp_community_mib, + [ + snmpCommunityTable + ], + []}, + {snmp_notification_mib, + [ + snmpNotifyTable + ], + []}, + {snmp_user_based_sm_mib, + [ + usmUserTable + ], + [ + usmUserSpinLock + ]}]. + +print_mib_info() -> + MibsInfo = mibs_info(), + print_mib_info(MibsInfo). + +print_mib_info([{Mod, Tables, Variables} | MibsInfo]) -> + io:format("~n** ~s ** ~n~n", [make_pretty_mib(Mod)]), + print_variables(Mod, Variables), print_tables(Mod, Tables), - print_tables(MibTables); -print_tables([_|MibTables]) -> - print_tables(MibTables). + print_mib_info(MibsInfo). -print_tables(Mod, Tables) -> + +print_mib_tables() -> + Tables = [{Mod, Tabs} || {Mod, Tabs, _Vars} <- mibs_info()], + print_mib_tables(Tables). + +print_mib_tables([]) -> + ok; +print_mib_tables([{Mod, Tabs}|MibTabs]) when is_atom(Mod) andalso is_list(Tabs) -> + print_mib_tables(Mod, Tabs), + print_mib_tables(MibTabs); +print_mib_tables([_|MibTabs]) -> + print_mib_tables(MibTabs). + +print_mib_tables(Mod, Tables) -> io:format("~n** ~s ** ~n~n", [make_pretty_mib(Mod)]), + print_tables(Mod, Tables). + +print_tables(Mod, Tables) -> [(catch Mod:Table(print)) || Table <- Tables]. +print_mib_variables() -> + Variables = [{Mod, Vars} || {Mod, _Tabs, Vars} <- mibs_info()], + print_mib_variables(Variables). + +print_mib_variables([]) -> + ok; +print_mib_variables([{Mod, Vars}|MibVars]) when is_atom(Mod) andalso is_list(Vars) -> + print_mib_variables(Mod, Vars), + print_mib_variables(MibVars); +print_mib_variables([_|MibVars]) -> + print_mib_variables(MibVars). + +print_mib_variables(Mod, Vars) -> + io:format("~n** ~s ** ~n~n", [make_pretty_mib(Mod)]), + print_variables(Mod, Vars). + +print_variables(Mod, Variables) -> + [(catch Mod:Variable(print)) || Variable <- Variables]. + + make_pretty_mib(snmp_view_based_acm_mib) -> "SNMP-VIEW-BASED-ACM-MIB"; make_pretty_mib(snmp_target_mib) -> -- cgit v1.2.3 From 9a5ba00578bd2b2d04d8814f8a228ff7bed1c18f Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 8 Dec 2010 18:42:41 +0100 Subject: Added utility variable print function, and utilized it in view-mib. --- lib/snmp/src/agent/snmp_view_based_acm_mib.erl | 20 ++++++------ lib/snmp/src/agent/snmpa.erl | 18 ++++++----- lib/snmp/src/agent/snmpa_mib_lib.erl | 44 +++++++++++++++++++++++++- 3 files changed, 63 insertions(+), 19 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl index f98b799631..659babaf94 100644 --- a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl +++ b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl @@ -782,32 +782,30 @@ split_cols(Cols, PreCols) -> {PreCols, Cols}. vacmViewSpinLock(print) -> - case vacmViewSpinLock(get) of - {value, Val} -> io:format("vacmViewSpinLock => ~p~n", [Val]); - Error -> io:format("vacmViewSpinLock => ERROR: ~p~n", [Error]) - end; + VarAndValue = [{vacmViewSpinLock, vacmViewSpinLock(get)}], + snmpa_mib_lib:print_variables(VarAndValue); vacmViewSpinLock(new) -> - snmp_generic:variable_func(new, {vacmViewSpinLock, volatile}), + snmp_generic:variable_func(new, volatile_db(vacmViewSpinLock)), {A1,A2,A3} = erlang:now(), random:seed(A1,A2,A3), Val = random:uniform(2147483648) - 1, - snmp_generic:variable_func(set, Val, {vacmViewSpinLock, volatile}); + snmp_generic:variable_func(set, Val, volatile_db(vacmViewSpinLock)); vacmViewSpinLock(delete) -> ok; vacmViewSpinLock(get) -> - snmp_generic:variable_func(get, {vacmViewSpinLock, volatile}). + snmp_generic:variable_func(get, volatile_db(vacmViewSpinLock)). vacmViewSpinLock(is_set_ok, NewVal) -> - case snmp_generic:variable_func(get, {vacmViewSpinLock, volatile}) of + case snmp_generic:variable_func(get, volatile_db(vacmViewSpinLock)) of {value, NewVal} -> noError; _ -> inconsistentValue end; vacmViewSpinLock(set, NewVal) -> snmp_generic:variable_func(set, (NewVal + 1) rem 2147483648, - {vacmViewSpinLock, volatile}). + volatile_db(vacmViewSpinLock)). vacmViewTreeFamilyTable(print) -> @@ -942,7 +940,9 @@ do_get_vacmAccessTable(Key0, Acc) -> -db(X) -> snmpa_agent:db(X). +db(X) -> snmpa_agent:db(X). +volatile_db(X) -> {X, volatile}. + fa(vacmSecurityToGroupTable) -> ?vacmGroupName; fa(vacmViewTreeFamilyTable) -> ?vacmViewTreeFamilyMask. diff --git a/lib/snmp/src/agent/snmpa.erl b/lib/snmp/src/agent/snmpa.erl index 88417b19fe..8ad2a83de4 100644 --- a/lib/snmp/src/agent/snmpa.erl +++ b/lib/snmp/src/agent/snmpa.erl @@ -328,8 +328,8 @@ print_mib_info() -> print_mib_info([{Mod, Tables, Variables} | MibsInfo]) -> io:format("~n** ~s ** ~n~n", [make_pretty_mib(Mod)]), - print_variables(Mod, Variables), - print_tables(Mod, Tables), + print_mib_variables2(Mod, Variables), + print_mib_tables2(Mod, Tables), print_mib_info(MibsInfo). @@ -339,7 +339,8 @@ print_mib_tables() -> print_mib_tables([]) -> ok; -print_mib_tables([{Mod, Tabs}|MibTabs]) when is_atom(Mod) andalso is_list(Tabs) -> +print_mib_tables([{Mod, Tabs}|MibTabs]) + when is_atom(Mod) andalso is_list(Tabs) -> print_mib_tables(Mod, Tabs), print_mib_tables(MibTabs); print_mib_tables([_|MibTabs]) -> @@ -347,9 +348,9 @@ print_mib_tables([_|MibTabs]) -> print_mib_tables(Mod, Tables) -> io:format("~n** ~s ** ~n~n", [make_pretty_mib(Mod)]), - print_tables(Mod, Tables). + print_mib_tables2(Mod, Tables). -print_tables(Mod, Tables) -> +print_mib_tables2(Mod, Tables) -> [(catch Mod:Table(print)) || Table <- Tables]. @@ -359,7 +360,8 @@ print_mib_variables() -> print_mib_variables([]) -> ok; -print_mib_variables([{Mod, Vars}|MibVars]) when is_atom(Mod) andalso is_list(Vars) -> +print_mib_variables([{Mod, Vars}|MibVars]) + when is_atom(Mod) andalso is_list(Vars) -> print_mib_variables(Mod, Vars), print_mib_variables(MibVars); print_mib_variables([_|MibVars]) -> @@ -367,9 +369,9 @@ print_mib_variables([_|MibVars]) -> print_mib_variables(Mod, Vars) -> io:format("~n** ~s ** ~n~n", [make_pretty_mib(Mod)]), - print_variables(Mod, Vars). + print_mib_variables2(Mod, Vars). -print_variables(Mod, Variables) -> +print_mib_variables2(Mod, Variables) -> [(catch Mod:Variable(print)) || Variable <- Variables]. diff --git a/lib/snmp/src/agent/snmpa_mib_lib.erl b/lib/snmp/src/agent/snmpa_mib_lib.erl index 441228b9ee..22057b4547 100644 --- a/lib/snmp/src/agent/snmpa_mib_lib.erl +++ b/lib/snmp/src/agent/snmpa_mib_lib.erl @@ -19,7 +19,8 @@ -module(snmpa_mib_lib). -export([table_cre_row/3, table_del_row/2]). --export([get_table/2, print_table/3, print_table/4, print_tables/1]). +-export([get_table/2]). +-export([print_variables/1, print_table/3, print_table/4, print_tables/1]). -export([gc_tab/3, gc_tab/5]). -include("SNMPv2-TC.hrl"). @@ -81,6 +82,47 @@ get_table(NameDb, FOI, Oid, Acc) -> end. +print_variables(Variables) when is_list(Variables) -> + Variables2 = print_variables_prefixify(Variables), + lists:foreach(fun({Variable, ValueResult, Prefix}) -> + print_variable(Variable, ValueResult, Prefix) + end, Variables2), + ok. + +print_variable(Variable, {value, Val}, Prefix) when is_atom(Variable) -> + io:format("~w~s => ~p~n", [Variable, Prefix, Val]); +print_variable(Variable, Error, Prefix) when is_atom(Variable) -> + io:format("~w~s => ERROR: ~p~n", [Variable, Prefix, Error]). + +print_variables_prefixify(Variables) -> + MaxVarLength = print_variables_maxlength(Variables), + print_variables_prefixify(Variables, MaxVarLength, []). + +print_variables_prefixify([], _MaxVarLength, Acc) -> + lists:reverse(Acc); +print_variables_prefixify([{Var, Res}|Variables], MaxVarLength, Acc) -> + Prefix = make_variable_print_prefix(Var, MaxVarLength), + print_variables_prefixify(Variables, MaxVarLength, + [{Var, Res, Prefix}|Acc]). + +make_variable_print_prefix(Var, MaxVarLength) -> + lists:duplicate(MaxVarLength - length(atom_to_list(Var)) + 1, $ ). + +print_variables_maxlength(Variables) -> + print_variables_maxlength(Variables, 0). + +print_variables_maxlength([], MaxLength) -> + MaxLength; +print_variables_maxlength([{Var, _}|Variables], MaxLength) when is_atom(Var) -> + VarLen = length(atom_to_list(Var)), + if + VarLen > MaxLength -> + print_variables_maxlength(Variables, VarLen); + true -> + print_variables_maxlength(Variables, MaxLength) + end. + + print_tables(Tables) when is_list(Tables) -> lists:foreach(fun({Table, DB, FOI, PrintRow}) -> print_table(Table, DB, FOI, PrintRow) -- cgit v1.2.3 From 9a80a4f0064af1773bf73df86d3534049a61e373 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 9 Dec 2010 12:19:36 +0100 Subject: First preliminary addition of the test config (there are still a bunch of hard coded paths and stuff). No sed'ing yet... --- lib/snmp/test/test_config/Makefile | 130 +++++++++++++++++++++ lib/snmp/test/test_config/agent/agent.conf.src | 20 ++++ lib/snmp/test/test_config/agent/community.conf.src | 16 +++ lib/snmp/test/test_config/agent/context.conf.src | 15 +++ lib/snmp/test/test_config/agent/notify.conf.src | 14 +++ lib/snmp/test/test_config/agent/standard.conf.src | 22 ++++ .../test/test_config/agent/target_addr.conf.src | 22 ++++ .../test/test_config/agent/target_params.conf.src | 12 ++ lib/snmp/test/test_config/agent/vacm.conf.src | 28 +++++ lib/snmp/test/test_config/manager/manager.conf.src | 16 +++ lib/snmp/test/test_config/manager/usm.conf.src | 8 ++ lib/snmp/test/test_config/modules.mk | 37 ++++++ lib/snmp/test/test_config/sys-agent.config.src | 42 +++++++ lib/snmp/test/test_config/sys-manager.config.src | 55 +++++++++ lib/snmp/test/test_config/sys.config.src | 67 +++++++++++ 15 files changed, 504 insertions(+) create mode 100644 lib/snmp/test/test_config/Makefile create mode 100644 lib/snmp/test/test_config/agent/agent.conf.src create mode 100644 lib/snmp/test/test_config/agent/community.conf.src create mode 100644 lib/snmp/test/test_config/agent/context.conf.src create mode 100644 lib/snmp/test/test_config/agent/notify.conf.src create mode 100644 lib/snmp/test/test_config/agent/standard.conf.src create mode 100644 lib/snmp/test/test_config/agent/target_addr.conf.src create mode 100644 lib/snmp/test/test_config/agent/target_params.conf.src create mode 100644 lib/snmp/test/test_config/agent/vacm.conf.src create mode 100644 lib/snmp/test/test_config/manager/manager.conf.src create mode 100644 lib/snmp/test/test_config/manager/usm.conf.src create mode 100644 lib/snmp/test/test_config/modules.mk create mode 100644 lib/snmp/test/test_config/sys-agent.config.src create mode 100644 lib/snmp/test/test_config/sys-manager.config.src create mode 100644 lib/snmp/test/test_config/sys.config.src (limited to 'lib/snmp') diff --git a/lib/snmp/test/test_config/Makefile b/lib/snmp/test/test_config/Makefile new file mode 100644 index 0000000000..187a0ca901 --- /dev/null +++ b/lib/snmp/test/test_config/Makefile @@ -0,0 +1,130 @@ +#-*-makefile-*- ; force emacs to enter makefile-mode + +# %CopyrightBegin% +# +# Copyright Ericsson AB 1997-2009. All Rights Reserved. +# +# The contents of this file are subject to the Erlang Public License, +# Version 1.1, (the "License"); you may not use this file except in +# compliance with the License. You should have received a copy of the +# Erlang Public License along with this software. If not, it can be +# retrieved online at http://www.erlang.org/. +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +# the License for the specific language governing rights and limitations +# under the License. +# +# %CopyrightEnd% + +include $(ERL_TOP)/make/target.mk +include $(ERL_TOP)/make/$(TARGET)/otp.mk + + +# ---------------------------------------------------- +# Application version +# ---------------------------------------------------- +include ../../vsn.mk + +VSN = $(SNMP_VSN) + + +# ---------------------------------------------------- +# Target Specs +# ---------------------------------------------------- + +include modules.mk + +SYS_CONFIG_SRCS = $(SYS_CONFIG_FILES:%=%.src) +AGENT_CONFIG_SRCS = $(AGENT_CONFIG_FILES:%=%.src) +MANAGER_CONFIG_SRCS = $(MANAGER_CONFIG_FILES:%=%.src) + + +# ---------------------------------------------------- +# Release directory specification +# ---------------------------------------------------- +RELSYSDIR = $(RELEASE_PATH) + + +# ---------------------------------------------------- +# SNMP FLAGS +# ---------------------------------------------------- + + +# ---------------------------------------------------- +# FLAGS +# ---------------------------------------------------- + + +# ---------------------------------------------------- +# Targets +# ---------------------------------------------------- + +tests debug opt: $(SYS_CONFIG_FILES) $(AGENT_CONFIG_FILES) $(MANAGER_CONFIG_FILES) + +clean: + rm -f $(SYS_CONFIG_FILES) + rm -f $(AGENT_CONFIG_FILES) + rm -f $(MANAGER_CONFIG_FILES) + rm -f core + +docs: + + +# ---------------------------------------------------- +# Release Target +# ---------------------------------------------------- +include $(ERL_TOP)/make/otp_release_targets.mk + +release_spec: + +release_tests_spec: opt + $(INSTALL_DIR) $(RELSYSDIR) + chmod -f -R u+w $(RELSYSDIR) + $(INSTALL_DIR) $(RELSYSDIR)/agent + chmod -f -R u+w $(RELSYSDIR)/agent + $(INSTALL_DIR) $(RELSYSDIR)/agent/conf + chmod -f -R u+w $(RELSYSDIR)/agent/conf + $(INSTALL_DIR) $(RELSYSDIR)/agent/db + chmod -f -R u+w $(RELSYSDIR)/agent/db + $(INSTALL_DIR) $(RELSYSDIR)/agent/log + chmod -f -R u+w $(RELSYSDIR)/agent/log + $(INSTALL_DIR) $(RELSYSDIR)/manager + chmod -f -R u+w $(RELSYSDIR)/manager + $(INSTALL_DIR) $(RELSYSDIR)/manager/conf + chmod -f -R u+w $(RELSYSDIR)/manager/conf + $(INSTALL_DIR) $(RELSYSDIR)/manager/db + chmod -f -R u+w $(RELSYSDIR)/manager/db + $(INSTALL_DIR) $(RELSYSDIR)/manager/log + chmod -f -R u+w $(RELSYSDIR)/manager/log + $(INSTALL_DATA) $(SYS_CONFIG_FILES) $(RELSYSDIR) + $(INSTALL_DATA) $(AGENT_CONFIG_FILES) $(RELSYSDIR)/agent/conf + $(INSTALL_DATA) $(MANAGER_CONFIG_FILES) $(RELSYSDIR)/manager/conf + +release_docs_spec: + + +info: + @echo "SNMP_DEBUG = $(SNMP_DEBUG)" + @echo "SNMP_FLAGS = $(SNMP_FLAGS)" + @echo "" + @echo "SNMP_MIB_DIR = $(SNMP_MIB_DIR)" + @echo "MIB_SOURCE = $(MIB_SOURCE)" + @echo "MIB_TARGETS = $(MIB_TARGETS)" + @echo "SNMP_MIB_FLAGS = $(SNMP_MIB_FLAGS)" + @echo "" + @echo "ERL_COMPILE_FLAGS = $(ERL_COMPILE_FLAGS)" + @echo "" + @echo "RELSYSDIR = $(RELSYSDIR)" + @echo "" + @echo "SOURCE = $(SOURCE)" + @echo "" + @echo "TARGET_FILES = $(TARGET_FILES)" + @echo "" + @echo "EMAKEFILE = $(EMAKEFILE)" + @echo "MAKE_EMAKE = $(MAKE_EMAKE)" + @echo "BUILDTARGET = $(BUILDTARGET)" + @echo "RELTEST_FILES = $(RELTEST_FILES)" + @echo "" + + diff --git a/lib/snmp/test/test_config/agent/agent.conf.src b/lib/snmp/test/test_config/agent/agent.conf.src new file mode 100644 index 0000000000..53830dbc3e --- /dev/null +++ b/lib/snmp/test/test_config/agent/agent.conf.src @@ -0,0 +1,20 @@ +%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48 +%% This file defines the Agent local configuration info +%% The data is inserted into the snmpEngine* variables defined +%% in SNMP-FRAMEWORK-MIB, and the intAgent* variables defined +%% in OTP-SNMPEA-MIB. +%% Each row is a 2-tuple: +%% {AgentVariable, Value}. +%% For example +%% {intAgentUDPPort, 4000}. +%% The ip address for the agent is sent as id in traps. +%% {intAgentIpAddress, [127,42,17,5]}. +%% {snmpEngineID, "agentEngine"}. +%% {snmpEngineMaxMessageSize, 484}. +%% + + +{intAgentUDPPort, 4000}. +{intAgentIpAddress, [127,0,0,1]}. +{snmpEngineID, "foo"}. +{snmpEngineMaxMessageSize, 484}. diff --git a/lib/snmp/test/test_config/agent/community.conf.src b/lib/snmp/test/test_config/agent/community.conf.src new file mode 100644 index 0000000000..4661267950 --- /dev/null +++ b/lib/snmp/test/test_config/agent/community.conf.src @@ -0,0 +1,16 @@ +%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48 +%% This file defines the community info which maps to VACM parameters. +%% The data is inserted into the snmpCommunityTable defined +%% in SNMP-COMMUNITY-MIB. +%% Each row is a 5-tuple: +%% {CommunityIndex, CommunityName, SecurityName, ContextName, TransportTag}. +%% For example +%% {"1", "public", "initial", "", ""}. +%% {"2", "secret", "secret_name", "", "tag"}. +%% {"3", "bridge1", "initial", "bridge1", ""}. +%% + + +{"public", "public", "initial", "", ""}. +{"all-rights", "all-rights", "all-rights", "", ""}. +{"standard trap", "standard trap", "initial", "", ""}. diff --git a/lib/snmp/test/test_config/agent/context.conf.src b/lib/snmp/test/test_config/agent/context.conf.src new file mode 100644 index 0000000000..56000d0308 --- /dev/null +++ b/lib/snmp/test/test_config/agent/context.conf.src @@ -0,0 +1,15 @@ +%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48 +%% This file defines the contexts known to the agent. +%% The data is inserted into the vacmContextTable defined +%% in SNMP-VIEW-BASED-ACM-MIB. +%% Each row is a string: +%% ContextName. +%% +%% The empty string is the default context. +%% For example +%% "bridge1". +%% "bridge2". +%% + + +"". diff --git a/lib/snmp/test/test_config/agent/notify.conf.src b/lib/snmp/test/test_config/agent/notify.conf.src new file mode 100644 index 0000000000..b63668f4fd --- /dev/null +++ b/lib/snmp/test/test_config/agent/notify.conf.src @@ -0,0 +1,14 @@ +%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48 +%% This file defines the notification parameters. +%% The data is inserted into the snmpNotifyTable defined +%% in SNMP-NOTIFICATION-MIB. +%% The Name is used as CommunityString for v1 and v2c. +%% Each row is a 3-tuple: +%% {Name, Tag, Type}. +%% For example +%% {"standard trap", "std_trap", trap}. +%% {"standard inform", "std_inform", inform}. +%% + + +{"stadard_trap", "std_trap", trap}. diff --git a/lib/snmp/test/test_config/agent/standard.conf.src b/lib/snmp/test/test_config/agent/standard.conf.src new file mode 100644 index 0000000000..9bcca18b5e --- /dev/null +++ b/lib/snmp/test/test_config/agent/standard.conf.src @@ -0,0 +1,22 @@ +%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48 +%% This file defines the STANDARD-MIB info. +%% Each row is a 2-tuple: +%% {StandardVariable, Value}. +%% For example +%% {sysDescr, "Erlang SNMP agent"}. +%% {sysObjectID, [1,2,3]}. +%% {sysContact, "{mbj,eklas}@erlang.ericsson.se"}. +%% {sysName, "test"}. +%% {sysLocation, "erlang"}. +%% {sysServices, 72}. +%% {snmpEnableAuthenTraps, enabled}. +%% + + +{sysDescr, "Erlang SNMP agent"}. +{sysObjectID, [1,2,3]}. +{sysContact, "{mbj,eklas}@erlang.ericsson.se"}. +{sysLocation, "erlang"}. +{sysServices, 72}. +{snmpEnableAuthenTraps, disabled}. +{sysName, "foo"}. diff --git a/lib/snmp/test/test_config/agent/target_addr.conf.src b/lib/snmp/test/test_config/agent/target_addr.conf.src new file mode 100644 index 0000000000..2c7a6a15ad --- /dev/null +++ b/lib/snmp/test/test_config/agent/target_addr.conf.src @@ -0,0 +1,22 @@ +%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48 +%% This file defines the target address parameters. +%% The data is inserted into the snmpTargetAddrTable defined +%% in SNMP-TARGET-MIB, and in the snmpTargetAddrExtTable defined +%% in SNMP-COMMUNITY-MIB. +%% Each row is a 10-tuple: +%% {Name, Ip, Udp, Timeout, RetryCount, TagList, ParamsName, EngineId, +%% TMask, MaxMessageSize}. +%% The EngineId value is only used if Inform-Requests are sent to this +%% target. If Informs are not sent, this value is ignored, and can be +%% e.g. an empty string. However, if Informs are sent, it is essential +%% that the value of EngineId matches the value of the target's +%% actual snmpEngineID. +%% For example +%% {"1.2.3.4 v1", [1,2,3,4], 162, +%% 1500, 3, "std_inform", "otp_v2", "", +%% [127,0,0,0], 2048}. +%% + + +{"127.0.0.1 v2", [127,0,0,1], 5000, 1500, 3, "std_trap", "target_v2", "", [], 2048}. +{"127.0.0.1 v2.2", [127,0,0,1], 5000, 1500, 3, "std_inform", "target_v2", "", [], 2048}. diff --git a/lib/snmp/test/test_config/agent/target_params.conf.src b/lib/snmp/test/test_config/agent/target_params.conf.src new file mode 100644 index 0000000000..8e89b91d81 --- /dev/null +++ b/lib/snmp/test/test_config/agent/target_params.conf.src @@ -0,0 +1,12 @@ +%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48 +%% This file defines the target parameters. +%% The data is inserted into the snmpTargetParamsTable defined +%% in SNMP-TARGET-MIB. +%% Each row is a 5-tuple: +%% {Name, MPModel, SecurityModel, SecurityName, SecurityLevel}. +%% For example +%% {"target_v3", v3, usm, "", noAuthNoPriv}. +%% + + +{"target_v2", v2c, v2c, "initial", noAuthNoPriv}. diff --git a/lib/snmp/test/test_config/agent/vacm.conf.src b/lib/snmp/test/test_config/agent/vacm.conf.src new file mode 100644 index 0000000000..c7dc5170c2 --- /dev/null +++ b/lib/snmp/test/test_config/agent/vacm.conf.src @@ -0,0 +1,28 @@ +%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48 +%% This file defines the Mib Views. +%% The data is inserted into the vacm* tables defined +%% in SNMP-VIEW-BASED-ACM-MIB. +%% Each row is one of 3 tuples; one for each table in the MIB: +%% {vacmSecurityToGroup, SecModel, SecName, GroupName}. +%% {vacmAccess, GroupName, Prefix, SecModel, SecLevel, Match, RV, WV, NV}. +%% {vacmViewTreeFamily, ViewIndex, ViewSubtree, ViewStatus, ViewMask}. +%% For example +%% {vacmSecurityToGroup, v2c, "initial", "initial"}. +%% {vacmSecurityToGroup, usm, "initial", "initial"}. +%% read/notify access to system +%% {vacmAccess, "initial", "", any, noAuthNoPriv, exact, +%% "system", "", "system"}. +%% {vacmViewTreeFamily, "system", [1,3,6,1,2,1,1], included, null}. +%% {vacmViewTreeFamily, "exmib", [1,3,6,1,3], included, null}. % for EX1-MIB +%% {vacmViewTreeFamily, "internet", [1,3,6,1], included, null}. +%% + + +{vacmSecurityToGroup, v2c, "initial", "initial"}. +{vacmSecurityToGroup, v2c, "all-rights", "all-rights"}. +{vacmAccess, "initial", "", any, noAuthNoPriv, exact, "restricted", "", "restricted"}. +{vacmAccess, "initial", "", usm, authNoPriv, exact, "internet", "internet", "internet"}. +{vacmAccess, "initial", "", usm, authPriv, exact, "internet", "internet", "internet"}. +{vacmAccess, "all-rights", "", any, noAuthNoPriv, exact, "internet", "internet", "internet"}. +{vacmViewTreeFamily, "restricted", [1,3,6,1], included, null}. +{vacmViewTreeFamily, "internet", [1,3,6,1], included, null}. diff --git a/lib/snmp/test/test_config/manager/manager.conf.src b/lib/snmp/test/test_config/manager/manager.conf.src new file mode 100644 index 0000000000..164e5507c6 --- /dev/null +++ b/lib/snmp/test/test_config/manager/manager.conf.src @@ -0,0 +1,16 @@ +%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:35:05 +%% This file defines the Manager local configuration info +%% Each row is a 2-tuple: +%% {Variable, Value}. +%% For example +%% {port, 5000}. +%% {address, [127,42,17,5]}. +%% {engine_id, "managerEngine"}. +%% {max_message_size, 484}. +%% + + +{port, 5000}. +{address, [127,0,0,1]}. +{engine_id, "foo"}. +{max_message_size, 484}. diff --git a/lib/snmp/test/test_config/manager/usm.conf.src b/lib/snmp/test/test_config/manager/usm.conf.src new file mode 100644 index 0000000000..39122cab5c --- /dev/null +++ b/lib/snmp/test/test_config/manager/usm.conf.src @@ -0,0 +1,8 @@ +%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:35:05 +%% This file defines the usm users the manager handles +%% Each row is a 6 or 7-tuple: +%% {EngineID, UserName, AuthP, AuthKey, PrivP, PrivKey} +%% {EngineID, UserName, SecName, AuthP, AuthKey, PrivP, PrivKey} +%% + + diff --git a/lib/snmp/test/test_config/modules.mk b/lib/snmp/test/test_config/modules.mk new file mode 100644 index 0000000000..54e6e22966 --- /dev/null +++ b/lib/snmp/test/test_config/modules.mk @@ -0,0 +1,37 @@ +#-*-makefile-*- ; force emacs to enter makefile-mode + +# %CopyrightBegin% +# +# Copyright Ericsson AB 2004-2010. All Rights Reserved. +# +# The contents of this file are subject to the Erlang Public License, +# Version 1.1, (the "License"); you may not use this file except in +# compliance with the License. You should have received a copy of the +# Erlang Public License along with this software. If not, it can be +# retrieved online at http://www.erlang.org/. +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +# the License for the specific language governing rights and limitations +# under the License. +# +# %CopyrightEnd% + +SYS_CONFIG_FILES = \ + sys.config \ + sys-agent.config \ + sys-manager.config + +AGENT_CONFIG_FILES = \ + agent/agent.conf \ + agent/community.conf \ + agent/context.conf \ + agent/notify.conf \ + agent/standard.conf \ + agent/target_addr.conf \ + agent/target_params.conf \ + agent/vacm.conf + +MANAGER_CONFIG_FILES = \ + manager/manager.conf \ + manager/usm.conf diff --git a/lib/snmp/test/test_config/sys-agent.config.src b/lib/snmp/test/test_config/sys-agent.config.src new file mode 100644 index 0000000000..9df2c6a6bc --- /dev/null +++ b/lib/snmp/test/test_config/sys-agent.config.src @@ -0,0 +1,42 @@ +%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:35:10 +[{snmp, + [ + {agent, + [ + {priority, normal}, + {versions, [v2]}, + {db_dir, "/ldisk/bmk/tests/snmp/seq10689/a/db"}, + {mib_storage, ets}, +%% {agent_mib_storage, volatile}, + {agent_mib_storage, persistent}, + {target_cache, [{verbosity,silence}]}, + {symbolic_store, [{verbosity,silence}]}, + {local_db, [{repair,true},{auto_save,5000},{verbosity,silence}]}, + {error_report_module, snmpa_error_logger}, + {agent_type, master}, + {agent_verbosity, trace}, + {audit_trail_log, [{type, read}, + {dir, "/ldisk/bmk/tests/snmp/seq10689/a/log"}, + {size, {10240,10}}]}, + {config, [{dir, "/ldisk/bmk/tests/snmp/seq10689/a/conf"}, + {force_load, true}, + {verbosity, trace}]}, + {multi_threaded, true}, + {mib_server, [{mibentry_override, false}, + {trapentry_override, false}, + {cache, true}, + {verbosity, trace}]}, + {note_store, [{timeout,30000}, {verbosity,silence}]}, + {supervisor, [{verbosity,silence}]}, + {net_if, [{module, snmpa_net_if}, + {verbosity, silence}, + {options, [{bind_to, true}, + {no_reuse, false}, + {req_limit, infinity}, + {sndbuf, 32000}, + {recbuf, 32000}]}]} + ] + } + ] + } +]. diff --git a/lib/snmp/test/test_config/sys-manager.config.src b/lib/snmp/test/test_config/sys-manager.config.src new file mode 100644 index 0000000000..dc795e31ab --- /dev/null +++ b/lib/snmp/test/test_config/sys-manager.config.src @@ -0,0 +1,55 @@ +%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:35:10 +[{snmp, + [ +%% {agent, +%% [ +%% {priority, normal}, +%% {versions, [v2]}, +%% {db_dir, "/home/eklajoh/tmp/snmp-config-2/a/"}, +%% {mib_storage, ets}, +%% {agent_mib_storage, volatile}, +%% {target_cache, [{verbosity,silence}]}, +%% {symbolic_store, [{verbosity,silence}]}, +%% {local_db, [{repair,true},{auto_save,5000},{verbosity,silence}]}, +%% {error_report_module, snmpa_error_logger}, +%% {agent_type, master}, +%% {agent_verbosity, silence}, +%% {config, [{dir, "/home/eklajoh/tmp/snmp-config-2/a/"}, {force_load, true}, {verbosity, silence}]}, +%% {multi_threaded, false}, +%% {mib_server, [{mibentry_override,false},{trapentry_override,false},{verbosity,silence}]}, +%% {note_store, [{timeout,30000},{verbosity,silence}]}, +%% {net_if, [{module,snmpa_net_if},{verbosity,silence},{options,[{bind_to,true},{no_reuse,false},{req_limit,infinity}]}]} +%% ] +%% }, + {manager, + [ + {priority, normal}, + {versions, [v1,v2,v3]}, + {config, [{dir, "/ldisk/bmk/tests/snmp/seq10689/m/conf"}, + {verbosity, trace}, + {db_dir, "/ldisk/bmk/tests/snmp/seq10689/m/db"}, + {repair, true}, + {auto_save, 5000}]}, + {inform_request_behaviour, user}, + {mibs, []}, + {server, [{timeout, 30000}, + {verbosity, trace}]}, + {note_store, [{timeout,30000}, + {verbosity,silence}]}, + {audit_trail_log, [{type, read}, + {dir, "/ldisk/bmk/tests/snmp/seq10689/m/log"}, + {size, {10240,10}}]}, + {net_if, [{module,snmpm_net_if}, + {verbosity, trace}, + {options, [{bind_to, true}, + {no_reuse, false}, +% {sndbuf, 32000}, + {recbuf, 45000} +]}]}, + {def_user_mod, snmpm_user_default}, + {def_user_data, undefined} + ] + } + ] + } +]. diff --git a/lib/snmp/test/test_config/sys.config.src b/lib/snmp/test/test_config/sys.config.src new file mode 100644 index 0000000000..5a0fa0624b --- /dev/null +++ b/lib/snmp/test/test_config/sys.config.src @@ -0,0 +1,67 @@ +%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:35:10 +[{snmp, + [ + {agent, + [ + {priority, normal}, + {versions, [v2]}, + {db_dir, "/ldisk/bmk/tests/snmp/seq10689/a/db"}, + {mib_storage, ets}, + {agent_mib_storage, volatile}, + {target_cache, [{verbosity,silence}]}, + {symbolic_store, [{verbosity,silence}]}, + {local_db, [{repair,true},{auto_save,5000},{verbosity,silence}]}, + {error_report_module, snmpa_error_logger}, + {agent_type, master}, + {agent_verbosity, silence}, + {audit_trail_log, [{type, read}, + {dir, "/ldisk/bmk/tests/snmp/seq10689/a/log"}, + {size, {10240,10}}]}, + {config, [{dir, "/ldisk/bmk/tests/snmp/seq10689/a/conf"}, + {force_load, true}, + {verbosity, silence}]}, + {multi_threaded, false}, + {mib_server, [{mibentry_override, false}, + {trapentry_override, false}, + {verbosity, silence}]}, + {note_store, [{timeout,30000},{verbosity,silence}]}, + {net_if, [{module, snmpa_net_if}, + {verbosity, silence}, + {options, [{bind_to, true}, + {no_reuse, false}, + {req_limit, infinity}, + {sndbuf, 32000}, + {recbuf, 32000}]}]} + ] + }, + {manager, + [ + {priority, normal}, + {versions, [v2]}, + {config, [{dir, "/ldisk/bmk/tests/snmp/seq10689/m/conf"}, + {verbosity, silence}, + {db_dir, "/ldisk/bmk/tests/snmp/seq10689/m/db"}, + {repair, true}, + {auto_save, 5000}]}, + {inform_request_behaviour, auto}, + {mibs, []}, + {server, [{timeout, 30000}, + {verbosity, silence}]}, + {note_store, [{timeout, 30000}, + {verbosity, silence}]}, + {audit_trail_log, [{type, read}, + {dir, "/ldisk/bmk/tests/snmp/seq10689/m/log"}, + {size, {10240,10}}]}, + {net_if, [{module,snmpm_net_if}, + {verbosity, silence}, + {options, [{bind_to, true}, + {no_reuse, false}, + {recbuf, 33000}, + {sndbuf, 34000}]}]}, + {def_user_mod, snmpm_user_default}, + {def_user_data, undefined} + ] + } + ] + } +]. -- cgit v1.2.3 From add572241ac6085f1dc1062ae6ca351737ec43eb Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 9 Dec 2010 12:30:02 +0100 Subject: Added preliminary make targets for config file building (sed'ing). --- lib/snmp/test/test_config/Makefile | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/test/test_config/Makefile b/lib/snmp/test/test_config/Makefile index 187a0ca901..250c594af6 100644 --- a/lib/snmp/test/test_config/Makefile +++ b/lib/snmp/test/test_config/Makefile @@ -70,6 +70,15 @@ clean: docs: +$(SYS_CONFIG_FILES): $(SYS_CONFIG_SRCS) + @echo "sys: $< -> $@" + +$(AGENT_CONFIG_FILES): $(AGENT_CONFIG_SRCS) + @echo "agent: $< -> $@" + +$(MANAGER_CONFIG_FILES): $(MANAGER_CONFIG_SRCS) + @echo "manager: $< -> $@" + # ---------------------------------------------------- # Release Target @@ -105,26 +114,14 @@ release_docs_spec: info: - @echo "SNMP_DEBUG = $(SNMP_DEBUG)" - @echo "SNMP_FLAGS = $(SNMP_FLAGS)" - @echo "" - @echo "SNMP_MIB_DIR = $(SNMP_MIB_DIR)" - @echo "MIB_SOURCE = $(MIB_SOURCE)" - @echo "MIB_TARGETS = $(MIB_TARGETS)" - @echo "SNMP_MIB_FLAGS = $(SNMP_MIB_FLAGS)" - @echo "" - @echo "ERL_COMPILE_FLAGS = $(ERL_COMPILE_FLAGS)" - @echo "" - @echo "RELSYSDIR = $(RELSYSDIR)" - @echo "" - @echo "SOURCE = $(SOURCE)" + @echo "SYS_CONFIG_SRCS = $(SYS_CONFIG_SRCS)" + @echo "SYS_CONFIG_FILES = $(SYS_CONFIG_FILES)" @echo "" - @echo "TARGET_FILES = $(TARGET_FILES)" + @echo "AGENT_CONFIG_SRCS = $(AGENT_CONFIG_SRCS)" + @echo "AGENT_CONFIG_FILES = $(AGENT_CONFIG_FILES)" @echo "" - @echo "EMAKEFILE = $(EMAKEFILE)" - @echo "MAKE_EMAKE = $(MAKE_EMAKE)" - @echo "BUILDTARGET = $(BUILDTARGET)" - @echo "RELTEST_FILES = $(RELTEST_FILES)" + @echo "MANAGER_CONFIG_SRCS = $(MANAGER_CONFIG_SRCS)" + @echo "MANAGER_CONFIG_FILES = $(MANAGER_CONFIG_FILES)" @echo "" -- cgit v1.2.3 From ec857328b0ece6a676633a3bd647a4ce37703469 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 9 Dec 2010 18:44:04 +0100 Subject: First preliminary sedding... --- lib/snmp/test/test_config/.gitignore | 18 ++++++++ lib/snmp/test/test_config/Makefile | 56 +++++++++++++++++++----- lib/snmp/test/test_config/agent/agent.conf.src | 2 +- lib/snmp/test/test_config/modules.mk | 3 ++ lib/snmp/test/test_config/sys-agent.config.src | 9 ++-- lib/snmp/test/test_config/sys-manager.config.src | 32 +++----------- lib/snmp/test/test_config/sys.config.src | 15 ++++--- lib/snmp/test/test_config/test_config.erl | 27 ++++++++++++ 8 files changed, 112 insertions(+), 50 deletions(-) create mode 100644 lib/snmp/test/test_config/.gitignore create mode 100644 lib/snmp/test/test_config/test_config.erl (limited to 'lib/snmp') diff --git a/lib/snmp/test/test_config/.gitignore b/lib/snmp/test/test_config/.gitignore new file mode 100644 index 0000000000..60d564fe4d --- /dev/null +++ b/lib/snmp/test/test_config/.gitignore @@ -0,0 +1,18 @@ +# Sys config files (Generated) +/sys.config +/sys-agent.config +/sys-manager.config + +# Agent config files (Generated) +/agent/agent.conf +/agent/community.conf +/agent/context.conf +/agent/notify.conf +/agent/standard.conf +/agent/target_addr.conf +/agent/target_params.conf +/agent/vacm.conf + +# Manager config files (Generated) +/manager/manager.conf +/manager/usm.conf diff --git a/lib/snmp/test/test_config/Makefile b/lib/snmp/test/test_config/Makefile index 250c594af6..064c9f4689 100644 --- a/lib/snmp/test/test_config/Makefile +++ b/lib/snmp/test/test_config/Makefile @@ -29,55 +29,82 @@ include ../../vsn.mk VSN = $(SNMP_VSN) +# ---------------------------------------------------- +# Configured variables +# ---------------------------------------------------- +# PERL = @PERL@ +PERL = perl + + # ---------------------------------------------------- # Target Specs # ---------------------------------------------------- include modules.mk +ERL_TARGETS = $(MODULES:%=$(EBIN)/%.$(EMULATOR)) + SYS_CONFIG_SRCS = $(SYS_CONFIG_FILES:%=%.src) AGENT_CONFIG_SRCS = $(AGENT_CONFIG_FILES:%=%.src) MANAGER_CONFIG_SRCS = $(MANAGER_CONFIG_FILES:%=%.src) +CONFIG_FILES = \ + $(SYS_CONFIG_FILES) \ + $(AGENT_CONFIG_FILES) \ + $(MANAGER_CONFIG_FILES) -# ---------------------------------------------------- -# Release directory specification -# ---------------------------------------------------- -RELSYSDIR = $(RELEASE_PATH) +TARGETS = \ + $(ERL_TARGETS) \ + $(CONFIG_FILES) # ---------------------------------------------------- -# SNMP FLAGS +# Release directory specification # ---------------------------------------------------- +ifeq ($(TESTROOT),) +TESTROOT=/tmp +endif +RELSYSDIR = $(TESTROOT) # ---------------------------------------------------- # FLAGS # ---------------------------------------------------- +EBIN = . + +ERL_COMPILE_FLAGS += +'{parse_transform,sys_pre_attributes}' \ + +'{attribute,insert,app_vsn,$(APP_VSN)}' + +ifeq ($(ADDR),) +ADDR = $(shell erl -noshell -s test_config ip_address -s init stop) +endif + # ---------------------------------------------------- # Targets # ---------------------------------------------------- -tests debug opt: $(SYS_CONFIG_FILES) $(AGENT_CONFIG_FILES) $(MANAGER_CONFIG_FILES) +tests debug opt: $(TARGETS) clean: - rm -f $(SYS_CONFIG_FILES) - rm -f $(AGENT_CONFIG_FILES) - rm -f $(MANAGER_CONFIG_FILES) + rm -f $(CONFIG_FILES) + rm -f $(ERL_TARGETS) rm -f core docs: $(SYS_CONFIG_FILES): $(SYS_CONFIG_SRCS) - @echo "sys: $< -> $@" + @echo "$< -> $@" + $(PERL) -p -e 's?%DIR%?$(RELSYSDIR)? ' < $< > $@ $(AGENT_CONFIG_FILES): $(AGENT_CONFIG_SRCS) - @echo "agent: $< -> $@" + @echo "$< -> $@" + $(PERL) -p -e 's?%ADDR%?$(ADDR)? ' < $< > $@ $(MANAGER_CONFIG_FILES): $(MANAGER_CONFIG_SRCS) - @echo "manager: $< -> $@" + @echo "$< -> $@" + $(PERL) -p -e 's?%ADDR%?$(ADDR)? ' < $< > $@ # ---------------------------------------------------- @@ -114,6 +141,9 @@ release_docs_spec: info: + @echo "" + @echo "RELSYSDIR = $(RELSYSDIR)" + @echo "" @echo "SYS_CONFIG_SRCS = $(SYS_CONFIG_SRCS)" @echo "SYS_CONFIG_FILES = $(SYS_CONFIG_FILES)" @echo "" @@ -123,5 +153,7 @@ info: @echo "MANAGER_CONFIG_SRCS = $(MANAGER_CONFIG_SRCS)" @echo "MANAGER_CONFIG_FILES = $(MANAGER_CONFIG_FILES)" @echo "" + @echo "ADDR = $(ADDR)" + @echo "" diff --git a/lib/snmp/test/test_config/agent/agent.conf.src b/lib/snmp/test/test_config/agent/agent.conf.src index 53830dbc3e..900e6a4282 100644 --- a/lib/snmp/test/test_config/agent/agent.conf.src +++ b/lib/snmp/test/test_config/agent/agent.conf.src @@ -15,6 +15,6 @@ {intAgentUDPPort, 4000}. -{intAgentIpAddress, [127,0,0,1]}. +{intAgentIpAddress, %ADDR%}. {snmpEngineID, "foo"}. {snmpEngineMaxMessageSize, 484}. diff --git a/lib/snmp/test/test_config/modules.mk b/lib/snmp/test/test_config/modules.mk index 54e6e22966..956bb54af3 100644 --- a/lib/snmp/test/test_config/modules.mk +++ b/lib/snmp/test/test_config/modules.mk @@ -35,3 +35,6 @@ AGENT_CONFIG_FILES = \ MANAGER_CONFIG_FILES = \ manager/manager.conf \ manager/usm.conf + +MODULES = \ + test_config diff --git a/lib/snmp/test/test_config/sys-agent.config.src b/lib/snmp/test/test_config/sys-agent.config.src index 9df2c6a6bc..eb6b0916ff 100644 --- a/lib/snmp/test/test_config/sys-agent.config.src +++ b/lib/snmp/test/test_config/sys-agent.config.src @@ -1,11 +1,12 @@ -%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:35:10 +%% This is an example sys config file for starting the snmp application +%% with only a agent running. [{snmp, [ {agent, [ {priority, normal}, {versions, [v2]}, - {db_dir, "/ldisk/bmk/tests/snmp/seq10689/a/db"}, + {db_dir, "%DIR%/agent/db"}, {mib_storage, ets}, %% {agent_mib_storage, volatile}, {agent_mib_storage, persistent}, @@ -16,9 +17,9 @@ {agent_type, master}, {agent_verbosity, trace}, {audit_trail_log, [{type, read}, - {dir, "/ldisk/bmk/tests/snmp/seq10689/a/log"}, + {dir, "%DIR%/agent/log"}, {size, {10240,10}}]}, - {config, [{dir, "/ldisk/bmk/tests/snmp/seq10689/a/conf"}, + {config, [{dir, "%DIR%/agent/conf"}, {force_load, true}, {verbosity, trace}]}, {multi_threaded, true}, diff --git a/lib/snmp/test/test_config/sys-manager.config.src b/lib/snmp/test/test_config/sys-manager.config.src index dc795e31ab..4366263084 100644 --- a/lib/snmp/test/test_config/sys-manager.config.src +++ b/lib/snmp/test/test_config/sys-manager.config.src @@ -1,33 +1,14 @@ -%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:35:10 +%% This is an example sys config file for starting the snmp application +%% with only a manager running. [{snmp, [ -%% {agent, -%% [ -%% {priority, normal}, -%% {versions, [v2]}, -%% {db_dir, "/home/eklajoh/tmp/snmp-config-2/a/"}, -%% {mib_storage, ets}, -%% {agent_mib_storage, volatile}, -%% {target_cache, [{verbosity,silence}]}, -%% {symbolic_store, [{verbosity,silence}]}, -%% {local_db, [{repair,true},{auto_save,5000},{verbosity,silence}]}, -%% {error_report_module, snmpa_error_logger}, -%% {agent_type, master}, -%% {agent_verbosity, silence}, -%% {config, [{dir, "/home/eklajoh/tmp/snmp-config-2/a/"}, {force_load, true}, {verbosity, silence}]}, -%% {multi_threaded, false}, -%% {mib_server, [{mibentry_override,false},{trapentry_override,false},{verbosity,silence}]}, -%% {note_store, [{timeout,30000},{verbosity,silence}]}, -%% {net_if, [{module,snmpa_net_if},{verbosity,silence},{options,[{bind_to,true},{no_reuse,false},{req_limit,infinity}]}]} -%% ] -%% }, {manager, [ {priority, normal}, {versions, [v1,v2,v3]}, - {config, [{dir, "/ldisk/bmk/tests/snmp/seq10689/m/conf"}, + {config, [{dir, "%DIR%/manager/conf"}, {verbosity, trace}, - {db_dir, "/ldisk/bmk/tests/snmp/seq10689/m/db"}, + {db_dir, "%DIR%/manager/db"}, {repair, true}, {auto_save, 5000}]}, {inform_request_behaviour, user}, @@ -37,15 +18,14 @@ {note_store, [{timeout,30000}, {verbosity,silence}]}, {audit_trail_log, [{type, read}, - {dir, "/ldisk/bmk/tests/snmp/seq10689/m/log"}, + {dir, "%DIR%/manager/log"}, {size, {10240,10}}]}, {net_if, [{module,snmpm_net_if}, {verbosity, trace}, {options, [{bind_to, true}, {no_reuse, false}, % {sndbuf, 32000}, - {recbuf, 45000} -]}]}, + {recbuf, 45000}]}]}, {def_user_mod, snmpm_user_default}, {def_user_data, undefined} ] diff --git a/lib/snmp/test/test_config/sys.config.src b/lib/snmp/test/test_config/sys.config.src index 5a0fa0624b..7e4e3b0acd 100644 --- a/lib/snmp/test/test_config/sys.config.src +++ b/lib/snmp/test/test_config/sys.config.src @@ -1,11 +1,12 @@ -%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:35:10 +%% This is an example sys config file for starting the snmp application +%% with both an agent and a manager running. [{snmp, [ {agent, [ {priority, normal}, {versions, [v2]}, - {db_dir, "/ldisk/bmk/tests/snmp/seq10689/a/db"}, + {db_dir, "%DIR%/agent/db"}, {mib_storage, ets}, {agent_mib_storage, volatile}, {target_cache, [{verbosity,silence}]}, @@ -15,9 +16,9 @@ {agent_type, master}, {agent_verbosity, silence}, {audit_trail_log, [{type, read}, - {dir, "/ldisk/bmk/tests/snmp/seq10689/a/log"}, + {dir, "%DIR%/agent/log"}, {size, {10240,10}}]}, - {config, [{dir, "/ldisk/bmk/tests/snmp/seq10689/a/conf"}, + {config, [{dir, "%DIR%/agent/conf"}, {force_load, true}, {verbosity, silence}]}, {multi_threaded, false}, @@ -38,9 +39,9 @@ [ {priority, normal}, {versions, [v2]}, - {config, [{dir, "/ldisk/bmk/tests/snmp/seq10689/m/conf"}, + {config, [{dir, "%DIR%/manager/conf"}, {verbosity, silence}, - {db_dir, "/ldisk/bmk/tests/snmp/seq10689/m/db"}, + {db_dir, "%DIR%/manager/db"}, {repair, true}, {auto_save, 5000}]}, {inform_request_behaviour, auto}, @@ -50,7 +51,7 @@ {note_store, [{timeout, 30000}, {verbosity, silence}]}, {audit_trail_log, [{type, read}, - {dir, "/ldisk/bmk/tests/snmp/seq10689/m/log"}, + {dir, "%DIR%/manager/log"}, {size, {10240,10}}]}, {net_if, [{module,snmpm_net_if}, {verbosity, silence}, diff --git a/lib/snmp/test/test_config/test_config.erl b/lib/snmp/test/test_config/test_config.erl new file mode 100644 index 0000000000..2a94bf5e8d --- /dev/null +++ b/lib/snmp/test/test_config/test_config.erl @@ -0,0 +1,27 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2002-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(test_config). + +-export([ip_address/0]). + +ip_address() -> + {ok, Hostname} = inet:gethostname(), + {ok, Address} = inet:getaddr(Hostname, inet), + io:format("~w", [tuple_to_list(Address)]). -- cgit v1.2.3 From d49bdb7c372c93d5b8007cbc016a587d91539fe9 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Fri, 10 Dec 2010 13:41:38 +0100 Subject: "Completed" sed'ing of config files. --- lib/snmp/test/test_config/Makefile | 36 +++++++++++++++++----- lib/snmp/test/test_config/agent/agent.conf.src | 1 - lib/snmp/test/test_config/agent/community.conf.src | 1 - lib/snmp/test/test_config/agent/context.conf.src | 1 - lib/snmp/test/test_config/agent/notify.conf.src | 1 - lib/snmp/test/test_config/agent/standard.conf.src | 15 +++++---- .../test/test_config/agent/target_addr.conf.src | 5 ++- .../test/test_config/agent/target_params.conf.src | 1 - lib/snmp/test/test_config/agent/vacm.conf.src | 1 - lib/snmp/test/test_config/manager/manager.conf.src | 2 +- lib/snmp/test/test_config/snmp_test_config.erl | 32 +++++++++++++++++++ lib/snmp/test/test_config/test_config.erl | 27 ---------------- 12 files changed, 71 insertions(+), 52 deletions(-) create mode 100644 lib/snmp/test/test_config/snmp_test_config.erl delete mode 100644 lib/snmp/test/test_config/test_config.erl (limited to 'lib/snmp') diff --git a/lib/snmp/test/test_config/Makefile b/lib/snmp/test/test_config/Makefile index 064c9f4689..446e7d8adf 100644 --- a/lib/snmp/test/test_config/Makefile +++ b/lib/snmp/test/test_config/Makefile @@ -68,7 +68,7 @@ RELSYSDIR = $(TESTROOT) # ---------------------------------------------------- -# FLAGS +# FLAGS AND VARIABLES # ---------------------------------------------------- EBIN = . @@ -77,9 +77,26 @@ ERL_COMPILE_FLAGS += +'{parse_transform,sys_pre_attributes}' \ +'{attribute,insert,app_vsn,$(APP_VSN)}' ifeq ($(ADDR),) -ADDR = $(shell erl -noshell -s test_config ip_address -s init stop) +ADDR = $(shell erl -noshell -s snmp_test_config ip_address -s init stop) endif +ifeq ($(TARGET_NAME_PRE),) +TARGET_NAME_PRE = $(shell erl -noshell -s snmp_test_config ip_address2 -s init stop) +endif + +ifeq ($(SYS_CONTACT),) +SYS_CONTACT = foo@bar.ericsson.se +endif + +ifeq ($(SYS_LOCATION),) +SYS_LOCATION = Erlang/OTP +endif + +ifeq ($(SYS_NAME),) +SYS_NAME = FOO +endif + + # ---------------------------------------------------- # Targets @@ -94,15 +111,19 @@ clean: docs: -$(SYS_CONFIG_FILES): $(SYS_CONFIG_SRCS) +%.config: %.config.src @echo "$< -> $@" $(PERL) -p -e 's?%DIR%?$(RELSYSDIR)? ' < $< > $@ -$(AGENT_CONFIG_FILES): $(AGENT_CONFIG_SRCS) +agent/%.conf: agent/%.conf.src @echo "$< -> $@" - $(PERL) -p -e 's?%ADDR%?$(ADDR)? ' < $< > $@ + sed -e 's?%ADDR%?$(ADDR)? ' \ + -e 's?%SYS_CONTACT%?$(SYS_CONTACT)? ' \ + -e 's?%SYS_LOCATION%?$(SYS_LOCATION)? ' \ + -e 's?%SYS_NAME%?$(SYS_NAME)? ' \ + -e 's?%TARGET_NAME_PRE%?$(TARGET_NAME_PRE)? ' < $< > $@ -$(MANAGER_CONFIG_FILES): $(MANAGER_CONFIG_SRCS) +manager/%.conf: manager/%.conf.src @echo "$< -> $@" $(PERL) -p -e 's?%ADDR%?$(ADDR)? ' < $< > $@ @@ -153,7 +174,8 @@ info: @echo "MANAGER_CONFIG_SRCS = $(MANAGER_CONFIG_SRCS)" @echo "MANAGER_CONFIG_FILES = $(MANAGER_CONFIG_FILES)" @echo "" - @echo "ADDR = $(ADDR)" + @echo "ADDR = $(ADDR)" + @echo "TARGET_NAME_PRE = $(TARGET_NAME_PRE)" @echo "" diff --git a/lib/snmp/test/test_config/agent/agent.conf.src b/lib/snmp/test/test_config/agent/agent.conf.src index 900e6a4282..2977cd49f8 100644 --- a/lib/snmp/test/test_config/agent/agent.conf.src +++ b/lib/snmp/test/test_config/agent/agent.conf.src @@ -1,4 +1,3 @@ -%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48 %% This file defines the Agent local configuration info %% The data is inserted into the snmpEngine* variables defined %% in SNMP-FRAMEWORK-MIB, and the intAgent* variables defined diff --git a/lib/snmp/test/test_config/agent/community.conf.src b/lib/snmp/test/test_config/agent/community.conf.src index 4661267950..8dccb929c9 100644 --- a/lib/snmp/test/test_config/agent/community.conf.src +++ b/lib/snmp/test/test_config/agent/community.conf.src @@ -1,4 +1,3 @@ -%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48 %% This file defines the community info which maps to VACM parameters. %% The data is inserted into the snmpCommunityTable defined %% in SNMP-COMMUNITY-MIB. diff --git a/lib/snmp/test/test_config/agent/context.conf.src b/lib/snmp/test/test_config/agent/context.conf.src index 56000d0308..ea8b5a97eb 100644 --- a/lib/snmp/test/test_config/agent/context.conf.src +++ b/lib/snmp/test/test_config/agent/context.conf.src @@ -1,4 +1,3 @@ -%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48 %% This file defines the contexts known to the agent. %% The data is inserted into the vacmContextTable defined %% in SNMP-VIEW-BASED-ACM-MIB. diff --git a/lib/snmp/test/test_config/agent/notify.conf.src b/lib/snmp/test/test_config/agent/notify.conf.src index b63668f4fd..164fd25b95 100644 --- a/lib/snmp/test/test_config/agent/notify.conf.src +++ b/lib/snmp/test/test_config/agent/notify.conf.src @@ -1,4 +1,3 @@ -%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48 %% This file defines the notification parameters. %% The data is inserted into the snmpNotifyTable defined %% in SNMP-NOTIFICATION-MIB. diff --git a/lib/snmp/test/test_config/agent/standard.conf.src b/lib/snmp/test/test_config/agent/standard.conf.src index 9bcca18b5e..31e04e7695 100644 --- a/lib/snmp/test/test_config/agent/standard.conf.src +++ b/lib/snmp/test/test_config/agent/standard.conf.src @@ -1,11 +1,10 @@ -%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48 %% This file defines the STANDARD-MIB info. %% Each row is a 2-tuple: %% {StandardVariable, Value}. %% For example %% {sysDescr, "Erlang SNMP agent"}. %% {sysObjectID, [1,2,3]}. -%% {sysContact, "{mbj,eklas}@erlang.ericsson.se"}. +%% {sysContact, "foo@bar.ericsson.se"}. %% {sysName, "test"}. %% {sysLocation, "erlang"}. %% {sysServices, 72}. @@ -13,10 +12,10 @@ %% -{sysDescr, "Erlang SNMP agent"}. -{sysObjectID, [1,2,3]}. -{sysContact, "{mbj,eklas}@erlang.ericsson.se"}. -{sysLocation, "erlang"}. -{sysServices, 72}. +{sysDescr, "Erlang SNMP agent"}. +{sysObjectID, [1,2,3]}. +{sysContact, "%SYS_CONTACT%"}. +{sysLocation, "%SYS_LOCATION%"}. +{sysServices, 72}. {snmpEnableAuthenTraps, disabled}. -{sysName, "foo"}. +{sysName, "%SYS_NAME%"}. diff --git a/lib/snmp/test/test_config/agent/target_addr.conf.src b/lib/snmp/test/test_config/agent/target_addr.conf.src index 2c7a6a15ad..740df74ecf 100644 --- a/lib/snmp/test/test_config/agent/target_addr.conf.src +++ b/lib/snmp/test/test_config/agent/target_addr.conf.src @@ -1,4 +1,3 @@ -%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48 %% This file defines the target address parameters. %% The data is inserted into the snmpTargetAddrTable defined %% in SNMP-TARGET-MIB, and in the snmpTargetAddrExtTable defined @@ -18,5 +17,5 @@ %% -{"127.0.0.1 v2", [127,0,0,1], 5000, 1500, 3, "std_trap", "target_v2", "", [], 2048}. -{"127.0.0.1 v2.2", [127,0,0,1], 5000, 1500, 3, "std_inform", "target_v2", "", [], 2048}. +{"%TARGET_NAME_PRE% v2", %ADDR%, 5000, 1500, 3, "std_trap", "target_v2", "", [], 2048}. +{"%TARGET_NAME_PRE% v2.2", %ADDR%, 5000, 1500, 3, "std_inform", "target_v2", "", [], 2048}. diff --git a/lib/snmp/test/test_config/agent/target_params.conf.src b/lib/snmp/test/test_config/agent/target_params.conf.src index 8e89b91d81..a4a535baa2 100644 --- a/lib/snmp/test/test_config/agent/target_params.conf.src +++ b/lib/snmp/test/test_config/agent/target_params.conf.src @@ -1,4 +1,3 @@ -%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48 %% This file defines the target parameters. %% The data is inserted into the snmpTargetParamsTable defined %% in SNMP-TARGET-MIB. diff --git a/lib/snmp/test/test_config/agent/vacm.conf.src b/lib/snmp/test/test_config/agent/vacm.conf.src index c7dc5170c2..86271443ad 100644 --- a/lib/snmp/test/test_config/agent/vacm.conf.src +++ b/lib/snmp/test/test_config/agent/vacm.conf.src @@ -1,4 +1,3 @@ -%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48 %% This file defines the Mib Views. %% The data is inserted into the vacm* tables defined %% in SNMP-VIEW-BASED-ACM-MIB. diff --git a/lib/snmp/test/test_config/manager/manager.conf.src b/lib/snmp/test/test_config/manager/manager.conf.src index 164e5507c6..7d4104ded2 100644 --- a/lib/snmp/test/test_config/manager/manager.conf.src +++ b/lib/snmp/test/test_config/manager/manager.conf.src @@ -11,6 +11,6 @@ {port, 5000}. -{address, [127,0,0,1]}. +{address, %ADDR%}. {engine_id, "foo"}. {max_message_size, 484}. diff --git a/lib/snmp/test/test_config/snmp_test_config.erl b/lib/snmp/test/test_config/snmp_test_config.erl new file mode 100644 index 0000000000..8d2005d061 --- /dev/null +++ b/lib/snmp/test/test_config/snmp_test_config.erl @@ -0,0 +1,32 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2002-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(test_config). + +-export([ip_address/0, ip_address2/0]). + +ip_address() -> + {ok, Hostname} = inet:gethostname(), + {ok, Address} = inet:getaddr(Hostname, inet), + io:format("~w", [tuple_to_list(Address)]). + +ip_address2() -> + {ok, Hostname} = inet:gethostname(), + {ok, {A1, A2, A3, A4}} = inet:getaddr(Hostname, inet), + io:format("~w.~w.~w.~w", [A1, A2, A3, A4]). diff --git a/lib/snmp/test/test_config/test_config.erl b/lib/snmp/test/test_config/test_config.erl deleted file mode 100644 index 2a94bf5e8d..0000000000 --- a/lib/snmp/test/test_config/test_config.erl +++ /dev/null @@ -1,27 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2002-2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - --module(test_config). - --export([ip_address/0]). - -ip_address() -> - {ok, Hostname} = inet:gethostname(), - {ok, Address} = inet:getaddr(Hostname, inet), - io:format("~w", [tuple_to_list(Address)]). -- cgit v1.2.3 From 58620c2052e07490beb44a4bd1a8fbb5ebc028ac Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Fri, 10 Dec 2010 14:17:30 +0100 Subject: Various cosmetic (print) fixes. Wrong module names used for the utility module in the test_config dir. --- lib/snmp/src/agent/snmp_community_mib.erl | 4 +++- lib/snmp/src/agent/snmpa.erl | 7 +++++-- lib/snmp/src/agent/snmpa_mib_lib.erl | 9 ++++++--- lib/snmp/test/test_config/Makefile | 2 -- lib/snmp/test/test_config/modules.mk | 2 +- lib/snmp/test/test_config/snmp_test_config.erl | 2 +- 6 files changed, 16 insertions(+), 10 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/src/agent/snmp_community_mib.erl b/lib/snmp/src/agent/snmp_community_mib.erl index 8f0f4cad73..5644a43345 100644 --- a/lib/snmp/src/agent/snmp_community_mib.erl +++ b/lib/snmp/src/agent/snmp_community_mib.erl @@ -336,6 +336,8 @@ get_target_addr_ext_mms(TDomain, TAddress, Key) -> get_target_addr_ext_mms(TDomain, TAddress, NextKey) end end. + + %%----------------------------------------------------------------- %% Instrumentation Functions %%----------------------------------------------------------------- @@ -347,7 +349,7 @@ snmpCommunityTable(print) -> PrintRow = fun(Prefix, Row) -> lists:flatten( - io_lib:format("~sIndex: ~p" + io_lib:format("~sIndex: ~p" "~n~sName: ~p" "~n~sSecurityName: ~p" "~n~sContextEngineID: ~p" diff --git a/lib/snmp/src/agent/snmpa.erl b/lib/snmp/src/agent/snmpa.erl index 8ad2a83de4..c09435c03b 100644 --- a/lib/snmp/src/agent/snmpa.erl +++ b/lib/snmp/src/agent/snmpa.erl @@ -326,6 +326,9 @@ print_mib_info() -> MibsInfo = mibs_info(), print_mib_info(MibsInfo). +print_mib_info([]) -> + io:format("~n", []), + ok; print_mib_info([{Mod, Tables, Variables} | MibsInfo]) -> io:format("~n** ~s ** ~n~n", [make_pretty_mib(Mod)]), print_mib_variables2(Mod, Variables), @@ -379,9 +382,9 @@ make_pretty_mib(snmp_view_based_acm_mib) -> "SNMP-VIEW-BASED-ACM-MIB"; make_pretty_mib(snmp_target_mib) -> "SNMP-TARGET-MIB"; -make_pretty_mib(snmp_target_mib) -> +make_pretty_mib(snmp_community_mib) -> "SNMP-COMMUNITY-MIB"; -make_pretty_mib(snmp_target_mib) -> +make_pretty_mib(snmp_notification_mib) -> "SNMP-NOTIFICATION-MIB"; make_pretty_mib(snmp_target_mib) -> "SNMP-USER-BASED-SM-MIB"; diff --git a/lib/snmp/src/agent/snmpa_mib_lib.erl b/lib/snmp/src/agent/snmpa_mib_lib.erl index 22057b4547..700bdd1a6e 100644 --- a/lib/snmp/src/agent/snmpa_mib_lib.erl +++ b/lib/snmp/src/agent/snmpa_mib_lib.erl @@ -90,9 +90,9 @@ print_variables(Variables) when is_list(Variables) -> ok. print_variable(Variable, {value, Val}, Prefix) when is_atom(Variable) -> - io:format("~w~s => ~p~n", [Variable, Prefix, Val]); + io:format("~w~s=> ~p~n", [Variable, Prefix, Val]); print_variable(Variable, Error, Prefix) when is_atom(Variable) -> - io:format("~w~s => ERROR: ~p~n", [Variable, Prefix, Error]). + io:format("~w~s=> [e] ~p~n", [Variable, Prefix, Error]). print_variables_prefixify(Variables) -> MaxVarLength = print_variables_maxlength(Variables), @@ -139,10 +139,13 @@ print_table(Table, DB, FOI, PrintRow) -> print_table(Table, TableInfo, PrintRow). print_table(Table, TableInfo, PrintRow) when is_function(PrintRow, 2) -> - io:format("~w => ~n", [Table]), + io:format("~w =>", [Table]), do_print_table(TableInfo, PrintRow). +do_print_table({ok, [] = _TableInfo}, _PrintRow) -> + io:format(" -~n", []); do_print_table({ok, TableInfo}, PrintRow) when is_function(PrintRow, 2) -> + io:format("~n", []), lists:foreach(fun({RowIdx, Row}) -> io:format(" ~w => ~n~s~n", [RowIdx, PrintRow(" ", Row)]) diff --git a/lib/snmp/test/test_config/Makefile b/lib/snmp/test/test_config/Makefile index 446e7d8adf..c02bb5c601 100644 --- a/lib/snmp/test/test_config/Makefile +++ b/lib/snmp/test/test_config/Makefile @@ -32,8 +32,6 @@ VSN = $(SNMP_VSN) # ---------------------------------------------------- # Configured variables # ---------------------------------------------------- -# PERL = @PERL@ -PERL = perl # ---------------------------------------------------- diff --git a/lib/snmp/test/test_config/modules.mk b/lib/snmp/test/test_config/modules.mk index 956bb54af3..ee8b68d4eb 100644 --- a/lib/snmp/test/test_config/modules.mk +++ b/lib/snmp/test/test_config/modules.mk @@ -37,4 +37,4 @@ MANAGER_CONFIG_FILES = \ manager/usm.conf MODULES = \ - test_config + snmp_test_config diff --git a/lib/snmp/test/test_config/snmp_test_config.erl b/lib/snmp/test/test_config/snmp_test_config.erl index 8d2005d061..550a276c4c 100644 --- a/lib/snmp/test/test_config/snmp_test_config.erl +++ b/lib/snmp/test/test_config/snmp_test_config.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% --module(test_config). +-module(snmp_test_config). -export([ip_address/0, ip_address2/0]). -- cgit v1.2.3 From fee3f48c37432c7ea28f2e8c9eb4eacac4422db9 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Fri, 10 Dec 2010 15:54:25 +0100 Subject: Added variables from STANDARD-MIB (including counters). Also some minor fixes. --- lib/snmp/src/agent/snmp_standard_mib.erl | 266 ++++++++++++++++++++++++++ lib/snmp/src/agent/snmp_target_mib.erl | 4 + lib/snmp/src/agent/snmp_user_based_sm_mib.erl | 5 + lib/snmp/src/agent/snmpa.erl | 57 +++++- 4 files changed, 327 insertions(+), 5 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/src/agent/snmp_standard_mib.erl b/lib/snmp/src/agent/snmp_standard_mib.erl index 639172401d..7292d5b98e 100644 --- a/lib/snmp/src/agent/snmp_standard_mib.erl +++ b/lib/snmp/src/agent/snmp_standard_mib.erl @@ -40,6 +40,28 @@ sys_object_id/1, sys_object_id/2, sys_or_table/3, variable_func/1, variable_func/2, inc/1, inc/2]). +-export([sysDescr/1, sysContact/1, sysName/1, sysLocation/1, + sysServices/1, sysUpTime/1, snmpEnableAuthenTraps/1, + sysObjectID/1, + snmpInPkts/1, snmpOutPkts/1, + snmpInBadVersions/1, + snmpInBadCommunityNames/1, snmpInBadCommunityUses/1, + snmpInASNParseErrs/1, + snmpInTooBigs/1, + snmpInNoSuchNames/1, snmpInBadValues/1, + snmpInReadOnlys/1, snmpInGenErrs/1, + snmpInTotalReqVars/1, snmpInTotalSetVars/1, + snmpInGetRequests/1, snmpInSetRequests/1, + snmpInGetNexts/1, + snmpInGetResponses/1, snmpInTraps/1, + snmpOutTooBigs/1, + snmpOutNoSuchNames/1, + snmpOutBadValues/1, + snmpOutGenErrs/1, + snmpOutGetRequests/1, snmpOutSetRequests/1, + snmpOutGetNexts/1, + snmpOutGetResponses/1, + snmpOutTraps/1]). -export([dummy/1, snmp_set_serial_no/1, snmp_set_serial_no/2]). -export([add_agent_caps/2, del_agent_caps/1, get_agent_caps/0]). -export([check_standard/1]). @@ -202,18 +224,252 @@ variable_func(get, Name) -> inc(Name) -> inc(Name, 1). inc(Name, N) -> ets:update_counter(snmp_agent_table, Name, N). + +sysDescr(print) -> + VarAndValue = [{sysDescr, sysDescr(get)}], + snmpa_mib_lib:print_variables(VarAndValue); + +sysDescr(get) -> + VarDB = db(sysDescr), + snmp_generic:variable_get(VarDB). + + +sysContact(print) -> + VarAndValue = [{sysContact, sysContact(get)}], + snmpa_mib_lib:print_variables(VarAndValue); + +sysContact(get) -> + VarDB = db(sysContact), + snmp_generic:variable_get(VarDB). + + +sysName(print) -> + VarAndValue = [{sysName, sysName(get)}], + snmpa_mib_lib:print_variables(VarAndValue); + +sysName(get) -> + VarDB = db(sysName), + snmp_generic:variable_get(VarDB). + + +sysLocation(print) -> + VarAndValue = [{sysLocation, sysLocation(get)}], + snmpa_mib_lib:print_variables(VarAndValue); + +sysLocation(get) -> + VarDB = db(sysLocation), + snmp_generic:variable_get(VarDB). + + +sysServices(print) -> + VarAndValue = [{sysServices, sysServices(get)}], + snmpa_mib_lib:print_variables(VarAndValue); + +sysServices(get) -> + VarDB = db(sysServices), + snmp_generic:variable_get(VarDB). + + +snmpInPkts(print) -> + gen_counter(print, snmpInPkts); +snmpInPkts(get) -> + gen_counter(get, snmpInPkts). + + +snmpOutPkts(print) -> + gen_counter(print, snmpOutPkts); +snmpOutPkts(get) -> + gen_counter(get, snmpOutPkts). + + +snmpInASNParseErrs(print) -> + gen_counter(print, snmpInASNParseErrs); +snmpInASNParseErrs(get) -> + gen_counter(get, snmpInASNParseErrs). + + +snmpInBadCommunityNames(print) -> + gen_counter(print, snmpInBadCommunityNames); +snmpInBadCommunityNames(get) -> + gen_counter(get, snmpInBadCommunityNames). + + +snmpInBadCommunityUses(print) -> + gen_counter(print, snmpInBadCommunityUses); + +snmpInBadCommunityUses(get) -> + gen_counter(get, snmpInBadCommunityUses). + + +snmpInBadVersions(print) -> + gen_counter(print, snmpInBadVersions); +snmpInBadVersions(get) -> + gen_counter(get, snmpInBadVersions). + + +snmpInTooBigs(print) -> + gen_counter(print, snmpInTooBigs); +snmpInTooBigs(get) -> + gen_counter(get, snmpInTooBigs). + + +snmpInNoSuchNames(print) -> + gen_counter(print, snmpInNoSuchNames); +snmpInNoSuchNames(get) -> + gen_counter(get, snmpInNoSuchNames). + + +snmpInBadValues(print) -> + gen_counter(print, snmpInBadValues); +snmpInBadValues(get) -> + gen_counter(get, snmpInBadValues). + + +snmpInReadOnlys(print) -> + gen_counter(print, snmpInReadOnlys); +snmpInReadOnlys(get) -> + gen_counter(get, snmpInReadOnlys). + + +snmpInGenErrs(print) -> + gen_counter(print, snmpInGenErrs); +snmpInGenErrs(get) -> + gen_counter(get, snmpInGenErrs). + + +snmpInTotalReqVars(print) -> + gen_counter(print, snmpInTotalReqVars); +snmpInTotalReqVars(get) -> + gen_counter(get, snmpInTotalReqVars). + + +snmpInTotalSetVars(print) -> + gen_counter(print, snmpInTotalSetVars); +snmpInTotalSetVars(get) -> + gen_counter(get, snmpInTotalSetVars). + + +snmpInGetRequests(print) -> + gen_counter(print, snmpInGetRequests); +snmpInGetRequests(get) -> + gen_counter(get, snmpInGetRequests). + + +snmpInSetRequests(print) -> + gen_counter(print, snmpInSetRequests); +snmpInSetRequests(get) -> + gen_counter(get, snmpInSetRequests). + + +snmpInGetNexts(print) -> + gen_counter(print, snmpInGetNexts); +snmpInGetNexts(get) -> + gen_counter(get, snmpInGetNexts). + + +snmpInGetResponses(print) -> + gen_counter(print, snmpInGetResponses); +snmpInGetResponses(get) -> + gen_counter(get, snmpInGetResponses). + + +snmpInTraps(print) -> + gen_counter(print, snmpInTraps); +snmpInTraps(get) -> + gen_counter(get, snmpInTraps). + + +snmpOutTooBigs(print) -> + gen_counter(print, snmpOutTooBigs); +snmpOutTooBigs(get) -> + gen_counter(get, snmpOutTooBigs). + + +snmpOutNoSuchNames(print) -> + gen_counter(print, snmpOutNoSuchNames); +snmpOutNoSuchNames(get) -> + gen_counter(get, snmpOutNoSuchNames). + + +snmpOutBadValues(print) -> + gen_counter(print, snmpOutBadValues); +snmpOutBadValues(get) -> + gen_counter(get, snmpOutBadValues). + + +snmpOutGenErrs(print) -> + gen_counter(print, snmpOutGenErrs); +snmpOutGenErrs(get) -> + gen_counter(get, snmpOutGenErrs). + + +snmpOutGetRequests(print) -> + gen_counter(print, snmpOutGetRequests); +snmpOutGetRequests(get) -> + gen_counter(get, snmpOutGetRequests). + + +snmpOutSetRequests(print) -> + gen_counter(print, snmpOutSetRequests); +snmpOutSetRequests(get) -> + gen_counter(get, snmpOutSetRequests). + + +snmpOutGetNexts(print) -> + gen_counter(print, snmpOutGetNexts); +snmpOutGetNexts(get) -> + gen_counter(get, snmpOutGetNexts). + + +snmpOutGetResponses(print) -> + gen_counter(print, snmpOutGetResponses); +snmpOutGetResponses(get) -> + gen_counter(get, snmpOutGetResponses). + + +snmpOutTraps(print) -> + gen_counter(print, snmpOutTraps); +snmpOutTraps(get) -> + gen_counter(get, snmpOutTraps). + + +gen_counter(print, Counter) -> + Val = gen_counter(get, Counter), + VarAndValue = [{Counter, Val}], + snmpa_mib_lib:print_variables(VarAndValue); + +gen_counter(get, Counter) -> + variable_func(get, Counter). + + %%----------------------------------------------------------------- %% This is the instrumentation function for sysUpTime. %%----------------------------------------------------------------- +sysUpTime(print) -> + sys_up_time(print). + sys_up_time() -> snmpa:sys_up_time(). +sys_up_time(print) -> + VarAndValue = [{sysUpTime, sys_up_time(get)}], + snmpa_mib_lib:print_variables(VarAndValue); + sys_up_time(get) -> {value, snmpa:sys_up_time()}. + %%----------------------------------------------------------------- %% This is the instrumentation function for snmpEnableAuthenTraps %%----------------------------------------------------------------- + +snmpEnableAuthenTraps(print) -> + snmp_enable_authen_traps(print). + +snmp_enable_authen_traps(print) -> + VarAndValue = [{snmpEnableAuthenTraps, snmp_enable_authen_traps(get)}], + snmpa_mib_lib:print_variables(VarAndValue); + snmp_enable_authen_traps(new) -> snmp_generic:variable_func(new, db(snmpEnableAuthenTraps)); @@ -226,9 +482,17 @@ snmp_enable_authen_traps(get) -> snmp_enable_authen_traps(set, NewVal) -> snmp_generic:variable_func(set, NewVal, db(snmpEnableAuthenTraps)). + %%----------------------------------------------------------------- %% This is the instrumentation function for sysObjectId %%----------------------------------------------------------------- +sysObjectID(print) -> + sys_object_id(print). + +sys_object_id(print) -> + VarAndValue = [{sysObjectID, sys_object_id(get)}], + snmpa_mib_lib:print_variables(VarAndValue); + sys_object_id(new) -> snmp_generic:variable_func(new, db(sysObjectID)); @@ -241,6 +505,7 @@ sys_object_id(get) -> sys_object_id(set, NewVal) -> snmp_generic:variable_func(set, NewVal, db(sysObjectID)). + %%----------------------------------------------------------------- %% This is a dummy instrumentation function for objects like %% snmpTrapOID, that is accessible-for-notify, with different @@ -249,6 +514,7 @@ sys_object_id(set, NewVal) -> %%----------------------------------------------------------------- dummy(_Op) -> ok. + %%----------------------------------------------------------------- %% This is the instrumentation function for snmpSetSerialNo. %% It is always volatile. diff --git a/lib/snmp/src/agent/snmp_target_mib.erl b/lib/snmp/src/agent/snmp_target_mib.erl index 033dfdd92e..270a5fd5b6 100644 --- a/lib/snmp/src/agent/snmp_target_mib.erl +++ b/lib/snmp/src/agent/snmp_target_mib.erl @@ -511,6 +511,10 @@ set_target_engine_id(TargetAddrName, EngineId) -> %%----------------------------------------------------------------- %% Instrumentation Functions %%----------------------------------------------------------------- +snmpTargetSpinLock(print) -> + VarAndValue = [{snmpTargetSpinLock, snmpTargetSpinLock(get)}], + snmpa_mib_lib:print_variables(VarAndValue); + snmpTargetSpinLock(new) -> snmp_generic:variable_func(new, {snmpTargetSpinLock, volatile}), {A1,A2,A3} = erlang:now(), diff --git a/lib/snmp/src/agent/snmp_user_based_sm_mib.erl b/lib/snmp/src/agent/snmp_user_based_sm_mib.erl index f40bb1a5b9..4c3f27c4ef 100644 --- a/lib/snmp/src/agent/snmp_user_based_sm_mib.erl +++ b/lib/snmp/src/agent/snmp_user_based_sm_mib.erl @@ -374,6 +374,11 @@ get_user_from_security_name(EngineID, SecName) -> %%----------------------------------------------------------------- %% Instrumentation Functions %%----------------------------------------------------------------- + +usmUserSpinLock(print) -> + VarAndValue = [{usmUserSpinLock, usmUserSpinLock(get)}], + snmpa_mib_lib:print_variables(VarAndValue); + usmUserSpinLock(new) -> snmp_generic:variable_func(new, {usmUserSpinLock, volatile}), {A1,A2,A3} = erlang:now(), diff --git a/lib/snmp/src/agent/snmpa.erl b/lib/snmp/src/agent/snmpa.erl index c09435c03b..8ca057892c 100644 --- a/lib/snmp/src/agent/snmpa.erl +++ b/lib/snmp/src/agent/snmpa.erl @@ -287,6 +287,46 @@ whereis_mib(Agent, Mib) when is_atom(Mib) -> mibs_info() -> [ + {snmp_standard_mib, + [], + [ + sysDescr, + sysObjectID, + sysContact, + sysName, + sysLocation, + sysServices, + snmpEnableAuthenTraps, + sysUpTime, + snmpInPkts, + snmpOutPkts, + snmpInBadVersions, + snmpInBadCommunityNames, + snmpInBadCommunityUses, + snmpInASNParseErrs, + snmpInTooBigs, + snmpInNoSuchNames, + snmpInBadValues, + snmpInReadOnlys, + snmpInGenErrs, + snmpInTotalReqVars, + snmpInTotalSetVars, + snmpInGetRequests, + snmpInSetRequests, + snmpInGetNexts, + snmpInGetResponses, + snmpInTraps, + snmpOutTooBigs, + snmpOutNoSuchNames, + snmpOutBadValues, + snmpOutGenErrs, + snmpOutGetRequests, + snmpOutSetRequests, + snmpOutGetNexts, + snmpOutGetResponses, + snmpOutTraps + ] + }, {snmp_view_based_acm_mib, [ vacmAccessTable, @@ -295,7 +335,8 @@ mibs_info() -> ], [ vacmViewSpinLock - ]}, + ] + }, {snmp_target_mib, [ snmpTargetAddrTable, @@ -303,12 +344,14 @@ mibs_info() -> ], [ snmpTargetSpinLock - ]}, + ] + }, {snmp_community_mib, [ snmpCommunityTable ], - []}, + [] + }, {snmp_notification_mib, [ snmpNotifyTable @@ -320,7 +363,9 @@ mibs_info() -> ], [ usmUserSpinLock - ]}]. + ] + } + ]. print_mib_info() -> MibsInfo = mibs_info(), @@ -386,8 +431,10 @@ make_pretty_mib(snmp_community_mib) -> "SNMP-COMMUNITY-MIB"; make_pretty_mib(snmp_notification_mib) -> "SNMP-NOTIFICATION-MIB"; -make_pretty_mib(snmp_target_mib) -> +make_pretty_mib(snmp_user_based_sm_mib) -> "SNMP-USER-BASED-SM-MIB"; +make_pretty_mib(snmp_standard_mib) -> + "STANDARD-MIB"; make_pretty_mib(Mod) -> atom_to_list(Mod). -- cgit v1.2.3 From a0e4728a5e8e366c83e8229cefc63ba92151a86d Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Fri, 10 Dec 2010 16:21:08 +0100 Subject: Cosmetic stuff (when to newline, intending, ..). --- lib/snmp/src/agent/snmp_standard_mib.erl | 15 +++++++++++---- lib/snmp/src/agent/snmpa.erl | 14 +++++++++++--- lib/snmp/src/agent/snmpa_mib_lib.erl | 8 +------- 3 files changed, 23 insertions(+), 14 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/src/agent/snmp_standard_mib.erl b/lib/snmp/src/agent/snmp_standard_mib.erl index 7292d5b98e..b6834d278c 100644 --- a/lib/snmp/src/agent/snmp_standard_mib.erl +++ b/lib/snmp/src/agent/snmp_standard_mib.erl @@ -446,7 +446,9 @@ gen_counter(get, Counter) -> %% This is the instrumentation function for sysUpTime. %%----------------------------------------------------------------- sysUpTime(print) -> - sys_up_time(print). + sys_up_time(print); +sysUpTime(get) -> + sys_up_time(get). sys_up_time() -> snmpa:sys_up_time(). @@ -464,7 +466,10 @@ sys_up_time(get) -> %%----------------------------------------------------------------- snmpEnableAuthenTraps(print) -> - snmp_enable_authen_traps(print). + snmp_enable_authen_traps(print); +snmpEnableAuthenTraps(get) -> + snmp_enable_authen_traps(get). + snmp_enable_authen_traps(print) -> VarAndValue = [{snmpEnableAuthenTraps, snmp_enable_authen_traps(get)}], @@ -484,10 +489,12 @@ snmp_enable_authen_traps(set, NewVal) -> %%----------------------------------------------------------------- -%% This is the instrumentation function for sysObjectId +%% This is the instrumentation function for sysObjectID %%----------------------------------------------------------------- sysObjectID(print) -> - sys_object_id(print). + sys_object_id(print); +sysObjectID(get) -> + sys_object_id(get). sys_object_id(print) -> VarAndValue = [{sysObjectID, sys_object_id(get)}], diff --git a/lib/snmp/src/agent/snmpa.erl b/lib/snmp/src/agent/snmpa.erl index 8ca057892c..3c214874fe 100644 --- a/lib/snmp/src/agent/snmpa.erl +++ b/lib/snmp/src/agent/snmpa.erl @@ -378,6 +378,7 @@ print_mib_info([{Mod, Tables, Variables} | MibsInfo]) -> io:format("~n** ~s ** ~n~n", [make_pretty_mib(Mod)]), print_mib_variables2(Mod, Variables), print_mib_tables2(Mod, Tables), + io:format("~n", []), print_mib_info(MibsInfo). @@ -394,9 +395,12 @@ print_mib_tables([{Mod, Tabs}|MibTabs]) print_mib_tables([_|MibTabs]) -> print_mib_tables(MibTabs). +print_mib_tables(_Mod, [] = _Tables) -> + ok; print_mib_tables(Mod, Tables) -> io:format("~n** ~s ** ~n~n", [make_pretty_mib(Mod)]), - print_mib_tables2(Mod, Tables). + print_mib_tables2(Mod, Tables), + io:format("~n", []). print_mib_tables2(Mod, Tables) -> [(catch Mod:Table(print)) || Table <- Tables]. @@ -415,12 +419,16 @@ print_mib_variables([{Mod, Vars}|MibVars]) print_mib_variables([_|MibVars]) -> print_mib_variables(MibVars). +print_mib_variables(_Mod, [] = _Vars) -> + ok; print_mib_variables(Mod, Vars) -> io:format("~n** ~s ** ~n~n", [make_pretty_mib(Mod)]), - print_mib_variables2(Mod, Vars). + print_mib_variables2(Mod, Vars), + io:format("~n", []). print_mib_variables2(Mod, Variables) -> - [(catch Mod:Variable(print)) || Variable <- Variables]. + Vars = [{Var, (catch Mod:Var(get))} || Var <- Variables], + snmpa_mib_lib:print_variables(Vars). make_pretty_mib(snmp_view_based_acm_mib) -> diff --git a/lib/snmp/src/agent/snmpa_mib_lib.erl b/lib/snmp/src/agent/snmpa_mib_lib.erl index 700bdd1a6e..cb96ff8056 100644 --- a/lib/snmp/src/agent/snmpa_mib_lib.erl +++ b/lib/snmp/src/agent/snmpa_mib_lib.erl @@ -129,11 +129,6 @@ print_tables(Tables) when is_list(Tables) -> end, Tables), ok. -%% print_table(Table, DB, FOI, PrintRow) -> -%% TableInfo = get_table(DB(Table), FOI(Table)), -%% print_table(Table, TableInfo, PrintRow), -%% ok. - print_table(Table, DB, FOI, PrintRow) -> TableInfo = get_table(DB, FOI), print_table(Table, TableInfo, PrintRow). @@ -149,8 +144,7 @@ do_print_table({ok, TableInfo}, PrintRow) when is_function(PrintRow, 2) -> lists:foreach(fun({RowIdx, Row}) -> io:format(" ~w => ~n~s~n", [RowIdx, PrintRow(" ", Row)]) - end, TableInfo), - io:format("~n", []); + end, TableInfo); do_print_table({error, {invalid_rowindex, BadRowIndex, []}}, _PrintRow) -> io:format("Error: Bad rowindex ~w~n", [BadRowIndex]); do_print_table({error, {invalid_rowindex, BadRowIndex, TableInfo}}, PrintRow) -> -- cgit v1.2.3 From 8e9ef38dd36c771dff0d477fa7999d34b72e8a7a Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Fri, 10 Dec 2010 17:50:38 +0100 Subject: Added counter (variables) for usm. Also added config file for usm. And more sed'ing... --- lib/snmp/src/agent/snmp_framework_mib.erl | 12 +++++ lib/snmp/src/agent/snmp_user_based_sm_mib.erl | 55 ++++++++++++++++++++++ lib/snmp/src/agent/snmp_view_based_acm_mib.erl | 4 ++ lib/snmp/src/agent/snmpa.erl | 22 +++++++-- lib/snmp/test/test_config/.gitignore | 1 + lib/snmp/test/test_config/Makefile | 26 ++++++++-- lib/snmp/test/test_config/agent/agent.conf.src | 2 +- lib/snmp/test/test_config/agent/usm.conf.src | 17 +++++++ lib/snmp/test/test_config/manager/manager.conf.src | 2 +- lib/snmp/test/test_config/manager/usm.conf.src | 1 + lib/snmp/test/test_config/modules.mk | 1 + lib/snmp/test/test_config/sys-agent.config.src | 2 +- lib/snmp/test/test_config/sys.config.src | 4 +- 13 files changed, 138 insertions(+), 11 deletions(-) create mode 100644 lib/snmp/test/test_config/agent/usm.conf.src (limited to 'lib/snmp') diff --git a/lib/snmp/src/agent/snmp_framework_mib.erl b/lib/snmp/src/agent/snmp_framework_mib.erl index d9bf7e8551..0d7866d94d 100644 --- a/lib/snmp/src/agent/snmp_framework_mib.erl +++ b/lib/snmp/src/agent/snmp_framework_mib.erl @@ -373,15 +373,27 @@ intAgentUDPPort(Op) -> intAgentIpAddress(Op) -> snmp_generic:variable_func(Op, db(intAgentIpAddress)). +snmpEngineID(print) -> + VarAndValue = [{snmpEngineID, snmpEngineID(get)}], + snmpa_mib_lib:print_variables(VarAndValue); snmpEngineID(Op) -> snmp_generic:variable_func(Op, db(snmpEngineID)). +snmpEngineMaxMessageSize(print) -> + VarAndValue = [{snmpEngineMaxMessageSize, snmpEngineMaxMessageSize(get)}], + snmpa_mib_lib:print_variables(VarAndValue); snmpEngineMaxMessageSize(Op) -> snmp_generic:variable_func(Op, db(snmpEngineMaxMessageSize)). +snmpEngineBoots(print) -> + VarAndValue = [{snmpEngineBoots, snmpEngineBoots(get)}], + snmpa_mib_lib:print_variables(VarAndValue); snmpEngineBoots(Op) -> snmp_generic:variable_func(Op, db(snmpEngineBoots)). +snmpEngineTime(print) -> + VarAndValue = [{snmpEngineTime, snmpEngineTime(get)}], + snmpa_mib_lib:print_variables(VarAndValue); snmpEngineTime(get) -> {value, get_engine_time()}. diff --git a/lib/snmp/src/agent/snmp_user_based_sm_mib.erl b/lib/snmp/src/agent/snmp_user_based_sm_mib.erl index 4c3f27c4ef..69cebc858b 100644 --- a/lib/snmp/src/agent/snmp_user_based_sm_mib.erl +++ b/lib/snmp/src/agent/snmp_user_based_sm_mib.erl @@ -26,6 +26,12 @@ table_next/2, is_engine_id_known/1, get_user/2, get_user_from_security_name/2, mk_key_change/3, mk_key_change/5, extract_new_key/3, mk_random/1]). +-export([usmStatsUnsupportedSecLevels/1, + usmStatsNotInTimeWindows/1, + usmStatsUnknownUserNames/1, + usmStatsUnknownEngineIDs/1, + usmStatsWrongDigests/1, + usmStatsDecryptionErrors/1]). -export([add_user/1, add_user/13, delete_user/1]). %% Internal @@ -303,6 +309,54 @@ gc_tabs() -> %%----------------------------------------------------------------- %% Counter functions %%----------------------------------------------------------------- + +usmStatsUnsupportedSecLevels(print) -> + VarAndValue = [{usmStatsUnsupportedSecLevels, + usmStatsUnsupportedSecLevels(get)}], + snmpa_mib_lib:print_variables(VarAndValue); +usmStatsUnsupportedSecLevels(get) -> + get_counter(usmStatsUnsupportedSecLevels). + +usmStatsNotInTimeWindows(print) -> + VarAndValue = [{usmStatsNotInTimeWindows, usmStatsNotInTimeWindows(get)}], + snmpa_mib_lib:print_variables(VarAndValue); +usmStatsNotInTimeWindows(get) -> + get_counter(usmStatsNotInTimeWindows). + +usmStatsUnknownUserNames(print) -> + VarAndValue = [{usmStatsUnknownUserNames, usmStatsUnknownUserNames(get)}], + snmpa_mib_lib:print_variables(VarAndValue); +usmStatsUnknownUserNames(get) -> + get_counter(usmStatsUnknownUserNames). + +usmStatsUnknownEngineIDs(print) -> + VarAndValue = [{usmStatsUnknownEngineIDs, usmStatsUnknownEngineIDs(get)}], + snmpa_mib_lib:print_variables(VarAndValue); +usmStatsUnknownEngineIDs(get) -> + get_counter(usmStatsUnknownEngineIDs). + +usmStatsWrongDigests(print) -> + VarAndValue = [{usmStatsWrongDigests, usmStatsWrongDigests(get)}], + snmpa_mib_lib:print_variables(VarAndValue); +usmStatsWrongDigests(get) -> + get_counter(usmStatsWrongDigests). + +usmStatsDecryptionErrors(print) -> + VarAndValue = [{usmStatsDecryptionErrors, usmStatsDecryptionErrors(get)}], + snmpa_mib_lib:print_variables(VarAndValue); +usmStatsDecryptionErrors(get) -> + get_counter(usmStatsDecryptionErrors). + + +get_counter(Name) -> + case (catch ets:lookup(snmp_agent_table, Name)) of + [{_, Val}] -> + {value, Val}; + _ -> + genErr + end. + + init_vars() -> lists:map(fun maybe_create_var/1, vars()). maybe_create_var(Var) -> @@ -323,6 +377,7 @@ vars() -> usmStatsDecryptionErrors ]. + %%----------------------------------------------------------------- %% API functions %%----------------------------------------------------------------- diff --git a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl index 659babaf94..74acda2f21 100644 --- a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl +++ b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl @@ -749,6 +749,7 @@ do_get_next(RowIndex, Cols) -> end end. + %%----------------------------------------------------------------- %% Functions to manipulate vacmAccessRows. %%----------------------------------------------------------------- @@ -939,6 +940,9 @@ do_get_vacmAccessTable(Key0, Acc) -> end. +%%----------------------------------------------------------------- +%% Wrappers +%%----------------------------------------------------------------- db(X) -> snmpa_agent:db(X). volatile_db(X) -> {X, volatile}. diff --git a/lib/snmp/src/agent/snmpa.erl b/lib/snmp/src/agent/snmpa.erl index 3c214874fe..22fbd33add 100644 --- a/lib/snmp/src/agent/snmpa.erl +++ b/lib/snmp/src/agent/snmpa.erl @@ -327,6 +327,16 @@ mibs_info() -> snmpOutTraps ] }, + {snmp_framework_mib, + [ + ], + [ + snmpEngineID, + snmpEngineBoots, + snmpEngineTime, + snmpEngineMaxMessageSize + ] + }, {snmp_view_based_acm_mib, [ vacmAccessTable, @@ -362,7 +372,13 @@ mibs_info() -> usmUserTable ], [ - usmUserSpinLock + usmUserSpinLock, + usmStatsUnsupportedSecLevels, + usmStatsNotInTimeWindows, + usmStatsUnknownUserNames, + usmStatsUnknownEngineIDs, + usmStatsWrongDigests, + usmStatsDecryptionErrors ] } ]. @@ -441,8 +457,8 @@ make_pretty_mib(snmp_notification_mib) -> "SNMP-NOTIFICATION-MIB"; make_pretty_mib(snmp_user_based_sm_mib) -> "SNMP-USER-BASED-SM-MIB"; -make_pretty_mib(snmp_standard_mib) -> - "STANDARD-MIB"; +make_pretty_mib(snmp_framework_mib) -> + "SNMP-FRAMEWORK-MIB"; make_pretty_mib(Mod) -> atom_to_list(Mod). diff --git a/lib/snmp/test/test_config/.gitignore b/lib/snmp/test/test_config/.gitignore index 60d564fe4d..fc2d5dbadf 100644 --- a/lib/snmp/test/test_config/.gitignore +++ b/lib/snmp/test/test_config/.gitignore @@ -11,6 +11,7 @@ /agent/standard.conf /agent/target_addr.conf /agent/target_params.conf +/agent/usm.conf /agent/vacm.conf # Manager config files (Generated) diff --git a/lib/snmp/test/test_config/Makefile b/lib/snmp/test/test_config/Makefile index c02bb5c601..4953de7fe8 100644 --- a/lib/snmp/test/test_config/Makefile +++ b/lib/snmp/test/test_config/Makefile @@ -94,6 +94,22 @@ ifeq ($(SYS_NAME),) SYS_NAME = FOO endif +ifeq ($(AGENT_ENGINE_ID),) +AGENT_ENGINE_ID = Agent engine of $(USER) +endif + +ifeq ($(AGENT_USM_ENGINE_ID),) +AGENT_USM_ENGINE_ID = $(AGENT_ENGINE_ID) +endif + +ifeq ($(MANAGER_ENGINE_ID),) +MANAGER_ENGINE_ID = Manager engine of $(USER) +endif + +ifeq ($(MANAGER_USM_ENGINE_ID),) +MANAGER_USM_ENGINE_ID = $(MANAGER_ENGINE_ID) +endif + # ---------------------------------------------------- @@ -119,11 +135,15 @@ agent/%.conf: agent/%.conf.src -e 's?%SYS_CONTACT%?$(SYS_CONTACT)? ' \ -e 's?%SYS_LOCATION%?$(SYS_LOCATION)? ' \ -e 's?%SYS_NAME%?$(SYS_NAME)? ' \ - -e 's?%TARGET_NAME_PRE%?$(TARGET_NAME_PRE)? ' < $< > $@ + -e 's?%TARGET_NAME_PRE%?$(TARGET_NAME_PRE)? ' \ + -e 's?%ENGINE_ID%?\"$(AGENT_ENGINE_ID)\"? ' \ + -e 's?%USM_ENGINE_ID%?\"$(AGENT_USM_ENGINE_ID)\"? ' < $< > $@ manager/%.conf: manager/%.conf.src @echo "$< -> $@" - $(PERL) -p -e 's?%ADDR%?$(ADDR)? ' < $< > $@ + sed -e 's?%ADDR%?$(ADDR)? ' \ + -e 's?%ENGINE_ID%?\"$(MANAGER_ENGINE_ID)\"? ' \ + -e 's?%USM_ENGINE_ID%?\"$(MANAGER_USM_ENGINE_ID)\"? ' < $< > $@ # ---------------------------------------------------- @@ -133,7 +153,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk release_spec: -release_tests_spec: opt +release_tests_spec: clean opt $(INSTALL_DIR) $(RELSYSDIR) chmod -f -R u+w $(RELSYSDIR) $(INSTALL_DIR) $(RELSYSDIR)/agent diff --git a/lib/snmp/test/test_config/agent/agent.conf.src b/lib/snmp/test/test_config/agent/agent.conf.src index 2977cd49f8..1fe95cc72d 100644 --- a/lib/snmp/test/test_config/agent/agent.conf.src +++ b/lib/snmp/test/test_config/agent/agent.conf.src @@ -15,5 +15,5 @@ {intAgentUDPPort, 4000}. {intAgentIpAddress, %ADDR%}. -{snmpEngineID, "foo"}. +{snmpEngineID, %ENGINE_ID%}. {snmpEngineMaxMessageSize, 484}. diff --git a/lib/snmp/test/test_config/agent/usm.conf.src b/lib/snmp/test/test_config/agent/usm.conf.src new file mode 100644 index 0000000000..0409084048 --- /dev/null +++ b/lib/snmp/test/test_config/agent/usm.conf.src @@ -0,0 +1,17 @@ +%% This file defines the security parameters for the user-based +%% security model. +%% The data is inserted into the usmUserTable defined +%% in SNMP-USER-BASED-SM-MIB. +%% Each row is a 13-tuple: +%% {EngineID, UserName, SecName, Clone, AuthP, AuthKeyC, OwnAuthKeyC, +%% PrivP, PrivKeyC, OwnPrivKeyC, Public, AuthKey, PrivKey}. +%% For example +%% {"agentEngine", "initial", "initial", zeroDotZero, +%% usmNoAuthProtocol, "", "", usmNoPrivProtocol, "", "", "", +%% "", ""}. +%% + + +{%USM_ENGINE_ID%, "initial", "initial", zeroDotZero, usmHMACMD5AuthProtocol, "", "", usmNoPrivProtocol, "", "", "", [160,66,33,136,178,59,246,214,102,63,131,131,54,14,221,177], ""}. +{%USM_ENGINE_ID%, "templateMD5", "templateMD5", zeroDotZero, usmHMACMD5AuthProtocol, "", "", usmNoPrivProtocol, "", "", "", [160,66,33,136,178,59,246,214,102,63,131,131,54,14,221,177], ""}. +{%USM_ENGINE_ID%, "templateSHA", "templateSHA", zeroDotZero, usmHMACSHAAuthProtocol, "", "", usmNoPrivProtocol, "", "", "", [199,94,239,13,229,135,141,77,124,129,65,189,230,240,115,163,239,15,13,242], ""}. diff --git a/lib/snmp/test/test_config/manager/manager.conf.src b/lib/snmp/test/test_config/manager/manager.conf.src index 7d4104ded2..c38a61b13c 100644 --- a/lib/snmp/test/test_config/manager/manager.conf.src +++ b/lib/snmp/test/test_config/manager/manager.conf.src @@ -12,5 +12,5 @@ {port, 5000}. {address, %ADDR%}. -{engine_id, "foo"}. +{engine_id, %ENGINE_ID%}. {max_message_size, 484}. diff --git a/lib/snmp/test/test_config/manager/usm.conf.src b/lib/snmp/test/test_config/manager/usm.conf.src index 39122cab5c..a558c86710 100644 --- a/lib/snmp/test/test_config/manager/usm.conf.src +++ b/lib/snmp/test/test_config/manager/usm.conf.src @@ -5,4 +5,5 @@ %% {EngineID, UserName, SecName, AuthP, AuthKey, PrivP, PrivKey} %% +{%USM_ENGINE_ID%, "initial", usmNoAuthProtocol, "", usmNoPrivProtocol, ""}. diff --git a/lib/snmp/test/test_config/modules.mk b/lib/snmp/test/test_config/modules.mk index ee8b68d4eb..3d084cef01 100644 --- a/lib/snmp/test/test_config/modules.mk +++ b/lib/snmp/test/test_config/modules.mk @@ -30,6 +30,7 @@ AGENT_CONFIG_FILES = \ agent/standard.conf \ agent/target_addr.conf \ agent/target_params.conf \ + agent/usm.conf \ agent/vacm.conf MANAGER_CONFIG_FILES = \ diff --git a/lib/snmp/test/test_config/sys-agent.config.src b/lib/snmp/test/test_config/sys-agent.config.src index eb6b0916ff..46a458203d 100644 --- a/lib/snmp/test/test_config/sys-agent.config.src +++ b/lib/snmp/test/test_config/sys-agent.config.src @@ -5,7 +5,7 @@ {agent, [ {priority, normal}, - {versions, [v2]}, + {versions, [v1,v2,v3]}, {db_dir, "%DIR%/agent/db"}, {mib_storage, ets}, %% {agent_mib_storage, volatile}, diff --git a/lib/snmp/test/test_config/sys.config.src b/lib/snmp/test/test_config/sys.config.src index 7e4e3b0acd..b2cd399883 100644 --- a/lib/snmp/test/test_config/sys.config.src +++ b/lib/snmp/test/test_config/sys.config.src @@ -5,7 +5,7 @@ {agent, [ {priority, normal}, - {versions, [v2]}, + {versions, [v1,v2,v3]}, {db_dir, "%DIR%/agent/db"}, {mib_storage, ets}, {agent_mib_storage, volatile}, @@ -38,7 +38,7 @@ {manager, [ {priority, normal}, - {versions, [v2]}, + {versions, [v1,v2,v3]}, {config, [{dir, "%DIR%/manager/conf"}, {verbosity, silence}, {db_dir, "%DIR%/manager/db"}, -- cgit v1.2.3 From 6bd03dbc48e148d1fcad13d2301231507e49c77d Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 16 Dec 2010 14:44:18 +0100 Subject: Added dumping of data after (snmpa_vacm) cleanup call. --- lib/snmp/src/agent/snmp_view_based_acm_mib.erl | 7 ++++++- lib/snmp/src/agent/snmpa_vacm.erl | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl index 5e188c74c5..f0c4a16cee 100644 --- a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl +++ b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl @@ -181,13 +181,18 @@ init_tabs(Sec2Group, Access, View) -> snmpa_local_db:table_delete(db(vacmSecurityToGroupTable)), snmpa_local_db:table_create(db(vacmSecurityToGroupTable)), init_sec2group_table(Sec2Group), + ?vdebug("create vacm access table",[]), snmpa_vacm:cleanup(), init_access_table(Access), + ?vdebug("create vacm view-tree-family table",[]), snmpa_local_db:table_delete(db(vacmViewTreeFamilyTable)), snmpa_local_db:table_create(db(vacmViewTreeFamilyTable)), - init_view_table(View). + init_view_table(View), + + ?vdebug("table(s) initiated",[]), + ok. init_sec2group_table([Row | T]) -> % ?vtrace("init security-to-group table: " diff --git a/lib/snmp/src/agent/snmpa_vacm.erl b/lib/snmp/src/agent/snmpa_vacm.erl index 91cecfcd1e..892dc265f1 100644 --- a/lib/snmp/src/agent/snmpa_vacm.erl +++ b/lib/snmp/src/agent/snmpa_vacm.erl @@ -258,7 +258,8 @@ delete(Key) -> cleanup() -> - ets:delete_all_objects(snmpa_vacm). + ets:delete_all_objects(snmpa_vacm), + dump_table(). dump_table(true) -> dump_table(); -- cgit v1.2.3 From 7cd1a358ed784e8872dcc7fa6c6f719401b12f52 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 17 Feb 2011 11:23:33 +0100 Subject: Some cosmetic changes... --- lib/snmp/doc/src/snmp_agent_config_files.xml | 11 ++++++----- lib/snmp/vsn.mk | 21 ++++++++++++++++++++- 2 files changed, 26 insertions(+), 6 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/doc/src/snmp_agent_config_files.xml b/lib/snmp/doc/src/snmp_agent_config_files.xml index 0bab563f87..b62269d506 100644 --- a/lib/snmp/doc/src/snmp_agent_config_files.xml +++ b/lib/snmp/doc/src/snmp_agent_config_files.xml @@ -4,7 +4,7 @@
- 19972009 + 19972011 Ericsson AB. All Rights Reserved. @@ -178,11 +178,12 @@ community.conf. It must be present if the agent is configured for SNMPv1 or SNMPv2c.

+

An SNMP community is a relationship between an SNMP + agent and a set of SNMP managers that defines authentication, access + control and proxy characteristics.

The corresponding table is snmpCommunityTable in the - SNMP-COMMUNITY-MIB. -

-

Each entry is a term: -

+ SNMP-COMMUNITY-MIB.

+

Each entry is a term:

{CommunityIndex, CommunityName, SecurityName, ContextName, TransportTag}.

CommunityIndex is a non-empty string. diff --git a/lib/snmp/vsn.mk b/lib/snmp/vsn.mk index 1229b12ae2..e70c97dcb8 100644 --- a/lib/snmp/vsn.mk +++ b/lib/snmp/vsn.mk @@ -1,3 +1,22 @@ -SNMP_VSN = 4.18 +#-*-makefile-*- ; force emacs to enter makefile-mode + +# %CopyrightBegin% +# +# Copyright Ericsson AB 1997-2011. All Rights Reserved. +# +# The contents of this file are subject to the Erlang Public License, +# Version 1.1, (the "License"); you may not use this file except in +# compliance with the License. You should have received a copy of the +# Erlang Public License along with this software. If not, it can be +# retrieved online at http://www.erlang.org/. +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +# the License for the specific language governing rights and limitations +# under the License. +# +# %CopyrightEnd% + +SNMP_VSN = 4.19 PRE_VSN = APP_VSN = "snmp-$(SNMP_VSN)$(PRE_VSN)" -- cgit v1.2.3 From dd99864e18829150951285d3819096e04ebda3de Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 17 Feb 2011 12:02:54 +0100 Subject: No auto-import of erlang:error/1,2. --- lib/snmp/test/snmp_appup_test.erl | 4 +++- lib/snmp/test/snmp_test_mgr_misc.erl | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/test/snmp_appup_test.erl b/lib/snmp/test/snmp_appup_test.erl index 18509526cf..756636f79c 100644 --- a/lib/snmp/test/snmp_appup_test.erl +++ b/lib/snmp/test/snmp_appup_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -30,6 +30,8 @@ ]). +-compile({no_auto_import, [error/1]}). + -include("test_server.hrl"). -include("snmp_test_lib.hrl"). diff --git a/lib/snmp/test/snmp_test_mgr_misc.erl b/lib/snmp/test/snmp_test_mgr_misc.erl index ef1ba0b948..fc6dedd96d 100644 --- a/lib/snmp/test/snmp_test_mgr_misc.erl +++ b/lib/snmp/test/snmp_test_mgr_misc.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2010. All Rights Reserved. +%% Copyright Ericsson AB 1996-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -33,6 +33,8 @@ %% internal exports -export([init_packet/10]). +-compile({no_auto_import, [error/2]}). + -define(SNMP_USE_V3, true). -include_lib("snmp/include/snmp_types.hrl"). -- cgit v1.2.3 From e993afa1fb9c7143e09c55dee58aee32e9876d78 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 4 Oct 2010 19:03:41 +0200 Subject: Updated test cases to work with ts conversion algorithm --- lib/snmp/test/snmp_agent_test.erl | 8 ++++---- lib/snmp/test/snmp_app_test.erl | 8 ++++---- lib/snmp/test/snmp_appup_test.erl | 12 ++++++------ 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/test/snmp_agent_test.erl b/lib/snmp/test/snmp_agent_test.erl index 9d2e9969c4..ba438f0568 100644 --- a/lib/snmp/test/snmp_agent_test.erl +++ b/lib/snmp/test/snmp_agent_test.erl @@ -96,7 +96,7 @@ init_per_testcase(otp8395 = Case, Config) when is_list(Config) -> ?DBG("init_per_testcase -> entry with" "~n Case: ~p" "~n Config: ~p", [Case, Config]), - Config2 = init_per_testcase2(Case, init_suite(Config)), + Config2 = init_per_testcase2(Case, init_per_suite(Config)), otp8395({init, Config2}); init_per_testcase(otp_7157_test = _Case, Config) when is_list(Config) -> ?DBG("init_per_testcase -> entry with" @@ -134,8 +134,8 @@ fin_per_testcase(_Case, Config) when is_list(Config) -> Config. -init_suite(Config) -> - ?DBG("init_suite -> entry with" +init_per_suite(Config) -> + ?DBG("init_per_suite -> entry with" "~n Config: ~p", [Config]), %% Suite root dir for test suite @@ -170,7 +170,7 @@ init_suite(Config) -> {mib_dir, MibDir}, {std_mib_dir, StdMibDir} | Config1], - ?DBG("init_suite -> done when" + ?DBG("init_per_suite -> done when" "~n Config2: ~p", [Config2]), Config2. diff --git a/lib/snmp/test/snmp_app_test.erl b/lib/snmp/test/snmp_app_test.erl index 5c5a5285a0..773f65be46 100644 --- a/lib/snmp/test/snmp_app_test.erl +++ b/lib/snmp/test/snmp_app_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -23,7 +23,7 @@ -module(snmp_app_test). -export([ - all/1, init_suite/1, fin_suite/1, + all/1, init_per_suite/1, fin_suite/1, init_per_testcase/2, fin_per_testcase/2, fields/1, @@ -60,9 +60,9 @@ all(suite) -> undef_funcs, start_and_stop ], - {conf, init_suite, Cases, fin_suite}. + {conf, init_per_suite, Cases, fin_suite}. -init_suite(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> ?DISPLAY_SUITE_INFO(), PrivDir = ?config(priv_dir, Config), TopDir = filename:join(PrivDir, app), diff --git a/lib/snmp/test/snmp_appup_test.erl b/lib/snmp/test/snmp_appup_test.erl index 18509526cf..37522b8e3a 100644 --- a/lib/snmp/test/snmp_appup_test.erl +++ b/lib/snmp/test/snmp_appup_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -23,7 +23,7 @@ -module(snmp_appup_test). -export([ - all/1, init_suite/1, fin_suite/1, + all/1, init_per_suite/1, fin_suite/1, init_per_testcase/2, fin_per_testcase/2, appup_file/1 @@ -41,14 +41,14 @@ all(suite) -> [ appup_file ], - {conf, init_suite, Cases, fin_suite}. + {conf, init_per_suite, Cases, fin_suite}. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -init_suite(suite) -> []; -init_suite(doc) -> []; -init_suite(Config) when is_list(Config) -> +init_per_suite(suite) -> []; +init_per_suite(doc) -> []; +init_per_suite(Config) when is_list(Config) -> PrivDir = ?config(priv_dir, Config), TopDir = filename:join(PrivDir, appup), case file:make_dir(TopDir) of -- cgit v1.2.3 From 2cbb5d191fd8f94c113cbf61c243999388f65c3b Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 5 Oct 2010 17:58:16 +0200 Subject: Update all fin_per_testcase to end_per_testcase. --- lib/snmp/test/klas3.erl | 2 +- lib/snmp/test/sa.erl | 2 +- lib/snmp/test/snmp_SUITE.erl | 6 +++--- lib/snmp/test/snmp_agent_bl_test.erl | 4 ++-- lib/snmp/test/snmp_agent_mibs_test.erl | 12 ++++++------ lib/snmp/test/snmp_agent_ms_test.erl | 4 ++-- lib/snmp/test/snmp_agent_mt_test.erl | 4 ++-- lib/snmp/test/snmp_agent_nfilter_test.erl | 6 +++--- lib/snmp/test/snmp_agent_test.erl | 8 ++++---- lib/snmp/test/snmp_agent_v1_test.erl | 4 ++-- lib/snmp/test/snmp_agent_v2_test.erl | 4 ++-- lib/snmp/test/snmp_agent_v3_test.erl | 4 ++-- lib/snmp/test/snmp_app_test.erl | 4 ++-- lib/snmp/test/snmp_appup_mgr.erl | 2 +- lib/snmp/test/snmp_appup_test.erl | 4 ++-- lib/snmp/test/snmp_compiler_test.erl | 4 ++-- lib/snmp/test/snmp_conf_test.erl | 6 +++--- lib/snmp/test/snmp_log_test.erl | 4 ++-- lib/snmp/test/snmp_manager_config_test.erl | 6 +++--- lib/snmp/test/snmp_manager_test.erl | 8 ++++---- lib/snmp/test/snmp_manager_user.erl | 2 +- lib/snmp/test/snmp_manager_user_old.erl | 2 +- lib/snmp/test/snmp_manager_user_test.erl | 6 +++--- lib/snmp/test/snmp_manager_user_test_lib.erl | 2 +- lib/snmp/test/snmp_note_store_test.erl | 6 +++--- lib/snmp/test/snmp_pdus_test.erl | 4 ++-- lib/snmp/test/snmp_test_manager.erl | 2 +- lib/snmp/test/snmp_test_server.erl | 8 ++++---- lib/snmp/test/snmp_test_suite.erl | 4 ++-- lib/snmp/test/test1.erl | 2 +- lib/snmp/test/test2.erl | 2 +- 31 files changed, 69 insertions(+), 69 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/test/klas3.erl b/lib/snmp/test/klas3.erl index a5ce2af8c5..ec78d19dbb 100644 --- a/lib/snmp/test/klas3.erl +++ b/lib/snmp/test/klas3.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/snmp/test/sa.erl b/lib/snmp/test/sa.erl index ad3ccce08f..fee50c0e8c 100644 --- a/lib/snmp/test/sa.erl +++ b/lib/snmp/test/sa.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/snmp/test/snmp_SUITE.erl b/lib/snmp/test/snmp_SUITE.erl index f560e36663..5cf0af7992 100644 --- a/lib/snmp/test/snmp_SUITE.erl +++ b/lib/snmp/test/snmp_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -20,7 +20,7 @@ -module(snmp_SUITE). -export([all/1, - init_per_testcase/2, fin_per_testcase/2 + init_per_testcase/2, end_per_testcase/2 ]). -export([app/1, compiler/1, misc/1, agent/1, manager/1]). @@ -48,7 +48,7 @@ init_per_testcase(_Case, Config) when is_list(Config) -> Config. -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> Config. diff --git a/lib/snmp/test/snmp_agent_bl_test.erl b/lib/snmp/test/snmp_agent_bl_test.erl index 4608d90201..b17489a755 100644 --- a/lib/snmp/test/snmp_agent_bl_test.erl +++ b/lib/snmp/test/snmp_agent_bl_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -89,7 +89,7 @@ init_per_testcase(_Case, Config) when list(Config) -> Dog = ?t:timetrap(?t:minutes(6)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) when list(Config) -> +end_per_testcase(_Case, Config) when list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), Config. diff --git a/lib/snmp/test/snmp_agent_mibs_test.erl b/lib/snmp/test/snmp_agent_mibs_test.erl index 5f1ff53a79..c28fa81ae0 100644 --- a/lib/snmp/test/snmp_agent_mibs_test.erl +++ b/lib/snmp/test/snmp_agent_mibs_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -40,7 +40,7 @@ %%---------------------------------------------------------------------- -export([ all/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, init_all/1, finish_all/1, start_and_stop/1, @@ -100,20 +100,20 @@ init_per_testcase(cache_test, Config) when is_list(Config) -> init_per_testcase(_Case, Config) when is_list(Config) -> Config. -fin_per_testcase(size_check_dets, Config) when is_list(Config) -> +end_per_testcase(size_check_dets, Config) when is_list(Config) -> Dir = ?config(dets_dir, Config), ?line ok = ?DEL_DIR(Dir), lists:keydelete(dets_dir, 1, Config); -fin_per_testcase(size_check_mnesia, Config) when is_list(Config) -> +end_per_testcase(size_check_mnesia, Config) when is_list(Config) -> mnesia_stop(), Dir = ?config(mnesia_dir, Config), ?line ok = ?DEL_DIR(Dir), lists:keydelete(mnesia_dir, 1, Config); -fin_per_testcase(cache_test, Config) when is_list(Config) -> +end_per_testcase(cache_test, Config) when is_list(Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), Config; -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> Config. diff --git a/lib/snmp/test/snmp_agent_ms_test.erl b/lib/snmp/test/snmp_agent_ms_test.erl index 3a3a790e6a..cc4cdae32f 100644 --- a/lib/snmp/test/snmp_agent_ms_test.erl +++ b/lib/snmp/test/snmp_agent_ms_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -92,7 +92,7 @@ init_per_testcase(_Case, Config) when list(Config) -> Dog = ?t:timetrap(?t:minutes(6)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) when list(Config) -> +end_per_testcase(_Case, Config) when list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), Config. diff --git a/lib/snmp/test/snmp_agent_mt_test.erl b/lib/snmp/test/snmp_agent_mt_test.erl index 8d5a57f58d..c664dba288 100644 --- a/lib/snmp/test/snmp_agent_mt_test.erl +++ b/lib/snmp/test/snmp_agent_mt_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -92,7 +92,7 @@ init_per_testcase(_Case, Config) when list(Config) -> Dog = ?t:timetrap(?t:minutes(6)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) when list(Config) -> +end_per_testcase(_Case, Config) when list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), Config. diff --git a/lib/snmp/test/snmp_agent_nfilter_test.erl b/lib/snmp/test/snmp_agent_nfilter_test.erl index 269c7c96c9..f406ea1e63 100644 --- a/lib/snmp/test/snmp_agent_nfilter_test.erl +++ b/lib/snmp/test/snmp_agent_nfilter_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -34,7 +34,7 @@ %%---------------------------------------------------------------------- -export([ all/1, - init_per_testcase/2, fin_per_testcase/2 + init_per_testcase/2, end_per_testcase/2 ]). %%---------------------------------------------------------------------- @@ -58,7 +58,7 @@ init_per_testcase(_Case, Config) when is_list(Config) -> Config. -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> Config. %%====================================================================== diff --git a/lib/snmp/test/snmp_agent_test.erl b/lib/snmp/test/snmp_agent_test.erl index ba438f0568..cb4edf998b 100644 --- a/lib/snmp/test/snmp_agent_test.erl +++ b/lib/snmp/test/snmp_agent_test.erl @@ -123,10 +123,10 @@ init_per_testcase(_Case, Config) when is_list(Config) -> Dog = ?WD_START(?MINS(6)), [{watchdog, Dog}|Config]. -fin_per_testcase(otp8395, Config) when is_list(Config) -> +end_per_testcase(otp8395, Config) when is_list(Config) -> otp8395({fin, Config}); -fin_per_testcase(_Case, Config) when is_list(Config) -> - ?DBG("fin_per_testcase -> entry with" +end_per_testcase(_Case, Config) when is_list(Config) -> + ?DBG("end_per_testcase -> entry with" "~n Case: ~p" "~n Config: ~p", [_Case, Config]), Dog = ?config(watchdog, Config), @@ -220,7 +220,7 @@ init_per_testcase2(Case, Config) -> {sub_agent_top_dir, SubAgentTopDir}, {manager_top_dir, ManagerTopDir} | Config]. -fin_per_testcase2(_Case, Config) -> +end_per_testcase2(_Case, Config) -> Config. diff --git a/lib/snmp/test/snmp_agent_v1_test.erl b/lib/snmp/test/snmp_agent_v1_test.erl index 52ac6cf58f..737bb25cc3 100644 --- a/lib/snmp/test/snmp_agent_v1_test.erl +++ b/lib/snmp/test/snmp_agent_v1_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -103,7 +103,7 @@ init_per_testcase(_Case, Config) when list(Config) -> Dog = ?t:timetrap(?t:minutes(6)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) when list(Config) -> +end_per_testcase(_Case, Config) when list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), Config. diff --git a/lib/snmp/test/snmp_agent_v2_test.erl b/lib/snmp/test/snmp_agent_v2_test.erl index eca66dc30d..549521341e 100644 --- a/lib/snmp/test/snmp_agent_v2_test.erl +++ b/lib/snmp/test/snmp_agent_v2_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -92,7 +92,7 @@ init_per_testcase(_Case, Config) when list(Config) -> Dog = ?t:timetrap(?t:minutes(6)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) when list(Config) -> +end_per_testcase(_Case, Config) when list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), Config. diff --git a/lib/snmp/test/snmp_agent_v3_test.erl b/lib/snmp/test/snmp_agent_v3_test.erl index 823c914136..71b355057d 100644 --- a/lib/snmp/test/snmp_agent_v3_test.erl +++ b/lib/snmp/test/snmp_agent_v3_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -92,7 +92,7 @@ init_per_testcase(_Case, Config) when list(Config) -> Dog = ?t:timetrap(?t:minutes(6)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) when list(Config) -> +end_per_testcase(_Case, Config) when list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), Config. diff --git a/lib/snmp/test/snmp_app_test.erl b/lib/snmp/test/snmp_app_test.erl index 773f65be46..a973a2f325 100644 --- a/lib/snmp/test/snmp_app_test.erl +++ b/lib/snmp/test/snmp_app_test.erl @@ -24,7 +24,7 @@ -export([ all/1, init_per_suite/1, fin_suite/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, fields/1, modules/1, @@ -112,7 +112,7 @@ init_per_testcase(undef_funcs, Config) -> init_per_testcase(_Case, Config) -> Config. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Config. diff --git a/lib/snmp/test/snmp_appup_mgr.erl b/lib/snmp/test/snmp_appup_mgr.erl index 271d6a2847..6648ce9dbe 100644 --- a/lib/snmp/test/snmp_appup_mgr.erl +++ b/lib/snmp/test/snmp_appup_mgr.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/snmp/test/snmp_appup_test.erl b/lib/snmp/test/snmp_appup_test.erl index 37522b8e3a..3c708b8977 100644 --- a/lib/snmp/test/snmp_appup_test.erl +++ b/lib/snmp/test/snmp_appup_test.erl @@ -24,7 +24,7 @@ -export([ all/1, init_per_suite/1, fin_suite/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, appup_file/1 @@ -88,7 +88,7 @@ fin_suite(Config) when is_list(Config) -> init_per_testcase(_Case, Config) when is_list(Config) -> Config. -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> Config. diff --git a/lib/snmp/test/snmp_compiler_test.erl b/lib/snmp/test/snmp_compiler_test.erl index ad77b01362..7c1b278ac7 100644 --- a/lib/snmp/test/snmp_compiler_test.erl +++ b/lib/snmp/test/snmp_compiler_test.erl @@ -38,7 +38,7 @@ %%---------------------------------------------------------------------- -export([ all/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, description/1, oid_conflicts/1, @@ -80,7 +80,7 @@ init_per_testcase(_Case, Config) when is_list(Config) -> ?line ok = file:make_dir(CompDir), [{comp_dir, CompDir},{mib_dir, MibDir}|Config]. -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> CompDir = ?config(comp_dir, Config), ?line ok = ?DEL_DIR(CompDir), lists:keydelete(comp_dir, 1, Config). diff --git a/lib/snmp/test/snmp_conf_test.erl b/lib/snmp/test/snmp_conf_test.erl index d2f9631947..90416919d0 100644 --- a/lib/snmp/test/snmp_conf_test.erl +++ b/lib/snmp/test/snmp_conf_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -38,7 +38,7 @@ %%---------------------------------------------------------------------- -export([ all/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, check_mandatory/1, check_integer1/1, @@ -80,7 +80,7 @@ init_per_testcase(_Case, Config) when is_list(Config) -> Config. -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> Config. %%====================================================================== diff --git a/lib/snmp/test/snmp_log_test.erl b/lib/snmp/test/snmp_log_test.erl index 91bdc3e849..dd2f27862e 100644 --- a/lib/snmp/test/snmp_log_test.erl +++ b/lib/snmp/test/snmp_log_test.erl @@ -40,7 +40,7 @@ %% External exports %%---------------------------------------------------------------------- -export([ - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, all/1, open_and_close/1, @@ -97,7 +97,7 @@ init_per_testcase(Case, Config) when is_list(Config) -> Dog = ?WD_START(?MINS(5)), [{log_dir, CaseDir}, {watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> %% Leave the dirs created above (enable debugging of the test case(s)) Dog = ?config(watchdog, Config), ?WD_STOP(Dog), diff --git a/lib/snmp/test/snmp_manager_config_test.erl b/lib/snmp/test/snmp_manager_config_test.erl index d5dc1387f7..f3a4d70ef8 100644 --- a/lib/snmp/test/snmp_manager_config_test.erl +++ b/lib/snmp/test/snmp_manager_config_test.erl @@ -43,7 +43,7 @@ -export([ all/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, start_and_stop/1, @@ -150,8 +150,8 @@ init_per_testcase(Case, Config) when is_list(Config) -> {manager_log_dir, MgrLogDir} | Config]. -fin_per_testcase(Case, Config) when is_list(Config) -> - p("fin_per_testcase -> Case: ~p", [Case]), +end_per_testcase(Case, Config) when is_list(Config) -> + p("end_per_testcase -> Case: ~p", [Case]), %% The cleanup is removed due to some really discusting NFS behaviour... %% CaseTopDir = ?config(manager_dir, Config), %% ?line ok = ?DEL_DIR(CaseTopDir), diff --git a/lib/snmp/test/snmp_manager_test.erl b/lib/snmp/test/snmp_manager_test.erl index cef96417dc..83e861589d 100644 --- a/lib/snmp/test/snmp_manager_test.erl +++ b/lib/snmp/test/snmp_manager_test.erl @@ -44,7 +44,7 @@ %%---------------------------------------------------------------------- -export([ all/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, start_and_stop_tests/1, simple_start_and_stop1/1, @@ -289,18 +289,18 @@ init_per_testcase3(Case, Config) -> Config end. -fin_per_testcase(Case, Config) when is_list(Config) -> +end_per_testcase(Case, Config) when is_list(Config) -> ?DBG("fin [~w] Nodes [1]: ~p", [Case, erlang:nodes()]), Dog = ?config(watchdog, Config), ?WD_STOP(Dog), Conf1 = lists:keydelete(watchdog, 1, Config), - Conf2 = fin_per_testcase2(Case, Conf1), + Conf2 = end_per_testcase2(Case, Conf1), ?DBG("fin [~w] Nodes [2]: ~p", [Case, erlang:nodes()]), %% TopDir = ?config(top_dir, Conf2), %% ?DEL_DIR(TopDir), Conf2. -fin_per_testcase2(Case, Config) -> +end_per_testcase2(Case, Config) -> OldApiCases = [ simple_sync_get1, diff --git a/lib/snmp/test/snmp_manager_user.erl b/lib/snmp/test/snmp_manager_user.erl index 07b56bde39..b0e192344d 100644 --- a/lib/snmp/test/snmp_manager_user.erl +++ b/lib/snmp/test/snmp_manager_user.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/snmp/test/snmp_manager_user_old.erl b/lib/snmp/test/snmp_manager_user_old.erl index b53514d699..edffc80dd4 100755 --- a/lib/snmp/test/snmp_manager_user_old.erl +++ b/lib/snmp/test/snmp_manager_user_old.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/snmp/test/snmp_manager_user_test.erl b/lib/snmp/test/snmp_manager_user_test.erl index 0f47d70873..b80af16485 100644 --- a/lib/snmp/test/snmp_manager_user_test.erl +++ b/lib/snmp/test/snmp_manager_user_test.erl @@ -37,7 +37,7 @@ -export([ all/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, register_user/1, simple_register_and_unregister1/1, @@ -123,8 +123,8 @@ init_per_testcase(Case, Config) when is_list(Config) -> {manager_log_dir, MgrLogDir} | Config]. -fin_per_testcase(Case, Config) when is_list(Config) -> - p("fin_per_testcase -> Case: ~p", [Case]), +end_per_testcase(Case, Config) when is_list(Config) -> + p("end_per_testcase -> Case: ~p", [Case]), % MgrTopDir = ?config(manager_dir, Config), % ?DEL_DIR(MgrTopDir), Config. diff --git a/lib/snmp/test/snmp_manager_user_test_lib.erl b/lib/snmp/test/snmp_manager_user_test_lib.erl index a49fe93178..bf8fff7c4c 100644 --- a/lib/snmp/test/snmp_manager_user_test_lib.erl +++ b/lib/snmp/test/snmp_manager_user_test_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/snmp/test/snmp_note_store_test.erl b/lib/snmp/test/snmp_note_store_test.erl index 8686a47468..763c708bd6 100644 --- a/lib/snmp/test/snmp_note_store_test.erl +++ b/lib/snmp/test/snmp_note_store_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -33,7 +33,7 @@ %% External exports %%---------------------------------------------------------------------- -export([ - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, all/1, start_and_stop/1, notes/1, @@ -63,7 +63,7 @@ init_per_testcase(_Case, Config) when is_list(Config) -> Config. -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> Config. %%====================================================================== diff --git a/lib/snmp/test/snmp_pdus_test.erl b/lib/snmp/test/snmp_pdus_test.erl index 6dc5b779aa..7041552abf 100644 --- a/lib/snmp/test/snmp_pdus_test.erl +++ b/lib/snmp/test/snmp_pdus_test.erl @@ -38,7 +38,7 @@ tickets/1, otp7575/1, otp8563/1, - init_per_testcase/2, fin_per_testcase/2 + init_per_testcase/2, end_per_testcase/2 ]). @@ -64,7 +64,7 @@ init_per_testcase(_Case, Config) when is_list(Config) -> Config. -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> Config. diff --git a/lib/snmp/test/snmp_test_manager.erl b/lib/snmp/test/snmp_test_manager.erl index 9d9c52ef8d..4cc6d36acc 100644 --- a/lib/snmp/test/snmp_test_manager.erl +++ b/lib/snmp/test/snmp_test_manager.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/snmp/test/snmp_test_server.erl b/lib/snmp/test/snmp_test_server.erl index d0a5185452..ffbd2126a3 100644 --- a/lib/snmp/test/snmp_test_server.erl +++ b/lib/snmp/test/snmp_test_server.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -33,7 +33,7 @@ fatal_skip/3, init_per_testcase/2, - fin_per_testcase/2 + end_per_testcase/2 ]). -include("snmp_test_lib.hrl"). @@ -229,7 +229,7 @@ eval(Mod, Fun, Config) -> Eval = fun() -> do_eval(Self, Mod, Fun, Config2) end, Pid = spawn_link(Eval), R = wait_for_evaluator(Pid, Mod, Fun, Config2, []), - Mod:fin_per_testcase(Fun, Config2), + Mod:end_per_testcase(Fun, Config2), global:unregister_name(?TEST_CASE_SUP), process_flag(trap_exit, Flag), R. @@ -361,7 +361,7 @@ init_per_testcase(_Case, Config) -> global:register_name(?GLOBAL_LOGGER, group_leader()), Config. -fin_per_testcase(_Case, _Config) -> +end_per_testcase(_Case, _Config) -> global:unregister_name(?GLOBAL_LOGGER), ok. diff --git a/lib/snmp/test/snmp_test_suite.erl b/lib/snmp/test/snmp_test_suite.erl index a6e203eba3..77aaa508ad 100644 --- a/lib/snmp/test/snmp_test_suite.erl +++ b/lib/snmp/test/snmp_test_suite.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2009. All Rights Reserved. +%% Copyright Ericsson AB 2008-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -29,7 +29,7 @@ behaviour_info(callbacks) -> [ {all, 1}, {init_per_testcase, 2}, - {fin_per_testcase, 2} + {end_per_testcase, 2} ]; behaviour_info(_Other) -> undefined. diff --git a/lib/snmp/test/test1.erl b/lib/snmp/test/test1.erl index b26b03d4ce..23cfaf6aaa 100644 --- a/lib/snmp/test/test1.erl +++ b/lib/snmp/test/test1.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/snmp/test/test2.erl b/lib/snmp/test/test2.erl index dc010cfa11..a33208af7b 100644 --- a/lib/snmp/test/test2.erl +++ b/lib/snmp/test/test2.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in -- cgit v1.2.3 From f46420139c89668f24f9b86e80f0f93fbbb9827b Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:34:20 +0200 Subject: Update snmp tests to conform with common_test standard --- lib/snmp/test/snmp.spec | 2 +- lib/snmp/test/snmp_SUITE.erl | 144 +++---- lib/snmp/test/snmp_agent_mibs_test.erl | 47 +-- lib/snmp/test/snmp_agent_ms_test.erl | 474 +++++++++++---------- lib/snmp/test/snmp_agent_mt_test.erl | 474 +++++++++++---------- lib/snmp/test/snmp_agent_nfilter_test.erl | 8 +- lib/snmp/test/snmp_agent_test.erl | 642 ++++++++++++----------------- lib/snmp/test/snmp_agent_v2_test.erl | 474 +++++++++++---------- lib/snmp/test/snmp_agent_v3_test.erl | 474 +++++++++++---------- lib/snmp/test/snmp_app_test.erl | 54 +-- lib/snmp/test/snmp_appup_test.erl | 30 +- lib/snmp/test/snmp_compiler_test.erl | 35 +- lib/snmp/test/snmp_conf_test.erl | 40 +- lib/snmp/test/snmp_log_test.erl | 65 ++- lib/snmp/test/snmp_manager_config_test.erl | 155 +++---- lib/snmp/test/snmp_manager_test.erl | 202 ++++----- lib/snmp/test/snmp_manager_user_test.erl | 79 ++-- lib/snmp/test/snmp_note_store_test.erl | 24 +- lib/snmp/test/snmp_pdus_test.erl | 29 +- 19 files changed, 1585 insertions(+), 1867 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/test/snmp.spec b/lib/snmp/test/snmp.spec index 0af52c139e..07492337fb 100644 --- a/lib/snmp/test/snmp.spec +++ b/lib/snmp/test/snmp.spec @@ -1 +1 @@ -{topcase, {dir, "../snmp_test"}}. +{suites,"snmp_test",all}. diff --git a/lib/snmp/test/snmp_SUITE.erl b/lib/snmp/test/snmp_SUITE.erl index 5cf0af7992..4261a1c155 100644 --- a/lib/snmp/test/snmp_SUITE.erl +++ b/lib/snmp/test/snmp_SUITE.erl @@ -19,27 +19,26 @@ -module(snmp_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2 ]). --export([app/1, compiler/1, misc/1, agent/1, manager/1]). +-export([]). -export([ - app_test/1, - appup_test/1, - compiler_test/1, - conf_test/1, - pdus_test/1, - log_test/1, - note_store_test/1, - mibs_test/1, - nfilter_test/1, - agent_test/1, - manager_config_test/1, - manager_user_test/1, - manager_test/1 - ]). + + + + + + + + + + + + +]). %% %% ----- @@ -55,103 +54,74 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(doc) -> - ["Test suites for the snmp application.", - "There are eight different sub test-suites."]; - -all(suite) -> - [ - app, - compiler, - misc, - agent, - manager - - ]. - -app(suite) -> - [ - app_test, - appup_test - ]. - -compiler(suite) -> - [ - compiler_test - ]. - -misc(suite) -> - [ - conf_test, - pdus_test, - log_test, - note_store_test - ]. - -agent(suite) -> - [ - mibs_test, - nfilter_test, - agent_test - ]. +all() -> +[{group, app}, {group, compiler}, {group, misc}, + {group, agent}, {group, manager}]. -manager(suite) -> - [ - manager_config_test, - manager_user_test, - manager_test - ]. +groups() -> + [{app, [], [{group, app_test}, {group, appup_test}]}, + {compiler, [], [{group, compiler_test}]}, + {misc, [], + [{group, conf_test}, {group, pdus_test}, + {group, log_test}, {group, note_store_test}]}, + {agent, [], + [{group, mibs_test}, {group, nfilter_test}, + {group, agent_test}]}, + {manager, [], + [{group, manager_config_test}, + {group, manager_user_test}, {group, manager_test}]}, + {app_test, [], [{snmp_app_test, all}]}, + {appup_test, [], [{snmp_appup_test, all}]}, + {compiler_test, [], [{snmp_compiler_test, all}]}, + {conf_test, [], [{snmp_conf_test, all}]}, + {pdus_test, [], [{snmp_pdus_test, all}]}, + {log_test, [], [{snmp_log_test, all}]}, + {note_store_test, [], [{snmp_note_store_test, all}]}, + {mibs_test, [], [{snmp_agent_mibs_test, all}]}, + {nfilter_test, [], [{snmp_agent_nfilter_test, all}]}, + {agent_test, [], [{snmp_agent_test, all}]}, + {manager_config_test, [], + [{snmp_manager_config_test, all}]}, + {manager_user_test, [], + [{snmp_manager_user_test, all}]}, + {manager_test, [], [{snmp_manager_test, all}]}]. +init_per_group(_GroupName, Config) -> + Config. -app_test(suite) -> - [{snmp_app_test, all}]. +end_per_group(_GroupName, Config) -> + Config. -appup_test(suite) -> - [{snmp_appup_test, all}]. -compiler_test(suite) -> - [{snmp_compiler_test, all}]. -conf_test(suite) -> - [{snmp_conf_test, all}]. -pdus_test(suite) -> - [{snmp_pdus_test, all}]. -log_test(suite) -> - [{snmp_log_test, all}]. + -note_store_test(suite) -> - [{snmp_note_store_test, all}]. + + -mibs_test(suite) -> - [{snmp_agent_mibs_test, all}]. + + -nfilter_test(suite) -> - [{snmp_agent_nfilter_test, all}]. -agent_test(suite) -> - [{snmp_agent_test, all}]. -manager_config_test(suite) -> - [{snmp_manager_config_test, all}]. -manager_user_test(suite) -> - [{snmp_manager_user_test, all}]. + + -manager_test(suite) -> - [{snmp_manager_test, all}]. + diff --git a/lib/snmp/test/snmp_agent_mibs_test.erl b/lib/snmp/test/snmp_agent_mibs_test.erl index c28fa81ae0..3e48130fac 100644 --- a/lib/snmp/test/snmp_agent_mibs_test.erl +++ b/lib/snmp/test/snmp_agent_mibs_test.erl @@ -26,7 +26,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -include_lib("snmp/include/snmp_types.hrl"). -include_lib("snmp/include/SNMP-COMMUNITY-MIB.hrl"). @@ -39,12 +39,12 @@ %% External exports %%---------------------------------------------------------------------- -export([ - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, - init_all/1, finish_all/1, + init_per_suite/1, end_per_suite/1, start_and_stop/1, - size_check/1, + size_check_ets/1, size_check_dets/1, size_check_mnesia/1, @@ -58,8 +58,6 @@ %%---------------------------------------------------------------------- %% Internal exports %%---------------------------------------------------------------------- --export([ - ]). %%---------------------------------------------------------------------- %% Macros @@ -121,20 +119,25 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %% Test case definitions %%====================================================================== -all(suite) -> - {conf, init_all, cases(), finish_all}. +all() -> +cases(). + +groups() -> + [{size_check, [], + [size_check_ets, size_check_dets, size_check_mnesia]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -cases() -> - [ - start_and_stop, - load_unload, - size_check, - me_lookup, - which_mib, - cache_test - ]. +cases() -> +[start_and_stop, load_unload, {group, size_check}, + me_lookup, which_mib, cache_test]. -init_all(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> %% Data dir points wrong DataDir0 = ?config(data_dir, Config), DataDir1 = filename:split(filename:absname(DataDir0)), @@ -142,7 +145,7 @@ init_all(Config) when is_list(Config) -> DataDir = filename:join(lists:reverse(DataDir2) ++ [?snmp_test_data]), [{snmp_data_dir, DataDir ++ "/"}|Config]. -finish_all(Config) when is_list(Config) -> +end_per_suite(Config) when is_list(Config) -> lists:keydelete(snmp_data_dir, 1, Config). @@ -217,12 +220,6 @@ load_unload(Config) when is_list(Config) -> %% --------------------------------------------------------------------- -size_check(suite) -> - [ - size_check_ets, - size_check_dets, - size_check_mnesia - ]. size_check_ets(suite) -> []; diff --git a/lib/snmp/test/snmp_agent_ms_test.erl b/lib/snmp/test/snmp_agent_ms_test.erl index cc4cdae32f..1f34f1c8d1 100644 --- a/lib/snmp/test/snmp_agent_ms_test.erl +++ b/lib/snmp/test/snmp_agent_ms_test.erl @@ -28,7 +28,7 @@ -define(application, snmp). -include_lib("kernel/include/file.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -define(SNMP_USE_V3, true). -include_lib("snmp/include/snmp_types.hrl"). @@ -83,10 +83,143 @@ _ -> V3 end). -all(suite) -> {req, - [mnesia, distribution, - {local_slave_nodes, 2}, {time, 360}], - [{conf, init_all, cases(), finish_all}]}. +all() -> +[cases()]. + +groups() -> + [{mib_storage, [], + [{group, mib_storage_ets}, {group, mib_storage_dets}, + {group, mib_storage_mnesia}, + {group, mib_storage_size_check_ets}, + {group, mib_storage_size_check_dets}, + {group, mib_storage_size_check_mnesia}, + {group, mib_storage_varm_dets}, + {group, mib_storage_varm_mnesia}]}, + {mib_storage_ets, [], mib_storage_ets_cases()}, + {mib_storage_dets, [], mib_storage_dets_cases()}, + {mib_storage_mnesia, [], mib_storage_mnesia_cases()}, + {mib_storage_size_check_ets, [], + mse_size_check_cases()}, + {mib_storage_size_check_dets, [], + msd_size_check_cases()}, + {mib_storage_size_check_mnesia, [], + msm_size_check_cases()}, + {mib_storage_varm_dets, [], + varm_mib_storage_dets_cases()}, + {mib_storage_varm_mnesia, [], + varm_mib_storage_mnesia_cases()}, + {test_v1, [], v1_cases()}, {test_v2, [], v2_cases()}, + {test_v1_v2, [], v1_v2_cases()}, + {test_v3, [], v3_cases()}, + {test_multi_threaded, [], mt_cases()}, + {multiple_reqs, [], mul_cases()}, + {multiple_reqs_2, [], mul_cases_2()}, + {v2_inform, [], [v2_inform_i]}, + {v3_security, [], + [v3_crypto_basic, v3_md5_auth, v3_sha_auth, + v3_des_priv]}, + {standard_mibs, [], + [snmp_standard_mib, snmp_community_mib, + snmp_framework_mib, snmp_target_mib, + snmp_notification_mib, snmp_view_based_acm_mib]}, + {standard_mibs_2, [], + [snmpv2_mib_2, snmp_community_mib_2, + snmp_framework_mib_2, snmp_target_mib_2, + snmp_notification_mib_2, snmp_view_based_acm_mib_2]}, + {standard_mibs_3, [], + [snmpv2_mib_3, snmp_framework_mib_3, snmp_mpd_mib_3, + snmp_target_mib_3, snmp_notification_mib_3, + snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]}, + {reported_bugs, [], + [otp_1128, otp_1129, otp_1131, otp_1162, otp_1222, + otp_1298, otp_1331, otp_1338, otp_1342, otp_2776, + otp_2979, otp_3187, otp_3725]}, + {reported_bugs_2, [], + [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, + otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, + otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]}, + {reported_bugs_3, [], + [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, + otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, + otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, + otp_3542]}, + {tickets, [], [{group, otp_4394}]}, + {otp_4394, [], [otp_4394_test]}]. + +init_per_group(otp_4394, Config) -> + init_otp_4394(Config); +init_per_group(v2_inform, Config) -> + init_v2_inform(Config); +init_per_group(multiple_reqs_2, Config) -> + init_mul(Config); +init_per_group(multiple_reqs, Config) -> + init_mul(Config); +init_per_group(test_multi_threaded, Config) -> + init_mt(Config); +init_per_group(test_v3, Config) -> + init_v3(Config); +init_per_group(test_v1_v2, Config) -> + init_v1_v2(Config); +init_per_group(test_v2, Config) -> + init_v2(Config); +init_per_group(test_v1, Config) -> + init_v1(Config); +init_per_group(mib_storage_varm_mnesia, Config) -> + init_varm_mib_storage_mnesia(Config); +init_per_group(mib_storage_varm_dets, Config) -> + init_varm_mib_storage_dets(Config); +init_per_group(mib_storage_size_check_mnesia, Config) -> + init_size_check_msm(Config); +init_per_group(mib_storage_size_check_dets, Config) -> + init_size_check_msd(Config); +init_per_group(mib_storage_size_check_ets, Config) -> + init_size_check_mse(Config); +init_per_group(mib_storage_mnesia, Config) -> + init_mib_storage_mnesia(Config); +init_per_group(mib_storage_dets, Config) -> + init_mib_storage_dets(Config); +init_per_group(mib_storage_ets, Config) -> + init_mib_storage_ets(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(otp_4394, Config) -> + finish_otp_4394(Config); +end_per_group(v2_inform, Config) -> + finish_v2_inform(Config); +end_per_group(multiple_reqs_2, Config) -> + finish_mul(Config); +end_per_group(multiple_reqs, Config) -> + finish_mul(Config); +end_per_group(test_multi_threaded, Config) -> + finish_mt(Config); +end_per_group(test_v3, Config) -> + finish_v3(Config); +end_per_group(test_v1_v2, Config) -> + finish_v1_v2(Config); +end_per_group(test_v2, Config) -> + finish_v2(Config); +end_per_group(test_v1, Config) -> + finish_v1(Config); +end_per_group(mib_storage_varm_mnesia, Config) -> + finish_varm_mib_storage_mnesia(Config); +end_per_group(mib_storage_varm_dets, Config) -> + finish_varm_mib_storage_dets(Config); +end_per_group(mib_storage_size_check_mnesia, Config) -> + finish_size_check_msm(Config); +end_per_group(mib_storage_size_check_dets, Config) -> + finish_size_check_msd(Config); +end_per_group(mib_storage_size_check_ets, Config) -> + finish_size_check_mse(Config); +end_per_group(mib_storage_mnesia, Config) -> + finish_mib_storage_mnesia(Config); +end_per_group(mib_storage_dets, Config) -> + finish_mib_storage_dets(Config); +end_per_group(mib_storage_ets, Config) -> + finish_mib_storage_ets(Config); +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) when list(Config) -> Dog = ?t:timetrap(?t:minutes(6)), @@ -97,25 +230,18 @@ end_per_testcase(_Case, Config) when list(Config) -> ?t:timetrap_cancel(Dog), Config. -cases() -> - case ?OSTYPE() of - vxworks -> - %% No crypto app, so skip v3 testcases - [ - app_info, - test_v1, test_v2, test_v1_v2, - test_multi_threaded, - mib_storage, - tickets]; - _Else -> - [ - app_info, - test_v1, test_v2, test_v1_v2, test_v3, - test_multi_threaded, - mib_storage, - tickets - ] - end. +cases() -> +case ?OSTYPE() of + vxworks -> + [app_info, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_multi_threaded}, + {group, mib_storage}, {group, tickets}]; + _Else -> + [app_info, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_v3}, + {group, test_multi_threaded}, {group, mib_storage}, + {group, tickets}] +end. %%%----------------------------------------------------------------- @@ -460,144 +586,56 @@ delete_mib_storage_mnesia_tables() -> %% , and a second version _2. There may be several %% versions as well, _N. %%----------------------------------------------------------------- -mib_storage(suite) -> [ - mib_storage_ets, - mib_storage_dets, - mib_storage_mnesia, - mib_storage_size_check_ets, - mib_storage_size_check_dets, - mib_storage_size_check_mnesia, - mib_storage_varm_dets, - mib_storage_varm_mnesia - ]. - -mib_storage_ets(suite) -> {req, [], {conf, init_mib_storage_ets, - mib_storage_ets_cases(), - finish_mib_storage_ets}}. - -mib_storage_dets(suite) -> {req, [], {conf, init_mib_storage_dets, - mib_storage_dets_cases(), - finish_mib_storage_dets}}. - -mib_storage_mnesia(suite) -> {req, [], {conf, init_mib_storage_mnesia, - mib_storage_mnesia_cases(), - finish_mib_storage_mnesia}}. - -mib_storage_size_check_ets(suite) -> - {req, [], {conf, - init_size_check_mse, - mse_size_check_cases(), - finish_size_check_mse}}. - -mib_storage_size_check_dets(suite) -> - {req, [], {conf, - init_size_check_msd, - msd_size_check_cases(), - finish_size_check_msd}}. - -mib_storage_size_check_mnesia(suite) -> - {req, [], {conf, - init_size_check_msm, - msm_size_check_cases(), - finish_size_check_msm}}. - -mib_storage_varm_dets(suite) -> - {req, [], {conf, - init_varm_mib_storage_dets, - varm_mib_storage_dets_cases(), - finish_varm_mib_storage_dets}}. - -mib_storage_varm_mnesia(suite) -> - {req, [], {conf, - init_varm_mib_storage_mnesia, - varm_mib_storage_mnesia_cases(), - finish_varm_mib_storage_mnesia}}. - -mib_storage_ets_cases() -> - [ - mse_simple, - mse_v1_processing, - mse_big, - mse_big2, - mse_loop_mib, - mse_api, - mse_sa_register, - mse_v1_trap, - mse_sa_error, - mse_next_across_sa, - mse_undo, - mse_standard_mib, - mse_community_mib, - mse_framework_mib, - mse_target_mib, - mse_notification_mib, - mse_view_based_acm_mib, - mse_sparse_table, - mse_me_of, - mse_mib_of]. - -mib_storage_dets_cases() -> - [ - msd_simple, - msd_v1_processing, - msd_big, - msd_big2, - msd_loop_mib, - msd_api, - msd_sa_register, - msd_v1_trap, - msd_sa_error, - msd_next_across_sa, - msd_undo, - msd_standard_mib, - msd_community_mib, - msd_framework_mib, - msd_target_mib, - msd_notification_mib, - msd_view_based_acm_mib, - msd_sparse_table, - msd_me_of, - msd_mib_of - ]. - -mib_storage_mnesia_cases() -> - [ - msm_simple, - msm_v1_processing, - msm_big, - msm_big2, - msm_loop_mib, - msm_api, - msm_sa_register, - msm_v1_trap, - msm_sa_error, - msm_next_across_sa, - msm_undo, - msm_standard_mib, - msm_community_mib, - msm_framework_mib, - msm_target_mib, - msm_notification_mib, - msm_view_based_acm_mib, - msm_sparse_table, - msm_me_of, - msm_mib_of - ]. - -mse_size_check_cases() -> - [mse_size_check]. - -msd_size_check_cases() -> - [msd_size_check]. - -msm_size_check_cases() -> - [msm_size_check]. - -varm_mib_storage_dets_cases() -> - [msd_varm_mib_start]. - -varm_mib_storage_mnesia_cases() -> - [msm_varm_mib_start]. + + + + + + + + + +mib_storage_ets_cases() -> +[mse_simple, mse_v1_processing, mse_big, mse_big2, + mse_loop_mib, mse_api, mse_sa_register, mse_v1_trap, + mse_sa_error, mse_next_across_sa, mse_undo, + mse_standard_mib, mse_community_mib, mse_framework_mib, + mse_target_mib, mse_notification_mib, + mse_view_based_acm_mib, mse_sparse_table, mse_me_of, + mse_mib_of]. + +mib_storage_dets_cases() -> +[msd_simple, msd_v1_processing, msd_big, msd_big2, + msd_loop_mib, msd_api, msd_sa_register, msd_v1_trap, + msd_sa_error, msd_next_across_sa, msd_undo, + msd_standard_mib, msd_community_mib, msd_framework_mib, + msd_target_mib, msd_notification_mib, + msd_view_based_acm_mib, msd_sparse_table, msd_me_of, + msd_mib_of]. + +mib_storage_mnesia_cases() -> +[msm_simple, msm_v1_processing, msm_big, msm_big2, + msm_loop_mib, msm_api, msm_sa_register, msm_v1_trap, + msm_sa_error, msm_next_across_sa, msm_undo, + msm_standard_mib, msm_community_mib, msm_framework_mib, + msm_target_mib, msm_notification_mib, + msm_view_based_acm_mib, msm_sparse_table, msm_me_of, + msm_mib_of]. + +mse_size_check_cases() -> +[mse_size_check]. + +msd_size_check_cases() -> +[msd_size_check]. + +msm_size_check_cases() -> +[msm_size_check]. + +varm_mib_storage_dets_cases() -> +[msd_varm_mib_start]. + +varm_mib_storage_mnesia_cases() -> +[msm_varm_mib_start]. init_mib_storage_ets(Config) when list(Config) -> ?LOG("init_mib_storage_ets -> entry", []), @@ -1099,20 +1137,14 @@ app_dir(App) -> end. -test_v1(suite) -> {req, [], {conf, init_v1, v1_cases(), finish_v1}}. %v1_cases() -> [loop_mib]; -v1_cases() -> - [simple, - db_notify_client, - v1_processing, big, big2, loop_mib, - api, subagent, mnesia, multiple_reqs, - sa_register, v1_trap, sa_error, next_across_sa, undo, reported_bugs, - standard_mibs, sparse_table, cnt_64, - opaque, - % opaque]. - - change_target_addr_config]. +v1_cases() -> +[simple, db_notify_client, v1_processing, big, big2, + loop_mib, api, subagent, mnesia, {group, multiple_reqs}, + sa_register, v1_trap, sa_error, next_across_sa, undo, + {group, reported_bugs}, {group, standard_mibs}, + sparse_table, cnt_64, opaque, change_target_addr_config]. init_v1(Config) when list(Config) -> ?line SaNode = ?config(snmp_sa, Config), @@ -1129,15 +1161,15 @@ finish_v1(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v2(suite) -> {req, [], {conf, init_v2, v2_cases(), finish_v2}}. %v2_cases() -> [loop_mib_2]; -v2_cases() -> - [simple_2, v2_processing, big_2, big2_2, loop_mib_2, - api_2, subagent_2, mnesia_2, - multiple_reqs_2, sa_register_2, v2_trap, v2_inform, sa_error_2, - next_across_sa_2, undo_2, reported_bugs_2, standard_mibs_2, - v2_types, implied, sparse_table_2, cnt_64_2, opaque_2, v2_caps]. +v2_cases() -> +[simple_2, v2_processing, big_2, big2_2, loop_mib_2, + api_2, subagent_2, mnesia_2, {group, multiple_reqs_2}, + sa_register_2, v2_trap, {group, v2_inform}, sa_error_2, + next_across_sa_2, undo_2, {group, reported_bugs_2}, + {group, standard_mibs_2}, v2_types, implied, + sparse_table_2, cnt_64_2, opaque_2, v2_caps]. init_v2(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1154,10 +1186,9 @@ finish_v2(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v1_v2(suite) -> {req, [], {conf, init_v1_v2, v1_v2_cases(), finish_v1_v2}}. -v1_v2_cases() -> - [simple_bi]. +v1_v2_cases() -> +[simple_bi]. init_v1_v2(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1174,16 +1205,16 @@ finish_v1_v2(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v3(suite) -> {req, [], {conf, init_v3, v3_cases(), finish_v3}}. %v3_cases() -> [loop_mib_3]; -v3_cases() -> - [simple_3, v3_processing, - big_3, big2_3, api_3, subagent_3, mnesia_3, loop_mib_3, - multiple_reqs_3, sa_register_3, v3_trap, v3_inform, sa_error_3, - next_across_sa_3, undo_3, reported_bugs_3, standard_mibs_3, - v3_security, - v2_types_3, implied_3, sparse_table_3, cnt_64_3, opaque_3, v2_caps_3]. +v3_cases() -> +[simple_3, v3_processing, big_3, big2_3, api_3, + subagent_3, mnesia_3, loop_mib_3, multiple_reqs_3, + sa_register_3, v3_trap, v3_inform, sa_error_3, + next_across_sa_3, undo_3, {group, reported_bugs_3}, + {group, standard_mibs_3}, {group, v3_security}, + v2_types_3, implied_3, sparse_table_3, cnt_64_3, + opaque_3, v2_caps_3]. init_v3(Config) when list(Config) -> %% Make sure crypto works, otherwise start_agent will fail @@ -1221,10 +1252,9 @@ finish_v3(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_multi_threaded(suite) -> {req, [], {conf, init_mt, mt_cases(), finish_mt}}. -mt_cases() -> - [multi_threaded, mt_trap]. +mt_cases() -> +[multi_threaded, mt_trap]. init_mt(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1739,21 +1769,19 @@ mnesia_2(X) -> mnesia(X). mnesia_3(X) -> mnesia(X). -multiple_reqs(suite) -> - {req, [], {conf, init_mul, mul_cases(), finish_mul}}. -mul_cases() -> - [mul_get, mul_get_err, mul_next, mul_next_err, mul_set_err]. +mul_cases() -> +[mul_get, mul_get_err, mul_next, mul_next_err, + mul_set_err]. -multiple_reqs_2(suite) -> - {req, [], {conf, init_mul, mul_cases_2(), finish_mul}}. multiple_reqs_3(_X) -> {req, [], {conf, init_mul, mul_cases_3(), finish_mul}}. -mul_cases_2() -> - [mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, mul_set_err_2]. +mul_cases_2() -> +[mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, + mul_set_err_2]. mul_cases_3() -> @@ -1939,8 +1967,6 @@ v2_trap(Config) when list(Config) -> v3_trap(X) -> v2_trap(X). -v2_inform(suite) -> - {req, [], {conf, init_v2_inform, [v2_inform_i], finish_v2_inform}}. v3_inform(_X) -> %% v2_inform(X). @@ -2112,7 +2138,6 @@ v3_processing(Config) when list(Config) -> %% accomplished by the first inform sent. That one will generate a %% report, which makes it in sync. The notification-generating %% application times out, and send again. This time it'll work. -v3_security(suite) -> [v3_crypto_basic, v3_md5_auth, v3_sha_auth, v3_des_priv]. v3_crypto_basic(suite) -> []; v3_crypto_basic(_Config) -> @@ -3591,22 +3616,8 @@ bad_return() -> %%% Note that many of the functions in the standard mib is %%% already tested by the normal tests. %%%----------------------------------------------------------------- -standard_mibs(suite) -> - [snmp_standard_mib, snmp_community_mib, - snmp_framework_mib, - snmp_target_mib, snmp_notification_mib, - snmp_view_based_acm_mib]. - -standard_mibs_2(suite) -> - [snmpv2_mib_2, snmp_community_mib_2, - snmp_framework_mib_2, - snmp_target_mib_2, snmp_notification_mib_2, - snmp_view_based_acm_mib_2]. - -standard_mibs_3(suite) -> - [snmpv2_mib_3,snmp_framework_mib_3, snmp_mpd_mib_3, - snmp_target_mib_3, snmp_notification_mib_3, - snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]. + + %%----------------------------------------------------------------- %% For this test, the agent is configured for v1. @@ -4527,27 +4538,12 @@ loop_it_2(Oid, N) -> %%% Testing of reported bugs and other tickets. %%%----------------------------------------------------------------- -reported_bugs(suite) -> - [otp_1128, otp_1129, otp_1131, otp_1162, - otp_1222, otp_1298, otp_1331, otp_1338, - otp_1342, otp_2776, otp_2979, otp_3187, otp_3725]. -reported_bugs_2(suite) -> - [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, - otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, - otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]. -reported_bugs_3(suite) -> - [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, - otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, - otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, - otp_3542]. %% These are (ticket) test cases where the initiation has to be done %% individually. -tickets(suite) -> - [otp_4394]. %%----------------------------------------------------------------- %% Ticket: OTP-1128 @@ -4971,10 +4967,6 @@ otp_3725_test(MaNode) -> %%----------------------------------------------------------------- -otp_4394(suite) -> {req, [], {conf, - init_otp_4394, - [otp_4394_test], - finish_otp_4394}}. init_otp_4394(Config) when list(Config) -> ?DBG("init_otp_4394 -> entry with" diff --git a/lib/snmp/test/snmp_agent_mt_test.erl b/lib/snmp/test/snmp_agent_mt_test.erl index c664dba288..4f125c0017 100644 --- a/lib/snmp/test/snmp_agent_mt_test.erl +++ b/lib/snmp/test/snmp_agent_mt_test.erl @@ -28,7 +28,7 @@ -define(application, snmp). -include_lib("kernel/include/file.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -define(SNMP_USE_V3, true). -include_lib("snmp/include/snmp_types.hrl"). @@ -83,10 +83,143 @@ _ -> V3 end). -all(suite) -> {req, - [mnesia, distribution, - {local_slave_nodes, 2}, {time, 360}], - [{conf, init_all, cases(), finish_all}]}. +all() -> +[cases()]. + +groups() -> + [{mib_storage, [], + [{group, mib_storage_ets}, {group, mib_storage_dets}, + {group, mib_storage_mnesia}, + {group, mib_storage_size_check_ets}, + {group, mib_storage_size_check_dets}, + {group, mib_storage_size_check_mnesia}, + {group, mib_storage_varm_dets}, + {group, mib_storage_varm_mnesia}]}, + {mib_storage_ets, [], mib_storage_ets_cases()}, + {mib_storage_dets, [], mib_storage_dets_cases()}, + {mib_storage_mnesia, [], mib_storage_mnesia_cases()}, + {mib_storage_size_check_ets, [], + mse_size_check_cases()}, + {mib_storage_size_check_dets, [], + msd_size_check_cases()}, + {mib_storage_size_check_mnesia, [], + msm_size_check_cases()}, + {mib_storage_varm_dets, [], + varm_mib_storage_dets_cases()}, + {mib_storage_varm_mnesia, [], + varm_mib_storage_mnesia_cases()}, + {test_v1, [], v1_cases()}, {test_v2, [], v2_cases()}, + {test_v1_v2, [], v1_v2_cases()}, + {test_v3, [], v3_cases()}, + {test_multi_threaded, [], mt_cases()}, + {multiple_reqs, [], mul_cases()}, + {multiple_reqs_2, [], mul_cases_2()}, + {v2_inform, [], [v2_inform_i]}, + {v3_security, [], + [v3_crypto_basic, v3_md5_auth, v3_sha_auth, + v3_des_priv]}, + {standard_mibs, [], + [snmp_standard_mib, snmp_community_mib, + snmp_framework_mib, snmp_target_mib, + snmp_notification_mib, snmp_view_based_acm_mib]}, + {standard_mibs_2, [], + [snmpv2_mib_2, snmp_community_mib_2, + snmp_framework_mib_2, snmp_target_mib_2, + snmp_notification_mib_2, snmp_view_based_acm_mib_2]}, + {standard_mibs_3, [], + [snmpv2_mib_3, snmp_framework_mib_3, snmp_mpd_mib_3, + snmp_target_mib_3, snmp_notification_mib_3, + snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]}, + {reported_bugs, [], + [otp_1128, otp_1129, otp_1131, otp_1162, otp_1222, + otp_1298, otp_1331, otp_1338, otp_1342, otp_2776, + otp_2979, otp_3187, otp_3725]}, + {reported_bugs_2, [], + [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, + otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, + otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]}, + {reported_bugs_3, [], + [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, + otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, + otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, + otp_3542]}, + {tickets, [], [{group, otp_4394}]}, + {otp_4394, [], [otp_4394_test]}]. + +init_per_group(otp_4394, Config) -> + init_otp_4394(Config); +init_per_group(v2_inform, Config) -> + init_v2_inform(Config); +init_per_group(multiple_reqs_2, Config) -> + init_mul(Config); +init_per_group(multiple_reqs, Config) -> + init_mul(Config); +init_per_group(test_multi_threaded, Config) -> + init_mt(Config); +init_per_group(test_v3, Config) -> + init_v3(Config); +init_per_group(test_v1_v2, Config) -> + init_v1_v2(Config); +init_per_group(test_v2, Config) -> + init_v2(Config); +init_per_group(test_v1, Config) -> + init_v1(Config); +init_per_group(mib_storage_varm_mnesia, Config) -> + init_varm_mib_storage_mnesia(Config); +init_per_group(mib_storage_varm_dets, Config) -> + init_varm_mib_storage_dets(Config); +init_per_group(mib_storage_size_check_mnesia, Config) -> + init_size_check_msm(Config); +init_per_group(mib_storage_size_check_dets, Config) -> + init_size_check_msd(Config); +init_per_group(mib_storage_size_check_ets, Config) -> + init_size_check_mse(Config); +init_per_group(mib_storage_mnesia, Config) -> + init_mib_storage_mnesia(Config); +init_per_group(mib_storage_dets, Config) -> + init_mib_storage_dets(Config); +init_per_group(mib_storage_ets, Config) -> + init_mib_storage_ets(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(otp_4394, Config) -> + finish_otp_4394(Config); +end_per_group(v2_inform, Config) -> + finish_v2_inform(Config); +end_per_group(multiple_reqs_2, Config) -> + finish_mul(Config); +end_per_group(multiple_reqs, Config) -> + finish_mul(Config); +end_per_group(test_multi_threaded, Config) -> + finish_mt(Config); +end_per_group(test_v3, Config) -> + finish_v3(Config); +end_per_group(test_v1_v2, Config) -> + finish_v1_v2(Config); +end_per_group(test_v2, Config) -> + finish_v2(Config); +end_per_group(test_v1, Config) -> + finish_v1(Config); +end_per_group(mib_storage_varm_mnesia, Config) -> + finish_varm_mib_storage_mnesia(Config); +end_per_group(mib_storage_varm_dets, Config) -> + finish_varm_mib_storage_dets(Config); +end_per_group(mib_storage_size_check_mnesia, Config) -> + finish_size_check_msm(Config); +end_per_group(mib_storage_size_check_dets, Config) -> + finish_size_check_msd(Config); +end_per_group(mib_storage_size_check_ets, Config) -> + finish_size_check_mse(Config); +end_per_group(mib_storage_mnesia, Config) -> + finish_mib_storage_mnesia(Config); +end_per_group(mib_storage_dets, Config) -> + finish_mib_storage_dets(Config); +end_per_group(mib_storage_ets, Config) -> + finish_mib_storage_ets(Config); +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) when list(Config) -> Dog = ?t:timetrap(?t:minutes(6)), @@ -97,25 +230,18 @@ end_per_testcase(_Case, Config) when list(Config) -> ?t:timetrap_cancel(Dog), Config. -cases() -> - case ?OSTYPE() of - vxworks -> - %% No crypto app, so skip v3 testcases - [ - app_info, - test_v1, test_v2, test_v1_v2, - test_multi_threaded, - mib_storage, - tickets]; - _Else -> - [ - app_info, - test_v1, test_v2, test_v1_v2, test_v3, - test_multi_threaded, - mib_storage, - tickets - ] - end. +cases() -> +case ?OSTYPE() of + vxworks -> + [app_info, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_multi_threaded}, + {group, mib_storage}, {group, tickets}]; + _Else -> + [app_info, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_v3}, + {group, test_multi_threaded}, {group, mib_storage}, + {group, tickets}] +end. %%%----------------------------------------------------------------- @@ -460,144 +586,56 @@ delete_mib_storage_mnesia_tables() -> %% , and a second version _2. There may be several %% versions as well, _N. %%----------------------------------------------------------------- -mib_storage(suite) -> [ - mib_storage_ets, - mib_storage_dets, - mib_storage_mnesia, - mib_storage_size_check_ets, - mib_storage_size_check_dets, - mib_storage_size_check_mnesia, - mib_storage_varm_dets, - mib_storage_varm_mnesia - ]. - -mib_storage_ets(suite) -> {req, [], {conf, init_mib_storage_ets, - mib_storage_ets_cases(), - finish_mib_storage_ets}}. - -mib_storage_dets(suite) -> {req, [], {conf, init_mib_storage_dets, - mib_storage_dets_cases(), - finish_mib_storage_dets}}. - -mib_storage_mnesia(suite) -> {req, [], {conf, init_mib_storage_mnesia, - mib_storage_mnesia_cases(), - finish_mib_storage_mnesia}}. - -mib_storage_size_check_ets(suite) -> - {req, [], {conf, - init_size_check_mse, - mse_size_check_cases(), - finish_size_check_mse}}. - -mib_storage_size_check_dets(suite) -> - {req, [], {conf, - init_size_check_msd, - msd_size_check_cases(), - finish_size_check_msd}}. - -mib_storage_size_check_mnesia(suite) -> - {req, [], {conf, - init_size_check_msm, - msm_size_check_cases(), - finish_size_check_msm}}. - -mib_storage_varm_dets(suite) -> - {req, [], {conf, - init_varm_mib_storage_dets, - varm_mib_storage_dets_cases(), - finish_varm_mib_storage_dets}}. - -mib_storage_varm_mnesia(suite) -> - {req, [], {conf, - init_varm_mib_storage_mnesia, - varm_mib_storage_mnesia_cases(), - finish_varm_mib_storage_mnesia}}. - -mib_storage_ets_cases() -> - [ - mse_simple, - mse_v1_processing, - mse_big, - mse_big2, - mse_loop_mib, - mse_api, - mse_sa_register, - mse_v1_trap, - mse_sa_error, - mse_next_across_sa, - mse_undo, - mse_standard_mib, - mse_community_mib, - mse_framework_mib, - mse_target_mib, - mse_notification_mib, - mse_view_based_acm_mib, - mse_sparse_table, - mse_me_of, - mse_mib_of]. - -mib_storage_dets_cases() -> - [ - msd_simple, - msd_v1_processing, - msd_big, - msd_big2, - msd_loop_mib, - msd_api, - msd_sa_register, - msd_v1_trap, - msd_sa_error, - msd_next_across_sa, - msd_undo, - msd_standard_mib, - msd_community_mib, - msd_framework_mib, - msd_target_mib, - msd_notification_mib, - msd_view_based_acm_mib, - msd_sparse_table, - msd_me_of, - msd_mib_of - ]. - -mib_storage_mnesia_cases() -> - [ - msm_simple, - msm_v1_processing, - msm_big, - msm_big2, - msm_loop_mib, - msm_api, - msm_sa_register, - msm_v1_trap, - msm_sa_error, - msm_next_across_sa, - msm_undo, - msm_standard_mib, - msm_community_mib, - msm_framework_mib, - msm_target_mib, - msm_notification_mib, - msm_view_based_acm_mib, - msm_sparse_table, - msm_me_of, - msm_mib_of - ]. - -mse_size_check_cases() -> - [mse_size_check]. - -msd_size_check_cases() -> - [msd_size_check]. - -msm_size_check_cases() -> - [msm_size_check]. - -varm_mib_storage_dets_cases() -> - [msd_varm_mib_start]. - -varm_mib_storage_mnesia_cases() -> - [msm_varm_mib_start]. + + + + + + + + + +mib_storage_ets_cases() -> +[mse_simple, mse_v1_processing, mse_big, mse_big2, + mse_loop_mib, mse_api, mse_sa_register, mse_v1_trap, + mse_sa_error, mse_next_across_sa, mse_undo, + mse_standard_mib, mse_community_mib, mse_framework_mib, + mse_target_mib, mse_notification_mib, + mse_view_based_acm_mib, mse_sparse_table, mse_me_of, + mse_mib_of]. + +mib_storage_dets_cases() -> +[msd_simple, msd_v1_processing, msd_big, msd_big2, + msd_loop_mib, msd_api, msd_sa_register, msd_v1_trap, + msd_sa_error, msd_next_across_sa, msd_undo, + msd_standard_mib, msd_community_mib, msd_framework_mib, + msd_target_mib, msd_notification_mib, + msd_view_based_acm_mib, msd_sparse_table, msd_me_of, + msd_mib_of]. + +mib_storage_mnesia_cases() -> +[msm_simple, msm_v1_processing, msm_big, msm_big2, + msm_loop_mib, msm_api, msm_sa_register, msm_v1_trap, + msm_sa_error, msm_next_across_sa, msm_undo, + msm_standard_mib, msm_community_mib, msm_framework_mib, + msm_target_mib, msm_notification_mib, + msm_view_based_acm_mib, msm_sparse_table, msm_me_of, + msm_mib_of]. + +mse_size_check_cases() -> +[mse_size_check]. + +msd_size_check_cases() -> +[msd_size_check]. + +msm_size_check_cases() -> +[msm_size_check]. + +varm_mib_storage_dets_cases() -> +[msd_varm_mib_start]. + +varm_mib_storage_mnesia_cases() -> +[msm_varm_mib_start]. init_mib_storage_ets(Config) when list(Config) -> ?LOG("init_mib_storage_ets -> entry", []), @@ -1099,20 +1137,14 @@ app_dir(App) -> end. -test_v1(suite) -> {req, [], {conf, init_v1, v1_cases(), finish_v1}}. %v1_cases() -> [loop_mib]; -v1_cases() -> - [simple, - db_notify_client, - v1_processing, big, big2, loop_mib, - api, subagent, mnesia, multiple_reqs, - sa_register, v1_trap, sa_error, next_across_sa, undo, reported_bugs, - standard_mibs, sparse_table, cnt_64, - opaque, - % opaque]. - - change_target_addr_config]. +v1_cases() -> +[simple, db_notify_client, v1_processing, big, big2, + loop_mib, api, subagent, mnesia, {group, multiple_reqs}, + sa_register, v1_trap, sa_error, next_across_sa, undo, + {group, reported_bugs}, {group, standard_mibs}, + sparse_table, cnt_64, opaque, change_target_addr_config]. init_v1(Config) when list(Config) -> ?line SaNode = ?config(snmp_sa, Config), @@ -1129,15 +1161,15 @@ finish_v1(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v2(suite) -> {req, [], {conf, init_v2, v2_cases(), finish_v2}}. %v2_cases() -> [loop_mib_2]; -v2_cases() -> - [simple_2, v2_processing, big_2, big2_2, loop_mib_2, - api_2, subagent_2, mnesia_2, - multiple_reqs_2, sa_register_2, v2_trap, v2_inform, sa_error_2, - next_across_sa_2, undo_2, reported_bugs_2, standard_mibs_2, - v2_types, implied, sparse_table_2, cnt_64_2, opaque_2, v2_caps]. +v2_cases() -> +[simple_2, v2_processing, big_2, big2_2, loop_mib_2, + api_2, subagent_2, mnesia_2, {group, multiple_reqs_2}, + sa_register_2, v2_trap, {group, v2_inform}, sa_error_2, + next_across_sa_2, undo_2, {group, reported_bugs_2}, + {group, standard_mibs_2}, v2_types, implied, + sparse_table_2, cnt_64_2, opaque_2, v2_caps]. init_v2(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1154,10 +1186,9 @@ finish_v2(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v1_v2(suite) -> {req, [], {conf, init_v1_v2, v1_v2_cases(), finish_v1_v2}}. -v1_v2_cases() -> - [simple_bi]. +v1_v2_cases() -> +[simple_bi]. init_v1_v2(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1174,16 +1205,16 @@ finish_v1_v2(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v3(suite) -> {req, [], {conf, init_v3, v3_cases(), finish_v3}}. %v3_cases() -> [loop_mib_3]; -v3_cases() -> - [simple_3, v3_processing, - big_3, big2_3, api_3, subagent_3, mnesia_3, loop_mib_3, - multiple_reqs_3, sa_register_3, v3_trap, v3_inform, sa_error_3, - next_across_sa_3, undo_3, reported_bugs_3, standard_mibs_3, - v3_security, - v2_types_3, implied_3, sparse_table_3, cnt_64_3, opaque_3, v2_caps_3]. +v3_cases() -> +[simple_3, v3_processing, big_3, big2_3, api_3, + subagent_3, mnesia_3, loop_mib_3, multiple_reqs_3, + sa_register_3, v3_trap, v3_inform, sa_error_3, + next_across_sa_3, undo_3, {group, reported_bugs_3}, + {group, standard_mibs_3}, {group, v3_security}, + v2_types_3, implied_3, sparse_table_3, cnt_64_3, + opaque_3, v2_caps_3]. init_v3(Config) when list(Config) -> %% Make sure crypto works, otherwise start_agent will fail @@ -1221,10 +1252,9 @@ finish_v3(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_multi_threaded(suite) -> {req, [], {conf, init_mt, mt_cases(), finish_mt}}. -mt_cases() -> - [multi_threaded, mt_trap]. +mt_cases() -> +[multi_threaded, mt_trap]. init_mt(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1739,21 +1769,19 @@ mnesia_2(X) -> mnesia(X). mnesia_3(X) -> mnesia(X). -multiple_reqs(suite) -> - {req, [], {conf, init_mul, mul_cases(), finish_mul}}. -mul_cases() -> - [mul_get, mul_get_err, mul_next, mul_next_err, mul_set_err]. +mul_cases() -> +[mul_get, mul_get_err, mul_next, mul_next_err, + mul_set_err]. -multiple_reqs_2(suite) -> - {req, [], {conf, init_mul, mul_cases_2(), finish_mul}}. multiple_reqs_3(_X) -> {req, [], {conf, init_mul, mul_cases_3(), finish_mul}}. -mul_cases_2() -> - [mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, mul_set_err_2]. +mul_cases_2() -> +[mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, + mul_set_err_2]. mul_cases_3() -> @@ -1939,8 +1967,6 @@ v2_trap(Config) when list(Config) -> v3_trap(X) -> v2_trap(X). -v2_inform(suite) -> - {req, [], {conf, init_v2_inform, [v2_inform_i], finish_v2_inform}}. v3_inform(_X) -> %% v2_inform(X). @@ -2112,7 +2138,6 @@ v3_processing(Config) when list(Config) -> %% accomplished by the first inform sent. That one will generate a %% report, which makes it in sync. The notification-generating %% application times out, and send again. This time it'll work. -v3_security(suite) -> [v3_crypto_basic, v3_md5_auth, v3_sha_auth, v3_des_priv]. v3_crypto_basic(suite) -> []; v3_crypto_basic(_Config) -> @@ -3591,22 +3616,8 @@ bad_return() -> %%% Note that many of the functions in the standard mib is %%% already tested by the normal tests. %%%----------------------------------------------------------------- -standard_mibs(suite) -> - [snmp_standard_mib, snmp_community_mib, - snmp_framework_mib, - snmp_target_mib, snmp_notification_mib, - snmp_view_based_acm_mib]. - -standard_mibs_2(suite) -> - [snmpv2_mib_2, snmp_community_mib_2, - snmp_framework_mib_2, - snmp_target_mib_2, snmp_notification_mib_2, - snmp_view_based_acm_mib_2]. - -standard_mibs_3(suite) -> - [snmpv2_mib_3,snmp_framework_mib_3, snmp_mpd_mib_3, - snmp_target_mib_3, snmp_notification_mib_3, - snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]. + + %%----------------------------------------------------------------- %% For this test, the agent is configured for v1. @@ -4527,27 +4538,12 @@ loop_it_2(Oid, N) -> %%% Testing of reported bugs and other tickets. %%%----------------------------------------------------------------- -reported_bugs(suite) -> - [otp_1128, otp_1129, otp_1131, otp_1162, - otp_1222, otp_1298, otp_1331, otp_1338, - otp_1342, otp_2776, otp_2979, otp_3187, otp_3725]. -reported_bugs_2(suite) -> - [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, - otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, - otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]. -reported_bugs_3(suite) -> - [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, - otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, - otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, - otp_3542]. %% These are (ticket) test cases where the initiation has to be done %% individually. -tickets(suite) -> - [otp_4394]. %%----------------------------------------------------------------- %% Ticket: OTP-1128 @@ -4971,10 +4967,6 @@ otp_3725_test(MaNode) -> %%----------------------------------------------------------------- -otp_4394(suite) -> {req, [], {conf, - init_otp_4394, - [otp_4394_test], - finish_otp_4394}}. init_otp_4394(Config) when list(Config) -> ?DBG("init_otp_4394 -> entry with" diff --git a/lib/snmp/test/snmp_agent_nfilter_test.erl b/lib/snmp/test/snmp_agent_nfilter_test.erl index f406ea1e63..f08060cee3 100644 --- a/lib/snmp/test/snmp_agent_nfilter_test.erl +++ b/lib/snmp/test/snmp_agent_nfilter_test.erl @@ -25,7 +25,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). @@ -33,7 +33,7 @@ %% External exports %%---------------------------------------------------------------------- -export([ - all/1, + all/0, init_per_testcase/2, end_per_testcase/2 ]). @@ -64,8 +64,8 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %%====================================================================== %% Test case definitions %%====================================================================== -all(_) -> - ?SKIP(not_yet_implemented). +all() -> + {skip,not_yet_implemented}. %%====================================================================== diff --git a/lib/snmp/test/snmp_agent_test.erl b/lib/snmp/test/snmp_agent_test.erl index cb4edf998b..692d29fda0 100644 --- a/lib/snmp/test/snmp_agent_test.erl +++ b/lib/snmp/test/snmp_agent_test.erl @@ -28,7 +28,7 @@ -define(application, snmp). -include_lib("kernel/include/file.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -define(SNMP_USE_V3, true). -include_lib("snmp/include/snmp_types.hrl"). @@ -85,11 +85,164 @@ end). -all(suite) -> - Reqs = [mnesia, distribution, {local_slave_nodes, 2}, {time, 360}], - Conf1 = [{conf, init_all, cases(), finish_all}], - Conf2 = [tickets2], - {req, Reqs, Conf1 ++ Conf2}. +all() -> + Reqs = [mnesia, distribution, {local_slave_nodes, 2}, + {time, 360}], + Conf1 = [{group, all_tcs}], + Conf2 = [{group, tickets2}], + Conf1 ++ Conf2. + +groups() -> + [{all_tcs, [], cases()}, + {mib_storage, [], + [{group, mib_storage_ets}, {group, mib_storage_dets}, + {group, mib_storage_mnesia}, + {group, mib_storage_size_check_ets}, + {group, mib_storage_size_check_dets}, + {group, mib_storage_size_check_mnesia}, + {group, mib_storage_varm_dets}, + {group, mib_storage_varm_mnesia}]}, + {mib_storage_ets, [], mib_storage_ets_cases()}, + {mib_storage_dets, [], mib_storage_dets_cases()}, + {mib_storage_mnesia, [], mib_storage_mnesia_cases()}, + {mib_storage_size_check_ets, [], + mse_size_check_cases()}, + {mib_storage_size_check_dets, [], + msd_size_check_cases()}, + {mib_storage_size_check_mnesia, [], + msm_size_check_cases()}, + {mib_storage_varm_dets, [], + varm_mib_storage_dets_cases()}, + {mib_storage_varm_mnesia, [], + varm_mib_storage_mnesia_cases()}, + {misc, [], misc_cases()}, {test_v1, [], v1_cases()}, + {test_v2, [], v2_cases()}, + {test_v1_v2, [], v1_v2_cases()}, + {test_v3, [], v3_cases()}, + {test_multi_threaded, [], mt_cases()}, + {multiple_reqs, [], mul_cases()}, + {multiple_reqs_2, [], mul_cases_2()}, + {v2_inform, [], [v2_inform_i]}, + {v3_security, [], + [v3_crypto_basic, v3_md5_auth, v3_sha_auth, + v3_des_priv]}, + {standard_mibs, [], + [snmp_standard_mib, snmp_community_mib, + snmp_framework_mib, snmp_target_mib, + snmp_notification_mib, snmp_view_based_acm_mib]}, + {standard_mibs_2, [], + [snmpv2_mib_2, snmp_community_mib_2, + snmp_framework_mib_2, snmp_target_mib_2, + snmp_notification_mib_2, snmp_view_based_acm_mib_2]}, + {standard_mibs_3, [], + [snmpv2_mib_3, snmp_framework_mib_3, snmp_mpd_mib_3, + snmp_target_mib_3, snmp_notification_mib_3, + snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]}, + {reported_bugs, [], + [otp_1128, otp_1129, otp_1131, otp_1162, otp_1222, + otp_1298, otp_1331, otp_1338, otp_1342, otp_2776, + otp_2979, otp_3187, otp_3725]}, + {reported_bugs_2, [], + [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, + otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, + otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]}, + {reported_bugs_3, [], + [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, + otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, + otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, + otp_3542]}, + {tickets1, [], [{group, otp_4394}, {group, otp_7157}]}, + {tickets2, [], [otp8395]}, + {otp_4394, [], [otp_4394_test]}, + {otp_7157, [], + begin Reqs = [], Conf = [otp_7157_test], Conf end}]. + +init_per_group(all_tcs, Config) -> + init_all(Config); +init_per_group(otp_7157, Config) -> + init_otp_7157(Config); +init_per_group(otp_4394, Config) -> + init_otp_4394(Config); +init_per_group(v2_inform, Config) -> + init_v2_inform(Config); +init_per_group(multiple_reqs_2, Config) -> + init_mul(Config); +init_per_group(multiple_reqs, Config) -> + init_mul(Config); +init_per_group(test_multi_threaded, Config) -> + init_mt(Config); +init_per_group(test_v3, Config) -> + init_v3(Config); +init_per_group(test_v1_v2, Config) -> + init_v1_v2(Config); +init_per_group(test_v2, Config) -> + init_v2(Config); +init_per_group(test_v1, Config) -> + init_v1(Config); +init_per_group(misc, Config) -> + init_misc(Config); +init_per_group(mib_storage_varm_mnesia, Config) -> + init_varm_mib_storage_mnesia(Config); +init_per_group(mib_storage_varm_dets, Config) -> + init_varm_mib_storage_dets(Config); +init_per_group(mib_storage_size_check_mnesia, Config) -> + init_size_check_msm(Config); +init_per_group(mib_storage_size_check_dets, Config) -> + init_size_check_msd(Config); +init_per_group(mib_storage_size_check_ets, Config) -> + init_size_check_mse(Config); +init_per_group(mib_storage_mnesia, Config) -> + init_mib_storage_mnesia(Config); +init_per_group(mib_storage_dets, Config) -> + init_mib_storage_dets(Config); +init_per_group(mib_storage_ets, Config) -> + init_mib_storage_ets(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(all_tcs, Config) -> + finish_all(Config); +end_per_group(otp_7157, Config) -> + finish_otp_7157(Config); +end_per_group(otp_4394, Config) -> + finish_otp_4394(Config); +end_per_group(v2_inform, Config) -> + finish_v2_inform(Config); +end_per_group(multiple_reqs_2, Config) -> + finish_mul(Config); +end_per_group(multiple_reqs, Config) -> + finish_mul(Config); +end_per_group(test_multi_threaded, Config) -> + finish_mt(Config); +end_per_group(test_v3, Config) -> + finish_v3(Config); +end_per_group(test_v1_v2, Config) -> + finish_v1_v2(Config); +end_per_group(test_v2, Config) -> + finish_v2(Config); +end_per_group(test_v1, Config) -> + finish_v1(Config); +end_per_group(misc, Config) -> + finish_misc(Config); +end_per_group(mib_storage_varm_mnesia, Config) -> + finish_varm_mib_storage_mnesia(Config); +end_per_group(mib_storage_varm_dets, Config) -> + finish_varm_mib_storage_dets(Config); +end_per_group(mib_storage_size_check_mnesia, Config) -> + finish_size_check_msm(Config); +end_per_group(mib_storage_size_check_dets, Config) -> + finish_size_check_msd(Config); +end_per_group(mib_storage_size_check_ets, Config) -> + finish_size_check_mse(Config); +end_per_group(mib_storage_mnesia, Config) -> + finish_mib_storage_mnesia(Config); +end_per_group(mib_storage_dets, Config) -> + finish_mib_storage_dets(Config); +end_per_group(mib_storage_ets, Config) -> + finish_mib_storage_ets(Config); +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(otp8395 = Case, Config) when is_list(Config) -> @@ -175,7 +328,7 @@ init_per_suite(Config) -> Config2. %% end_per_suite(Config) -> -end_suite(Config) -> +end_per_suite(Config) -> Config. fix_data_dir(Config) -> @@ -224,31 +377,18 @@ end_per_testcase2(_Case, Config) -> Config. -cases() -> - case ?OSTYPE() of - vxworks -> - %% No crypto app, so skip v3 testcases - [ - misc, - test_v1, - test_v2, - test_v1_v2, - test_multi_threaded, - mib_storage, - tickets1 - ]; - _Else -> - [ - misc, - test_v1, - test_v2, - test_v1_v2, - test_v3, - test_multi_threaded, - mib_storage, - tickets1 - ] - end. +cases() -> +case ?OSTYPE() of + vxworks -> + [{group, misc}, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_multi_threaded}, + {group, mib_storage}, {group, tickets1}]; + _Else -> + [{group, misc}, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_v3}, + {group, test_multi_threaded}, {group, mib_storage}, + {group, tickets1}] +end. %%%----------------------------------------------------------------- @@ -355,144 +495,56 @@ delete_mib_storage_mnesia_tables() -> %% , and a second version _2. There may be several %% versions as well, _N. %%----------------------------------------------------------------- -mib_storage(suite) -> [ - mib_storage_ets, - mib_storage_dets, - mib_storage_mnesia, - mib_storage_size_check_ets, - mib_storage_size_check_dets, - mib_storage_size_check_mnesia, - mib_storage_varm_dets, - mib_storage_varm_mnesia - ]. - -mib_storage_ets(suite) -> {req, [], {conf, init_mib_storage_ets, - mib_storage_ets_cases(), - finish_mib_storage_ets}}. - -mib_storage_dets(suite) -> {req, [], {conf, init_mib_storage_dets, - mib_storage_dets_cases(), - finish_mib_storage_dets}}. - -mib_storage_mnesia(suite) -> {req, [], {conf, init_mib_storage_mnesia, - mib_storage_mnesia_cases(), - finish_mib_storage_mnesia}}. - -mib_storage_size_check_ets(suite) -> - {req, [], {conf, - init_size_check_mse, - mse_size_check_cases(), - finish_size_check_mse}}. - -mib_storage_size_check_dets(suite) -> - {req, [], {conf, - init_size_check_msd, - msd_size_check_cases(), - finish_size_check_msd}}. - -mib_storage_size_check_mnesia(suite) -> - {req, [], {conf, - init_size_check_msm, - msm_size_check_cases(), - finish_size_check_msm}}. - -mib_storage_varm_dets(suite) -> - {req, [], {conf, - init_varm_mib_storage_dets, - varm_mib_storage_dets_cases(), - finish_varm_mib_storage_dets}}. - -mib_storage_varm_mnesia(suite) -> - {req, [], {conf, - init_varm_mib_storage_mnesia, - varm_mib_storage_mnesia_cases(), - finish_varm_mib_storage_mnesia}}. - -mib_storage_ets_cases() -> - [ - mse_simple, - mse_v1_processing, - mse_big, - mse_big2, - mse_loop_mib, - mse_api, - mse_sa_register, - mse_v1_trap, - mse_sa_error, - mse_next_across_sa, - mse_undo, - mse_standard_mib, - mse_community_mib, - mse_framework_mib, - mse_target_mib, - mse_notification_mib, - mse_view_based_acm_mib, - mse_sparse_table, - mse_me_of, - mse_mib_of]. - -mib_storage_dets_cases() -> - [ - msd_simple, - msd_v1_processing, - msd_big, - msd_big2, - msd_loop_mib, - msd_api, - msd_sa_register, - msd_v1_trap, - msd_sa_error, - msd_next_across_sa, - msd_undo, - msd_standard_mib, - msd_community_mib, - msd_framework_mib, - msd_target_mib, - msd_notification_mib, - msd_view_based_acm_mib, - msd_sparse_table, - msd_me_of, - msd_mib_of - ]. - -mib_storage_mnesia_cases() -> - [ - msm_simple, - msm_v1_processing, - msm_big, - msm_big2, - msm_loop_mib, - msm_api, - msm_sa_register, - msm_v1_trap, - msm_sa_error, - msm_next_across_sa, - msm_undo, - msm_standard_mib, - msm_community_mib, - msm_framework_mib, - msm_target_mib, - msm_notification_mib, - msm_view_based_acm_mib, - msm_sparse_table, - msm_me_of, - msm_mib_of - ]. - -mse_size_check_cases() -> - [mse_size_check]. - -msd_size_check_cases() -> - [msd_size_check]. - -msm_size_check_cases() -> - [msm_size_check]. - -varm_mib_storage_dets_cases() -> - [msd_varm_mib_start]. - -varm_mib_storage_mnesia_cases() -> - [msm_varm_mib_start]. + + + + + + + + + +mib_storage_ets_cases() -> +[mse_simple, mse_v1_processing, mse_big, mse_big2, + mse_loop_mib, mse_api, mse_sa_register, mse_v1_trap, + mse_sa_error, mse_next_across_sa, mse_undo, + mse_standard_mib, mse_community_mib, mse_framework_mib, + mse_target_mib, mse_notification_mib, + mse_view_based_acm_mib, mse_sparse_table, mse_me_of, + mse_mib_of]. + +mib_storage_dets_cases() -> +[msd_simple, msd_v1_processing, msd_big, msd_big2, + msd_loop_mib, msd_api, msd_sa_register, msd_v1_trap, + msd_sa_error, msd_next_across_sa, msd_undo, + msd_standard_mib, msd_community_mib, msd_framework_mib, + msd_target_mib, msd_notification_mib, + msd_view_based_acm_mib, msd_sparse_table, msd_me_of, + msd_mib_of]. + +mib_storage_mnesia_cases() -> +[msm_simple, msm_v1_processing, msm_big, msm_big2, + msm_loop_mib, msm_api, msm_sa_register, msm_v1_trap, + msm_sa_error, msm_next_across_sa, msm_undo, + msm_standard_mib, msm_community_mib, msm_framework_mib, + msm_target_mib, msm_notification_mib, + msm_view_based_acm_mib, msm_sparse_table, msm_me_of, + msm_mib_of]. + +mse_size_check_cases() -> +[mse_size_check]. + +msd_size_check_cases() -> +[msd_size_check]. + +msm_size_check_cases() -> +[msm_size_check]. + +varm_mib_storage_dets_cases() -> +[msd_varm_mib_start]. + +varm_mib_storage_mnesia_cases() -> +[msm_varm_mib_start]. init_mib_storage_ets(Config) when is_list(Config) -> ?LOG("init_mib_storage_ets -> entry", []), @@ -975,8 +1027,6 @@ mib_of(Oid, ExpectedMibName) -> end. -misc(suite) -> - {req, [], {conf, init_misc, misc_cases(), finish_misc}}. init_misc(Config) -> init_v1(Config). @@ -984,11 +1034,8 @@ init_misc(Config) -> finish_misc(Config) -> finish_v1(Config). -misc_cases() -> - [ - app_info, - info_test - ]. +misc_cases() -> +[app_info, info_test]. app_info(suite) -> []; app_info(Config) when is_list(Config) -> @@ -1021,34 +1068,14 @@ app_dir(App) -> end. -test_v1(suite) -> {req, [], {conf, init_v1, v1_cases(), finish_v1}}. %v1_cases() -> [loop_mib]; -v1_cases() -> - [ - simple, - db_notify_client, - v1_processing, - big, - big2, - loop_mib, - api, - subagent, - mnesia, - multiple_reqs, - sa_register, - v1_trap, - sa_error, - next_across_sa, - undo, - reported_bugs, - standard_mibs, - sparse_table, - cnt_64, - opaque, - - change_target_addr_config - ]. +v1_cases() -> +[simple, db_notify_client, v1_processing, big, big2, + loop_mib, api, subagent, mnesia, {group, multiple_reqs}, + sa_register, v1_trap, sa_error, next_across_sa, undo, + {group, reported_bugs}, {group, standard_mibs}, + sparse_table, cnt_64, opaque, change_target_addr_config]. init_v1(Config) when is_list(Config) -> ?line SaNode = ?config(snmp_sa, Config), @@ -1065,34 +1092,14 @@ finish_v1(Config) when is_list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v2(suite) -> {req, [], {conf, init_v2, v2_cases(), finish_v2}}. - -v2_cases() -> - [ - simple_2, - v2_processing, - big_2, - big2_2, - loop_mib_2, - api_2, - subagent_2, - mnesia_2, - multiple_reqs_2, - sa_register_2, - v2_trap, - v2_inform, - sa_error_2, - next_across_sa_2, - undo_2, - reported_bugs_2, - standard_mibs_2, - v2_types, - implied, - sparse_table_2, - cnt_64_2, - opaque_2, - v2_caps - ]. + +v2_cases() -> +[simple_2, v2_processing, big_2, big2_2, loop_mib_2, + api_2, subagent_2, mnesia_2, {group, multiple_reqs_2}, + sa_register_2, v2_trap, {group, v2_inform}, sa_error_2, + next_across_sa_2, undo_2, {group, reported_bugs_2}, + {group, standard_mibs_2}, v2_types, implied, + sparse_table_2, cnt_64_2, opaque_2, v2_caps]. init_v2(Config) when is_list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1109,11 +1116,9 @@ finish_v2(Config) when is_list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v1_v2(suite) -> - {req, [], {conf, init_v1_v2, v1_v2_cases(), finish_v1_v2}}. -v1_v2_cases() -> - [simple_bi]. +v1_v2_cases() -> +[simple_bi]. init_v1_v2(Config) when is_list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1130,35 +1135,15 @@ finish_v1_v2(Config) when is_list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v3(suite) -> {req, [], {conf, init_v3, v3_cases(), finish_v3}}. - -v3_cases() -> - [ - simple_3, - v3_processing, - big_3, - big2_3, - api_3, - subagent_3, - mnesia_3, - loop_mib_3, - multiple_reqs_3, - sa_register_3, - v3_trap, - v3_inform, - sa_error_3, - next_across_sa_3, - undo_3, - reported_bugs_3, - standard_mibs_3, - v3_security, - v2_types_3, - implied_3, - sparse_table_3, - cnt_64_3, - opaque_3, - v2_caps_3 - ]. + +v3_cases() -> +[simple_3, v3_processing, big_3, big2_3, api_3, + subagent_3, mnesia_3, loop_mib_3, multiple_reqs_3, + sa_register_3, v3_trap, v3_inform, sa_error_3, + next_across_sa_3, undo_3, {group, reported_bugs_3}, + {group, standard_mibs_3}, {group, v3_security}, + v2_types_3, implied_3, sparse_table_3, cnt_64_3, + opaque_3, v2_caps_3]. init_v3(Config) when is_list(Config) -> %% Make sure crypto works, otherwise start_agent will fail @@ -1196,11 +1181,9 @@ finish_v3(Config) when is_list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_multi_threaded(suite) -> - {req, [], {conf, init_mt, mt_cases(), finish_mt}}. -mt_cases() -> - [multi_threaded, mt_trap]. +mt_cases() -> +[multi_threaded, mt_trap]. init_mt(Config) when is_list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1690,21 +1673,19 @@ mnesia_2(X) -> ?P(mnesia_2), mnesia(X). mnesia_3(X) -> ?P(mnesia_3), mnesia(X). -multiple_reqs(suite) -> - {req, [], {conf, init_mul, mul_cases(), finish_mul}}. -mul_cases() -> - [mul_get, mul_get_err, mul_next, mul_next_err, mul_set_err]. +mul_cases() -> +[mul_get, mul_get_err, mul_next, mul_next_err, + mul_set_err]. -multiple_reqs_2(suite) -> - {req, [], {conf, init_mul, mul_cases_2(), finish_mul}}. multiple_reqs_3(_X) -> {req, [], {conf, init_mul, mul_cases_3(), finish_mul}}. -mul_cases_2() -> - [mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, mul_set_err_2]. +mul_cases_2() -> +[mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, + mul_set_err_2]. mul_cases_3() -> @@ -1929,8 +1910,6 @@ v3_trap(Config) when is_list(Config) -> ?P(v3_trap), trap2(Config). -v2_inform(suite) -> - {req, [], {conf, init_v2_inform, [v2_inform_i], finish_v2_inform}}. v3_inform(_X) -> %% v2_inform(X). @@ -2190,13 +2169,6 @@ v3_processing(Config) when is_list(Config) -> %% accomplished by the first inform sent. That one will generate a %% report, which makes it in sync. The notification-generating %% application times out, and send again. This time it'll work. -v3_security(suite) -> - [ - v3_crypto_basic, - v3_md5_auth, - v3_sha_auth, - v3_des_priv - ]. v3_crypto_basic(suite) -> []; v3_crypto_basic(_Config) -> @@ -4044,36 +4016,8 @@ bad_return() -> %%% Note that many of the functions in the standard mib is %%% already tested by the normal tests. %%%----------------------------------------------------------------- -standard_mibs(suite) -> - [ - snmp_standard_mib, - snmp_community_mib, - snmp_framework_mib, - snmp_target_mib, - snmp_notification_mib, - snmp_view_based_acm_mib - ]. - -standard_mibs_2(suite) -> - [ - snmpv2_mib_2, - snmp_community_mib_2, - snmp_framework_mib_2, - snmp_target_mib_2, - snmp_notification_mib_2, - snmp_view_based_acm_mib_2 - ]. - -standard_mibs_3(suite) -> - [ - snmpv2_mib_3, - snmp_framework_mib_3, - snmp_mpd_mib_3, - snmp_target_mib_3, - snmp_notification_mib_3, - snmp_view_based_acm_mib_3, - snmp_user_based_sm_mib_3 - ]. + + %%----------------------------------------------------------------- %% For this test, the agent is configured for v1. @@ -5117,70 +5061,14 @@ loop_it_2(Oid, N) -> %%% Testing of reported bugs and other tickets. %%%----------------------------------------------------------------- -reported_bugs(suite) -> - [ - otp_1128, - otp_1129, - otp_1131, - otp_1162, - otp_1222, - otp_1298, - otp_1331, - otp_1338, - otp_1342, - otp_2776, - otp_2979, - otp_3187, - otp_3725 - ]. - -reported_bugs_2(suite) -> - [ - otp_1128_2, - otp_1129_2, - otp_1131_2, - otp_1162_2, - otp_1222_2, - otp_1298_2, - otp_1331_2, - otp_1338_2, - otp_1342_2, - otp_2776_2, - otp_2979_2, - otp_3187_2 - ]. - -reported_bugs_3(suite) -> - [ - otp_1128_3, - otp_1129_3, - otp_1131_3, - otp_1162_3, - otp_1222_3, - otp_1298_3, - otp_1331_3, - otp_1338_3, - otp_1342_3, - otp_2776_3, - otp_2979_3, - otp_3187_3, - otp_3542 - ]. + + %% These are (ticket) test cases where the initiation has to be done %% individually. -tickets1(suite) -> - [ - otp_4394, - otp_7157 - ]. -tickets2(suite) -> - [ - otp8395 - ]. @@ -5661,10 +5549,6 @@ otp_3725_test(MaNode) -> %%----------------------------------------------------------------- -otp_4394(suite) -> {req, [], {conf, - init_otp_4394, - [otp_4394_test], - finish_otp_4394}}. init_otp_4394(Config) when is_list(Config) -> ?DBG("init_otp_4394 -> entry with" @@ -5758,10 +5642,6 @@ otp_4394_test1() -> %%----------------------------------------------------------------- -otp_7157(suite) -> - Reqs = [], - Conf = [{conf, init_otp_7157, [otp_7157_test], finish_otp_7157}], - {req, Reqs, Conf}. init_otp_7157(Config) when is_list(Config) -> %% diff --git a/lib/snmp/test/snmp_agent_v2_test.erl b/lib/snmp/test/snmp_agent_v2_test.erl index 549521341e..dc94c18ad9 100644 --- a/lib/snmp/test/snmp_agent_v2_test.erl +++ b/lib/snmp/test/snmp_agent_v2_test.erl @@ -28,7 +28,7 @@ -define(application, snmp). -include_lib("kernel/include/file.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -define(SNMP_USE_V3, true). -include_lib("snmp/include/snmp_types.hrl"). @@ -83,10 +83,143 @@ _ -> V3 end). -all(suite) -> {req, - [mnesia, distribution, - {local_slave_nodes, 2}, {time, 360}], - [{conf, init_all, cases(), finish_all}]}. +all() -> +[cases()]. + +groups() -> + [{mib_storage, [], + [{group, mib_storage_ets}, {group, mib_storage_dets}, + {group, mib_storage_mnesia}, + {group, mib_storage_size_check_ets}, + {group, mib_storage_size_check_dets}, + {group, mib_storage_size_check_mnesia}, + {group, mib_storage_varm_dets}, + {group, mib_storage_varm_mnesia}]}, + {mib_storage_ets, [], mib_storage_ets_cases()}, + {mib_storage_dets, [], mib_storage_dets_cases()}, + {mib_storage_mnesia, [], mib_storage_mnesia_cases()}, + {mib_storage_size_check_ets, [], + mse_size_check_cases()}, + {mib_storage_size_check_dets, [], + msd_size_check_cases()}, + {mib_storage_size_check_mnesia, [], + msm_size_check_cases()}, + {mib_storage_varm_dets, [], + varm_mib_storage_dets_cases()}, + {mib_storage_varm_mnesia, [], + varm_mib_storage_mnesia_cases()}, + {test_v1, [], v1_cases()}, {test_v2, [], v2_cases()}, + {test_v1_v2, [], v1_v2_cases()}, + {test_v3, [], v3_cases()}, + {test_multi_threaded, [], mt_cases()}, + {multiple_reqs, [], mul_cases()}, + {multiple_reqs_2, [], mul_cases_2()}, + {v2_inform, [], [v2_inform_i]}, + {v3_security, [], + [v3_crypto_basic, v3_md5_auth, v3_sha_auth, + v3_des_priv]}, + {standard_mibs, [], + [snmp_standard_mib, snmp_community_mib, + snmp_framework_mib, snmp_target_mib, + snmp_notification_mib, snmp_view_based_acm_mib]}, + {standard_mibs_2, [], + [snmpv2_mib_2, snmp_community_mib_2, + snmp_framework_mib_2, snmp_target_mib_2, + snmp_notification_mib_2, snmp_view_based_acm_mib_2]}, + {standard_mibs_3, [], + [snmpv2_mib_3, snmp_framework_mib_3, snmp_mpd_mib_3, + snmp_target_mib_3, snmp_notification_mib_3, + snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]}, + {reported_bugs, [], + [otp_1128, otp_1129, otp_1131, otp_1162, otp_1222, + otp_1298, otp_1331, otp_1338, otp_1342, otp_2776, + otp_2979, otp_3187, otp_3725]}, + {reported_bugs_2, [], + [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, + otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, + otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]}, + {reported_bugs_3, [], + [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, + otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, + otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, + otp_3542]}, + {tickets, [], [{group, otp_4394}]}, + {otp_4394, [], [otp_4394_test]}]. + +init_per_group(otp_4394, Config) -> + init_otp_4394(Config); +init_per_group(v2_inform, Config) -> + init_v2_inform(Config); +init_per_group(multiple_reqs_2, Config) -> + init_mul(Config); +init_per_group(multiple_reqs, Config) -> + init_mul(Config); +init_per_group(test_multi_threaded, Config) -> + init_mt(Config); +init_per_group(test_v3, Config) -> + init_v3(Config); +init_per_group(test_v1_v2, Config) -> + init_v1_v2(Config); +init_per_group(test_v2, Config) -> + init_v2(Config); +init_per_group(test_v1, Config) -> + init_v1(Config); +init_per_group(mib_storage_varm_mnesia, Config) -> + init_varm_mib_storage_mnesia(Config); +init_per_group(mib_storage_varm_dets, Config) -> + init_varm_mib_storage_dets(Config); +init_per_group(mib_storage_size_check_mnesia, Config) -> + init_size_check_msm(Config); +init_per_group(mib_storage_size_check_dets, Config) -> + init_size_check_msd(Config); +init_per_group(mib_storage_size_check_ets, Config) -> + init_size_check_mse(Config); +init_per_group(mib_storage_mnesia, Config) -> + init_mib_storage_mnesia(Config); +init_per_group(mib_storage_dets, Config) -> + init_mib_storage_dets(Config); +init_per_group(mib_storage_ets, Config) -> + init_mib_storage_ets(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(otp_4394, Config) -> + finish_otp_4394(Config); +end_per_group(v2_inform, Config) -> + finish_v2_inform(Config); +end_per_group(multiple_reqs_2, Config) -> + finish_mul(Config); +end_per_group(multiple_reqs, Config) -> + finish_mul(Config); +end_per_group(test_multi_threaded, Config) -> + finish_mt(Config); +end_per_group(test_v3, Config) -> + finish_v3(Config); +end_per_group(test_v1_v2, Config) -> + finish_v1_v2(Config); +end_per_group(test_v2, Config) -> + finish_v2(Config); +end_per_group(test_v1, Config) -> + finish_v1(Config); +end_per_group(mib_storage_varm_mnesia, Config) -> + finish_varm_mib_storage_mnesia(Config); +end_per_group(mib_storage_varm_dets, Config) -> + finish_varm_mib_storage_dets(Config); +end_per_group(mib_storage_size_check_mnesia, Config) -> + finish_size_check_msm(Config); +end_per_group(mib_storage_size_check_dets, Config) -> + finish_size_check_msd(Config); +end_per_group(mib_storage_size_check_ets, Config) -> + finish_size_check_mse(Config); +end_per_group(mib_storage_mnesia, Config) -> + finish_mib_storage_mnesia(Config); +end_per_group(mib_storage_dets, Config) -> + finish_mib_storage_dets(Config); +end_per_group(mib_storage_ets, Config) -> + finish_mib_storage_ets(Config); +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) when list(Config) -> Dog = ?t:timetrap(?t:minutes(6)), @@ -97,25 +230,18 @@ end_per_testcase(_Case, Config) when list(Config) -> ?t:timetrap_cancel(Dog), Config. -cases() -> - case ?OSTYPE() of - vxworks -> - %% No crypto app, so skip v3 testcases - [ - app_info, - test_v1, test_v2, test_v1_v2, - test_multi_threaded, - mib_storage, - tickets]; - _Else -> - [ - app_info, - test_v1, test_v2, test_v1_v2, test_v3, - test_multi_threaded, - mib_storage, - tickets - ] - end. +cases() -> +case ?OSTYPE() of + vxworks -> + [app_info, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_multi_threaded}, + {group, mib_storage}, {group, tickets}]; + _Else -> + [app_info, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_v3}, + {group, test_multi_threaded}, {group, mib_storage}, + {group, tickets}] +end. %%%----------------------------------------------------------------- @@ -460,144 +586,56 @@ delete_mib_storage_mnesia_tables() -> %% , and a second version _2. There may be several %% versions as well, _N. %%----------------------------------------------------------------- -mib_storage(suite) -> [ - mib_storage_ets, - mib_storage_dets, - mib_storage_mnesia, - mib_storage_size_check_ets, - mib_storage_size_check_dets, - mib_storage_size_check_mnesia, - mib_storage_varm_dets, - mib_storage_varm_mnesia - ]. - -mib_storage_ets(suite) -> {req, [], {conf, init_mib_storage_ets, - mib_storage_ets_cases(), - finish_mib_storage_ets}}. - -mib_storage_dets(suite) -> {req, [], {conf, init_mib_storage_dets, - mib_storage_dets_cases(), - finish_mib_storage_dets}}. - -mib_storage_mnesia(suite) -> {req, [], {conf, init_mib_storage_mnesia, - mib_storage_mnesia_cases(), - finish_mib_storage_mnesia}}. - -mib_storage_size_check_ets(suite) -> - {req, [], {conf, - init_size_check_mse, - mse_size_check_cases(), - finish_size_check_mse}}. - -mib_storage_size_check_dets(suite) -> - {req, [], {conf, - init_size_check_msd, - msd_size_check_cases(), - finish_size_check_msd}}. - -mib_storage_size_check_mnesia(suite) -> - {req, [], {conf, - init_size_check_msm, - msm_size_check_cases(), - finish_size_check_msm}}. - -mib_storage_varm_dets(suite) -> - {req, [], {conf, - init_varm_mib_storage_dets, - varm_mib_storage_dets_cases(), - finish_varm_mib_storage_dets}}. - -mib_storage_varm_mnesia(suite) -> - {req, [], {conf, - init_varm_mib_storage_mnesia, - varm_mib_storage_mnesia_cases(), - finish_varm_mib_storage_mnesia}}. - -mib_storage_ets_cases() -> - [ - mse_simple, - mse_v1_processing, - mse_big, - mse_big2, - mse_loop_mib, - mse_api, - mse_sa_register, - mse_v1_trap, - mse_sa_error, - mse_next_across_sa, - mse_undo, - mse_standard_mib, - mse_community_mib, - mse_framework_mib, - mse_target_mib, - mse_notification_mib, - mse_view_based_acm_mib, - mse_sparse_table, - mse_me_of, - mse_mib_of]. - -mib_storage_dets_cases() -> - [ - msd_simple, - msd_v1_processing, - msd_big, - msd_big2, - msd_loop_mib, - msd_api, - msd_sa_register, - msd_v1_trap, - msd_sa_error, - msd_next_across_sa, - msd_undo, - msd_standard_mib, - msd_community_mib, - msd_framework_mib, - msd_target_mib, - msd_notification_mib, - msd_view_based_acm_mib, - msd_sparse_table, - msd_me_of, - msd_mib_of - ]. - -mib_storage_mnesia_cases() -> - [ - msm_simple, - msm_v1_processing, - msm_big, - msm_big2, - msm_loop_mib, - msm_api, - msm_sa_register, - msm_v1_trap, - msm_sa_error, - msm_next_across_sa, - msm_undo, - msm_standard_mib, - msm_community_mib, - msm_framework_mib, - msm_target_mib, - msm_notification_mib, - msm_view_based_acm_mib, - msm_sparse_table, - msm_me_of, - msm_mib_of - ]. - -mse_size_check_cases() -> - [mse_size_check]. - -msd_size_check_cases() -> - [msd_size_check]. - -msm_size_check_cases() -> - [msm_size_check]. - -varm_mib_storage_dets_cases() -> - [msd_varm_mib_start]. - -varm_mib_storage_mnesia_cases() -> - [msm_varm_mib_start]. + + + + + + + + + +mib_storage_ets_cases() -> +[mse_simple, mse_v1_processing, mse_big, mse_big2, + mse_loop_mib, mse_api, mse_sa_register, mse_v1_trap, + mse_sa_error, mse_next_across_sa, mse_undo, + mse_standard_mib, mse_community_mib, mse_framework_mib, + mse_target_mib, mse_notification_mib, + mse_view_based_acm_mib, mse_sparse_table, mse_me_of, + mse_mib_of]. + +mib_storage_dets_cases() -> +[msd_simple, msd_v1_processing, msd_big, msd_big2, + msd_loop_mib, msd_api, msd_sa_register, msd_v1_trap, + msd_sa_error, msd_next_across_sa, msd_undo, + msd_standard_mib, msd_community_mib, msd_framework_mib, + msd_target_mib, msd_notification_mib, + msd_view_based_acm_mib, msd_sparse_table, msd_me_of, + msd_mib_of]. + +mib_storage_mnesia_cases() -> +[msm_simple, msm_v1_processing, msm_big, msm_big2, + msm_loop_mib, msm_api, msm_sa_register, msm_v1_trap, + msm_sa_error, msm_next_across_sa, msm_undo, + msm_standard_mib, msm_community_mib, msm_framework_mib, + msm_target_mib, msm_notification_mib, + msm_view_based_acm_mib, msm_sparse_table, msm_me_of, + msm_mib_of]. + +mse_size_check_cases() -> +[mse_size_check]. + +msd_size_check_cases() -> +[msd_size_check]. + +msm_size_check_cases() -> +[msm_size_check]. + +varm_mib_storage_dets_cases() -> +[msd_varm_mib_start]. + +varm_mib_storage_mnesia_cases() -> +[msm_varm_mib_start]. init_mib_storage_ets(Config) when list(Config) -> ?LOG("init_mib_storage_ets -> entry", []), @@ -1099,20 +1137,14 @@ app_dir(App) -> end. -test_v1(suite) -> {req, [], {conf, init_v1, v1_cases(), finish_v1}}. %v1_cases() -> [loop_mib]; -v1_cases() -> - [simple, - db_notify_client, - v1_processing, big, big2, loop_mib, - api, subagent, mnesia, multiple_reqs, - sa_register, v1_trap, sa_error, next_across_sa, undo, reported_bugs, - standard_mibs, sparse_table, cnt_64, - opaque, - % opaque]. - - change_target_addr_config]. +v1_cases() -> +[simple, db_notify_client, v1_processing, big, big2, + loop_mib, api, subagent, mnesia, {group, multiple_reqs}, + sa_register, v1_trap, sa_error, next_across_sa, undo, + {group, reported_bugs}, {group, standard_mibs}, + sparse_table, cnt_64, opaque, change_target_addr_config]. init_v1(Config) when list(Config) -> ?line SaNode = ?config(snmp_sa, Config), @@ -1129,15 +1161,15 @@ finish_v1(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v2(suite) -> {req, [], {conf, init_v2, v2_cases(), finish_v2}}. %v2_cases() -> [loop_mib_2]; -v2_cases() -> - [simple_2, v2_processing, big_2, big2_2, loop_mib_2, - api_2, subagent_2, mnesia_2, - multiple_reqs_2, sa_register_2, v2_trap, v2_inform, sa_error_2, - next_across_sa_2, undo_2, reported_bugs_2, standard_mibs_2, - v2_types, implied, sparse_table_2, cnt_64_2, opaque_2, v2_caps]. +v2_cases() -> +[simple_2, v2_processing, big_2, big2_2, loop_mib_2, + api_2, subagent_2, mnesia_2, {group, multiple_reqs_2}, + sa_register_2, v2_trap, {group, v2_inform}, sa_error_2, + next_across_sa_2, undo_2, {group, reported_bugs_2}, + {group, standard_mibs_2}, v2_types, implied, + sparse_table_2, cnt_64_2, opaque_2, v2_caps]. init_v2(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1154,10 +1186,9 @@ finish_v2(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v1_v2(suite) -> {req, [], {conf, init_v1_v2, v1_v2_cases(), finish_v1_v2}}. -v1_v2_cases() -> - [simple_bi]. +v1_v2_cases() -> +[simple_bi]. init_v1_v2(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1174,16 +1205,16 @@ finish_v1_v2(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v3(suite) -> {req, [], {conf, init_v3, v3_cases(), finish_v3}}. %v3_cases() -> [loop_mib_3]; -v3_cases() -> - [simple_3, v3_processing, - big_3, big2_3, api_3, subagent_3, mnesia_3, loop_mib_3, - multiple_reqs_3, sa_register_3, v3_trap, v3_inform, sa_error_3, - next_across_sa_3, undo_3, reported_bugs_3, standard_mibs_3, - v3_security, - v2_types_3, implied_3, sparse_table_3, cnt_64_3, opaque_3, v2_caps_3]. +v3_cases() -> +[simple_3, v3_processing, big_3, big2_3, api_3, + subagent_3, mnesia_3, loop_mib_3, multiple_reqs_3, + sa_register_3, v3_trap, v3_inform, sa_error_3, + next_across_sa_3, undo_3, {group, reported_bugs_3}, + {group, standard_mibs_3}, {group, v3_security}, + v2_types_3, implied_3, sparse_table_3, cnt_64_3, + opaque_3, v2_caps_3]. init_v3(Config) when list(Config) -> %% Make sure crypto works, otherwise start_agent will fail @@ -1221,10 +1252,9 @@ finish_v3(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_multi_threaded(suite) -> {req, [], {conf, init_mt, mt_cases(), finish_mt}}. -mt_cases() -> - [multi_threaded, mt_trap]. +mt_cases() -> +[multi_threaded, mt_trap]. init_mt(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1739,21 +1769,19 @@ mnesia_2(X) -> mnesia(X). mnesia_3(X) -> mnesia(X). -multiple_reqs(suite) -> - {req, [], {conf, init_mul, mul_cases(), finish_mul}}. -mul_cases() -> - [mul_get, mul_get_err, mul_next, mul_next_err, mul_set_err]. +mul_cases() -> +[mul_get, mul_get_err, mul_next, mul_next_err, + mul_set_err]. -multiple_reqs_2(suite) -> - {req, [], {conf, init_mul, mul_cases_2(), finish_mul}}. multiple_reqs_3(_X) -> {req, [], {conf, init_mul, mul_cases_3(), finish_mul}}. -mul_cases_2() -> - [mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, mul_set_err_2]. +mul_cases_2() -> +[mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, + mul_set_err_2]. mul_cases_3() -> @@ -1939,8 +1967,6 @@ v2_trap(Config) when list(Config) -> v3_trap(X) -> v2_trap(X). -v2_inform(suite) -> - {req, [], {conf, init_v2_inform, [v2_inform_i], finish_v2_inform}}. v3_inform(_X) -> %% v2_inform(X). @@ -2112,7 +2138,6 @@ v3_processing(Config) when list(Config) -> %% accomplished by the first inform sent. That one will generate a %% report, which makes it in sync. The notification-generating %% application times out, and send again. This time it'll work. -v3_security(suite) -> [v3_crypto_basic, v3_md5_auth, v3_sha_auth, v3_des_priv]. v3_crypto_basic(suite) -> []; v3_crypto_basic(_Config) -> @@ -3591,22 +3616,8 @@ bad_return() -> %%% Note that many of the functions in the standard mib is %%% already tested by the normal tests. %%%----------------------------------------------------------------- -standard_mibs(suite) -> - [snmp_standard_mib, snmp_community_mib, - snmp_framework_mib, - snmp_target_mib, snmp_notification_mib, - snmp_view_based_acm_mib]. - -standard_mibs_2(suite) -> - [snmpv2_mib_2, snmp_community_mib_2, - snmp_framework_mib_2, - snmp_target_mib_2, snmp_notification_mib_2, - snmp_view_based_acm_mib_2]. - -standard_mibs_3(suite) -> - [snmpv2_mib_3,snmp_framework_mib_3, snmp_mpd_mib_3, - snmp_target_mib_3, snmp_notification_mib_3, - snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]. + + %%----------------------------------------------------------------- %% For this test, the agent is configured for v1. @@ -4527,27 +4538,12 @@ loop_it_2(Oid, N) -> %%% Testing of reported bugs and other tickets. %%%----------------------------------------------------------------- -reported_bugs(suite) -> - [otp_1128, otp_1129, otp_1131, otp_1162, - otp_1222, otp_1298, otp_1331, otp_1338, - otp_1342, otp_2776, otp_2979, otp_3187, otp_3725]. -reported_bugs_2(suite) -> - [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, - otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, - otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]. -reported_bugs_3(suite) -> - [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, - otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, - otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, - otp_3542]. %% These are (ticket) test cases where the initiation has to be done %% individually. -tickets(suite) -> - [otp_4394]. %%----------------------------------------------------------------- %% Ticket: OTP-1128 @@ -4971,10 +4967,6 @@ otp_3725_test(MaNode) -> %%----------------------------------------------------------------- -otp_4394(suite) -> {req, [], {conf, - init_otp_4394, - [otp_4394_test], - finish_otp_4394}}. init_otp_4394(Config) when list(Config) -> ?DBG("init_otp_4394 -> entry with" diff --git a/lib/snmp/test/snmp_agent_v3_test.erl b/lib/snmp/test/snmp_agent_v3_test.erl index 71b355057d..266be72878 100644 --- a/lib/snmp/test/snmp_agent_v3_test.erl +++ b/lib/snmp/test/snmp_agent_v3_test.erl @@ -28,7 +28,7 @@ -define(application, snmp). -include_lib("kernel/include/file.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -define(SNMP_USE_V3, true). -include_lib("snmp/include/snmp_types.hrl"). @@ -83,10 +83,143 @@ _ -> V3 end). -all(suite) -> {req, - [mnesia, distribution, - {local_slave_nodes, 2}, {time, 360}], - [{conf, init_all, cases(), finish_all}]}. +all() -> +[cases()]. + +groups() -> + [{mib_storage, [], + [{group, mib_storage_ets}, {group, mib_storage_dets}, + {group, mib_storage_mnesia}, + {group, mib_storage_size_check_ets}, + {group, mib_storage_size_check_dets}, + {group, mib_storage_size_check_mnesia}, + {group, mib_storage_varm_dets}, + {group, mib_storage_varm_mnesia}]}, + {mib_storage_ets, [], mib_storage_ets_cases()}, + {mib_storage_dets, [], mib_storage_dets_cases()}, + {mib_storage_mnesia, [], mib_storage_mnesia_cases()}, + {mib_storage_size_check_ets, [], + mse_size_check_cases()}, + {mib_storage_size_check_dets, [], + msd_size_check_cases()}, + {mib_storage_size_check_mnesia, [], + msm_size_check_cases()}, + {mib_storage_varm_dets, [], + varm_mib_storage_dets_cases()}, + {mib_storage_varm_mnesia, [], + varm_mib_storage_mnesia_cases()}, + {test_v1, [], v1_cases()}, {test_v2, [], v2_cases()}, + {test_v1_v2, [], v1_v2_cases()}, + {test_v3, [], v3_cases()}, + {test_multi_threaded, [], mt_cases()}, + {multiple_reqs, [], mul_cases()}, + {multiple_reqs_2, [], mul_cases_2()}, + {v2_inform, [], [v2_inform_i]}, + {v3_security, [], + [v3_crypto_basic, v3_md5_auth, v3_sha_auth, + v3_des_priv]}, + {standard_mibs, [], + [snmp_standard_mib, snmp_community_mib, + snmp_framework_mib, snmp_target_mib, + snmp_notification_mib, snmp_view_based_acm_mib]}, + {standard_mibs_2, [], + [snmpv2_mib_2, snmp_community_mib_2, + snmp_framework_mib_2, snmp_target_mib_2, + snmp_notification_mib_2, snmp_view_based_acm_mib_2]}, + {standard_mibs_3, [], + [snmpv2_mib_3, snmp_framework_mib_3, snmp_mpd_mib_3, + snmp_target_mib_3, snmp_notification_mib_3, + snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]}, + {reported_bugs, [], + [otp_1128, otp_1129, otp_1131, otp_1162, otp_1222, + otp_1298, otp_1331, otp_1338, otp_1342, otp_2776, + otp_2979, otp_3187, otp_3725]}, + {reported_bugs_2, [], + [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, + otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, + otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]}, + {reported_bugs_3, [], + [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, + otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, + otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, + otp_3542]}, + {tickets, [], [{group, otp_4394}]}, + {otp_4394, [], [otp_4394_test]}]. + +init_per_group(otp_4394, Config) -> + init_otp_4394(Config); +init_per_group(v2_inform, Config) -> + init_v2_inform(Config); +init_per_group(multiple_reqs_2, Config) -> + init_mul(Config); +init_per_group(multiple_reqs, Config) -> + init_mul(Config); +init_per_group(test_multi_threaded, Config) -> + init_mt(Config); +init_per_group(test_v3, Config) -> + init_v3(Config); +init_per_group(test_v1_v2, Config) -> + init_v1_v2(Config); +init_per_group(test_v2, Config) -> + init_v2(Config); +init_per_group(test_v1, Config) -> + init_v1(Config); +init_per_group(mib_storage_varm_mnesia, Config) -> + init_varm_mib_storage_mnesia(Config); +init_per_group(mib_storage_varm_dets, Config) -> + init_varm_mib_storage_dets(Config); +init_per_group(mib_storage_size_check_mnesia, Config) -> + init_size_check_msm(Config); +init_per_group(mib_storage_size_check_dets, Config) -> + init_size_check_msd(Config); +init_per_group(mib_storage_size_check_ets, Config) -> + init_size_check_mse(Config); +init_per_group(mib_storage_mnesia, Config) -> + init_mib_storage_mnesia(Config); +init_per_group(mib_storage_dets, Config) -> + init_mib_storage_dets(Config); +init_per_group(mib_storage_ets, Config) -> + init_mib_storage_ets(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(otp_4394, Config) -> + finish_otp_4394(Config); +end_per_group(v2_inform, Config) -> + finish_v2_inform(Config); +end_per_group(multiple_reqs_2, Config) -> + finish_mul(Config); +end_per_group(multiple_reqs, Config) -> + finish_mul(Config); +end_per_group(test_multi_threaded, Config) -> + finish_mt(Config); +end_per_group(test_v3, Config) -> + finish_v3(Config); +end_per_group(test_v1_v2, Config) -> + finish_v1_v2(Config); +end_per_group(test_v2, Config) -> + finish_v2(Config); +end_per_group(test_v1, Config) -> + finish_v1(Config); +end_per_group(mib_storage_varm_mnesia, Config) -> + finish_varm_mib_storage_mnesia(Config); +end_per_group(mib_storage_varm_dets, Config) -> + finish_varm_mib_storage_dets(Config); +end_per_group(mib_storage_size_check_mnesia, Config) -> + finish_size_check_msm(Config); +end_per_group(mib_storage_size_check_dets, Config) -> + finish_size_check_msd(Config); +end_per_group(mib_storage_size_check_ets, Config) -> + finish_size_check_mse(Config); +end_per_group(mib_storage_mnesia, Config) -> + finish_mib_storage_mnesia(Config); +end_per_group(mib_storage_dets, Config) -> + finish_mib_storage_dets(Config); +end_per_group(mib_storage_ets, Config) -> + finish_mib_storage_ets(Config); +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) when list(Config) -> Dog = ?t:timetrap(?t:minutes(6)), @@ -97,25 +230,18 @@ end_per_testcase(_Case, Config) when list(Config) -> ?t:timetrap_cancel(Dog), Config. -cases() -> - case ?OSTYPE() of - vxworks -> - %% No crypto app, so skip v3 testcases - [ - app_info, - test_v1, test_v2, test_v1_v2, - test_multi_threaded, - mib_storage, - tickets]; - _Else -> - [ - app_info, - test_v1, test_v2, test_v1_v2, test_v3, - test_multi_threaded, - mib_storage, - tickets - ] - end. +cases() -> +case ?OSTYPE() of + vxworks -> + [app_info, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_multi_threaded}, + {group, mib_storage}, {group, tickets}]; + _Else -> + [app_info, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_v3}, + {group, test_multi_threaded}, {group, mib_storage}, + {group, tickets}] +end. %%%----------------------------------------------------------------- @@ -460,144 +586,56 @@ delete_mib_storage_mnesia_tables() -> %% , and a second version _2. There may be several %% versions as well, _N. %%----------------------------------------------------------------- -mib_storage(suite) -> [ - mib_storage_ets, - mib_storage_dets, - mib_storage_mnesia, - mib_storage_size_check_ets, - mib_storage_size_check_dets, - mib_storage_size_check_mnesia, - mib_storage_varm_dets, - mib_storage_varm_mnesia - ]. - -mib_storage_ets(suite) -> {req, [], {conf, init_mib_storage_ets, - mib_storage_ets_cases(), - finish_mib_storage_ets}}. - -mib_storage_dets(suite) -> {req, [], {conf, init_mib_storage_dets, - mib_storage_dets_cases(), - finish_mib_storage_dets}}. - -mib_storage_mnesia(suite) -> {req, [], {conf, init_mib_storage_mnesia, - mib_storage_mnesia_cases(), - finish_mib_storage_mnesia}}. - -mib_storage_size_check_ets(suite) -> - {req, [], {conf, - init_size_check_mse, - mse_size_check_cases(), - finish_size_check_mse}}. - -mib_storage_size_check_dets(suite) -> - {req, [], {conf, - init_size_check_msd, - msd_size_check_cases(), - finish_size_check_msd}}. - -mib_storage_size_check_mnesia(suite) -> - {req, [], {conf, - init_size_check_msm, - msm_size_check_cases(), - finish_size_check_msm}}. - -mib_storage_varm_dets(suite) -> - {req, [], {conf, - init_varm_mib_storage_dets, - varm_mib_storage_dets_cases(), - finish_varm_mib_storage_dets}}. - -mib_storage_varm_mnesia(suite) -> - {req, [], {conf, - init_varm_mib_storage_mnesia, - varm_mib_storage_mnesia_cases(), - finish_varm_mib_storage_mnesia}}. - -mib_storage_ets_cases() -> - [ - mse_simple, - mse_v1_processing, - mse_big, - mse_big2, - mse_loop_mib, - mse_api, - mse_sa_register, - mse_v1_trap, - mse_sa_error, - mse_next_across_sa, - mse_undo, - mse_standard_mib, - mse_community_mib, - mse_framework_mib, - mse_target_mib, - mse_notification_mib, - mse_view_based_acm_mib, - mse_sparse_table, - mse_me_of, - mse_mib_of]. - -mib_storage_dets_cases() -> - [ - msd_simple, - msd_v1_processing, - msd_big, - msd_big2, - msd_loop_mib, - msd_api, - msd_sa_register, - msd_v1_trap, - msd_sa_error, - msd_next_across_sa, - msd_undo, - msd_standard_mib, - msd_community_mib, - msd_framework_mib, - msd_target_mib, - msd_notification_mib, - msd_view_based_acm_mib, - msd_sparse_table, - msd_me_of, - msd_mib_of - ]. - -mib_storage_mnesia_cases() -> - [ - msm_simple, - msm_v1_processing, - msm_big, - msm_big2, - msm_loop_mib, - msm_api, - msm_sa_register, - msm_v1_trap, - msm_sa_error, - msm_next_across_sa, - msm_undo, - msm_standard_mib, - msm_community_mib, - msm_framework_mib, - msm_target_mib, - msm_notification_mib, - msm_view_based_acm_mib, - msm_sparse_table, - msm_me_of, - msm_mib_of - ]. - -mse_size_check_cases() -> - [mse_size_check]. - -msd_size_check_cases() -> - [msd_size_check]. - -msm_size_check_cases() -> - [msm_size_check]. - -varm_mib_storage_dets_cases() -> - [msd_varm_mib_start]. - -varm_mib_storage_mnesia_cases() -> - [msm_varm_mib_start]. + + + + + + + + + +mib_storage_ets_cases() -> +[mse_simple, mse_v1_processing, mse_big, mse_big2, + mse_loop_mib, mse_api, mse_sa_register, mse_v1_trap, + mse_sa_error, mse_next_across_sa, mse_undo, + mse_standard_mib, mse_community_mib, mse_framework_mib, + mse_target_mib, mse_notification_mib, + mse_view_based_acm_mib, mse_sparse_table, mse_me_of, + mse_mib_of]. + +mib_storage_dets_cases() -> +[msd_simple, msd_v1_processing, msd_big, msd_big2, + msd_loop_mib, msd_api, msd_sa_register, msd_v1_trap, + msd_sa_error, msd_next_across_sa, msd_undo, + msd_standard_mib, msd_community_mib, msd_framework_mib, + msd_target_mib, msd_notification_mib, + msd_view_based_acm_mib, msd_sparse_table, msd_me_of, + msd_mib_of]. + +mib_storage_mnesia_cases() -> +[msm_simple, msm_v1_processing, msm_big, msm_big2, + msm_loop_mib, msm_api, msm_sa_register, msm_v1_trap, + msm_sa_error, msm_next_across_sa, msm_undo, + msm_standard_mib, msm_community_mib, msm_framework_mib, + msm_target_mib, msm_notification_mib, + msm_view_based_acm_mib, msm_sparse_table, msm_me_of, + msm_mib_of]. + +mse_size_check_cases() -> +[mse_size_check]. + +msd_size_check_cases() -> +[msd_size_check]. + +msm_size_check_cases() -> +[msm_size_check]. + +varm_mib_storage_dets_cases() -> +[msd_varm_mib_start]. + +varm_mib_storage_mnesia_cases() -> +[msm_varm_mib_start]. init_mib_storage_ets(Config) when list(Config) -> ?LOG("init_mib_storage_ets -> entry", []), @@ -1099,20 +1137,14 @@ app_dir(App) -> end. -test_v1(suite) -> {req, [], {conf, init_v1, v1_cases(), finish_v1}}. %v1_cases() -> [loop_mib]; -v1_cases() -> - [simple, - db_notify_client, - v1_processing, big, big2, loop_mib, - api, subagent, mnesia, multiple_reqs, - sa_register, v1_trap, sa_error, next_across_sa, undo, reported_bugs, - standard_mibs, sparse_table, cnt_64, - opaque, - % opaque]. - - change_target_addr_config]. +v1_cases() -> +[simple, db_notify_client, v1_processing, big, big2, + loop_mib, api, subagent, mnesia, {group, multiple_reqs}, + sa_register, v1_trap, sa_error, next_across_sa, undo, + {group, reported_bugs}, {group, standard_mibs}, + sparse_table, cnt_64, opaque, change_target_addr_config]. init_v1(Config) when list(Config) -> ?line SaNode = ?config(snmp_sa, Config), @@ -1129,15 +1161,15 @@ finish_v1(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v2(suite) -> {req, [], {conf, init_v2, v2_cases(), finish_v2}}. %v2_cases() -> [loop_mib_2]; -v2_cases() -> - [simple_2, v2_processing, big_2, big2_2, loop_mib_2, - api_2, subagent_2, mnesia_2, - multiple_reqs_2, sa_register_2, v2_trap, v2_inform, sa_error_2, - next_across_sa_2, undo_2, reported_bugs_2, standard_mibs_2, - v2_types, implied, sparse_table_2, cnt_64_2, opaque_2, v2_caps]. +v2_cases() -> +[simple_2, v2_processing, big_2, big2_2, loop_mib_2, + api_2, subagent_2, mnesia_2, {group, multiple_reqs_2}, + sa_register_2, v2_trap, {group, v2_inform}, sa_error_2, + next_across_sa_2, undo_2, {group, reported_bugs_2}, + {group, standard_mibs_2}, v2_types, implied, + sparse_table_2, cnt_64_2, opaque_2, v2_caps]. init_v2(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1154,10 +1186,9 @@ finish_v2(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v1_v2(suite) -> {req, [], {conf, init_v1_v2, v1_v2_cases(), finish_v1_v2}}. -v1_v2_cases() -> - [simple_bi]. +v1_v2_cases() -> +[simple_bi]. init_v1_v2(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1174,16 +1205,16 @@ finish_v1_v2(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v3(suite) -> {req, [], {conf, init_v3, v3_cases(), finish_v3}}. %v3_cases() -> [loop_mib_3]; -v3_cases() -> - [simple_3, v3_processing, - big_3, big2_3, api_3, subagent_3, mnesia_3, loop_mib_3, - multiple_reqs_3, sa_register_3, v3_trap, v3_inform, sa_error_3, - next_across_sa_3, undo_3, reported_bugs_3, standard_mibs_3, - v3_security, - v2_types_3, implied_3, sparse_table_3, cnt_64_3, opaque_3, v2_caps_3]. +v3_cases() -> +[simple_3, v3_processing, big_3, big2_3, api_3, + subagent_3, mnesia_3, loop_mib_3, multiple_reqs_3, + sa_register_3, v3_trap, v3_inform, sa_error_3, + next_across_sa_3, undo_3, {group, reported_bugs_3}, + {group, standard_mibs_3}, {group, v3_security}, + v2_types_3, implied_3, sparse_table_3, cnt_64_3, + opaque_3, v2_caps_3]. init_v3(Config) when list(Config) -> %% Make sure crypto works, otherwise start_agent will fail @@ -1221,10 +1252,9 @@ finish_v3(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_multi_threaded(suite) -> {req, [], {conf, init_mt, mt_cases(), finish_mt}}. -mt_cases() -> - [multi_threaded, mt_trap]. +mt_cases() -> +[multi_threaded, mt_trap]. init_mt(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1739,21 +1769,19 @@ mnesia_2(X) -> mnesia(X). mnesia_3(X) -> mnesia(X). -multiple_reqs(suite) -> - {req, [], {conf, init_mul, mul_cases(), finish_mul}}. -mul_cases() -> - [mul_get, mul_get_err, mul_next, mul_next_err, mul_set_err]. +mul_cases() -> +[mul_get, mul_get_err, mul_next, mul_next_err, + mul_set_err]. -multiple_reqs_2(suite) -> - {req, [], {conf, init_mul, mul_cases_2(), finish_mul}}. multiple_reqs_3(_X) -> {req, [], {conf, init_mul, mul_cases_3(), finish_mul}}. -mul_cases_2() -> - [mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, mul_set_err_2]. +mul_cases_2() -> +[mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, + mul_set_err_2]. mul_cases_3() -> @@ -1939,8 +1967,6 @@ v2_trap(Config) when list(Config) -> v3_trap(X) -> v2_trap(X). -v2_inform(suite) -> - {req, [], {conf, init_v2_inform, [v2_inform_i], finish_v2_inform}}. v3_inform(_X) -> %% v2_inform(X). @@ -2112,7 +2138,6 @@ v3_processing(Config) when list(Config) -> %% accomplished by the first inform sent. That one will generate a %% report, which makes it in sync. The notification-generating %% application times out, and send again. This time it'll work. -v3_security(suite) -> [v3_crypto_basic, v3_md5_auth, v3_sha_auth, v3_des_priv]. v3_crypto_basic(suite) -> []; v3_crypto_basic(_Config) -> @@ -3591,22 +3616,8 @@ bad_return() -> %%% Note that many of the functions in the standard mib is %%% already tested by the normal tests. %%%----------------------------------------------------------------- -standard_mibs(suite) -> - [snmp_standard_mib, snmp_community_mib, - snmp_framework_mib, - snmp_target_mib, snmp_notification_mib, - snmp_view_based_acm_mib]. - -standard_mibs_2(suite) -> - [snmpv2_mib_2, snmp_community_mib_2, - snmp_framework_mib_2, - snmp_target_mib_2, snmp_notification_mib_2, - snmp_view_based_acm_mib_2]. - -standard_mibs_3(suite) -> - [snmpv2_mib_3,snmp_framework_mib_3, snmp_mpd_mib_3, - snmp_target_mib_3, snmp_notification_mib_3, - snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]. + + %%----------------------------------------------------------------- %% For this test, the agent is configured for v1. @@ -4527,27 +4538,12 @@ loop_it_2(Oid, N) -> %%% Testing of reported bugs and other tickets. %%%----------------------------------------------------------------- -reported_bugs(suite) -> - [otp_1128, otp_1129, otp_1131, otp_1162, - otp_1222, otp_1298, otp_1331, otp_1338, - otp_1342, otp_2776, otp_2979, otp_3187, otp_3725]. -reported_bugs_2(suite) -> - [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, - otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, - otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]. -reported_bugs_3(suite) -> - [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, - otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, - otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, - otp_3542]. %% These are (ticket) test cases where the initiation has to be done %% individually. -tickets(suite) -> - [otp_4394]. %%----------------------------------------------------------------- %% Ticket: OTP-1128 @@ -4971,10 +4967,6 @@ otp_3725_test(MaNode) -> %%----------------------------------------------------------------- -otp_4394(suite) -> {req, [], {conf, - init_otp_4394, - [otp_4394_test], - finish_otp_4394}}. init_otp_4394(Config) when list(Config) -> ?DBG("init_otp_4394 -> entry with" diff --git a/lib/snmp/test/snmp_app_test.erl b/lib/snmp/test/snmp_app_test.erl index a973a2f325..64dd638f83 100644 --- a/lib/snmp/test/snmp_app_test.erl +++ b/lib/snmp/test/snmp_app_test.erl @@ -23,7 +23,8 @@ -module(snmp_app_test). -export([ - all/1, init_per_suite/1, fin_suite/1, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, + end_per_suite/1, init_per_testcase/2, end_per_testcase/2, fields/1, @@ -32,7 +33,7 @@ app_depend/1, undef_funcs/1, - start_and_stop/1, + start_and_stop_empty/1, start_and_stop_with_agent/1, start_and_stop_with_manager/1, @@ -44,23 +45,32 @@ -include_lib("kernel/include/file.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - fields, - modules, - exportall, - app_depend, - undef_funcs, - start_and_stop - ], - {conf, init_per_suite, Cases, fin_suite}. +all() -> +Cases = [fields, modules, exportall, app_depend, + undef_funcs, {group, start_and_stop}], + Cases. + +groups() -> + [{start_and_stop, [], + [start_and_stop_empty, start_and_stop_with_agent, + start_and_stop_with_manager, + start_and_stop_with_agent_and_manager, + start_epmty_and_then_agent_and_manager_and_stop, + start_with_agent_and_then_manager_and_stop, + start_with_manager_and_then_agent_and_stop]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_suite(Config) when is_list(Config) -> ?DISPLAY_SUITE_INFO(), @@ -97,9 +107,9 @@ is_app(App) -> {error, {invalid_format, Error}} end. -fin_suite(suite) -> []; -fin_suite(doc) -> []; -fin_suite(Config) when is_list(Config) -> +end_per_suite(suite) -> []; +end_per_suite(doc) -> []; +end_per_suite(Config) when is_list(Config) -> Config. @@ -319,16 +329,6 @@ undef_funcs_make_name(App, PostFix) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -start_and_stop(suite) -> - [ - start_and_stop_empty, - start_and_stop_with_agent, - start_and_stop_with_manager, - start_and_stop_with_agent_and_manager, - start_epmty_and_then_agent_and_manager_and_stop, - start_with_agent_and_then_manager_and_stop, - start_with_manager_and_then_agent_and_stop - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/snmp/test/snmp_appup_test.erl b/lib/snmp/test/snmp_appup_test.erl index 3c708b8977..b93f960814 100644 --- a/lib/snmp/test/snmp_appup_test.erl +++ b/lib/snmp/test/snmp_appup_test.erl @@ -23,25 +23,33 @@ -module(snmp_appup_test). -export([ - all/1, init_per_suite/1, fin_suite/1, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, + end_per_suite/1, init_per_testcase/2, end_per_testcase/2, appup_file/1 ]). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("snmp_test_lib.hrl"). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - appup_file - ], - {conf, init_per_suite, Cases, fin_suite}. +all() -> +Cases = [appup_file], + Cases. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -76,9 +84,9 @@ file_name(App, Ext) -> filename:join([LibDir, "ebin", atom_to_list(App) ++ Ext]). -fin_suite(suite) -> []; -fin_suite(doc) -> []; -fin_suite(Config) when is_list(Config) -> +end_per_suite(suite) -> []; +end_per_suite(doc) -> []; +end_per_suite(Config) when is_list(Config) -> Config. diff --git a/lib/snmp/test/snmp_compiler_test.erl b/lib/snmp/test/snmp_compiler_test.erl index 7c1b278ac7..98ffaf8bae 100644 --- a/lib/snmp/test/snmp_compiler_test.erl +++ b/lib/snmp/test/snmp_compiler_test.erl @@ -28,7 +28,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -include_lib("snmp/include/snmp_types.hrl"). @@ -37,7 +37,7 @@ %% External exports %%---------------------------------------------------------------------- -export([ - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, description/1, @@ -45,7 +45,7 @@ imports/1, module_identity/1, - tickets/1, + otp_6150/1, otp_8574/1, otp_8595/1 @@ -90,21 +90,20 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %% Test case definitions %%====================================================================== -all(suite) -> - [ - description, - oid_conflicts, - imports, - module_identity, - tickets - ]. - -tickets(suite) -> - [ - otp_6150, - otp_8574, - otp_8595 - ]. +all() -> +[description, oid_conflicts, imports, module_identity, + {group, tickets}]. + +groups() -> + [{tickets, [], [otp_6150, otp_8574, otp_8595]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + %%====================================================================== diff --git a/lib/snmp/test/snmp_conf_test.erl b/lib/snmp/test/snmp_conf_test.erl index 90416919d0..c4341d8d7e 100644 --- a/lib/snmp/test/snmp_conf_test.erl +++ b/lib/snmp/test/snmp_conf_test.erl @@ -26,7 +26,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -include_lib("snmp/include/STANDARD-MIB.hrl"). @@ -37,7 +37,7 @@ %% External exports %%---------------------------------------------------------------------- -export([ - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, check_mandatory/1, @@ -86,26 +86,22 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %%====================================================================== %% Test case definitions %%====================================================================== -all(suite) -> - [ - check_mandatory, - check_integer1, - check_integer2, - check_string1, - check_string2, - check_atom, - check_ip, - check_taddress, - check_packet_size, - check_oid, - check_sec_model1, - check_sec_model2, - check_sec_level, - check_timer, - - read, - read_files - ]. +all() -> +[check_mandatory, check_integer1, check_integer2, + check_string1, check_string2, check_atom, check_ip, + check_taddress, check_packet_size, check_oid, + check_sec_model1, check_sec_model2, check_sec_level, + check_timer, read, read_files]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%====================================================================== diff --git a/lib/snmp/test/snmp_log_test.erl b/lib/snmp/test/snmp_log_test.erl index dd2f27862e..b692017407 100644 --- a/lib/snmp/test/snmp_log_test.erl +++ b/lib/snmp/test/snmp_log_test.erl @@ -29,7 +29,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -define(SNMP_USE_V3, true). -include_lib("snmp/include/snmp_types.hrl"). @@ -42,17 +42,17 @@ -export([ init_per_testcase/2, end_per_testcase/2, - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, open_and_close/1, - open_write_and_close/1, + open_write_and_close1/1, open_write_and_close2/1, open_write_and_close3/1, open_write_and_close4/1, - log_to_io/1, + log_to_io1/1, log_to_io2/1, - log_to_txt/1, + log_to_txt1/1, log_to_txt2/1, log_to_txt3/1 @@ -108,37 +108,30 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %% Test case definitions %%====================================================================== %% ?SKIP(not_yet_implemented). -all(suite) -> - [ - open_and_close, - open_write_and_close, - log_to_io, - log_to_txt - ]. - - -open_write_and_close(suite) -> - [ - open_write_and_close1, - open_write_and_close2, - open_write_and_close3, - open_write_and_close4 - ]. - - -log_to_io(suite) -> - [ - log_to_io1, - log_to_io2 - ]. - - -log_to_txt(suite) -> - [ - log_to_txt1, - log_to_txt2, - log_to_txt3 - ]. +all() -> +[open_and_close, {group, open_write_and_close}, + {group, log_to_io}, {group, log_to_txt}]. + +groups() -> + [{open_write_and_close, [], + [open_write_and_close1, open_write_and_close2, + open_write_and_close3, open_write_and_close4]}, + {log_to_io, [], [log_to_io1, log_to_io2]}, + {log_to_txt, [], + [log_to_txt1, log_to_txt2, log_to_txt3]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + + + + + + %%====================================================================== diff --git a/lib/snmp/test/snmp_manager_config_test.erl b/lib/snmp/test/snmp_manager_config_test.erl index f3a4d70ef8..a72dd0cc22 100644 --- a/lib/snmp/test/snmp_manager_config_test.erl +++ b/lib/snmp/test/snmp_manager_config_test.erl @@ -31,7 +31,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -include_lib("snmp/src/manager/snmpm_usm.hrl"). @@ -42,10 +42,10 @@ %% -compile(export_all). -export([ - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, - start_and_stop/1, + simple_start_and_stop/1, start_without_mandatory_opts1/1, @@ -58,36 +58,36 @@ start_with_invalid_agents_conf_file1/1, start_with_invalid_usm_conf_file1/1, - normal_op/1, + - system/1, + simple_system_op/1, - users/1, + register_user_using_file/1, register_user_using_function/1, register_user_failed_using_function1/1, - agents/1, + register_agent_using_file/1, register_agent_using_function/1, register_agent_failed_using_function1/1, - usm_users/1, + register_usm_user_using_file/1, register_usm_user_using_function/1, register_usm_user_failed_using_function1/1, update_usm_user_info/1, - counter/1, + create_and_increment/1, - stats_counter/1, + stats_create_and_increment/1, - tickets/1, + otp_7219/1, - otp_8395/1, + otp_8395_1/1, otp_8395_2/1, otp_8395_3/1, @@ -163,33 +163,55 @@ end_per_testcase(Case, Config) when is_list(Config) -> %%====================================================================== % all(doc) -> % "The top snmp manager config test case"; -all(suite) -> - [ - start_and_stop, - normal_op, - tickets - ]. +all() -> +[{group, start_and_stop}, {group, normal_op}, + {group, tickets}]. + +groups() -> + [{start_and_stop, [], + [simple_start_and_stop, start_without_mandatory_opts1, + start_without_mandatory_opts2, + start_with_all_valid_opts, start_with_unknown_opts, + start_with_incorrect_opts, + start_with_invalid_manager_conf_file1, + start_with_invalid_users_conf_file1, + start_with_invalid_agents_conf_file1, + start_with_invalid_usm_conf_file1]}, + {normal_op, [], + [{group, system}, {group, agents}, {group, users}, + {group, usm_users}, {group, counter}, + {group, stats_counter}]}, + {system, [], [simple_system_op]}, + {users, [], + [register_user_using_file, register_user_using_function, + register_user_failed_using_function1]}, + {agents, [], + [register_agent_using_file, + register_agent_using_function, + register_agent_failed_using_function1]}, + {usm_users, [], + [register_usm_user_using_file, + register_usm_user_using_function, + register_usm_user_failed_using_function1, + update_usm_user_info]}, + {counter, [], [create_and_increment]}, + {stats_counter, [], [stats_create_and_increment]}, + {tickets, [], [otp_7219, {group, otp_8395}]}, + {otp_8395, [], + [otp_8395_1, otp_8395_2, otp_8395_3, otp_8395_4]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%====================================================================== %% Test functions %%====================================================================== -start_and_stop(doc) -> - "A collection of start and stop tests"; -start_and_stop(suite) -> - [ - simple_start_and_stop, - start_without_mandatory_opts1, - start_without_mandatory_opts2, - start_with_all_valid_opts, - start_with_unknown_opts, - start_with_incorrect_opts, - start_with_invalid_manager_conf_file1, - start_with_invalid_users_conf_file1, - start_with_invalid_agents_conf_file1, - start_with_invalid_usm_conf_file1 - ]. %% @@ -1641,29 +1663,12 @@ start_with_invalid_usm_conf_file1(Conf) when is_list(Conf) -> %% --- %% -normal_op(doc) -> - "A collection of tests for normal operation"; -normal_op(suite) -> - [ - system, - agents, - users, - usm_users, - counter, - stats_counter - ]. %% %% --- %% -system(doc) -> - "Various system related operations with the snmp manager config"; -system(suite) -> - [ - simple_system_op - ]. simple_system_op(suite) -> []; simple_system_op(doc) -> @@ -1702,14 +1707,6 @@ simple_system_op(Conf) when is_list(Conf) -> %% --- %% -users(doc) -> - "Various users related operations with the snmp manager config"; -users(suite) -> - [ - register_user_using_file, - register_user_using_function, - register_user_failed_using_function1 - ]. %% @@ -1764,14 +1761,6 @@ register_user_failed_using_function1(Conf) when is_list(Conf) -> %% --- %% -agents(doc) -> - "Various agents related operations with the snmp manager config"; -agents(suite) -> - [ - register_agent_using_file, - register_agent_using_function, - register_agent_failed_using_function1 - ]. %% @@ -1950,15 +1939,6 @@ register_agent_failed_using_function1(Conf) when is_list(Conf) -> %% --- %% -usm_users(doc) -> - "Various USM users related operations with the snmp manager config"; -usm_users(suite) -> - [ - register_usm_user_using_file, - register_usm_user_using_function, - register_usm_user_failed_using_function1, - update_usm_user_info - ]. %% @@ -2208,12 +2188,6 @@ update_usm_user_info(Conf) when is_list(Conf) -> %% --- %% -counter(doc) -> - "Various counter related operations with the snmp manager config"; -counter(suite) -> - [ - create_and_increment - ]. %% @@ -2258,13 +2232,6 @@ create_and_increment(Conf) when is_list(Conf) -> %% --- %% -stats_counter(doc) -> - "Various statistic counter related operations with the " - "snmp manager config"; -stats_counter(suite) -> - [ - stats_create_and_increment - ]. %% @@ -2323,11 +2290,6 @@ loop(N, _, F) when (N > 0) andalso is_function(F) -> %% Ticket test-cases %%====================================================================== -tickets(suite) -> - [ - otp_7219, - otp_8395 - ]. otp_7219(suite) -> @@ -2379,13 +2341,6 @@ otp_7219(Config) when is_list(Config) -> -otp_8395(suite) -> - [ - otp_8395_1, - otp_8395_2, - otp_8395_3, - otp_8395_4 - ]. otp_8395_1(suite) -> []; otp_8395_1(doc) -> diff --git a/lib/snmp/test/snmp_manager_test.erl b/lib/snmp/test/snmp_manager_test.erl index 83e861589d..50836db731 100644 --- a/lib/snmp/test/snmp_manager_test.erl +++ b/lib/snmp/test/snmp_manager_test.erl @@ -31,7 +31,7 @@ %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -include("snmp_test_data/Test2.hrl"). @@ -43,10 +43,10 @@ %% External exports %%---------------------------------------------------------------------- -export([ - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, - start_and_stop_tests/1, + simple_start_and_stop1/1, simple_start_and_stop2/1, simple_start_and_monitor_crash1/1, @@ -54,49 +54,49 @@ notify_started01/1, notify_started02/1, - user_tests/1, + register_user1/1, - agent_tests/1, + register_agent1/1, register_agent2/1, - misc_tests/1, + info/1, - request_tests/1, + - get_tests/1, + simple_sync_get1/1, simple_sync_get2/1, simple_async_get1/1, simple_async_get2/1, - get_next_tests/1, + simple_sync_get_next1/1, simple_sync_get_next2/1, simple_async_get_next1/1, simple_async_get_next2/1, - set_tests/1, + simple_sync_set1/1, simple_sync_set2/1, simple_async_set1/1, simple_async_set2/1, - bulk_tests/1, + simple_sync_get_bulk1/1, simple_sync_get_bulk2/1, simple_async_get_bulk1/1, simple_async_get_bulk2/1, - misc_request_tests/1, + misc_async1/1, misc_async2/1, discovery/1, - event_tests/1, + trap1/1, trap2/1, @@ -109,10 +109,10 @@ report/1, - tickets/1, - otp8015/1, + + otp8015_1/1, - otp8395/1, + otp8395_1/1 ]). @@ -359,118 +359,64 @@ end_per_testcase2(Case, Config) -> %% Test case definitions %%====================================================================== -all(suite) -> - [ - start_and_stop_tests, - misc_tests, - user_tests, - agent_tests, - request_tests, - event_tests, - discovery, - tickets - ]. - -start_and_stop_tests(suite) -> - [ - simple_start_and_stop1, - simple_start_and_stop2, - simple_start_and_monitor_crash1, - simple_start_and_monitor_crash2, - notify_started01, - notify_started02 - ]. - -misc_tests(suite) -> - [ - info - ]. - -user_tests(suite) -> - [ - register_user1 - ]. - -agent_tests(suite) -> - [ - register_agent1, - register_agent2 - ]. - -request_tests(suite) -> - [ - get_tests, - get_next_tests, - set_tests, - bulk_tests, - misc_request_tests - ]. - -get_tests(suite) -> - [ - simple_sync_get1, - simple_sync_get2, - simple_async_get1, - simple_async_get2 - ]. - -get_next_tests(suite) -> - [ - simple_sync_get_next1, - simple_sync_get_next2, - simple_async_get_next1, - simple_async_get_next2 - ]. - -set_tests(suite) -> - [ - simple_sync_set1, - simple_sync_set2, - simple_async_set1, - simple_async_set2 - ]. - -bulk_tests(suite) -> - [ - simple_sync_get_bulk1, - simple_sync_get_bulk2, - simple_async_get_bulk1, - simple_async_get_bulk2 - ]. - -misc_request_tests(suite) -> - [ - misc_async1, - misc_async2 - ]. - -event_tests(suite) -> - [ - trap1, - trap2, - inform1, - inform2, - inform3, - inform4, - inform_swarm, - report - ]. - -tickets(suite) -> - [ - otp8015, - otp8395 - ]. - -otp8015(suite) -> - [ - otp8015_1 - ]. - -otp8395(suite) -> - [ - otp8395_1 - ]. +all() -> +[{group, start_and_stop_tests}, {group, misc_tests}, + {group, user_tests}, {group, agent_tests}, + {group, request_tests}, {group, event_tests}, discovery, + {group, tickets}]. + +groups() -> + [{start_and_stop_tests, [], + [simple_start_and_stop1, simple_start_and_stop2, + simple_start_and_monitor_crash1, + simple_start_and_monitor_crash2, notify_started01, + notify_started02]}, + {misc_tests, [], [info]}, + {user_tests, [], [register_user1]}, + {agent_tests, [], [register_agent1, register_agent2]}, + {request_tests, [], + [{group, get_tests}, {group, get_next_tests}, + {group, set_tests}, {group, bulk_tests}, + {group, misc_request_tests}]}, + {get_tests, [], + [simple_sync_get1, simple_sync_get2, simple_async_get1, + simple_async_get2]}, + {get_next_tests, [], + [simple_sync_get_next1, simple_sync_get_next2, + simple_async_get_next1, simple_async_get_next2]}, + {set_tests, [], + [simple_sync_set1, simple_sync_set2, simple_async_set1, + simple_async_set2]}, + {bulk_tests, [], + [simple_sync_get_bulk1, simple_sync_get_bulk2, + simple_async_get_bulk1, simple_async_get_bulk2]}, + {misc_request_tests, [], [misc_async1, misc_async2]}, + {event_tests, [], + [trap1, trap2, inform1, inform2, inform3, inform4, + inform_swarm, report]}, + {tickets, [], [{group, otp8015}, {group, otp8395}]}, + {otp8015, [], [otp8015_1]}, {otp8395, [], [otp8395_1]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + + + + + + + + + + + + + + %%====================================================================== diff --git a/lib/snmp/test/snmp_manager_user_test.erl b/lib/snmp/test/snmp_manager_user_test.erl index b80af16485..fefa1ad713 100644 --- a/lib/snmp/test/snmp_manager_user_test.erl +++ b/lib/snmp/test/snmp_manager_user_test.erl @@ -26,7 +26,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). @@ -36,10 +36,10 @@ %% -compile(export_all). -export([ - all/1, +all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, - register_user/1, + simple_register_and_unregister1/1, simple_register_and_unregister2/1, simple_register_and_unregister3/1, @@ -62,7 +62,7 @@ register_monitor_request_and_crash3/1, register_monitor_request_and_crash4/1, - tickets/1, + otp7902/1 ]). @@ -134,42 +134,41 @@ end_per_testcase(Case, Config) when is_list(Config) -> %% Test case definitions %%====================================================================== -all(suite) -> - [ - register_user, - tickets - ]. - -register_user(suite) -> - [ - simple_register_and_unregister1, - simple_register_and_unregister2, - simple_register_and_unregister3, - register_and_crash1, - register_and_crash2, - register_and_crash3, - register_request_and_crash1, - register_request_and_crash2, - register_request_and_crash3, - simple_register_monitor_and_unregister1, - simple_register_monitor_and_unregister2, - simple_register_monitor_and_unregister3, - register_monitor_and_crash1, - register_monitor_and_crash2, - register_monitor_and_crash3, - register_monitor_and_crash4, - register_monitor_and_crash5, - register_monitor_request_and_crash1, - register_monitor_request_and_crash2, - register_monitor_request_and_crash3, - register_monitor_request_and_crash4 - ]. - - -tickets(suite) -> - [ - otp7902 - ]. +all() -> +[{group, register_user}, {group, tickets}]. + +groups() -> + [{register_user, [], + [simple_register_and_unregister1, + simple_register_and_unregister2, + simple_register_and_unregister3, register_and_crash1, + register_and_crash2, register_and_crash3, + register_request_and_crash1, + register_request_and_crash2, + register_request_and_crash3, + simple_register_monitor_and_unregister1, + simple_register_monitor_and_unregister2, + simple_register_monitor_and_unregister3, + register_monitor_and_crash1, + register_monitor_and_crash2, + register_monitor_and_crash3, + register_monitor_and_crash4, + register_monitor_and_crash5, + register_monitor_request_and_crash1, + register_monitor_request_and_crash2, + register_monitor_request_and_crash3, + register_monitor_request_and_crash4]}, + {tickets, [], [otp7902]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + + + %%====================================================================== diff --git a/lib/snmp/test/snmp_note_store_test.erl b/lib/snmp/test/snmp_note_store_test.erl index 763c708bd6..24ba88f986 100644 --- a/lib/snmp/test/snmp_note_store_test.erl +++ b/lib/snmp/test/snmp_note_store_test.erl @@ -25,7 +25,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("snmp_test_lib.hrl"). @@ -34,7 +34,7 @@ %%---------------------------------------------------------------------- -export([ init_per_testcase/2, end_per_testcase/2, - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, start_and_stop/1, notes/1, info/1, @@ -69,14 +69,18 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %%====================================================================== %% Test case definitions %%====================================================================== -all(suite) -> - [ - start_and_stop, - notes, - info, - garbage_in - - ]. +all() -> +[start_and_stop, notes, info, garbage_in]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%====================================================================== diff --git a/lib/snmp/test/snmp_pdus_test.erl b/lib/snmp/test/snmp_pdus_test.erl index 7041552abf..ef510ad62e 100644 --- a/lib/snmp/test/snmp_pdus_test.erl +++ b/lib/snmp/test/snmp_pdus_test.erl @@ -25,7 +25,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("snmp_test_lib.hrl"). -include_lib("snmp/include/snmp_types.hrl"). @@ -34,8 +34,8 @@ %% External exports %%---------------------------------------------------------------------- -export([ - all/1, - tickets/1, + all/0,groups/0,init_per_group/2,end_per_group/2, + otp7575/1, otp8563/1, init_per_testcase/2, end_per_testcase/2 @@ -71,16 +71,19 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %%====================================================================== %% Test case definitions %%====================================================================== -all(suite) -> - [ - tickets - ]. - -tickets(suite) -> - [ - otp7575, - otp8563 - ]. +all() -> +[{group, tickets}]. + +groups() -> + [{tickets, [], [otp7575, otp8563]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + -- cgit v1.2.3 From 83f932257470f5ae01fc61130e997fdea0562653 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 6 Dec 2010 16:48:31 +0100 Subject: Add ts_install_scb to suite/0 --- lib/snmp/test/snmp_SUITE.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/snmp') diff --git a/lib/snmp/test/snmp_SUITE.erl b/lib/snmp/test/snmp_SUITE.erl index 4261a1c155..db5b3593c1 100644 --- a/lib/snmp/test/snmp_SUITE.erl +++ b/lib/snmp/test/snmp_SUITE.erl @@ -19,7 +19,7 @@ -module(snmp_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2 ]). @@ -54,6 +54,8 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, app}, {group, compiler}, {group, misc}, {group, agent}, {group, manager}]. -- cgit v1.2.3 From 8fd1f31f3074bc9444a0769418506b1ccc2041d3 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 7 Dec 2010 11:35:13 +0100 Subject: Add init_per_suite and end_per_suite --- lib/snmp/test/snmp_SUITE.erl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/snmp') diff --git a/lib/snmp/test/snmp_SUITE.erl b/lib/snmp/test/snmp_SUITE.erl index db5b3593c1..7919519913 100644 --- a/lib/snmp/test/snmp_SUITE.erl +++ b/lib/snmp/test/snmp_SUITE.erl @@ -19,7 +19,7 @@ -module(snmp_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2 ]). @@ -88,6 +88,12 @@ groups() -> [{snmp_manager_user_test, all}]}, {manager_test, [], [{snmp_manager_test, all}]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. -- cgit v1.2.3 From 5fef403779c4894189abf6fd18e6c8e5d54064c5 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 7 Dec 2010 17:52:12 +0100 Subject: Update all test specs --- lib/snmp/test/snmp.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/snmp') diff --git a/lib/snmp/test/snmp.spec b/lib/snmp/test/snmp.spec index 07492337fb..88ae0145f0 100644 --- a/lib/snmp/test/snmp.spec +++ b/lib/snmp/test/snmp.spec @@ -1 +1 @@ -{suites,"snmp_test",all}. +{suites,"../snmp_test",all}. -- cgit v1.2.3 From cfa01c9bd748df38750dc4841030e6520610538a Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 12 Jan 2011 14:56:23 +0100 Subject: Update and add cover spec files to work with common_test --- lib/snmp/test/snmp.cover | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/snmp') diff --git a/lib/snmp/test/snmp.cover b/lib/snmp/test/snmp.cover index 027dce68c1..a2e7dd978f 100644 --- a/lib/snmp/test/snmp.cover +++ b/lib/snmp/test/snmp.cover @@ -1,5 +1,7 @@ %% -*- erlang -*- -{exclude, +{incl_app,snmp,details}. + +{excl_mods,snmp, [snmp_index, snmpa_error_io, snmpa_authentication_service, -- cgit v1.2.3 From 308d6638450f5ffc7f432302367e84bcd92ea683 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 9 Feb 2011 19:10:44 +0100 Subject: Rename Suite Callback to Common Test Hook --- lib/snmp/test/snmp_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/snmp') diff --git a/lib/snmp/test/snmp_SUITE.erl b/lib/snmp/test/snmp_SUITE.erl index 7919519913..3f6473893b 100644 --- a/lib/snmp/test/snmp_SUITE.erl +++ b/lib/snmp/test/snmp_SUITE.erl @@ -54,7 +54,7 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, app}, {group, compiler}, {group, misc}, -- cgit v1.2.3 From b16c705cb08743333dba26f036ff44cf7d4b7da8 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 17 Feb 2011 18:49:32 +0100 Subject: Fixed release notes. --- lib/snmp/doc/src/notes.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index cb41ca8e3a..3fe39c4d03 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -4,7 +4,7 @@
- 19962010 + 19962011 Ericsson AB. All Rights Reserved. @@ -50,10 +50,10 @@ snmp_view_based_acm_mib:reconfigure/1 on a running node, the table vacmAccessTable was not properly cleaned. - This means that if some entries in the vacm.conf file was removed + This meant that if some entries in the vacm.conf file was removed (compared to the current config), - while others where modified and/or added, the removed entrie(s), - would still exist in the vacmAccessTable.

+ while others where modified and/or added, the removed entrie(s) + would still exist in the vacmAccessTable table.

Own Id: OTP-8981

Aux Id: Seq 11750

-- cgit v1.2.3 From 95280cc9c09187465d423fd3481b3aa4310c4bab Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 22 Feb 2011 10:32:00 +0100 Subject: Prep for release: snmp-4.19 --- lib/snmp/doc/src/notes.xml | 8 ++++---- lib/snmp/vsn.mk | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 3fe39c4d03..39aff4e28a 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -1,4 +1,4 @@ - + @@ -33,8 +33,8 @@
- SNMP Development Toolkit 4.18.1 -

Version 4.18.1 supports code replacement in runtime from/to + SNMP Development Toolkit 4.19 +

Version 4.19 supports code replacement in runtime from/to version 4.18, 4.17.1 and 4.17.

@@ -64,7 +64,7 @@ Incompatibilities

-

-
+
SNMP 4.18 diff --git a/lib/snmp/vsn.mk b/lib/snmp/vsn.mk index 67cc05687d..617f0fce62 100644 --- a/lib/snmp/vsn.mk +++ b/lib/snmp/vsn.mk @@ -17,6 +17,6 @@ # # %CopyrightEnd% -SNMP_VSN = 4.18.1 +SNMP_VSN = 4.19 PRE_VSN = APP_VSN = "snmp-$(SNMP_VSN)$(PRE_VSN)" -- cgit v1.2.3 From 197d6abd8b6efb30c6237133ed08bf379f29cb84 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 22 Feb 2011 10:37:18 +0100 Subject: Prep for release: snmp-4.19 --- lib/snmp/doc/src/notes.xml | 10 +++++----- lib/snmp/vsn.mk | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index f3bb9d25ea..c42d62f013 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -1,4 +1,4 @@ - + @@ -33,8 +33,8 @@
- SNMP Development Toolkit 4.18.1 -

Version 4.18.1 supports code replacement in runtime from/to + SNMP Development Toolkit 4.19 +

Version 4.19 supports code replacement in runtime from/to version 4.18, 4.17.1 and 4.17.

@@ -47,7 +47,7 @@

[agent] For the table vacmAccessTable, - when performing the is_set_ok and set opteration(s), + when performing the is_set_ok and set operation(s), all values of the vacmAccessSecurityModel column was incorrectly translated to any.

+
diff --git a/lib/snmp/vsn.mk b/lib/snmp/vsn.mk index 67cc05687d..617f0fce62 100644 --- a/lib/snmp/vsn.mk +++ b/lib/snmp/vsn.mk @@ -17,6 +17,6 @@ # # %CopyrightEnd% -SNMP_VSN = 4.18.1 +SNMP_VSN = 4.19 PRE_VSN = APP_VSN = "snmp-$(SNMP_VSN)$(PRE_VSN)" -- cgit v1.2.3 From fe1a4d17ee6558f466c49bfaea25c3a0b4ca9936 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 23 Feb 2011 11:58:16 +0100 Subject: Initial fix of release notes (bad notes for version 4.18). --- lib/snmp/doc/src/notes.xml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 493e7aa092..015e2628f4 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -1,10 +1,10 @@ - +
- 19962010 + 19962011 Ericsson AB. All Rights Reserved. @@ -37,18 +37,14 @@
Fixed Bugs and Malfunctions -

- When the function FilterMod:accept_recv/2 returned false - the SNMP agent stopped collecting messages from UDP.

-

- Own Id: OTP-8761

+

Cosmetic prep for R14B (plain) release.

-
+
-
+
SNMP Development Toolkit 4.17.1

Version 4.17.1 supports code replacement in runtime from/to version 4.17, 4.16.2, 4.16.1, 4.16, 4.15, 4.14 and 4.13.5.

@@ -63,7 +59,8 @@

When the function FilterMod:accept_recv/2 - returned false the SNMP agent stopped collecting messages from UDP.

+ returned false the SNMP agent stopped collecting + messages from UDP.

Own Id: OTP-8761

-- cgit v1.2.3 From ae806f1663d47569876b3abc0998ee3387c7abd2 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 23 Feb 2011 16:12:36 +0100 Subject: Updated release notes and the documentation. Also added entry in the appup file. --- lib/snmp/doc/src/notes.xml | 52 +++++++++++++++++- lib/snmp/doc/src/snmp_config.xml | 42 ++++----------- lib/snmp/doc/src/snmpa.xml | 37 ++++++++++++- lib/snmp/src/app/snmp.appup.src | 114 +++++++++++++++------------------------ 4 files changed, 139 insertions(+), 106 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 015e2628f4..3d76fdeaf6 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -32,6 +32,56 @@ notes.xml +
+ SNMP Development Toolkit 4.19 +

Version 4.19 supports code replacement in runtime from/to + version 4.18.

+ +
+ Improvements and new features + + + +

[agent] Added a "complete" set of (snmp) table and variable + print functions, for each mib handled by the SNMP (agent) + application. This will be usefull when debugging a running agent.

+

See + print_mib_info/0, + print_mib_tables/0 + and + print_mib_variables/0 + for more info.

+

Own Id: OTP-8977

+
+ +
+ +
+ +
+ Reported Fixed Bugs and Malfunctions +

-

+ +
+ +
+ Incompatibilities +

-

+
+
+ +
SNMP 4.18
Fixed Bugs and Malfunctions @@ -42,7 +92,7 @@
-
+
SNMP Development Toolkit 4.17.1 diff --git a/lib/snmp/doc/src/snmp_config.xml b/lib/snmp/doc/src/snmp_config.xml index 769b908adc..4e41cb5037 100644 --- a/lib/snmp/doc/src/snmp_config.xml +++ b/lib/snmp/doc/src/snmp_config.xml @@ -1,4 +1,4 @@ - + @@ -1004,36 +1004,16 @@ ok

Another usefull way to debug the agent is to pretty-print the content of - some of the (MIB-) tables handled directly by the agent. This can be done - for the following tables:

- - - -

-
- - - -

-
- - - -

-
- - - -

-
- - - -

-
- -
- + all the tables and/or variables handled directly by the agent. + This can be done by simply calling:

+

+

See + print_mib_info/0, + print_mib_tables/0 + or + print_mib_variables/0 + for more info.

+
diff --git a/lib/snmp/doc/src/snmpa.xml b/lib/snmp/doc/src/snmpa.xml index f546724a78..1d680e80f5 100644 --- a/lib/snmp/doc/src/snmpa.xml +++ b/lib/snmp/doc/src/snmpa.xml @@ -1,10 +1,10 @@ - +
- 20042010 + 20042011 Ericsson AB. All Rights Reserved. @@ -1252,6 +1252,39 @@ snmp_agent:register_subagent(SA1,[1,2,3], SA2).

This is a utility function, that can be useful when e.g. debugging instrumentation functions.

+ + + + + + print_mib_info() -> void() + Print mib info + +

Prints the content of all the (snmp) tables and variables + for all mibs handled by the snmp agent.

+ + +
+
+ + + print_mib_tables() -> void() + Print mib tables + +

Prints the content of all the (snmp) tables + for all mibs handled by the snmp agent.

+ + +
+
+ + + print_mib_variables() -> void() + Print mib variables + +

Prints the content of all the (snmp) variables + for all mibs handled by the snmp agent.

+
diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src index 2375e3df70..24f3b2e755 100644 --- a/lib/snmp/src/app/snmp.appup.src +++ b/lib/snmp/src/app/snmp.appup.src @@ -22,43 +22,28 @@ %% ----- U p g r a d e ------------------------------------------------------- [ - {"4.17.1", + {"4.18", [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []} - ] - }, - {"4.17", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []}, - {load_module, snmpa_net_if, soft_purge, soft_purge, []} + {load_module, snmpa, soft_purge, soft_purge, + [snmp_community_mib, + snmp_framework_mib, + snmp_standard_mib, + snmp_target_mib, + snmp_user_based_sm_mib, + snmp_view_based_acm_mib]}, + {load_module, snmp_community_mib, soft_purge, soft_purge, + [snmpa_mib_lib]}, + {load_module, snmp_framework_mib, soft_purge, soft_purge, + [snmpa_mib_lib]}, + {load_module, snmp_standard_mib, soft_purge, soft_purge, + [snmpa_mib_lib]}, + {load_module, snmp_target_mib, soft_purge, soft_purge, + [snmpa_mib_lib]}, + {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, + [snmpa_mib_lib]}, + {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, + [snmpa_mib_lib]}, + {load_module, snmps_mib_lib, soft_purge, soft_purge, []} ] } ], @@ -66,43 +51,28 @@ %% ------D o w n g r a d e --------------------------------------------------- [ - {"4.17.1", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []} - ] - }, - {"4.17", + {"4.18", [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []}, - {load_module, snmpa_net_if, soft_purge, soft_purge, []} + {load_module, snmpa, soft_purge, soft_purge, + [snmp_community_mib, + snmp_framework_mib, + snmp_standard_mib, + snmp_target_mib, + snmp_user_based_sm_mib, + snmp_view_based_acm_mib]}, + {load_module, snmp_community_mib, soft_purge, soft_purge, + [snmpa_mib_lib]}, + {load_module, snmp_framework_mib, soft_purge, soft_purge, + [snmpa_mib_lib]}, + {load_module, snmp_standard_mib, soft_purge, soft_purge, + [snmpa_mib_lib]}, + {load_module, snmp_target_mib, soft_purge, soft_purge, + [snmpa_mib_lib]}, + {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, + [snmpa_mib_lib]}, + {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, + [snmpa_mib_lib]}, + {load_module, snmps_mib_lib, soft_purge, soft_purge, []} ] } ] -- cgit v1.2.3 From 866edfa8a5510189ee7e0b1584edb5582ba7a589 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 23 Feb 2011 17:46:50 +0100 Subject: Final update to release notes and the appup file. --- lib/snmp/doc/src/notes.xml | 12 +++++-- lib/snmp/src/app/snmp.appup.src | 78 ----------------------------------------- 2 files changed, 10 insertions(+), 80 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index e9c7bef68f..41825df276 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -1,4 +1,4 @@ - + @@ -35,7 +35,7 @@
SNMP Development Toolkit 4.19

Version 4.19 supports code replacement in runtime from/to - version 4.18, 4.17.1, 4.17.

+ version 4.18.

Improvements and new features @@ -67,8 +67,15 @@

-

+ +
+ Incompatibilities +

-

+
+
+
SNMP 4.18
Fixed Bugs and Malfunctions @@ -81,6 +88,7 @@
+
SNMP Development Toolkit 4.17.1

Version 4.17.1 supports code replacement in runtime from/to diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src index 9bb4846c6e..4f76095c04 100644 --- a/lib/snmp/src/app/snmp.appup.src +++ b/lib/snmp/src/app/snmp.appup.src @@ -25,45 +25,6 @@ {"4.18", [ ] - }, - {"4.17.1", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []} - ] - }, - {"4.17", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []}, - {load_module, snmpa_net_if, soft_purge, soft_purge, []} - ] } ], @@ -73,45 +34,6 @@ {"4.18", [ ] - }, - {"4.17.1", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []} - ] - }, - {"4.17", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []}, - {load_module, snmpa_net_if, soft_purge, soft_purge, []} - ] } ] }. -- cgit v1.2.3 From 205d55b2ee2afe70a9cbac6da15c8b985c76f2ab Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 23 Feb 2011 17:55:21 +0100 Subject: Final update of appup filer (forgot about the read_mib macro used by the snmp_misc module). --- lib/snmp/src/app/snmp.appup.src | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/snmp') diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src index 4f76095c04..ea39a7c30a 100644 --- a/lib/snmp/src/app/snmp.appup.src +++ b/lib/snmp/src/app/snmp.appup.src @@ -24,6 +24,7 @@ [ {"4.18", [ + {load_module, snmp_misc, soft_purge, soft_purge, []} ] } ], @@ -33,6 +34,7 @@ [ {"4.18", [ + {load_module, snmp_misc, soft_purge, soft_purge, []} ] } ] -- cgit v1.2.3 From bb3fef253dc2e1253d7c422c1d9846d13135f847 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 23 Feb 2011 21:00:48 +0100 Subject: Updated release notes and appup file. --- lib/snmp/doc/src/notes.xml | 4 +-- lib/snmp/src/app/snmp.appup.src | 80 +---------------------------------------- 2 files changed, 3 insertions(+), 81 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index c42d62f013..7010b3c641 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -4,7 +4,7 @@

- 19962010 + 19962011 Ericsson AB. All Rights Reserved. @@ -35,7 +35,7 @@
SNMP Development Toolkit 4.19

Version 4.19 supports code replacement in runtime from/to - version 4.18, 4.17.1 and 4.17.

+ version 4.18.

Improvements and new features diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src index 03a0044908..13a84d4ab1 100644 --- a/lib/snmp/src/app/snmp.appup.src +++ b/lib/snmp/src/app/snmp.appup.src @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2010. All Rights Reserved. +%% Copyright Ericsson AB 1999-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,45 +26,6 @@ [ {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []} ] - }, - {"4.17.1", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []} - ] - }, - {"4.17", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []}, - {load_module, snmpa_net_if, soft_purge, soft_purge, []} - ] } ], @@ -75,45 +36,6 @@ [ {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []} ] - }, - {"4.17.1", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []} - ] - }, - {"4.17", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []}, - {load_module, snmpa_net_if, soft_purge, soft_purge, []} - ] } ] }. -- cgit v1.2.3 From ca6e87e84dae13b6ebe15ca67bf98a0245f25857 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 23 Feb 2011 23:07:52 +0100 Subject: Fixed release notes and appup file. --- lib/snmp/doc/src/notes.xml | 2 +- lib/snmp/src/app/snmp.appup.src | 78 ----------------------------------------- 2 files changed, 1 insertion(+), 79 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 39aff4e28a..4896a62bb4 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -35,7 +35,7 @@
SNMP Development Toolkit 4.19

Version 4.19 supports code replacement in runtime from/to - version 4.18, 4.17.1 and 4.17.

+ version 4.18.

Improvements and new features diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src index fafbf79bb7..0c1d6655ef 100644 --- a/lib/snmp/src/app/snmp.appup.src +++ b/lib/snmp/src/app/snmp.appup.src @@ -27,45 +27,6 @@ {load_module, snmpa_vacm, soft_purge, soft_purge, []}, {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, [snmpa_vacm]} ] - }, - {"4.17.1", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []} - ] - }, - {"4.17", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []}, - {load_module, snmpa_net_if, soft_purge, soft_purge, []} - ] } ], @@ -77,45 +38,6 @@ {load_module, snmpa_vacm, soft_purge, soft_purge, []}, {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, [snmpa_vacm]} ] - }, - {"4.17.1", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []} - ] - }, - {"4.17", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []}, - {load_module, snmpa_net_if, soft_purge, soft_purge, []} - ] } ] }. -- cgit v1.2.3 From cf8a23cd0017d2206926a4445736029a05a7a0dd Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 23 Feb 2011 23:18:27 +0100 Subject: Fixed release notes (almost, since this change will not actually be part of the release notes) and appup file. --- lib/snmp/doc/src/notes.xml | 23 ++++++++----- lib/snmp/src/app/snmp.appup.src | 74 ++--------------------------------------- 2 files changed, 16 insertions(+), 81 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 493e7aa092..03881f1823 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -1,10 +1,10 @@ - +
- 19962010 + 19962011 Ericsson AB. All Rights Reserved. @@ -33,22 +33,27 @@
SNMP 4.18 +
+ Improvements and new features +

-

+
Fixed Bugs and Malfunctions -

- When the function FilterMod:accept_recv/2 returned false - the SNMP agent stopped collecting messages from UDP.

-

- Own Id: OTP-8761

+

Cosmetic prep for R14B (plain) release.

-
+
+ Incompatibilities +

-

+
+
+ -
+
SNMP Development Toolkit 4.17.1

Version 4.17.1 supports code replacement in runtime from/to version 4.17, 4.16.2, 4.16.1, 4.16, 4.15, 4.14 and 4.13.5.

diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src index 2375e3df70..4f76095c04 100644 --- a/lib/snmp/src/app/snmp.appup.src +++ b/lib/snmp/src/app/snmp.appup.src @@ -22,43 +22,8 @@ %% ----- U p g r a d e ------------------------------------------------------- [ - {"4.17.1", + {"4.18", [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []} - ] - }, - {"4.17", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []}, - {load_module, snmpa_net_if, soft_purge, soft_purge, []} ] } ], @@ -66,43 +31,8 @@ %% ------D o w n g r a d e --------------------------------------------------- [ - {"4.17.1", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []} - ] - }, - {"4.17", + {"4.18", [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []}, - {load_module, snmpa_net_if, soft_purge, soft_purge, []} ] } ] -- cgit v1.2.3 From f00e9a7a31e7b58f1ac9e8f6e36183a5173f7eab Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 1 Mar 2011 10:43:43 +0100 Subject: Fixed wrong link (to non-existing snmpc ref-manual). --- lib/snmp/doc/src/notes.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/snmp') diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 665c78f603..2efeb8ae3f 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -77,7 +77,7 @@

[compiler] Added a MIB compiler (frontend) escript, - snmpc.

+ snmpc.

Own Id: OTP-9004

-- cgit v1.2.3 From cf7f5f99f46708db185d927d0c7681fc4f6f3a0e Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 1 Mar 2011 18:00:33 +0100 Subject: Fixed an error detected by dialyzer: The second argument to the definitions_loop function should be the record dldata and not the atome false... --- lib/snmp/src/compile/snmpc.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/src/compile/snmpc.erl b/lib/snmp/src/compile/snmpc.erl index c4b3d7090f..195c238184 100644 --- a/lib/snmp/src/compile/snmpc.erl +++ b/lib/snmp/src/compile/snmpc.erl @@ -894,12 +894,12 @@ definitions_loop([{#mc_object_type{name = NameOfEntry, definitions_loop([{#mc_notification{name = TrapName, status = deprecated}, Line}|T], - false) -> + #dldata{deprecated = false} = Data) -> ?vinfo2("defloop -> notification ~w is deprecated => ignored", [TrapName], Line), update_status(TrapName, deprecated), ensure_macro_imported('NOTIFICATION-TYPE', Line), - definitions_loop(T, false); + definitions_loop(T, Data); definitions_loop([{#mc_notification{name = TrapName, status = obsolete}, Line}|T], -- cgit v1.2.3 From 24c45e5d18eafbc8fc85b0c49622980dac3f6fe2 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 2 Mar 2011 16:23:04 +0100 Subject: * On some windows machines dirs seem to vanish sometime between the call to init_per_testcase (when they are created) and the call to the actual test case (when they are used). * Try to handle systems where crypto is not built better. This *is* handled by application, but the test case snmp_app_test:undef_funcs could do a better job (which it hopefully does now :). --- lib/snmp/test/snmp_app_test.erl | 44 ++++++++++-- lib/snmp/test/snmp_manager_config_test.erl | 105 +++++++++++++++++++---------- 2 files changed, 106 insertions(+), 43 deletions(-) (limited to 'lib/snmp') diff --git a/lib/snmp/test/snmp_app_test.erl b/lib/snmp/test/snmp_app_test.erl index 64dd638f83..27a7b4af2e 100644 --- a/lib/snmp/test/snmp_app_test.erl +++ b/lib/snmp/test/snmp_app_test.erl @@ -300,6 +300,25 @@ undef_funcs(Config) when is_list(Config) -> xref:stop(XRef), analyze_undefined_function_calls(Undefs, Mods, []). +valid_undef(crypto = CalledMod) -> + case (catch CalledMod:version()) of + Version when is_list(Version) -> + %% The called module was crypto and the version + %% function returns a valid value. + %% This means that the function is + %% actually undefined... + true; + _ -> + %% The called module was crypto but the version + %% function does *not* return a valid value. + %% This means the crypto was not actually not + %% build, which is an case snmp handles. + false + end; +valid_undef(_) -> + true. + + analyze_undefined_function_calls([], _, []) -> ok; analyze_undefined_function_calls([], _, AppUndefs) -> @@ -312,14 +331,25 @@ analyze_undefined_function_calls([{{Mod, _F, _A}, _C} = AppUndef|Undefs], {Calling,Called} = AppUndef, {Mod1,Func1,Ar1} = Calling, {Mod2,Func2,Ar2} = Called, - io:format("undefined function call: " - "~n ~w:~w/~w calls ~w:~w/~w~n", - [Mod1,Func1,Ar1,Mod2,Func2,Ar2]), - analyze_undefined_function_calls(Undefs, AppModules, - [AppUndef|AppUndefs]); + %% If the called module is crypto, then we will *not* + %% fail if crypto is not built (since crypto is actually + %% not built for all platforms) + case valid_undef(Mod2) of + true -> + io:format("undefined function call: " + "~n ~w:~w/~w calls ~w:~w/~w~n", + [Mod1,Func1,Ar1,Mod2,Func2,Ar2]), + analyze_undefined_function_calls( + Undefs, AppModules, [AppUndef|AppUndefs]); + false -> + io:format("skipping ~p (calling ~w:~w/~w)~n", + [Mod, Mod2, Func2, Ar2]), + analyze_undefined_function_calls(Undefs, + AppModules, AppUndefs) + end; false -> - io:format("dropping ~p~n", [Mod]), - analyze_undefined_function_calls(Undefs, AppModules, AppUndefs) + io:format("dropping ~p~n", [Mod]), + analyze_undefined_function_calls(Undefs, AppModules, AppUndefs) end. %% This function is used simply to avoid cut-and-paste errors later... diff --git a/lib/snmp/test/snmp_manager_config_test.erl b/lib/snmp/test/snmp_manager_config_test.erl index a72dd0cc22..e38a99d413 100644 --- a/lib/snmp/test/snmp_manager_config_test.erl +++ b/lib/snmp/test/snmp_manager_config_test.erl @@ -169,36 +169,41 @@ all() -> groups() -> [{start_and_stop, [], - [simple_start_and_stop, start_without_mandatory_opts1, - start_without_mandatory_opts2, - start_with_all_valid_opts, start_with_unknown_opts, - start_with_incorrect_opts, - start_with_invalid_manager_conf_file1, - start_with_invalid_users_conf_file1, - start_with_invalid_agents_conf_file1, - start_with_invalid_usm_conf_file1]}, - {normal_op, [], - [{group, system}, {group, agents}, {group, users}, - {group, usm_users}, {group, counter}, - {group, stats_counter}]}, - {system, [], [simple_system_op]}, - {users, [], - [register_user_using_file, register_user_using_function, - register_user_failed_using_function1]}, - {agents, [], - [register_agent_using_file, - register_agent_using_function, - register_agent_failed_using_function1]}, - {usm_users, [], - [register_usm_user_using_file, - register_usm_user_using_function, - register_usm_user_failed_using_function1, - update_usm_user_info]}, - {counter, [], [create_and_increment]}, - {stats_counter, [], [stats_create_and_increment]}, - {tickets, [], [otp_7219, {group, otp_8395}]}, - {otp_8395, [], - [otp_8395_1, otp_8395_2, otp_8395_3, otp_8395_4]}]. + [simple_start_and_stop, + start_without_mandatory_opts1, + start_without_mandatory_opts2, + start_with_all_valid_opts, start_with_unknown_opts, + start_with_incorrect_opts, + start_with_invalid_manager_conf_file1, + start_with_invalid_users_conf_file1, + start_with_invalid_agents_conf_file1, + start_with_invalid_usm_conf_file1]}, + {normal_op, [], + [{group, system}, + {group, agents}, + {group, users}, + {group, usm_users}, + {group, counter}, + {group, stats_counter}]}, + {system, [], [simple_system_op]}, + {users, [], + [register_user_using_file, + register_user_using_function, + register_user_failed_using_function1]}, + {agents, [], + [register_agent_using_file, + register_agent_using_function, + register_agent_failed_using_function1]}, + {usm_users, [], + [register_usm_user_using_file, + register_usm_user_using_function, + register_usm_user_failed_using_function1, + update_usm_user_info]}, + {counter, [], [create_and_increment]}, + {stats_counter, [], [stats_create_and_increment]}, + {tickets, [], [otp_7219, {group, otp_8395}]}, + {otp_8395, [], + [otp_8395_1, otp_8395_2, otp_8395_3, otp_8395_4]}]. init_per_group(_GroupName, Config) -> Config. @@ -816,7 +821,10 @@ start_with_invalid_users_conf_file1(Conf) when is_list(Conf) -> p("start"), process_flag(trap_exit, true), ConfDir = ?config(manager_conf_dir, Conf), - DbDir = ?config(manager_db_dir, Conf), + DbDir = ?config(manager_db_dir, Conf), + + verify_dir_existing(conf, ConfDir), + verify_dir_existing(db, DbDir), Opts = [{versions, [v1]}, {config, [{verbosity, trace}, {dir, ConfDir}, {db_dir, DbDir}]}], @@ -917,7 +925,10 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) -> p("start"), process_flag(trap_exit, true), ConfDir = ?config(manager_conf_dir, Conf), - DbDir = ?config(manager_db_dir, Conf), + DbDir = ?config(manager_db_dir, Conf), + + verify_dir_existing(conf, ConfDir), + verify_dir_existing(db, DbDir), Opts = [{versions, [v1]}, {config, [{verbosity, trace}, {dir, ConfDir}, {db_dir, DbDir}]}], @@ -2022,7 +2033,6 @@ register_usm_user_using_file(Conf) when is_list(Conf) -> %% -- p("done"), ok. -%% ?SKIP(not_yet_implemented). %% @@ -2651,9 +2661,21 @@ write_usm_conf2(Dir, Str) -> write_conf_file(Dir, File, Str) -> - ?line {ok, Fd} = file:open(filename:join(Dir, File), write), - ?line ok = io:format(Fd, "~s", [Str]), - file:close(Fd). + case file:open(filename:join(Dir, File), write) of + {ok, Fd} -> + ?line ok = io:format(Fd, "~s", [Str]), + file:close(Fd); + {error, Reason} -> + Info = + [{dir, Dir, case (catch file:read_file_info(Dir)) of + {ok, FI} -> + FI; + _ -> + undefined + end}, + {file, File}], + exit({failed_writing_conf_file, Info, Reason}) + end. maybe_start_crypto() -> @@ -2677,6 +2699,17 @@ maybe_stop_crypto() -> end. +%% ------ + +verify_dir_existing(DirName, Dir) -> + case file:read_file_info(Dir) of + {ok, _} -> + ok; + {error, Reason} -> + exit({non_existing_dir, DirName, Dir, Reason}) + end. + + %% ------ str(X) -> -- cgit v1.2.3 From 92b2fd6b18d052cd49e8921626ad0abbcedc0b0b Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 3 Mar 2011 18:32:59 +0100 Subject: Added documentation file (snmpc_cmd.xml) for the snmpc command line tool. Also updated the central .gitignore file. --- lib/snmp/doc/src/snmpc_cmd.xml | 191 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 lib/snmp/doc/src/snmpc_cmd.xml (limited to 'lib/snmp') diff --git a/lib/snmp/doc/src/snmpc_cmd.xml b/lib/snmp/doc/src/snmpc_cmd.xml new file mode 100644 index 0000000000..18ff71631c --- /dev/null +++ b/lib/snmp/doc/src/snmpc_cmd.xml @@ -0,0 +1,191 @@ + + + + +
+ + 20112011 + Ericsson AB. All Rights Reserved. + + + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + + + snmpc + + + + + + + + snmpc_cmd.xml +
+ snmpc + SNMP MIB compiler frontend + +

The program provides a way to run + the SNMP MIB compiler of the Erlang system.

+
+ + + + snmpc [options] file.mib | file.bin + Compile MIBs + +

compile a SNMP MIB file, + see compile/1,2 for + more info.

+

It can also be used to generate a header file (.hrl) + with definitions of Erlang constants for the objects in + the MIB, see + mib_to_hrl/1.

+
+
+
+ +
+ Compiler options +

The following options are supported (note that most of these relate + to the compilation of the MIB file):

+ + --help + +

Prints help info.

+
+ + --version + +

Prints application and mib format version.

+
+ + --verbosity verbosity + +

Print debug info.

+

verbosity = trace | debug | log | info | silence

+

Defaults to silence.

+
+ + --warnings + +

Print warning messages.

+
+ + --o directory + +

The directory where the compiler should place the output files. + If not specified, output files will be placed in the current working + directory.

+
+ + --i Directory + +

Specifies the path to search for imported (compiled) MIB files. + By default, the current working directory is always included.

+

This option can be present several times, each time specifying + one path.

+
+ + --il Directory + +

This option (include_lib), specifies a list of directories to + search for imported MIBs. It assumes that the first element in + the directory name corresponds to an OTP application. The compiler + will find the current installed version. For example, the value + ["snmp/mibs/"] will be replaced by ["snmp-3.1.1/mibs/"] (or what + the current version may be in the system). The current directory + and the "snmp-home"/priv/mibs/ are always listed last in the + include path.

+
+ + --sgc + +

This option (skip group check), if present, disables the + group check of the mib compiler. + That is, should the OBJECT-GROUP and the NOTIFICATION-GROUP + macro(s) be checked for correctness or not.

+
+ + --dep + +

Keep deprecated definition(s). + If not specified the compiler will ignore deprecated definitions.

+
+ + --desc + +

The DESCRIPTION field will be included.

+
+ + --ref + +

The REFERENCE field will be included.

+
+ + --imp + +

The IMPORTS field will be included.

+
+ + --mi + +

The MODULE-IDENTITY field will be included.

+
+ + --mc + +

The MODULE-COMPLIANCE field will be included.

+
+ + --ac + +

The AGENT-CAPABILITIES field will be included.

+
+ + --mod module + +

The module which implements all the instrumentation functions.

+

The name of all instrumentation functions must be the + same as the corresponding managed object it implements.

+
+ + --nd + +

The default instrumentation functions will not be + used if a managed object have no instrumentation function. + Instead this will be reported as an error, and the compilation + aborts.

+
+ + --rrnac + +

This option, if present, specifies that the row name assign check + shall not be done strictly according to the SMI (which allows only + the value 1).

+

With this option, all values greater than zero is allowed (>= 1). + This means that the error will be converted to a warning.

+

By default it is not included, but if this option is present + it will be.

+
+ +
+
+ +
+ SEE ALSO +

erlc(1), + compile(3), + snmpc(3)

+
+
+ -- cgit v1.2.3