diff options
author | Micael Karlberg <[email protected]> | 2019-04-11 12:50:25 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2019-04-11 18:55:44 +0200 |
commit | f287e693ef11f0d3fa5dd009154d22d396807325 (patch) | |
tree | 3dcc5ef99ec053a8cda7bde301232099afb51ddd /lib/snmp/test/snmp_agent_test.erl | |
parent | 0d125432b4a33c0f4ef1e179e60a8e842125227c (diff) | |
download | otp-f287e693ef11f0d3fa5dd009154d22d396807325.tar.gz otp-f287e693ef11f0d3fa5dd009154d22d396807325.tar.bz2 otp-f287e693ef11f0d3fa5dd009154d22d396807325.zip |
[snmp|agent|test] Test case info and cleanup
1) A test case failed due to the times retreived by
get(snmpEngineTime) reported to large time diffs
(this is basically a sanity check).
Added some more info about time(s) to see if there
are some "gaps" somewhere.
The problem occurred on a slow Virtial Machine.
2) A previous (failing) test case failed to cleanup after
itself (see above), which caused later test cases to fail.
Specifically, the app top supervisor was not terminated,
which caused the start agent function to fail (basically
already_started).
Diffstat (limited to 'lib/snmp/test/snmp_agent_test.erl')
-rw-r--r-- | lib/snmp/test/snmp_agent_test.erl | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/lib/snmp/test/snmp_agent_test.erl b/lib/snmp/test/snmp_agent_test.erl index c4365e6a96..71e3fa3b9a 100644 --- a/lib/snmp/test/snmp_agent_test.erl +++ b/lib/snmp/test/snmp_agent_test.erl @@ -5146,12 +5146,21 @@ snmp_framework_mib_3(Config) when is_list(Config) -> %% Req. SNMP-FRAMEWORK-MIB snmp_framework_mib_test() -> ?line ["agentEngine"] = get_req(1, [[snmpEngineID,0]]), + T1 = snmp_misc:now(ms), ?line [EngineTime] = get_req(2, [[snmpEngineTime,0]]), + T2 = snmp_misc:now(ms), ?SLEEP(5000), + T3 = snmp_misc:now(ms), ?line [EngineTime2] = get_req(3, [[snmpEngineTime,0]]), - ?DBG("snmp_framework_mib -> time(s): " - "~n EngineTime 1 = ~p" - "~n EngineTime 2 = ~p", [EngineTime, EngineTime2]), + T4 = snmp_misc:now(ms), + ?PRINT2("snmp_framework_mib -> time(s): " + "~n EngineTime 1: ~p" + "~n Time to acquire: ~w ms" + "~n EngineTime 2: ~p" + "~n Time to acquire: ~w ms" + "~n => (5 sec sleep between get(snmpEngineTime))" + "~n Total time to acquire: ~w ms", + [EngineTime, T2-T1, EngineTime2, T4-T3, T4-T1]), if (EngineTime+7) < EngineTime2 -> ?line ?FAIL({too_large_diff, EngineTime, EngineTime2}); @@ -5160,11 +5169,18 @@ snmp_framework_mib_test() -> true -> ok end, + T5 = snmp_misc:now(ms), ?line case get_req(4, [[snmpEngineBoots,0]]) of [Boots] when is_integer(Boots) -> + T6 = snmp_misc:now(ms), + ?PRINT2("snmp_framework_mib -> " + "~n boots: ~p" + "~n Time to acquire: ~w ms", [Boots, T6-T5]), ok; Else -> - ?FAIL(Else) + ?PRINT2("snmp_framework_mib -> failed get proper boots:" + "~n ~p", [Else]), + ?FAIL({invalid_boots, Else}) end, ok. |