aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/test
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2010-12-10 17:50:38 +0100
committerMicael Karlberg <[email protected]>2010-12-10 17:50:38 +0100
commit8e9ef38dd36c771dff0d477fa7999d34b72e8a7a (patch)
treed63bda2457bd06b75b2dfd6dd2152733d608711d /lib/snmp/test
parenta0e4728a5e8e366c83e8229cefc63ba92151a86d (diff)
downloadotp-8e9ef38dd36c771dff0d477fa7999d34b72e8a7a.tar.gz
otp-8e9ef38dd36c771dff0d477fa7999d34b72e8a7a.tar.bz2
otp-8e9ef38dd36c771dff0d477fa7999d34b72e8a7a.zip
Added counter (variables) for usm.
Also added config file for usm. And more sed'ing...
Diffstat (limited to 'lib/snmp/test')
-rw-r--r--lib/snmp/test/test_config/.gitignore1
-rw-r--r--lib/snmp/test/test_config/Makefile26
-rw-r--r--lib/snmp/test/test_config/agent/agent.conf.src2
-rw-r--r--lib/snmp/test/test_config/agent/usm.conf.src17
-rw-r--r--lib/snmp/test/test_config/manager/manager.conf.src2
-rw-r--r--lib/snmp/test/test_config/manager/usm.conf.src1
-rw-r--r--lib/snmp/test/test_config/modules.mk1
-rw-r--r--lib/snmp/test/test_config/sys-agent.config.src2
-rw-r--r--lib/snmp/test/test_config/sys.config.src4
9 files changed, 48 insertions, 8 deletions
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"},