diff options
author | Micael Karlberg <[email protected]> | 2010-05-28 12:00:00 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2010-08-20 08:54:26 +0200 |
commit | 8c78ac1382f089167afbf8d794cb9eff834577bd (patch) | |
tree | 0caa5a457d39b427fd4ca7c9af24e63b491ba48f /lib/snmp/test/snmp_pdus_test.erl | |
parent | a70dc0de5a7050c1313a604a261a35b42584950b (diff) | |
download | otp-8c78ac1382f089167afbf8d794cb9eff834577bd.tar.gz otp-8c78ac1382f089167afbf8d794cb9eff834577bd.tar.bz2 otp-8c78ac1382f089167afbf8d794cb9eff834577bd.zip |
snmp: Patch 1118
OTP-8574 The SMI specifies that an table row OID should be named:
{ "1" }. An option has been introduced, relaxed_row_name_assign_check,
that allows for a more liberal numbering scheme.
OTP-8594 Changes to make snmp (forward) compatible with the new version
of the crypto application (released in R14). As of R14,
crypto is implemented using NIFs. Also, the API is more
strict.
OTP-8648 [manager] Changed default value for the MIB server cache.
Auto GC is now on by default.
OTP-8563 Decoding of Counter64 values larger then 9306882749598007295
fails. Counter64 is encoded as an 64 bit signed integer,
but is actually an unsigned integer, which the decoder does
not take into account.
OTP-8595 [compiler] Fails to compile non-contiguous BITS. Per Hedeland
OTP-8646 [manager] Raise condition causing the manager server process
to crash. Unregistering an agent while traffic (set/get-operations)
is ongoing could cause a crash in the manager server process
(raise condition).
Diffstat (limited to 'lib/snmp/test/snmp_pdus_test.erl')
-rw-r--r-- | lib/snmp/test/snmp_pdus_test.erl | 64 |
1 files changed, 58 insertions, 6 deletions
diff --git a/lib/snmp/test/snmp_pdus_test.erl b/lib/snmp/test/snmp_pdus_test.erl index d5add50f52..6dc5b779aa 100644 --- a/lib/snmp/test/snmp_pdus_test.erl +++ b/lib/snmp/test/snmp_pdus_test.erl @@ -1,19 +1,19 @@ %% %% %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 %% 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% %% @@ -37,6 +37,7 @@ all/1, tickets/1, otp7575/1, + otp8563/1, init_per_testcase/2, fin_per_testcase/2 ]). @@ -66,6 +67,7 @@ init_per_testcase(_Case, Config) when is_list(Config) -> fin_per_testcase(_Case, Config) when is_list(Config) -> Config. + %%====================================================================== %% Test case definitions %%====================================================================== @@ -76,7 +78,8 @@ all(suite) -> tickets(suite) -> [ - otp7575 + otp7575, + otp8563 ]. @@ -118,6 +121,55 @@ otp7575(Config) when is_list(Config) -> ok. +otp8563(suite) -> []; +otp8563(doc) -> ["OTP-8563"]; +otp8563(Config) when is_list(Config) -> + Val1 = 16#7fffffffffffffff, + io:format("try encode and decode ~w~n", [Val1]), + Enc1 = snmp_pdus:enc_value('Counter64', Val1), + {{'Counter64', Val1}, []} = snmp_pdus:dec_value(Enc1), + + Val2 = Val1 + 1, + io:format("try encode and decode ~w~n", [Val2]), + Enc2 = snmp_pdus:enc_value('Counter64', Val2), + {{'Counter64', Val2}, []} = snmp_pdus:dec_value(Enc2), + + Val3 = Val2 + 1, + io:format("try encode and decode ~w~n", [Val3]), + Enc3 = snmp_pdus:enc_value('Counter64', Val3), + {{'Counter64', Val3}, []} = snmp_pdus:dec_value(Enc3), + + Val4 = 16#fffffffffffffffe, + io:format("try encode and decode ~w~n", [Val4]), + Enc4 = snmp_pdus:enc_value('Counter64', Val4), + {{'Counter64', Val4}, []} = snmp_pdus:dec_value(Enc4), + + Val5 = Val4 + 1, + io:format("try encode and decode ~w~n", [Val5]), + Enc5 = snmp_pdus:enc_value('Counter64', Val5), + {{'Counter64', Val5}, []} = snmp_pdus:dec_value(Enc5), + + Val6 = 16#ffffffffffffffff + 1, + io:format("try and fail to encode ~w~n", [Val6]), + case (catch snmp_pdus:enc_value('Counter64', Val6)) of + {'EXIT', {error, {bad_counter64, Val6}}} -> + ok; + Unexpected6 -> + exit({unexpected_encode_result, Unexpected6, Val6}) + end, + + Val7 = -1, + io:format("try and fail to encode ~w~n", [Val7]), + case (catch snmp_pdus:enc_value('Counter64', Val7)) of + {'EXIT', {error, {bad_counter64, Val7}}} -> + ok; + Unexpected7 -> + exit({unexpected_encode_result, Unexpected7, Val7}) + end, + + ok. + + %%====================================================================== %% Internal functions %%====================================================================== |