aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/test
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2013-02-05 15:12:52 +0100
committerMicael Karlberg <[email protected]>2013-02-05 15:12:52 +0100
commitd4c5e795b916485362e5aee780ffe99fee150c89 (patch)
tree9c02dfdf06b5a4dc55a7dcb4cd9d8f56d418b40a /lib/snmp/test
parent1cbd897c43f0dab1275392a3736e4629c1f80243 (diff)
parentc4425da5b7cf880b8ca76158e0bfecbf5202a333 (diff)
downloadotp-d4c5e795b916485362e5aee780ffe99fee150c89.tar.gz
otp-d4c5e795b916485362e5aee780ffe99fee150c89.tar.bz2
otp-d4c5e795b916485362e5aee780ffe99fee150c89.zip
Merge branch 'bmk/snmp/compiler/handling_import_of_BITS_in_mibs/r15/OTP-10799' into bmk/snmp/snmp4222_integration/r15
Diffstat (limited to 'lib/snmp/test')
-rw-r--r--lib/snmp/test/snmp_compiler_test.erl31
-rw-r--r--lib/snmp/test/snmp_test_data/OTP10799-MIB.mib75
-rw-r--r--lib/snmp/test/test-mibs/RFC1271-MIB.mib3
-rw-r--r--lib/snmp/test/test-mibs/RMON2-MIB.mib2
4 files changed, 103 insertions, 8 deletions
diff --git a/lib/snmp/test/snmp_compiler_test.erl b/lib/snmp/test/snmp_compiler_test.erl
index 257fc47952..4c5a945984 100644
--- a/lib/snmp/test/snmp_compiler_test.erl
+++ b/lib/snmp/test/snmp_compiler_test.erl
@@ -53,7 +53,8 @@
otp_6150/1,
otp_8574/1,
- otp_8595/1
+ otp_8595/1,
+ otp_10799/1
]).
@@ -132,7 +133,7 @@ all() ->
].
groups() ->
- [{tickets, [], [otp_6150, otp_8574, otp_8595]}].
+ [{tickets, [], [otp_6150, otp_8574, otp_8595, otp_10799]}].
init_per_group(_GroupName, Config) ->
Config.
@@ -326,13 +327,14 @@ warnings_as_errors(Config) when is_list(Config) ->
otp_6150(suite) ->
[];
otp_6150(Config) when is_list(Config) ->
- put(tname,otp_6150),
+ put(tname, otp6150),
p("starting with Config: ~p~n", [Config]),
Dir = ?config(case_top_dir, Config),
MibDir = ?config(mib_dir, Config),
MibFile = join(MibDir, "ERICSSON-TOP-MIB.mib"),
- ?line {ok, Mib} = snmpc:compile(MibFile, [{outdir, Dir}, {verbosity, trace}]),
+ ?line {ok, Mib} =
+ snmpc:compile(MibFile, [{outdir, Dir}, {verbosity, trace}]),
io:format("otp_6150 -> Mib: ~n~p~n", [Mib]),
ok.
@@ -342,7 +344,7 @@ otp_6150(Config) when is_list(Config) ->
otp_8574(suite) ->
[];
otp_8574(Config) when is_list(Config) ->
- put(tname,otp_8574),
+ put(tname, otp8574),
p("starting with Config: ~p~n", [Config]),
Dir = ?config(case_top_dir, Config),
@@ -375,7 +377,7 @@ otp_8574(Config) when is_list(Config) ->
otp_8595(suite) ->
[];
otp_8595(Config) when is_list(Config) ->
- put(tname,otp_8595),
+ put(tname, otp8595),
p("starting with Config: ~p~n", [Config]),
Dir = ?config(case_top_dir, Config),
@@ -391,6 +393,23 @@ otp_8595(Config) when is_list(Config) ->
%%======================================================================
+otp_10799(suite) ->
+ [];
+otp_10799(Config) when is_list(Config) ->
+ put(tname, otp10799),
+ p("starting with Config: ~p~n", [Config]),
+
+ Dir = ?config(case_top_dir, Config),
+ MibDir = ?config(mib_dir, Config),
+ MibFile = join(MibDir, "OTP10799-MIB.mib"),
+ ?line {ok, Mib} =
+ snmpc:compile(MibFile, [{outdir, Dir}, {verbosity, trace}]),
+ p("Mib: ~n~p~n", [Mib]),
+ ok.
+
+
+%%======================================================================
+
augments_extra_info(suite) ->
[];
augments_extra_info(Config) when is_list(Config) ->
diff --git a/lib/snmp/test/snmp_test_data/OTP10799-MIB.mib b/lib/snmp/test/snmp_test_data/OTP10799-MIB.mib
new file mode 100644
index 0000000000..f47bcfd7da
--- /dev/null
+++ b/lib/snmp/test/snmp_test_data/OTP10799-MIB.mib
@@ -0,0 +1,75 @@
+OTP10799-MIB DEFINITIONS ::= BEGIN
+
+IMPORTS
+ MODULE-IDENTITY, OBJECT-TYPE, snmpModules, mib-2, BITS
+ FROM SNMPv2-SMI
+ MODULE-COMPLIANCE, OBJECT-GROUP
+ FROM SNMPv2-CONF
+ ;
+
+otp10799MIB MODULE-IDENTITY
+ LAST-UPDATED "1004210000Z"
+ ORGANIZATION ""
+ CONTACT-INFO
+ ""
+ DESCRIPTION
+ "Test mib for OTP-10799"
+ ::= { snmpModules 1 }
+
+
+-- Administrative assignments ****************************************
+
+otp10799MIBObjects OBJECT IDENTIFIER ::= { otp10799MIB 1 }
+otp10799MIBConformance OBJECT IDENTIFIER ::= { otp10799MIB 2 }
+
+--
+
+test OBJECT IDENTIFIER ::= { mib-2 16 }
+
+bits1 OBJECT-TYPE
+ SYNTAX BITS {
+ b0(0),
+ b1(1),
+ b2(2),
+ b3(3),
+ b4(4),
+ b5(5),
+ b6(6),
+ b7(7)
+ }
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ ""
+ ::= { test 1 }
+
+-- Conformance Information *******************************************
+
+otp10799MIBCompliances OBJECT IDENTIFIER
+ ::= { otp10799MIBConformance 1 }
+otp10799MIBGroups OBJECT IDENTIFIER
+ ::= { otp10799MIBConformance 2 }
+
+-- Compliance statements
+
+otp10799MIBCompliance MODULE-COMPLIANCE
+ STATUS current
+ DESCRIPTION
+ "The compliance statement for SNMP engines which
+ implement the SNMP-COMMUNITY-MIB."
+
+ MODULE -- this module
+ MANDATORY-GROUPS { otp10799Group }
+
+ ::= { otp10799Compliances 1 }
+
+otp10799Group OBJECT-GROUP
+ OBJECTS {
+ bits1
+ }
+ STATUS current
+ DESCRIPTION
+ "A group."
+ ::= { otp10799MIBGroups 1 }
+
+END
diff --git a/lib/snmp/test/test-mibs/RFC1271-MIB.mib b/lib/snmp/test/test-mibs/RFC1271-MIB.mib
index 25778dede8..b1b3367667 100644
--- a/lib/snmp/test/test-mibs/RFC1271-MIB.mib
+++ b/lib/snmp/test/test-mibs/RFC1271-MIB.mib
@@ -3,7 +3,8 @@
IMPORTS
Counter FROM RFC1155-SMI
mib-2,DisplayString FROM RFC1213-MIB
- OBJECT-TYPE FROM RFC-1212;
+ OBJECT-TYPE FROM RFC-1212
+ TimeTicks FROM SNMPv2-SMI;
-- This MIB module uses the extended OBJECT-TYPE macro as
-- defined in [9].
diff --git a/lib/snmp/test/test-mibs/RMON2-MIB.mib b/lib/snmp/test/test-mibs/RMON2-MIB.mib
index 827bb38ff9..50c7e6657a 100644
--- a/lib/snmp/test/test-mibs/RMON2-MIB.mib
+++ b/lib/snmp/test/test-mibs/RMON2-MIB.mib
@@ -1,7 +1,7 @@
RMON2-MIB DEFINITIONS ::= BEGIN
IMPORTS
MODULE-IDENTITY, OBJECT-TYPE, Counter32, Integer32,
- Gauge32, IpAddress, TimeTicks FROM SNMPv2-SMI
+ Gauge32, IpAddress, TimeTicks, BITS FROM SNMPv2-SMI
TEXTUAL-CONVENTION, RowStatus, DisplayString, TimeStamp
FROM SNMPv2-TC
MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF