aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2019-06-19 14:44:07 +0200
committerMicael Karlberg <[email protected]>2019-06-27 18:35:21 +0200
commit7be6efd4ca4865c5be76dc35d880832ac02eda5b (patch)
tree3581cf36e6171806335a8fb156fa263420f6b4b4
parenta601b7989b90649acd4deb3e42a2105d4e145ca5 (diff)
downloadotp-7be6efd4ca4865c5be76dc35d880832ac02eda5b.tar.gz
otp-7be6efd4ca4865c5be76dc35d880832ac02eda5b.tar.bz2
otp-7be6efd4ca4865c5be76dc35d880832ac02eda5b.zip
[snmp|agent|test] (maybe) Needs to throw the skip
We maybe needs to throw the skip when we detect system events.
-rw-r--r--lib/snmp/test/snmp_agent_test.erl1
-rw-r--r--lib/snmp/test/snmp_agent_test_lib.erl16
2 files changed, 14 insertions, 3 deletions
diff --git a/lib/snmp/test/snmp_agent_test.erl b/lib/snmp/test/snmp_agent_test.erl
index 1ff8c2e057..a45cfa9e98 100644
--- a/lib/snmp/test/snmp_agent_test.erl
+++ b/lib/snmp/test/snmp_agent_test.erl
@@ -6593,7 +6593,6 @@ otp_4394_test() ->
gn([[1,1]]),
Res =
case snmp_test_mgr:expect(1, [{[sysDescr,0], "Erlang SNMP agent"}]) of
- %% {error, 1, {"?",[]}, {"~w",[timeout]}}
{error, 1, _, {_, [timeout]}} ->
?DBG("otp_4394_test -> expected result: timeout", []),
ok;
diff --git a/lib/snmp/test/snmp_agent_test_lib.erl b/lib/snmp/test/snmp_agent_test_lib.erl
index 8e54bcf3b8..931616edf9 100644
--- a/lib/snmp/test/snmp_agent_test_lib.erl
+++ b/lib/snmp/test/snmp_agent_test_lib.erl
@@ -1160,6 +1160,18 @@ do_expect(trap, Enterp, Generic, Specific, ExpVBs, To) ->
{PureE, Generic, Specific, ExpVBs},
{Ent2, G2, Spec2, VBs}}};
+ {error, timeout} = Error ->
+ SysEvs = snmp_test_global_sys_monitor:events(),
+ io_format_expect("[expecting trap] got timeout when system events:"
+ "~n ~p", [SysEvs]),
+ if
+ (SysEvs =:= []) ->
+ Error;
+ true ->
+ throw({skip, {system_events, SysEvs}})
+ end;
+
+
Error ->
Error
end.
@@ -1261,7 +1273,7 @@ do_expect2(Check, Type, Err, Idx, ExpVBs, To)
io_format_expect("received unexpected pdu with (11) "
"~n Type: ~p"
"~n ReqId: ~p"
- "~n Errot status: ~p"
+ "~n Error status: ~p"
"~n Error index: ~p",
[Type2, ReqId, Err2, Idx2]),
{error,
@@ -1324,7 +1336,7 @@ do_expect2(Check, Type, Err, Idx, ExpVBs, To)
io_format_expect("received unexpected pdu with (15) "
"~n Type: ~p"
"~n ReqId: ~p"
- "~n Errot status: ~p"
+ "~n Error status: ~p"
"~n Error index: ~p"
"~n Varbinds: ~p",
[Type2, ReqId, Err2, Idx2, VBs2]),