From d346ee9081c763ff1c5c33869009c06c754f595f Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 12 Mar 2020 10:04:54 +0100 Subject: [snmp|agent|test] Test tweaking It "looks like" an exit signal (intended to pass a result) from a test runner, passed the starter process and went directly to the test server, which promptly failed the test case. There was no sign that the starter process, which supervises the test runner, died, but that is the only reason I can think of... --- lib/snmp/test/snmp_agent_SUITE.erl | 13 ++++++++++--- lib/snmp/test/snmp_agent_test_lib.erl | 8 ++++---- lib/snmp/test/snmp_test_mgr.erl | 3 ++- 3 files changed, 16 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/snmp/test/snmp_agent_SUITE.erl b/lib/snmp/test/snmp_agent_SUITE.erl index 67ff6d5cb2..62129c2543 100644 --- a/lib/snmp/test/snmp_agent_SUITE.erl +++ b/lib/snmp/test/snmp_agent_SUITE.erl @@ -5051,25 +5051,32 @@ snmp_standard_mib(Config) when is_list(Config) -> ?DBG("snmp_standard_mib -> std_mib_a", []), InBadVsns = try_test(std_mib_a), put(vsn, v2), + ?DBG("snmp_standard_mib -> std_mib_read", []), try_test(std_mib_read), put(vsn, v1), ?DBG("snmp_standard_mib -> std_mib_b (~w)", [InBadVsns]), Bad = try_test(std_mib_b, [InBadVsns]), + ?DBG("snmp_standard_mib -> std_mib_read (community: 'bad community')", []), try_test(std_mib_read, [], [{community, "bad community"}]), + ?DBG("snmp_standard_mib -> std_mib_write (community: 'public')", []), try_test(std_mib_write, [], [{community, "public"}]), + ?DBG("snmp_standard_mib -> std_mib_asn_err", []), try_test(std_mib_asn_err), + ?DBG("snmp_standard_mib -> std_mib_c (~w)", [Bad]), try_test(std_mib_c, [Bad]), + ?DBG("snmp_standard_mib -> std_mib_a", []), try_test(standard_mib_a), ?DBG("snmp_standard_mib -> std_mib_finish", []), try_test(std_mib_finish), + ?DBG("snmp_standard_mib -> std_mib_test_finish", []), try_test(standard_mib_test_finish, [], [{community, "bad community"}]). @@ -5161,7 +5168,7 @@ snmpv2_mib_2(Config) when is_list(Config) -> ?DBG("snmpv2_mib_2 -> write with public community",[]), try_test(std_mib_write, [], [{community, "public"}]), - ?DBG("snmpv2_mib_2 -> asn err",[]), + ?DBG("snmpv2_mib_2 -> asn err", []), try_test(std_mib_asn_err), ?DBG("snmpv2_mib_2 -> check counters",[]), @@ -5174,7 +5181,7 @@ snmpv2_mib_2(Config) when is_list(Config) -> try_test(std_mib_finish), ?DBG("snmpv2_mib_2 -> force auth failure, and await trap, " - "then disable auth traps",[]), + "then disable auth traps", []), try_test(snmpv2_mib_test_finish, [], [{community, "bad community"}]), ?IPRINT("snmpv2_mib_2 -> done"), @@ -7588,7 +7595,7 @@ try_test(Func, A, Opts) -> ?ALIB:try_test(?MODULE, Func, A, Opts). -%% Test manager wrapperfunctions: +%% Test manager wrapper functions: g(Oids) -> snmp_test_mgr:g(Oids). %%gn() -> snmp_test_mgr:gn(). gn(OidsOrN) -> snmp_test_mgr:gn(OidsOrN). diff --git a/lib/snmp/test/snmp_agent_test_lib.erl b/lib/snmp/test/snmp_agent_test_lib.erl index 098b1a0910..629ec49db4 100644 --- a/lib/snmp/test/snmp_agent_test_lib.erl +++ b/lib/snmp/test/snmp_agent_test_lib.erl @@ -387,10 +387,10 @@ await_tc_runner_done(Runner, OldFlag) -> unlink_and_flush_exit(Runner), put(test_server_loc, Loc), exit(Rn); - {tc_runner_done, Runner, Ret, _Zed} -> - ?DBG("call -> done:" - "~n Ret: ~p" - "~n Zed: ~p", [Ret, _Zed]), + {tc_runner_done, Runner, Ret, _Loc} -> + ?IPRINT("call -> done:" + "~n Ret: ~p" + "~n Loc: ~p", [Ret, _Loc]), trap_exit(OldFlag), unlink_and_flush_exit(Runner), case Ret of diff --git a/lib/snmp/test/snmp_test_mgr.erl b/lib/snmp/test/snmp_test_mgr.erl index c2b8156be5..f8eb85734e 100644 --- a/lib/snmp/test/snmp_test_mgr.erl +++ b/lib/snmp/test/snmp_test_mgr.erl @@ -208,7 +208,8 @@ init({Options, CallerPid}) -> RecBufSz = get_value(recbuf, Options, 1024), ?IPRINT("init -> RecBufSz: ~p", [RecBufSz]), Mibs = get_value(mibs, Options, []), - ?IPRINT("init -> Mibs: ~p", [Mibs]), + ?IPRINT("init -> Mibs: " + "~n ~tp", [Mibs]), Udp = get_value(agent_udp, Options, 4000), ?IPRINT("init -> Udp: ~p", [Udp]), User = get_value(user, Options, "initial"), -- cgit v1.2.1