diff options
author | Micael Karlberg <bmk@erlang.org> | 2022-03-10 11:02:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-10 11:02:15 +0100 |
commit | fc22ecab999fcc1f29c736a72458fdaca07ea37a (patch) | |
tree | e2062d494d8fce98d179c964fdfb02aeefa72937 /lib/snmp | |
parent | 4c38ba73ea25ba984c389ee2ebef97a275f25494 (diff) | |
parent | f20413844422ca850cd341b6c7c3cbd09a302e10 (diff) | |
download | erlang-fc22ecab999fcc1f29c736a72458fdaca07ea37a.tar.gz |
Merge pull request #5704 from max-au/max-au/cleanup-line
[cleanup] remove ?line macro
Diffstat (limited to 'lib/snmp')
-rw-r--r-- | lib/snmp/test/snmp_agent_SUITE.erl | 1738 | ||||
-rw-r--r-- | lib/snmp/test/snmp_agent_mibs_SUITE.erl | 124 | ||||
-rw-r--r-- | lib/snmp/test/snmp_agent_test_lib.erl | 122 | ||||
-rw-r--r-- | lib/snmp/test/snmp_compiler_SUITE.erl | 42 | ||||
-rw-r--r-- | lib/snmp/test/snmp_conf_SUITE.erl | 332 | ||||
-rw-r--r-- | lib/snmp/test/snmp_log_SUITE.erl | 98 | ||||
-rw-r--r-- | lib/snmp/test/snmp_manager_SUITE.erl | 482 | ||||
-rw-r--r-- | lib/snmp/test/snmp_manager_config_SUITE.erl | 624 | ||||
-rw-r--r-- | lib/snmp/test/snmp_manager_user_SUITE.erl | 278 |
9 files changed, 1920 insertions, 1920 deletions
diff --git a/lib/snmp/test/snmp_agent_SUITE.erl b/lib/snmp/test/snmp_agent_SUITE.erl index d11e7ecfc3..e1172626af 100644 --- a/lib/snmp/test/snmp_agent_SUITE.erl +++ b/lib/snmp/test/snmp_agent_SUITE.erl @@ -1330,7 +1330,7 @@ stop_agent(Config) -> create_tables(SaNode) -> - %% ?line {atomic, ok} = mnesia:create_table([{name, friendsTable2}, + %% {atomic, ok} = mnesia:create_table([{name, friendsTable2}, %% {ram_copies, [SaNode]}, %% {snmp, [{key, integer}]}, %% {attributes, [a1,a2,a3]}]), @@ -1338,7 +1338,7 @@ create_tables(SaNode) -> {ram_copies, [SaNode]}, {snmp, [{key, integer}]}, {attributes, [a1,a2,a3]}]), - %% ?line {atomic, ok} = mnesia:create_table([{name, kompissTable2}, + %% {atomic, ok} = mnesia:create_table([{name, kompissTable2}, %% {ram_copies, [SaNode]}, %% {snmp, [{key, integer}]}, %% {attributes, [a1,a2,a3]}]), @@ -1346,7 +1346,7 @@ create_tables(SaNode) -> {ram_copies, [SaNode]}, {snmp, [{key, integer}]}, {attributes, [a1,a2,a3]}]), - %% ?line {atomic, ok} = mnesia:create_table([{name, snmp_variables}, + %% {atomic, ok} = mnesia:create_table([{name, snmp_variables}, %% {attributes, [a1,a2]}]), mnesia_create_table_or_fail([{name, snmp_variables}, {attributes, [a1,a2]}]), @@ -1526,14 +1526,14 @@ init_mib_storage_ets(Config) when is_list(Config) -> init_mib_storage_dets(Config) when is_list(Config) -> ?IPRINT("init_mib_storage_dets -> entry"), - ?line AgentDbDir = ?GCONF(agent_db_dir, Config), + AgentDbDir = ?GCONF(agent_db_dir, Config), MibStorage = {mib_storage, [{module, snmpa_mib_storage_dets}, {options, [{dir, AgentDbDir}]}]}, init_ms(Config, [MibStorage]). init_mib_storage_mnesia(Config) when is_list(Config) -> ?IPRINT("init_mib_storage_mnesia -> entry"), - ?line AgentNode = ?GCONF(snmp_master, Config), + AgentNode = ?GCONF(snmp_master, Config), MibStorage = {mib_storage, [{module, snmpa_mib_storage_mnesia}, {options, [{nodes, [AgentNode]}]}]}, init_ms(Config, [MibStorage]). @@ -1542,12 +1542,12 @@ init_ms(Config, Opts) when is_list(Config) -> ?IPRINT("init_ms -> entry with" "~n Config: ~p" "~n Opts: ~p", [Config, Opts]), - ?line SaNode = ?GCONF(snmp_sa, Config), - ?line create_tables(SaNode), - ?line AgentConfDir = ?GCONF(agent_conf_dir, Config), - ?line MgrDir = ?GCONF(mgr_dir, Config), - ?line Ip = ?GCONF(ip, Config), - ?line config([v1], MgrDir, AgentConfDir, + SaNode = ?GCONF(snmp_sa, Config), + create_tables(SaNode), + AgentConfDir = ?GCONF(agent_conf_dir, Config), + MgrDir = ?GCONF(mgr_dir, Config), + Ip = ?GCONF(ip, Config), + config([v1], MgrDir, AgentConfDir, tuple_to_list(Ip), tuple_to_list(Ip)), MasterAgentVerbosity = {agent_verbosity, trace}, MibsVerbosity = {mib_server, [{verbosity, trace}]}, @@ -1566,7 +1566,7 @@ init_ms(Config, Opts) when is_list(Config) -> %% init_size_check_ms(Config, [MibStorage]). init_size_check_msm(Config) when is_list(Config) -> - ?line AgentNode = ?GCONF(snmp_master, Config), + AgentNode = ?GCONF(snmp_master, Config), MibStorage = {mib_storage, [{module, snmpa_mib_storage_mnesia}, {options, [{nodes, [AgentNode]}]}]}, init_size_check_ms(Config, [MibStorage]). @@ -1594,19 +1594,19 @@ init_size_check_ms(Config, Opts) when is_list(Config) -> AgentConfDir = ?GCONF(agent_conf_dir, Config), MgrDir = ?GCONF(mgr_dir, Config), Ip = ?GCONF(ip, Config), - ?line ok = config([v3], MgrDir, AgentConfDir, + ok = config([v3], MgrDir, AgentConfDir, tuple_to_list(Ip), tuple_to_list(Ip)), [{vsn, v3} | start_v3_agent(Config, Opts)]. init_varm_mib_storage_dets(Config) when is_list(Config) -> ?IPRINT("init_varm_mib_storage_dets -> entry"), - ?line SaNode = ?GCONF(snmp_sa, Config), - ?line create_tables(SaNode), - ?line AgentDbDir = ?GCONF(agent_db_dir, Config), - ?line AgentConfDir = ?GCONF(agent_conf_dir, Config), - ?line MgrDir = ?GCONF(mgr_dir, Config), - ?line Ip = ?GCONF(ip, Config), - ?line config([v1], MgrDir, AgentConfDir, + SaNode = ?GCONF(snmp_sa, Config), + create_tables(SaNode), + AgentDbDir = ?GCONF(agent_db_dir, Config), + AgentConfDir = ?GCONF(agent_conf_dir, Config), + MgrDir = ?GCONF(mgr_dir, Config), + Ip = ?GCONF(ip, Config), + config([v1], MgrDir, AgentConfDir, tuple_to_list(Ip), tuple_to_list(Ip)), MibStorage = {mib_storage, [{module, snmpa_mib_storage_dets}, {options, [{dir, AgentDbDir}]}]}, @@ -1621,14 +1621,14 @@ init_varm_mib_storage_dets(Config) when is_list(Config) -> init_varm_mib_storage_mnesia(Config) when is_list(Config) -> ?IPRINT("init_varm_mib_storage_mnesia -> entry"), - ?line SaNode = ?GCONF(snmp_sa, Config), - ?line create_tables(SaNode), - ?line AgentConfDir = ?GCONF(agent_conf_dir, Config), - ?line MgrDir = ?GCONF(mgr_dir, Config), - ?line Ip = ?GCONF(ip, Config), - ?line config([v1], MgrDir, AgentConfDir, + SaNode = ?GCONF(snmp_sa, Config), + create_tables(SaNode), + AgentConfDir = ?GCONF(agent_conf_dir, Config), + MgrDir = ?GCONF(mgr_dir, Config), + Ip = ?GCONF(ip, Config), + config([v1], MgrDir, AgentConfDir, tuple_to_list(Ip), tuple_to_list(Ip)), - ?line AgentNode = ?GCONF(snmp_master, Config), + AgentNode = ?GCONF(snmp_master, Config), MibStorage = {mib_storage, [{module, snmpa_mib_storage_mnesia}, {options, [{nodes, [AgentNode]}]}]}, MasterAgentVerbosity = {agent_verbosity, trace}, @@ -1808,38 +1808,38 @@ ms_size_check(Config) when is_list(Config) -> init_case(Config), ?IPRINT("mib server size check..."), - ?line load_master("Test2"), - ?line load_master("TestTrap"), - ?line load_master("TestTrapv2"), - ?line load_master_std("OTP-SNMPEA-MIB"), - ?line load_master_std("SNMP-COMMUNITY-MIB"), - ?line load_master_std("SNMP-FRAMEWORK-MIB"), - ?line load_master_std("SNMP-MPD-MIB"), - ?line load_master_std("SNMP-NOTIFICATION-MIB"), - ?line load_master_std("SNMP-TARGET-MIB"), - ?line load_master_std("SNMP-USER-BASED-SM-MIB"), - ?line load_master_std("SNMP-VIEW-BASED-ACM-MIB"), - ?line load_master_std("SNMPv2-MIB"), - ?line load_master_std("SNMPv2-TM"), + load_master("Test2"), + load_master("TestTrap"), + load_master("TestTrapv2"), + load_master_std("OTP-SNMPEA-MIB"), + load_master_std("SNMP-COMMUNITY-MIB"), + load_master_std("SNMP-FRAMEWORK-MIB"), + load_master_std("SNMP-MPD-MIB"), + load_master_std("SNMP-NOTIFICATION-MIB"), + load_master_std("SNMP-TARGET-MIB"), + load_master_std("SNMP-USER-BASED-SM-MIB"), + load_master_std("SNMP-VIEW-BASED-ACM-MIB"), + load_master_std("SNMPv2-MIB"), + load_master_std("SNMPv2-TM"), ?SLEEP(2000), - ?line display_memory_usage(), + display_memory_usage(), - ?line unload_master("OTP-SNMPEA-MIB"), - ?line unload_master("SNMP-COMMUNITY-MIB"), - ?line unload_master("SNMP-FRAMEWORK-MIB"), - ?line unload_master("SNMP-MPD-MIB"), - ?line unload_master("SNMP-NOTIFICATION-MIB"), - ?line unload_master("SNMP-TARGET-MIB"), - ?line unload_master("SNMP-USER-BASED-SM-MIB"), - ?line unload_master("SNMP-VIEW-BASED-ACM-MIB"), - ?line unload_master("SNMPv2-MIB"), - ?line unload_master("SNMPv2-TM"), + unload_master("OTP-SNMPEA-MIB"), + unload_master("SNMP-COMMUNITY-MIB"), + unload_master("SNMP-FRAMEWORK-MIB"), + unload_master("SNMP-MPD-MIB"), + unload_master("SNMP-NOTIFICATION-MIB"), + unload_master("SNMP-TARGET-MIB"), + unload_master("SNMP-USER-BASED-SM-MIB"), + unload_master("SNMP-VIEW-BASED-ACM-MIB"), + unload_master("SNMPv2-MIB"), + unload_master("SNMPv2-TM"), - ?line unload_master("TestTrapv2"), - ?line unload_master("TestTrap"), - ?line unload_master("Test2"), + unload_master("TestTrapv2"), + unload_master("TestTrap"), + unload_master("Test2"), ok. @@ -1860,16 +1860,16 @@ varm_mib_start(Config) when is_list(Config) -> %% Load all the mibs HardwiredMibs = loaded_mibs(), ?DBG("varm_mib_start -> load all mibs", []), - ?line load_master_std("SNMP-COMMUNITY-MIB"), - ?line load_master_std("SNMP-FRAMEWORK-MIB"), - ?line load_master_std("SNMP-TARGET-MIB"), - ?line load_master_std("SNMP-NOTIFICATION-MIB"), + load_master_std("SNMP-COMMUNITY-MIB"), + load_master_std("SNMP-FRAMEWORK-MIB"), + load_master_std("SNMP-TARGET-MIB"), + load_master_std("SNMP-NOTIFICATION-MIB"), %% Unload the hardwired mibs ?DBG("varm_mib_start -> sleep some (before unloading hardwired mibs)", []), ?SLEEP(1000), ?DBG("varm_mib_start -> unload (hardwired) mibs", []), - ?line unload_mibs(HardwiredMibs), %% unload hardwired + unload_mibs(HardwiredMibs), %% unload hardwired ?DBG("varm_mib_start -> sleep some (before stopping agent)", []), ?SLEEP(1000), @@ -1910,46 +1910,46 @@ ms_me_of(Config) when is_list(Config) -> ?P(ms_me_of), init_case(Config), - ?line load_master("Test2"), - ?line load_master("TestTrap"), - ?line load_master("TestTrapv2"), - ?line load_master_std("OTP-SNMPEA-MIB"), - ?line load_master_std("SNMP-COMMUNITY-MIB"), - ?line load_master_std("SNMP-FRAMEWORK-MIB"), - ?line load_master_std("SNMP-MPD-MIB"), - ?line load_master_std("SNMP-NOTIFICATION-MIB"), - ?line load_master_std("SNMP-TARGET-MIB"), - ?line load_master_std("SNMP-VIEW-BASED-ACM-MIB"), + load_master("Test2"), + load_master("TestTrap"), + load_master("TestTrapv2"), + load_master_std("OTP-SNMPEA-MIB"), + load_master_std("SNMP-COMMUNITY-MIB"), + load_master_std("SNMP-FRAMEWORK-MIB"), + load_master_std("SNMP-MPD-MIB"), + load_master_std("SNMP-NOTIFICATION-MIB"), + load_master_std("SNMP-TARGET-MIB"), + load_master_std("SNMP-VIEW-BASED-ACM-MIB"), ?SLEEP(2000), - ?line display_memory_usage(), + display_memory_usage(), ?DBG("ms_me_of -> find ~w from SNMP-COMMUNITY-MIB", [?snmpTrapCommunity_instance]), - ?line ok = me_of(?snmpTrapCommunity_instance), + ok = me_of(?snmpTrapCommunity_instance), ?DBG("ms_me_of -> find ~w from SNMP-VIEW-BASED-ACM-MIB", [?vacmViewSpinLock_instance]), - ?line ok = me_of(?vacmViewSpinLock_instance), + ok = me_of(?vacmViewSpinLock_instance), ?DBG("ms_me_of -> find ~w from SNMP-USER-BASED-SM-MIB", [?usmStatsNotInTimeWindows_instance]), - ?line {error, _} = me_of(?usmStatsNotInTimeWindows_instance), + {error, _} = me_of(?usmStatsNotInTimeWindows_instance), - ?line unload_master("OTP-SNMPEA-MIB"), - ?line unload_master("SNMP-COMMUNITY-MIB"), - ?line unload_master("SNMP-FRAMEWORK-MIB"), - ?line unload_master("SNMP-MPD-MIB"), - ?line unload_master("SNMP-NOTIFICATION-MIB"), - ?line unload_master("SNMP-TARGET-MIB"), - ?line unload_master("SNMP-VIEW-BASED-ACM-MIB"), + unload_master("OTP-SNMPEA-MIB"), + unload_master("SNMP-COMMUNITY-MIB"), + unload_master("SNMP-FRAMEWORK-MIB"), + unload_master("SNMP-MPD-MIB"), + unload_master("SNMP-NOTIFICATION-MIB"), + unload_master("SNMP-TARGET-MIB"), + unload_master("SNMP-VIEW-BASED-ACM-MIB"), - ?line unload_master("TestTrapv2"), - ?line unload_master("TestTrap"), - ?line unload_master("Test2"), + unload_master("TestTrapv2"), + unload_master("TestTrap"), + unload_master("Test2"), ok. @@ -1980,47 +1980,47 @@ ms_mib_of(Config) when is_list(Config) -> ?P(ms_mib_of), init_case(Config), - ?line load_master("Test2"), - ?line load_master("TestTrap"), - ?line load_master("TestTrapv2"), - ?line load_master_std("OTP-SNMPEA-MIB"), - ?line load_master_std("SNMP-COMMUNITY-MIB"), - ?line load_master_std("SNMP-FRAMEWORK-MIB"), - ?line load_master_std("SNMP-MPD-MIB"), - ?line load_master_std("SNMP-NOTIFICATION-MIB"), - ?line load_master_std("SNMP-TARGET-MIB"), - ?line load_master_std("SNMP-VIEW-BASED-ACM-MIB"), + load_master("Test2"), + load_master("TestTrap"), + load_master("TestTrapv2"), + load_master_std("OTP-SNMPEA-MIB"), + load_master_std("SNMP-COMMUNITY-MIB"), + load_master_std("SNMP-FRAMEWORK-MIB"), + load_master_std("SNMP-MPD-MIB"), + load_master_std("SNMP-NOTIFICATION-MIB"), + load_master_std("SNMP-TARGET-MIB"), + load_master_std("SNMP-VIEW-BASED-ACM-MIB"), ?SLEEP(2000), - ?line display_memory_usage(), + display_memory_usage(), ?DBG("ms_mib_of -> find ~w from SNMP-COMMUNITY-MIB", [?snmpTrapCommunity_instance]), - ?line ok = mib_of(?snmpTrapCommunity_instance, 'SNMP-COMMUNITY-MIB'), + ok = mib_of(?snmpTrapCommunity_instance, 'SNMP-COMMUNITY-MIB'), ?DBG("ms_mib_of -> find ~w from SNMP-VIEW-BASED-ACM-MIB", [?vacmViewSpinLock_instance]), - ?line ok = mib_of(?vacmViewSpinLock_instance, 'SNMP-VIEW-BASED-ACM-MIB'), + ok = mib_of(?vacmViewSpinLock_instance, 'SNMP-VIEW-BASED-ACM-MIB'), ?DBG("ms_mib_of -> find ~w from SNMP-USER-BASED-SM-MIB", [?usmStatsNotInTimeWindows_instance]), - ?line {error, _} = mib_of(?usmStatsNotInTimeWindows_instance, + {error, _} = mib_of(?usmStatsNotInTimeWindows_instance, 'SNMP-USER-BASED-SM-MIB'), - ?line unload_master("OTP-SNMPEA-MIB"), - ?line unload_master("SNMP-COMMUNITY-MIB"), - ?line unload_master("SNMP-FRAMEWORK-MIB"), - ?line unload_master("SNMP-MPD-MIB"), - ?line unload_master("SNMP-NOTIFICATION-MIB"), - ?line unload_master("SNMP-TARGET-MIB"), - ?line unload_master("SNMP-VIEW-BASED-ACM-MIB"), + unload_master("OTP-SNMPEA-MIB"), + unload_master("SNMP-COMMUNITY-MIB"), + unload_master("SNMP-FRAMEWORK-MIB"), + unload_master("SNMP-MPD-MIB"), + unload_master("SNMP-NOTIFICATION-MIB"), + unload_master("SNMP-TARGET-MIB"), + unload_master("SNMP-VIEW-BASED-ACM-MIB"), - ?line unload_master("TestTrapv2"), - ?line unload_master("TestTrap"), - ?line unload_master("Test2"), + unload_master("TestTrapv2"), + unload_master("TestTrap"), + unload_master("Test2"), ok. @@ -2240,13 +2240,13 @@ v1_cases_ipv6() -> ]. init_v1(Config) when is_list(Config) -> - ?line SaNode = ?config(snmp_sa, Config), - ?line create_tables(SaNode), - ?line AgentConfDir = ?config(agent_conf_dir, Config), - ?line MgrDir = ?config(mgr_dir, Config), - ?line Ip = ?config(ip, Config), - ?line IpFamily = config_ipfamily(Config), - ?line config( + SaNode = ?config(snmp_sa, Config), + create_tables(SaNode), + AgentConfDir = ?config(agent_conf_dir, Config), + MgrDir = ?config(mgr_dir, Config), + Ip = ?config(ip, Config), + IpFamily = config_ipfamily(Config), + config( [v1], MgrDir, AgentConfDir, tuple_to_list(Ip), tuple_to_list(Ip), IpFamily), [{vsn, v1} | start_v1_agent(Config)]. @@ -2448,7 +2448,7 @@ init_v3(Config) when is_list(Config) -> MgrDir = ?config(mgr_dir, Config), Ip = ?config(ip, Config), IpFamily = config_ipfamily(Config), - ?line ok = + ok = config( [v3], MgrDir, AgentConfDir, tuple_to_list(Ip), tuple_to_list(Ip), IpFamily), @@ -2481,7 +2481,7 @@ init_mt(Config, MT) when is_list(Config) -> AgentConfDir = ?config(agent_conf_dir, Config), MgrDir = ?config(mgr_dir, Config), Ip = ?config(ip, Config), - ?line ok = config([v2], MgrDir, AgentConfDir, + ok = config([v2], MgrDir, AgentConfDir, tuple_to_list(Ip), tuple_to_list(Ip)), [{vsn, v2} | start_multi_threaded_agent(Config, MT)]. @@ -2592,12 +2592,12 @@ big(Config) when is_list(Config) -> {SaNode, _MgrNode, _MibDir} = init_case(Config), ?NPRINT("Starting subagent..."), - ?line pong = net_adm:ping(SaNode), + pong = net_adm:ping(SaNode), - ?line {ok, SA} = start_subagent(SaNode, ?klas1, "Klas1"), + {ok, SA} = start_subagent(SaNode, ?klas1, "Klas1"), ?DBG("big -> SA: ~p", [SA]), - ?line load_master("OLD-SNMPEA-MIB"), - ?line init_old(), + load_master("OLD-SNMPEA-MIB"), + init_old(), snmpa:dump_mibs(), snmpa:dump_mibs("dumped_mibs.txt"), @@ -2605,8 +2605,8 @@ big(Config) when is_list(Config) -> try_test(big_test), - ?line stop_subagent(SA), - ?line unload_master("OLD-SNMPEA-MIB"). + stop_subagent(SA), + unload_master("OLD-SNMPEA-MIB"). big_2(X) -> ?P(big_2), big(X). @@ -2620,14 +2620,14 @@ big2(Config) when is_list(Config) -> {SaNode, _MgrNode, _MibDir} = init_case(Config), ?NPRINT("Starting subagent..."), - ?line pong = net_adm:ping(SaNode), + pong = net_adm:ping(SaNode), - ?line {ok, SA} = start_subagent(SaNode, ?klas1, "Klas1-v2"), - ?line load_master("OLD-SNMPEA-MIB-v2"), - ?line init_old(), + {ok, SA} = start_subagent(SaNode, ?klas1, "Klas1-v2"), + load_master("OLD-SNMPEA-MIB-v2"), + init_old(), try_test(big_test), - ?line stop_subagent(SA), - ?line unload_master("OLD-SNMPEA-MIB-v2"). + stop_subagent(SA), + unload_master("OLD-SNMPEA-MIB-v2"). big2_2(X) -> ?P(big2_2), big2(X). @@ -2638,9 +2638,9 @@ multi_threaded(Config) when is_list(Config) -> ?P(multi_threaded), init_case(Config), - ?line load_master("Test1"), + load_master("Test1"), try_test(multi_threaded_test), - ?line unload_master("Test1"). + unload_master("Test1"). mt_trap(Config) when is_list(Config) -> ?P(mt_trap), @@ -2648,20 +2648,20 @@ mt_trap(Config) when is_list(Config) -> MA = whereis(snmp_master_agent), MT = ?config(multi_threaded, Config), - ?line load_master("Test1"), - ?line load_master("TestTrapv2"), + load_master("Test1"), + load_master("TestTrapv2"), try_test(mt_trap_test, [MA, MT]), - ?line unload_master("TestTrapv2"), - ?line unload_master("Test1"), + unload_master("TestTrapv2"), + unload_master("Test1"), ok. v2_types(Config) when is_list(Config) -> ?P(v2_types), init_case(Config), - ?line load_master("Test1"), + load_master("Test1"), try_test(types_v2_test), - ?line unload_master("Test1"). + unload_master("Test1"). v2_types_3(X) -> ?P(v2_types_3), v2_types(X). @@ -2671,9 +2671,9 @@ implied(Config) when is_list(Config) -> init_case(Config), MA = whereis(snmp_master_agent), - ?line load_master("Test1"), + load_master("Test1"), try_test(implied_test,[MA]), - ?line unload_master("Test1"). + unload_master("Test1"). implied_3(X) -> ?P(implied_3), implied(X). @@ -2682,9 +2682,9 @@ sparse_table(Config) when is_list(Config) -> ?P(sparse_table), init_case(Config), - ?line load_master("Test1"), + load_master("Test1"), try_test(sparse_table_test), - ?line unload_master("Test1"). + unload_master("Test1"). sparse_table_2(X) -> ?P(sparse_table_2), sparse_table(X). @@ -2695,9 +2695,9 @@ cnt_64(Config) when is_list(Config) -> init_case(Config), MA = whereis(snmp_master_agent), - ?line load_master("Test1"), + load_master("Test1"), try_test(cnt_64_test, [MA]), - ?line unload_master("Test1"). + unload_master("Test1"). cnt_64_2(X) -> ?P(cnt_64_2), cnt_64(X). @@ -2707,9 +2707,9 @@ opaque(Config) when is_list(Config) -> ?P(opaque), init_case(Config), - ?line load_master("Test1"), + load_master("Test1"), try_test(opaque_test), - ?line unload_master("Test1"). + unload_master("Test1"). opaque_2(X) -> ?P(opaque_2), opaque(X). @@ -2727,27 +2727,27 @@ change_target_addr_config(Config) when is_list(Config) -> MA = whereis(snmp_master_agent), ?IPRINT("change_target_addr_config -> load TestTrap"), - ?line load_master("TestTrap"), + load_master("TestTrap"), ?IPRINT("change_target_addr_config -> set trace verbosity for local_db"), - ?line snmpa:verbosity(local_db,trace), + snmpa:verbosity(local_db,trace), %% First send some traps that will arrive att the original manager ?IPRINT("change_target_addr_config -> send trap"), try_test(ma_trap1, [MA]), ?IPRINT("change_target_addr_config -> set silence verbosity for local_db"), - ?line snmpa:verbosity(local_db, silence), + snmpa:verbosity(local_db, silence), %% Start new dummy listener ?IPRINT("change_target_addr_config -> start dummy manager"), - ?line {ok,Pid,NewPort} = dummy_manager_start(MA), + {ok,Pid,NewPort} = dummy_manager_start(MA), %% Reconfigure ?IPRINT("change_target_addr_config -> reconfigure"), AgentConfDir = ?config(agent_conf_dir, Config), - ?line rewrite_target_addr_conf(AgentConfDir, NewPort), - ?line snmp_target_mib:reconfigure(AgentConfDir), + rewrite_target_addr_conf(AgentConfDir, NewPort), + snmp_target_mib:reconfigure(AgentConfDir), %% Send the trap again ?IPRINT("change_target_addr_config -> send trap again"), @@ -2757,13 +2757,13 @@ change_target_addr_config(Config) when is_list(Config) -> catch dummy_manager_await_trap2_ack(), ?IPRINT("change_target_addr_config -> stop dummy manager"), - ?line ok = dummy_manager_stop(Pid), + ok = dummy_manager_stop(Pid), ?IPRINT("change_target_addr_config -> reset target address config"), - ?line reset_target_addr_conf(AgentConfDir), + reset_target_addr_conf(AgentConfDir), ?IPRINT("change_target_addr_config -> unload TestTrap"), - ?line unload_master("TestTrap"). + unload_master("TestTrap"). dummy_manager_start(MA) -> @@ -2891,10 +2891,10 @@ api(Config) when is_list(Config) -> ?P(api), init_case(Config), - ?line load_master("OLD-SNMPEA-MIB"), - ?line init_old(), + load_master("OLD-SNMPEA-MIB"), + init_old(), try_test(api_test, [node()]), - ?line unload_master("OLD-SNMPEA-MIB"). + unload_master("OLD-SNMPEA-MIB"). api_2(X) -> ?P(api_2), api(X). @@ -2905,7 +2905,7 @@ subagent(Config) when is_list(Config) -> ?P(subagent), {SaNode, _MgrNode, MibDir} = init_case(Config), - ?line {ok, SA} = start_subagent(SaNode, ?klas1, "Klas1"), + {ok, SA} = start_subagent(SaNode, ?klas1, "Klas1"), try_test(load_test_sa), ?NPRINT("Testing unregister subagent..."), @@ -2914,11 +2914,11 @@ subagent(Config) when is_list(Config) -> try_test(unreg_test), ?NPRINT("Loading previous subagent mib in master and testing..."), - ?line ok = snmpa:load_mib(MA, join(MibDir, "Klas1")), + ok = snmpa:load_mib(MA, join(MibDir, "Klas1")), try_test(load_test), ?NPRINT("Unloading previous subagent mib in master and testing..."), - ?line ok = snmpa:unload_mib(MA, join(MibDir, "Klas1")), + ok = snmpa:unload_mib(MA, join(MibDir, "Klas1")), try_test(unreg_test), ?NPRINT("Testing register subagent..."), @@ -2926,7 +2926,7 @@ subagent(Config) when is_list(Config) -> [MA, ?klas1, SA]), try_test(load_test_sa), - ?line stop_subagent(SA), + stop_subagent(SA), try_test(unreg_test). subagent_2(X) -> ?P(subagent_2), subagent(X). @@ -2948,8 +2948,8 @@ mnesia(Config) when is_list(Config) -> ?NPRINT("Starting subagent with mnesia impl..."), {ok, SA} = start_subagent(SaNode, ?klas2, "Klas2"), - ?line load_master("OLD-SNMPEA-MIB"), - ?line init_old(), + load_master("OLD-SNMPEA-MIB"), + init_old(), try_test(big_test_2), @@ -2957,8 +2957,8 @@ mnesia(Config) when is_list(Config) -> MA = whereis(snmp_master_agent), rpc:call(SaNode, snmpa, unregister_subagent, [MA, SA]), try_test(unreg_test), - ?line unload_master("OLD-SNMPEA-MIB"), - ?line stop_subagent(SA). + unload_master("OLD-SNMPEA-MIB"), + stop_subagent(SA). mnesia_2(X) -> ?P(mnesia_2), mnesia(X). @@ -3001,9 +3001,9 @@ mul_cases_3() -> init_mul(Config) when is_list(Config) -> {SaNode, _MgrNode, _MibDir} = init_case(Config), - ?line {ok, SA} = start_subagent(SaNode, ?klas1, "Klas1"), - ?line load_master("OLD-SNMPEA-MIB"), - ?line init_old(), + {ok, SA} = start_subagent(SaNode, ?klas1, "Klas1"), + load_master("OLD-SNMPEA-MIB"), + init_old(), [{mul_sub, SA} | Config]. finish_mul(Config) when is_list(Config) -> @@ -3011,8 +3011,8 @@ finish_mul(Config) when is_list(Config) -> SA = ?config(mul_sub, Config), - ?line unload_master("OLD-SNMPEA-MIB"), - ?line stop_subagent(SA), + unload_master("OLD-SNMPEA-MIB"), + stop_subagent(SA), lists:keydelete(mul_sub, 1, Config). mul_get(Config) when is_list(Config) -> @@ -3093,7 +3093,7 @@ sa_register(Config) when is_list(Config) -> ?DBG("sa_register -> start subagent", []), ?NPRINT("start subagent..."), - ?line {ok, SA} = start_subagent(SaNode, ?klas1, "Klas1"), + {ok, SA} = start_subagent(SaNode, ?klas1, "Klas1"), ?DBG("sa_register -> unregister subagent", []), ?NPRINT("Testing unregister subagent (2)..."), @@ -3117,7 +3117,7 @@ sa_register(Config) when is_list(Config) -> ?NPRINT("stop subagent..."), ?DBG("sa_register -> stop subagent", []), - ?line stop_subagent(SA). + stop_subagent(SA). sa_register_2(X) -> ?P(sa_register_2), sa_register(X). @@ -3132,14 +3132,14 @@ trap1(Config) -> {SaNode, _MgrNode, _MibDir} = init_case(Config), ?NPRINT("start subagent..."), - ?line {ok, SA} = start_subagent(SaNode, ?sa, "SA-MIB"), + {ok, SA} = start_subagent(SaNode, ?sa, "SA-MIB"), ?NPRINT("Testing trap sending from master agent..."), MA = whereis(snmp_master_agent), ?NPRINT("load TestTrap & TestTrapv2..."), - ?line load_master("TestTrap"), - ?line load_master("TestTrapv2"), + load_master("TestTrap"), + load_master("TestTrapv2"), ?NPRINT("Testing trap sending from master-agent..."), try_test(ma_trap1, [MA]), @@ -3153,11 +3153,11 @@ trap1(Config) -> try_test(sa_trap3, [SA]), ?NPRINT("unload TestTrap & TestTrapv2..."), - ?line unload_master("TestTrap"), - ?line unload_master("TestTrapv2"), + unload_master("TestTrap"), + unload_master("TestTrapv2"), ?NPRINT("stop subagent..."), - ?line stop_subagent(SA). + stop_subagent(SA). v2_trap(Config) when is_list(Config) -> ?P(v2_trap), @@ -3167,14 +3167,14 @@ trap2(Config) -> {SaNode, _MgrNode, _MibDir} = init_case(Config), ?NPRINT("start subagent..."), - ?line {ok, SA} = start_subagent(SaNode, ?sa, "SA-MIB"), + {ok, SA} = start_subagent(SaNode, ?sa, "SA-MIB"), ?NPRINT("Testing trap sending from master agent..."), MA = whereis(snmp_master_agent), ?NPRINT("load TestTrap & TestTrapv2..."), - ?line load_master("TestTrap"), - ?line load_master("TestTrapv2"), + load_master("TestTrap"), + load_master("TestTrapv2"), ?NPRINT("Testing trap sending from master-agent..."), try_test(ma_v2_trap1, [MA]), @@ -3190,11 +3190,11 @@ trap2(Config) -> try_test(sa_v1_2_v2_trap3, [SA]), ?NPRINT("unload TestTrap & TestTrapv2..."), - ?line unload_master("TestTrap"), - ?line unload_master("TestTrapv2"), + unload_master("TestTrap"), + unload_master("TestTrapv2"), ?NPRINT("stop subagent..."), - ?line stop_subagent(SA). + stop_subagent(SA). v3_trap(Config) when is_list(Config) -> %% <CONDITIONAL-SKIP> @@ -3244,8 +3244,8 @@ inform_i(Config) -> MA = whereis(snmp_master_agent), ?NPRINT("load TestTrap & TestTrapv2..."), - ?line load_master("TestTrap"), - ?line load_master("TestTrapv2"), + load_master("TestTrap"), + load_master("TestTrapv2"), ?NPRINT("Testing inform sending from master agent... " "~nNOTE! This test takes a few minutes (10) to complete."), @@ -3255,8 +3255,8 @@ inform_i(Config) -> try_test(ma_v2_inform3, [MA]), ?NPRINT("unload TestTrap & TestTrapv2..."), - ?line unload_master("TestTrap"), - ?line unload_master("TestTrapv2"), + unload_master("TestTrap"), + unload_master("TestTrapv2"), ok. v3_inform_i(X) -> @@ -3275,11 +3275,11 @@ sa_error(Config) when is_list(Config) -> {SaNode, _MgrNode, _MibDir} = init_case(Config), ?NPRINT("load OLD-SNMPEA-MIB..."), - ?line load_master("OLD-SNMPEA-MIB"), - ?line init_old(), + load_master("OLD-SNMPEA-MIB"), + init_old(), ?NPRINT("start subagent..."), - ?line {ok, SA} = start_subagent(SaNode, ?sa, "SA-MIB"), + {ok, SA} = start_subagent(SaNode, ?sa, "SA-MIB"), ?NPRINT("Testing sa bad value (is_set_ok)..."), try_test(sa_errs_bad_value), @@ -3291,7 +3291,7 @@ sa_error(Config) when is_list(Config) -> try_test(sa_too_big), ?NPRINT("unload OLD-SNMPEA-MIB..."), - ?line unload_master("OLD-SNMPEA-MIB"), + unload_master("OLD-SNMPEA-MIB"), ?NPRINT("stop subagent..."), stop_subagent(SA). @@ -3317,10 +3317,10 @@ next_across_sa(Config) when is_list(Config) -> MA = whereis(snmp_master_agent), ?NPRINT("start subagent (1)..."), - ?line {ok, SA} = start_subagent(SaNode, ?sa, "SA-MIB"), + {ok, SA} = start_subagent(SaNode, ?sa, "SA-MIB"), ?NPRINT("Loading another subagent mib (Klas1)..."), - ?line ok = snmpa:load_mib(SA, MibDir ++ "Klas1"), + ok = snmpa:load_mib(SA, MibDir ++ "Klas1"), ?NPRINT("register subagent..."), rpc:call(SaNode, snmpa, register_subagent, [MA, ?klas1, SA]), @@ -3337,7 +3337,7 @@ next_across_sa(Config) when is_list(Config) -> try_test(unreg_test), ?NPRINT("Starting another subagent (2) "), - ?line {ok, SA2} = start_subagent(SaNode, ?klas1, "Klas1"), + {ok, SA2} = start_subagent(SaNode, ?klas1, "Klas1"), ?NPRINT("Testing next across subagent (wrong prefix from SA)..."), try_test(next_across_sa_test), @@ -3369,30 +3369,30 @@ undo(Config) when is_list(Config) -> MA = whereis(snmp_master_agent), ?NPRINT("start subagent (1)..."), - ?line {ok, SA} = start_subagent(SaNode, ?sa, "SA-MIB"), + {ok, SA} = start_subagent(SaNode, ?sa, "SA-MIB"), ?NPRINT("Load Klas3 & Klas4..."), - ?line ok = snmpa:load_mib(MA, join(MibDir, "Klas3")), - ?line ok = snmpa:load_mib(MA, join(MibDir, "Klas4")), + ok = snmpa:load_mib(MA, join(MibDir, "Klas3")), + ok = snmpa:load_mib(MA, join(MibDir, "Klas4")), ?NPRINT("Testing undo phase at master agent..."), try_test(undo_test), try_test(api_test2), ?NPRINT("Unload Klas3..."), - ?line ok = snmpa:unload_mib(MA, join(MibDir, "Klas3")), + ok = snmpa:unload_mib(MA, join(MibDir, "Klas3")), ?NPRINT("Testing bad return values from instrum. funcs..."), try_test(bad_return), ?NPRINT("Unload Klas4..."), - ?line ok = snmpa:unload_mib(MA, join(MibDir, "Klas4")), + ok = snmpa:unload_mib(MA, join(MibDir, "Klas4")), ?NPRINT("Testing undo phase at subagent..."), - ?line ok = snmpa:load_mib(SA, join(MibDir, "Klas3")), - ?line ok = snmpa:load_mib(SA, join(MibDir, "Klas4")), - ?line ok = snmpa:register_subagent(MA, ?klas3, SA), - ?line ok = snmpa:register_subagent(MA, ?klas4, SA), + ok = snmpa:load_mib(SA, join(MibDir, "Klas3")), + ok = snmpa:load_mib(SA, join(MibDir, "Klas4")), + ok = snmpa:register_subagent(MA, ?klas3, SA), + ok = snmpa:register_subagent(MA, ?klas4, SA), try_test(undo_test), try_test(api_test3), @@ -3424,12 +3424,12 @@ v1_processing(Config) when is_list(Config) -> init_case(Config), ?NPRINT("Load Test2..."), - ?line load_master("Test2"), + load_master("Test2"), try_test(v1_proc), ?NPRINT("Unload Test2..."), - ?line unload_master("Test2"). + unload_master("Test2"). %% Req. Test2 v2_processing(Config) when is_list(Config) -> @@ -3437,12 +3437,12 @@ v2_processing(Config) when is_list(Config) -> init_case(Config), ?NPRINT("Load Test2..."), - ?line load_master("Test2"), + load_master("Test2"), try_test(v2_proc), ?NPRINT("Unload Test2..."), - ?line unload_master("Test2"). + unload_master("Test2"). %% Req. Test2 v3_processing(Config) when is_list(Config) -> @@ -3450,12 +3450,12 @@ v3_processing(Config) when is_list(Config) -> init_case(Config), ?NPRINT("Load Test2..."), - ?line load_master("Test2"), + load_master("Test2"), try_test(v2_proc), % same as v2! ?NPRINT("Unload Test2..."), - ?line unload_master("Test2"). + unload_master("Test2"). %% We'll try get/set/trap and inform for all the auth & priv protocols. @@ -3481,26 +3481,26 @@ v3_crypto_basic(_Config) -> ?P(v3_crypto_basic), EID = [0,0,0,0,0,0,0,0,0,0,0,2], %% From rfc2274 appendix A.3.1 - ?line KMd5_1 = snmp:passwd2localized_key(md5, "maplesyrup", EID), - ?line [16#52,16#6f,16#5e,16#ed,16#9f,16#cc,16#e2,16#6f, + KMd5_1 = snmp:passwd2localized_key(md5, "maplesyrup", EID), + [16#52,16#6f,16#5e,16#ed,16#9f,16#cc,16#e2,16#6f, 16#89,16#64,16#c2,16#93,16#07,16#87,16#d8,16#2b] = KMd5_1, %% From rfc2274 appendix A.3.2 - ?line KSHA_1 = snmp:passwd2localized_key(sha, "maplesyrup", EID), - ?line [16#66,16#95,16#fe,16#bc,16#92,16#88,16#e3,16#62,16#82,16#23, + KSHA_1 = snmp:passwd2localized_key(sha, "maplesyrup", EID), + [16#66,16#95,16#fe,16#bc,16#92,16#88,16#e3,16#62,16#82,16#23, 16#5f,16#c7,16#15,16#1f,16#12,16#84,16#97,16#b3,16#8f,16#3f] = KSHA_1, %% From rfc2274, appendix A.5.1 - ?line KMd5_2 = snmp:passwd2localized_key(md5, "newsyrup", EID), - ?line [16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00, + KMd5_2 = snmp:passwd2localized_key(md5, "newsyrup", EID), + [16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00, 16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00, 16#88,16#05,16#61,16#51,16#41,16#67,16#6c,16#c9, 16#19,16#61,16#74,16#e7,16#42,16#a3,16#25,16#51] = snmp_user_based_sm_mib:mk_key_change(md5, KMd5_1, KMd5_2, 16, [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]), %% From rfc2274, appendix A.5.2 - ?line KSHA_2 = snmp:passwd2localized_key(sha, "newsyrup", EID), - ?line [16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00, + KSHA_2 = snmp:passwd2localized_key(sha, "newsyrup", EID), + [16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00, 16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00, 16#00,16#00,16#00,16#00,16#9c,16#10,16#17,16#f4, 16#fd,16#48,16#3d,16#2d,16#e8,16#d5,16#fa,16#db, @@ -3509,7 +3509,7 @@ v3_crypto_basic(_Config) -> [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]), KSHA_1t = lists:sublist(KSHA_1, 16), KSHA_2t = lists:sublist(KSHA_2, 16), - ?line [16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00, + [16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00, 16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00, 16#7e,16#f8,16#d8,16#a4,16#c9,16#cd,16#b2,16#6b, 16#47,16#59,16#1c,16#d8,16#52,16#ff,16#88,16#b5] = @@ -3517,10 +3517,10 @@ v3_crypto_basic(_Config) -> [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]), %% Try with correct random - ?line Kc1 = snmp_user_based_sm_mib:mk_key_change(md5, KMd5_1, KMd5_2), - ?line KMd5_2 = snmp_user_based_sm_mib:extract_new_key(md5, KMd5_1, Kc1), - ?line Kc2 = snmp_user_based_sm_mib:mk_key_change(sha, KSHA_1, KSHA_2), - ?line KSHA_2 = snmp_user_based_sm_mib:extract_new_key(sha, KSHA_1, Kc2), + Kc1 = snmp_user_based_sm_mib:mk_key_change(md5, KMd5_1, KMd5_2), + KMd5_2 = snmp_user_based_sm_mib:extract_new_key(md5, KMd5_1, Kc1), + Kc2 = snmp_user_based_sm_mib:mk_key_change(sha, KSHA_1, KSHA_2), + KSHA_2 = snmp_user_based_sm_mib:extract_new_key(sha, KSHA_1, Kc2), ok. @@ -3532,24 +3532,24 @@ v3_md5_auth(Config) when is_list(Config) -> ?NPRINT("Testing MD5 authentication...takes a few seconds..."), AgentConfDir = ?config(agent_conf_dir, Config), - ?line rewrite_target_params_conf(AgentConfDir, "authMD5", authNoPriv), - ?line snmp_target_mib:reconfigure(AgentConfDir), + rewrite_target_params_conf(AgentConfDir, "authMD5", authNoPriv), + snmp_target_mib:reconfigure(AgentConfDir), MA = whereis(snmp_master_agent), - ?line load_master("Test2"), - ?line load_master("TestTrap"), - ?line load_master("TestTrapv2"), + load_master("Test2"), + load_master("TestTrap"), + load_master("TestTrapv2"), try_test(v3_sync, [[{v2_proc, []}, {ma_v2_trap1, [MA]}, {v3_inform_sync, [MA]}]], [{sec_level, authNoPriv}, {user, "authMD5"}]), - ?line unload_master("TestTrapv2"), - ?line unload_master("TestTrap"), - ?line unload_master("Test2"), - ?line reset_target_params_conf(AgentConfDir). + unload_master("TestTrapv2"), + unload_master("TestTrap"), + unload_master("Test2"), + reset_target_params_conf(AgentConfDir). v3_sha_auth(Config) when is_list(Config) -> ?P(v3_sha_auth), @@ -3558,26 +3558,26 @@ v3_sha_auth(Config) when is_list(Config) -> ?NPRINT("Testing SHA authentication...takes a few seconds..."), AgentConfDir = ?config(agent_conf_dir, Config), - ?line rewrite_target_params_conf(AgentConfDir, "authSHA", authNoPriv), - ?line snmp_target_mib:reconfigure(AgentConfDir), + rewrite_target_params_conf(AgentConfDir, "authSHA", authNoPriv), + snmp_target_mib:reconfigure(AgentConfDir), MA = whereis(snmp_master_agent), snmp_user_based_sm_mib:usmUserTable(print), - ?line load_master("Test2"), - ?line load_master("TestTrap"), - ?line load_master("TestTrapv2"), + load_master("Test2"), + load_master("TestTrap"), + load_master("TestTrapv2"), try_test(v3_sync, [[{v2_proc, []}, {ma_v2_trap1, [MA]}, {v3_inform_sync, [MA]}]], [{sec_level, authNoPriv}, {user, "authSHA"}]), - ?line unload_master("TestTrapv2"), - ?line unload_master("TestTrap"), - ?line unload_master("Test2"), - ?line reset_target_params_conf(AgentConfDir). + unload_master("TestTrapv2"), + unload_master("TestTrap"), + unload_master("Test2"), + reset_target_params_conf(AgentConfDir). v3_sha224_auth(Config) when is_list(Config) -> ?P(v3_sha224_auth), @@ -3586,26 +3586,26 @@ v3_sha224_auth(Config) when is_list(Config) -> ?NPRINT("Testing SHA224 authentication...takes a few seconds..."), AgentConfDir = ?config(agent_conf_dir, Config), - ?line rewrite_target_params_conf(AgentConfDir, "authSHA224", authNoPriv), - ?line snmp_target_mib:reconfigure(AgentConfDir), + rewrite_target_params_conf(AgentConfDir, "authSHA224", authNoPriv), + snmp_target_mib:reconfigure(AgentConfDir), MA = whereis(snmp_master_agent), snmp_user_based_sm_mib:usmUserTable(print), - ?line load_master("Test2"), - ?line load_master("TestTrap"), - ?line load_master("TestTrapv2"), + load_master("Test2"), + load_master("TestTrap"), + load_master("TestTrapv2"), try_test(v3_sync, [[{v2_proc, []}, {ma_v2_trap1, [MA]}, {v3_inform_sync, [MA]}]], [{sec_level, authNoPriv}, {user, "authSHA224"}]), - ?line unload_master("TestTrapv2"), - ?line unload_master("TestTrap"), - ?line unload_master("Test2"), - ?line reset_target_params_conf(AgentConfDir). + unload_master("TestTrapv2"), + unload_master("TestTrap"), + unload_master("Test2"), + reset_target_params_conf(AgentConfDir). v3_sha256_auth(Config) when is_list(Config) -> ?P(v3_sha256_auth), @@ -3614,26 +3614,26 @@ v3_sha256_auth(Config) when is_list(Config) -> ?NPRINT("Testing SHA256 authentication...takes a few seconds..."), AgentConfDir = ?config(agent_conf_dir, Config), - ?line rewrite_target_params_conf(AgentConfDir, "authSHA256", authNoPriv), - ?line snmp_target_mib:reconfigure(AgentConfDir), + rewrite_target_params_conf(AgentConfDir, "authSHA256", authNoPriv), + snmp_target_mib:reconfigure(AgentConfDir), MA = whereis(snmp_master_agent), snmp_user_based_sm_mib:usmUserTable(print), - ?line load_master("Test2"), - ?line load_master("TestTrap"), - ?line load_master("TestTrapv2"), + load_master("Test2"), + load_master("TestTrap"), + load_master("TestTrapv2"), try_test(v3_sync, [[{v2_proc, []}, {ma_v2_trap1, [MA]}, {v3_inform_sync, [MA]}]], [{sec_level, authNoPriv}, {user, "authSHA256"}]), - ?line unload_master("TestTrapv2"), - ?line unload_master("TestTrap"), - ?line unload_master("Test2"), - ?line reset_target_params_conf(AgentConfDir). + unload_master("TestTrapv2"), + unload_master("TestTrap"), + unload_master("Test2"), + reset_target_params_conf(AgentConfDir). v3_sha384_auth(Config) when is_list(Config) -> ?P(v3_sha384_auth), @@ -3642,26 +3642,26 @@ v3_sha384_auth(Config) when is_list(Config) -> ?NPRINT("Testing SHA authentication...takes a few seconds..."), AgentConfDir = ?config(agent_conf_dir, Config), - ?line rewrite_target_params_conf(AgentConfDir, "authSHA384", authNoPriv), - ?line snmp_target_mib:reconfigure(AgentConfDir), + rewrite_target_params_conf(AgentConfDir, "authSHA384", authNoPriv), + snmp_target_mib:reconfigure(AgentConfDir), MA = whereis(snmp_master_agent), snmp_user_based_sm_mib:usmUserTable(print), - ?line load_master("Test2"), - ?line load_master("TestTrap"), - ?line load_master("TestTrapv2"), + load_master("Test2"), + load_master("TestTrap"), + load_master("TestTrapv2"), try_test(v3_sync, [[{v2_proc, []}, {ma_v2_trap1, [MA]}, {v3_inform_sync, [MA]}]], [{sec_level, authNoPriv}, {user, "authSHA384"}]), - ?line unload_master("TestTrapv2"), - ?line unload_master("TestTrap"), - ?line unload_master("Test2"), - ?line reset_target_params_conf(AgentConfDir). + unload_master("TestTrapv2"), + unload_master("TestTrap"), + unload_master("Test2"), + reset_target_params_conf(AgentConfDir). v3_sha512_auth(Config) when is_list(Config) -> ?P(v3_sha512_auth), @@ -3670,26 +3670,26 @@ v3_sha512_auth(Config) when is_list(Config) -> ?NPRINT("Testing SHA512 authentication...takes a few seconds..."), AgentConfDir = ?config(agent_conf_dir, Config), - ?line rewrite_target_params_conf(AgentConfDir, "authSHA512", authNoPriv), - ?line snmp_target_mib:reconfigure(AgentConfDir), + rewrite_target_params_conf(AgentConfDir, "authSHA512", authNoPriv), + snmp_target_mib:reconfigure(AgentConfDir), MA = whereis(snmp_master_agent), snmp_user_based_sm_mib:usmUserTable(print), - ?line load_master("Test2"), - ?line load_master("TestTrap"), - ?line load_master("TestTrapv2"), + load_master("Test2"), + load_master("TestTrap"), + load_master("TestTrapv2"), try_test(v3_sync, [[{v2_proc, []}, {ma_v2_trap1, [MA]}, {v3_inform_sync, [MA]}]], [{sec_level, authNoPriv}, {user, "authSHA512"}]), - ?line unload_master("TestTrapv2"), - ?line unload_master("TestTrap"), - ?line unload_master("Test2"), - ?line reset_target_params_conf(AgentConfDir). + unload_master("TestTrapv2"), + unload_master("TestTrap"), + unload_master("Test2"), + reset_target_params_conf(AgentConfDir). v3_des_priv(Config) when is_list(Config) -> ?P(v3_des_priv), @@ -3698,26 +3698,26 @@ v3_des_priv(Config) when is_list(Config) -> ?NPRINT("Testing DES encryption...takes a few seconds..."), AgentConfDir = ?config(agent_conf_dir, Config), - ?line rewrite_target_params_conf(AgentConfDir, "privDES", authPriv), - ?line snmp_target_mib:reconfigure(AgentConfDir), + rewrite_target_params_conf(AgentConfDir, "privDES", authPriv), + snmp_target_mib:reconfigure(AgentConfDir), MA = whereis(snmp_master_agent), snmp_user_based_sm_mib:usmUserTable(print), - ?line load_master("Test2"), - ?line load_master("TestTrap"), - ?line load_master("TestTrapv2"), + load_master("Test2"), + load_master("TestTrap"), + load_master("TestTrapv2"), try_test(v3_sync, [[{v2_proc, []}, {ma_v2_trap1, [MA]}, {v3_inform_sync, [MA]}]], [{sec_level, authPriv}, {user, "privDES"}]), - ?line unload_master("TestTrapv2"), - ?line unload_master("TestTrap"), - ?line unload_master("Test2"), - ?line reset_target_params_conf(AgentConfDir). + unload_master("TestTrapv2"), + unload_master("TestTrap"), + unload_master("Test2"), + reset_target_params_conf(AgentConfDir). %% -define(usmStatsNotInTimeWindows_instance, [1,3,6,1,6,3,15,1,1,2,0]). @@ -3732,13 +3732,13 @@ v3_sync(Funcs) -> v3_inform_sync(MA) -> ?DBG("v3_sync -> entry with MA: ~p => Send notification",[MA]), - ?line snmpa:send_notification(MA, testTrapv22, no_receiver, + snmpa:send_notification(MA, testTrapv22, no_receiver, "standard inform", []), %% Make sure agent is in sync with mgr... ?DBG("v3_sync -> wait some time: ",[]), ?SLEEP(20000), % more than 1500*10 in target_addr.conf ?DBG("v3_sync -> await response",[]), - ?line ?expect2({inform, true}, + ?expect2({inform, true}, [{[sysUpTime, 0], any}, {[snmpTrapOID, 0], ?system ++ [0,1]}]). @@ -3753,13 +3753,13 @@ v2_caps_3(X) -> ?P(v2_caps_3), v2_caps(X). v2_caps_i(Node) -> - ?line Idx = rpc:call(Node, snmpa, add_agent_caps, [[1,2,3,4,5], "test cap"]), + Idx = rpc:call(Node, snmpa, add_agent_caps, [[1,2,3,4,5], "test cap"]), g([[sysORID, Idx], [sysORDescr, Idx]]), - ?line ?expect1([{[sysORID, Idx], [1,2,3,4,5]}, + ?expect1([{[sysORID, Idx], [1,2,3,4,5]}, {[sysORDescr, Idx], "test cap"}]), - ?line rpc:call(Node, snmpa, del_agent_caps, [Idx]), + rpc:call(Node, snmpa, del_agent_caps, [Idx]), g([[sysORID, Idx]]), - ?line ?expect1([{[sysORID, Idx], noSuchInstance}]). + ?expect1([{[sysORID, Idx], noSuchInstance}]). %% Req. Test2 @@ -3775,85 +3775,85 @@ v1_proc() -> v1_get_p() -> %% 4.1.2:1 g([[test2]]), - ?line ?expect3(noSuchName, 1, [{[test2], 'NULL'}]), + ?expect3(noSuchName, 1, [{[test2], 'NULL'}]), g([[tDescr]]), - ?line ?expect3(noSuchName, 1, [{[tDescr], 'NULL'}]), + ?expect3(noSuchName, 1, [{[tDescr], 'NULL'}]), g([[tDescr2,0]]), - ?line ?expect3(noSuchName, 1, [{[tDescr2,0], 'NULL'}]), + ?expect3(noSuchName, 1, [{[tDescr2,0], 'NULL'}]), g([[tDescr3,0]]), - ?line ?expect3(noSuchName, 1, [{[tDescr3,0], 'NULL'}]), + ?expect3(noSuchName, 1, [{[tDescr3,0], 'NULL'}]), g([[tDescr4,0]]), - ?line ?expect3(noSuchName, 1, [{[tDescr4,0], 'NULL'}]), + ?expect3(noSuchName, 1, [{[tDescr4,0], 'NULL'}]), g([[sysDescr, 0], [tDescr,0]]), % Outside mibview - ?line ?expect3(noSuchName, 2, [{[sysDescr, 0], 'NULL'}, + ?expect3(noSuchName, 2, [{[sysDescr, 0], 'NULL'}, {[tDescr,0], 'NULL'}]), g([[sysDescr,3]]), - ?line ?expect3(noSuchName, 1, [{[sysDescr, 3], 'NULL'}]), + ?expect3(noSuchName, 1, [{[sysDescr, 3], 'NULL'}]), %% 4.1.2:2 g([[tTable]]), - ?line ?expect3(noSuchName, 1, [{[tTable], 'NULL'}]), + ?expect3(noSuchName, 1, [{[tTable], 'NULL'}]), g([[tEntry]]), - ?line ?expect3(noSuchName, 1, [{[tEntry], 'NULL'}]), + ?expect3(noSuchName, 1, [{[tEntry], 'NULL'}]), %% 4.1.2:3 g([[tTooBig, 0]]), - ?line ?expect3(tooBig, 0, [{[tTooBig, 0], 'NULL'}]), + ?expect3(tooBig, 0, [{[tTooBig, 0], 'NULL'}]), %% 4.1.2:4 g([[tGenErr1, 0]]), - ?line ?expect3(genErr, 1, [{[tGenErr1, 0], 'NULL'}]), + ?expect3(genErr, 1, [{[tGenErr1, 0], 'NULL'}]), g([[tGenErr2, 0]]), - ?line ?expect3(genErr, 1, [{[tGenErr2, 0], 'NULL'}]), + ?expect3(genErr, 1, [{[tGenErr2, 0], 'NULL'}]), g([[sysDescr, 0], [tGenErr3, 0]]), - ?line ?expect3(genErr, 2, [{[sysDescr, 0], 'NULL'}, + ?expect3(genErr, 2, [{[sysDescr, 0], 'NULL'}, {[tGenErr3, 0], 'NULL'}]). v1_get_next_p() -> %% 4.1.3:1 gn([[1,3,7,1]]), - ?line ?expect3(noSuchName, 1, [{[1,3,7,1], 'NULL'}]), + ?expect3(noSuchName, 1, [{[1,3,7,1], 'NULL'}]), gn([[tDescr2]]), - ?line ?expect3(tooBig, 0, any), + ?expect3(tooBig, 0, any), %% 4.1.3:2 gn([[tTooBig]]), io:format("We currently don't handle tooBig correct!!!\n"), - ?line ?expect3(tooBig, 0, any), + ?expect3(tooBig, 0, any), %% 4.1.3:3 gn([[tGenErr1]]), - ?line ?expect3(genErr, 1, any), + ?expect3(genErr, 1, any), gn([[tGenErr2]]), - ?line ?expect3(genErr, 1, any), + ?expect3(genErr, 1, any), gn([[sysDescr], [tGenErr3]]), - ?line ?expect3(genErr, 2, any). + ?expect3(genErr, 2, any). v1_set_p() -> %% 4.1.5:1 s([{[1,3,7,0], i, 4}]), - ?line ?expect3(noSuchName, 1, [{[1,3,7,0], 4}]), + ?expect3(noSuchName, 1, [{[1,3,7,0], 4}]), s([{[tDescr,0], s, "outside mibview"}]), - ?line ?expect3(noSuchName, 1, [{[tDescr,0], "outside mibview"}]), + ?expect3(noSuchName, 1, [{[tDescr,0], "outside mibview"}]), s([{[tDescr3,0], s, "read-only"}]), - ?line ?expect3(noSuchName, 1, [{[tDescr3,0], "read-only"}]), + ?expect3(noSuchName, 1, [{[tDescr3,0], "read-only"}]), s([{[tDescr3], s, "noSuchObject"}]), - ?line ?expect3(noSuchName, 1, [{[tDescr3], "noSuchObject"}]), + ?expect3(noSuchName, 1, [{[tDescr3], "noSuchObject"}]), s([{[tDescr3,1], s, "noSuchInstance"}]), - ?line ?expect3(noSuchName, 1, [{[tDescr3,1], "noSuchInstance"}]), + ?expect3(noSuchName, 1, [{[tDescr3,1], "noSuchInstance"}]), s([{[tDescr2,0], s, "inconsistentName"}]), - ?line ?expect3(noSuchName, 1, [{[tDescr2,0], "inconsistentName"}]), + ?expect3(noSuchName, 1, [{[tDescr2,0], "inconsistentName"}]), %% 4.1.5:2 s([{[tDescr2, 0], i, 4}]), - ?line ?expect3(badValue, 1, [{[tDescr2, 0], 4}]), + ?expect3(badValue, 1, [{[tDescr2, 0], 4}]), s([{[tDescr2, 0], s, "badValue"}]), - ?line ?expect3(badValue, 1, [{[tDescr2, 0], "badValue"}]), + ?expect3(badValue, 1, [{[tDescr2, 0], "badValue"}]), %% 4.1.5:3 %% The standard is quite incorrect here. The resp pdu was too big. In @@ -3863,14 +3863,14 @@ v1_set_p() -> %% of the std-like original value. s([{[tTooBig, 0], s, ?tooBigStr}]), %% according to std: -% ?line ?expect3(tooBig, 0, [{[tTooBig, 0], ?tooBigStr}]), - ?line ?expect3(tooBig, 0, [{[tTooBig, 0], 'NULL'}]), +% ?expect3(tooBig, 0, [{[tTooBig, 0], ?tooBigStr}]), + ?expect3(tooBig, 0, [{[tTooBig, 0], 'NULL'}]), %% 4.1.5:4 s([{[tDescr2, 0], s, "is_set_ok_fail"}]), - ?line ?expect3(genErr, 1, [{[tDescr2, 0], "is_set_ok_fail"}]), + ?expect3(genErr, 1, [{[tDescr2, 0], "is_set_ok_fail"}]), s([{[tDescr2, 0], s, "commit_fail"}]), - ?line ?expect3(genErr, 1, [{[tDescr2, 0], "commit_fail"}]). + ?expect3(genErr, 1, [{[tDescr2, 0], "commit_fail"}]). %% Req. Test2 v2_proc() -> @@ -3886,94 +3886,94 @@ v2_get_p() -> %% 4.2.1:2 ?DBG("v2_get_p -> entry",[]), g([[test2]]), - ?line ?expect1([{[test2], noSuchObject}]), + ?expect1([{[test2], noSuchObject}]), g([[tDescr]]), - ?line ?expect1([{[tDescr], noSuchObject}]), + ?expect1([{[tDescr], noSuchObject}]), g([[tDescr4,0]]), - ?line ?expect1([{[tDescr4,0], noSuchObject}]), + ?expect1([{[tDescr4,0], noSuchObject}]), g([[sysDescr, 0], [tDescr,0]]), % Outside mibview - ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"}, + ?expect1([{[sysDescr,0], "Erlang SNMP agent"}, {[tDescr,0], noSuchObject}]), g([[tTable]]), - ?line ?expect1([{[tTable], noSuchObject}]), + ?expect1([{[tTable], noSuchObject}]), g([[tEntry]]), - ?line ?expect1([{[tEntry], noSuchObject}]), + ?expect1([{[tEntry], noSuchObject}]), %% 4.2.1:3 g([[tDescr2,0]]), %% instrum ret noSuchName!!! - ?line ?expect1([{[tDescr2,0], noSuchInstance}]), + ?expect1([{[tDescr2,0], noSuchInstance}]), g([[tDescr3,0]]), - ?line ?expect1([{[tDescr3,0], noSuchInstance}]), + ?expect1([{[tDescr3,0], noSuchInstance}]), g([[sysDescr,3]]), - ?line ?expect1([{[sysDescr, 3], noSuchInstance}]), + ?expect1([{[sysDescr, 3], noSuchInstance}]), g([[tIndex,1]]), - ?line ?expect1([{[tIndex, 1], noSuchInstance}]), + ?expect1([{[tIndex, 1], noSuchInstance}]), %% 4.2.1 - any other error: genErr g([[tGenErr1, 0]]), - ?line ?expect3(genErr, 1, [{[tGenErr1, 0], 'NULL'}]), + ?expect3(genErr, 1, [{[tGenErr1, 0], 'NULL'}]), g([[tGenErr2, 0]]), - ?line ?expect3(genErr, 1, [{[tGenErr2, 0], 'NULL'}]), + ?expect3(genErr, 1, [{[tGenErr2, 0], 'NULL'}]), g([[sysDescr, 0], [tGenErr3, 0]]), - ?line ?expect3(genErr, 2, [{[sysDescr, 0], 'NULL'}, + ?expect3(genErr, 2, [{[sysDescr, 0], 'NULL'}, {[tGenErr3, 0], 'NULL'}]), %% 4.2.1 - tooBig g([[tTooBig, 0]]), - ?line ?expect3(tooBig, 0, []). + ?expect3(tooBig, 0, []). v2_get_next_p() -> %% 4.2.2:2 ?DBG("v2_get_next_p -> entry",[]), gn([[1,3,7,1]]), - ?line ?expect1([{[1,3,7,1], endOfMibView}]), + ?expect1([{[1,3,7,1], endOfMibView}]), gn([[sysDescr], [1,3,7,1]]), - ?line ?expect1([{[sysDescr, 0], "Erlang SNMP agent"}, + ?expect1([{[sysDescr, 0], "Erlang SNMP agent"}, {[1,3,7,1], endOfMibView}]), gn([[tCnt2, 1]]), - ?line ?expect1([{[tCnt2,2], 100}]), + ?expect1([{[tCnt2,2], 100}]), gn([[tCnt2, 2]]), - ?line ?expect1([{[tCnt2,2], endOfMibView}]), + ?expect1([{[tCnt2,2], endOfMibView}]), %% 4.2.2 - any other error: genErr gn([[tGenErr1]]), - ?line ?expect3(genErr, 1, [{[tGenErr1], 'NULL'}]), + ?expect3(genErr, 1, [{[tGenErr1], 'NULL'}]), gn([[tGenErr2]]), - ?line ?expect3(genErr, 1, [{[tGenErr2], 'NULL'}]), + ?expect3(genErr, 1, [{[tGenErr2], 'NULL'}]), gn([[sysDescr], [tGenErr3]]), - ?line ?expect3(genErr, 2, [{[sysDescr], 'NULL'}, + ?expect3(genErr, 2, [{[sysDescr], 'NULL'}, {[tGenErr3], 'NULL'}]), %% 4.2.2 - tooBig gn([[tTooBig]]), - ?line ?expect3(tooBig, 0, []). + ?expect3(tooBig, 0, []). v2_get_bulk_p() -> %% 4.2.3 ?DBG("v2_get_bulk_p -> entry",[]), gb(1, 1, []), - ?line ?expect1([]), + ?expect1([]), gb(-1, 1, []), - ?line ?expect1([]), + ?expect1([]), gb(-1, -1, []), - ?line ?expect1([]), + ?expect1([]), gb(-1, -1, []), - ?line ?expect1([]), + ?expect1([]), gb(2, 0, [[sysDescr], [1,3,7,1]]), - ?line ?expect1([{[sysDescr, 0], "Erlang SNMP agent"}, + ?expect1([{[sysDescr, 0], "Erlang SNMP agent"}, {[1,3,7,1], endOfMibView}]), gb(1, 2, [[sysDescr], [1,3,7,1]]), - ?line ?expect1([{[sysDescr, 0], "Erlang SNMP agent"}, + ?expect1([{[sysDescr, 0], "Erlang SNMP agent"}, {[1,3,7,1], endOfMibView}]), gb(0, 2, [[sysDescr], [1,3,7,1]]), - ?line ?expect1([{[sysDescr, 0], "Erlang SNMP agent"}, + ?expect1([{[sysDescr, 0], "Erlang SNMP agent"}, {[1,3,7,1], endOfMibView}, {[sysObjectID, 0], [1,2,3]}, {[1,3,7,1], endOfMibView}]), gb(2, 2, [[sysDescr], [1,3,7,1], [sysDescr], [1,3,7,1]]), - ?line ?expect1([{[sysDescr, 0], "Erlang SNMP agent"}, + ?expect1([{[sysDescr, 0], "Erlang SNMP agent"}, {[1,3,7,1], endOfMibView}, {[sysDescr, 0], "Erlang SNMP agent"}, {[1,3,7,1], endOfMibView}, @@ -3981,19 +3981,19 @@ v2_get_bulk_p() -> {[1,3,7,1], endOfMibView}]), gb(1, 2, [[sysDescr], [sysDescr], [tTooBig]]), - ?line ?expect1([{[sysDescr, 0], "Erlang SNMP agent"}, + ?expect1([{[sysDescr, 0], "Erlang SNMP agent"}, {[sysDescr, 0], "Erlang SNMP agent"}]), gb(1,12, [[tDescr2], [sysDescr]]), % next one after tDescr2 is tTooBig. - ?line ?expect1([]), + ?expect1([]), gb(2,2, [[sysDescr], [sysObjectID], [tGenErr1], [sysDescr]]), - ?line ?expect3(genErr, 3, [{[sysDescr], 'NULL'}, + ?expect3(genErr, 3, [{[sysDescr], 'NULL'}, {[sysObjectID], 'NULL'}, {[tGenErr1], 'NULL'}, {[sysDescr], 'NULL'}]), gb(0, 2, [[tCnt2, 1]]), - ?line ?expect1([{[tCnt2,2], 100}, + ?expect1([{[tCnt2,2], 100}, {[tCnt2,2], endOfMibView}]). @@ -4001,68 +4001,68 @@ v2_set_p() -> %% 4.2.5:1 ?DBG("v2_set_p -> entry",[]), s([{[1,3,7,0], i, 4}]), - ?line ?expect3(noAccess, 1, [{[1,3,7,0], 4}]), + ?expect3(noAccess, 1, [{[1,3,7,0], 4}]), s([{[tDescr,0], s, "outside mibview"}]), - ?line ?expect3(noAccess, 1, [{[tDescr,0], "outside mibview"}]), + ?expect3(noAccess, 1, [{[tDescr,0], "outside mibview"}]), %% 4.2.5:2 s([{[1,3,6,1,0], s, "noSuchObject"}]), - ?line ?expect3(notWritable, 1, [{[1,3,6,1,0], "noSuchObject"}]), + ?expect3(notWritable, 1, [{[1,3,6,1,0], "noSuchObject"}]), %% 4.2.5:3 s([{[tDescr2, 0], i, 4}]), - ?line ?expect3(wrongType, 1, [{[tDescr2, 0], 4}]), + ?expect3(wrongType, 1, [{[tDescr2, 0], 4}]), s([{[tDescr2, 0], s, "badValue"}]), - ?line ?expect3(badValue, 1, [{[tDescr2, 0], "badValue"}]), + ?expect3(badValue, 1, [{[tDescr2, 0], "badValue"}]), %% 4.2.5:4 s([{[tStr, 0], s, ""}]), - ?line ?expect3(wrongLength, 1, [{[tStr, 0], ""}]), + ?expect3(wrongLength, 1, [{[tStr, 0], ""}]), s([{[tStr, 0], s, "12345"}]), - ?line ?expect3(wrongLength, 1, [{[tStr, 0], "12345"}]), + ?expect3(wrongLength, 1, [{[tStr, 0], "12345"}]), %% 4.2.5:5 - N/A %% 4.2.5:6 s([{[tInt1, 0], i, 0}]), - ?line ?expect3(wrongValue, 1, [{[tInt1, 0], 0}]), + ?expect3(wrongValue, 1, [{[tInt1, 0], 0}]), s([{[tInt1, 0], i, 5}]), - ?line ?expect3(wrongValue, 1, [{[tInt1, 0], 5}]), + ?expect3(wrongValue, 1, [{[tInt1, 0], 5}]), s([{[tInt2, 0], i, 0}]), - ?line ?expect3(wrongValue, 1, [{[tInt2, 0], 0}]), + ?expect3(wrongValue, 1, [{[tInt2, 0], 0}]), s([{[tInt2, 0], i, 5}]), - ?line ?expect3(wrongValue, 1, [{[tInt2, 0], 5}]), + ?expect3(wrongValue, 1, [{[tInt2, 0], 5}]), s([{[tInt3, 0], i, 5}]), - ?line ?expect3(wrongValue, 1, [{[tInt3, 0], 5}]), + ?expect3(wrongValue, 1, [{[tInt3, 0], 5}]), %% 4.2.5:7 s([{[tDescrX, 1, 1], s, "noCreation"}]), - ?line ?expect3(noCreation, 1, [{[tDescrX, 1, 1], "noCreation"}]), + ?expect3(noCreation, 1, [{[tDescrX, 1, 1], "noCreation"}]), %% 4.2.5:8 s([{[tDescrX, 1, 2], s, "inconsistentName"}]), - ?line ?expect3(inconsistentName, 1, + ?expect3(inconsistentName, 1, [{[tDescrX, 1, 2], "inconsistentName"}]), %% 4.2.5:9 s([{[tCnt, 1, 2], i, 5}]), - ?line ?expect3(notWritable, 1, [{[tCnt, 1, 2], 5}]), + ?expect3(notWritable, 1, [{[tCnt, 1, 2], 5}]), s([{[tDescr3,0], s, "read-only"}]), - ?line ?expect3(notWritable, 1, [{[tDescr3,0], "read-only"}]), + ?expect3(notWritable, 1, [{[tDescr3,0], "read-only"}]), %% 4.2.5:10 s([{[tDescr2,0], s, "inconsistentValue"}]), - ?line ?expect3(inconsistentValue, 1, + ?expect3(inconsistentValue, 1, [{[tDescr2,0], "inconsistentValue"}]), %% 4.2.5:11 s([{[tDescr2,0], s, "resourceUnavailable"}]), - ?line ?expect3(resourceUnavailable, 1, + ?expect3(resourceUnavailable, 1, [{[tDescr2,0],"resourceUnavailable"}]), %% 4.2.5:12 s([{[tDescr2, 0], s, "is_set_ok_fail"}]), - ?line ?expect3(genErr, 1, [{[tDescr2, 0], "is_set_ok_fail"}]). + ?expect3(genErr, 1, [{[tDescr2, 0], "is_set_ok_fail"}]). %% commitFailed and undoFailed is tested by the 'undo' case. @@ -4076,26 +4076,26 @@ table_test() -> Key1c4 = [intCommunityAccess,get(mip),is("public")], EndKey = [intCommunityEntry,[9],get(mip),is("public")], gn([[intCommunityEntry]]), - ?line ?expect1([{Key1c3, 2}]), + ?expect1([{Key1c3, 2}]), gn([[intCommunityTable]]), - ?line ?expect1([{Key1c3, 2}]), + ?expect1([{Key1c3, 2}]), gn([[community]]), - ?line ?expect1([{Key1c3, 2}]), + ?expect1([{Key1c3, 2}]), gn([[otpSnmpeaMIB]]), - ?line ?expect1([{Key1c3, 2}]), + ?expect1([{Key1c3, 2}]), gn([[ericsson]]), - ?line ?expect1([{Key1c3, 2}]), + ?expect1([{Key1c3, 2}]), gn([Key1c3]), - ?line ?expect1([{Key2c3, 2}]), + ?expect1([{Key2c3, 2}]), gn([Key2c3]), - ?line ?expect1([{Key1c4, 2}]), + ?expect1([{Key1c4, 2}]), gn([EndKey]), AgentIp = [intAgentIpAddress,0], - ?line ?expect1([{AgentIp, any}]), + ?expect1([{AgentIp, any}]), g([Key1c3]), - ?line ?expect1([{Key1c3, 2}]), + ?expect1([{Key1c3, 2}]), g([EndKey]), - ?line ?v1_2(?expect3(noSuchName, 1, any), + ?v1_2(?expect3(noSuchName, 1, any), ?expect1([{EndKey, noSuchObject}])), io:format("Testing row creation/deletion on communityTable...~n"), @@ -4103,33 +4103,33 @@ table_test() -> NewKeyc4 = [intCommunityAccess,get(mip),is("test")], NewKeyc5 = [intCommunityStatus,get(mip),is("test")], s([{NewKeyc5, ?createAndGo}]), - ?line ?expect3(?v1_2(badValue, inconsistentValue), 1, any), + ?expect3(?v1_2(badValue, inconsistentValue), 1, any), s([{NewKeyc5, ?createAndGo}, {NewKeyc3, 2}, {NewKeyc4, 2}]), - ?line ?expect1([{NewKeyc5, ?createAndGo},{NewKeyc3, 2}, {NewKeyc4, 2}]), + ?expect1([{NewKeyc5, ?createAndGo},{NewKeyc3, 2}, {NewKeyc4, 2}]), g([NewKeyc4]), - ?line ?expect1([{NewKeyc4, 2}]), + ?expect1([{NewKeyc4, 2}]), s([{NewKeyc5, ?destroy}]), - ?line ?expect1([{NewKeyc5, ?destroy}]), + ?expect1([{NewKeyc5, ?destroy}]), s([{NewKeyc4, 2}]), - ?line ?expect3(?v1_2(noSuchName, inconsistentName), 1, [{NewKeyc4, 2}]), + ?expect3(?v1_2(noSuchName, inconsistentName), 1, [{NewKeyc4, 2}]), s([{NewKeyc5, ?createAndWait}]), - ?line ?expect1([{NewKeyc5, ?createAndWait}]), + ?expect1([{NewKeyc5, ?createAndWait}]), g([NewKeyc5]), - ?line ?expect1([{NewKeyc5, ?notReady}]), + ?expect1([{NewKeyc5, ?notReady}]), s([{NewKeyc4, 2}]), - ?line ?expect1([{NewKeyc4, 2}]), + ?expect1([{NewKeyc4, 2}]), g([NewKeyc5]), - ?line ?expect1([{NewKeyc5, ?notReady}]), + ?expect1([{NewKeyc5, ?notReady}]), s([{NewKeyc3, 2}]), - ?line ?expect1([{NewKeyc3, 2}]), + ?expect1([{NewKeyc3, 2}]), g([NewKeyc5]), - ?line ?expect1([{NewKeyc5, ?notInService}]), + ?expect1([{NewKeyc5, ?notInService}]), s([{NewKeyc5, ?active}]), - ?line ?expect1([{NewKeyc5, ?active}]), + ?expect1([{NewKeyc5, ?active}]), s([{NewKeyc5, ?destroy}]), - ?line ?expect1([{NewKeyc5, ?destroy}]), + ?expect1([{NewKeyc5, ?destroy}]), s([{NewKeyc3, 3}]), - ?line ?expect3(?v1_2(noSuchName, inconsistentName), 1, [{NewKeyc3, 3}]), + ?expect3(?v1_2(noSuchName, inconsistentName), 1, [{NewKeyc3, 3}]), otp_1128_test(), ok. @@ -4137,41 +4137,41 @@ table_test() -> simple_standard_test() -> ?DBG("simple_standard_test -> entry",[]), gn([[1,1]]), - ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]), + ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]), gn([[1,3]]), - ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]), + ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]), gn([[1,3,6]]), - ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]), + ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]), gn([[1,3,6,1]]), - ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]), + ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]), gn([[1,3,6,1,2]]), - ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]), + ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]), gn([[1,3,6,1,2,1]]), - ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]), + ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]), gn([[1,3,6,1,2,1,1]]), - ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]), + ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]), gn([[sysDescr]]), - ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]), + ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]), g([[sysDescr,0]]), - ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]), + ?expect1([{[sysDescr,0], "Erlang SNMP agent"}]), g([[sysDescr]]), - ?line ?v1_2(?expect3(noSuchName, 1, any), + ?v1_2(?expect3(noSuchName, 1, any), ?expect1([{[sysDescr], noSuchObject}])), g([[1,6,7,0]]), - ?line ?v1_2(?expect3(noSuchName, 1, any), + ?v1_2(?expect3(noSuchName, 1, any), ?expect1([{[1,6,7,0], noSuchObject}])), gn([[1,13]]), - ?line ?v1_2(?expect3(noSuchName,1, any), + ?v1_2(?expect3(noSuchName,1, any), ?expect1([{[1,13], endOfMibView}])), s([{[sysLocation, 0], "new_value"}]), - ?line ?expect1([{[sysLocation, 0], "new_value"}]), + ?expect1([{[sysLocation, 0], "new_value"}]), g([[sysLocation, 0]]), - ?line ?expect1([{[sysLocation, 0], "new_value"}]), + ?expect1([{[sysLocation, 0], "new_value"}]), io:format("Testing noSuchName and badValue...~n"), s([{[sysServices,0], 3}]), - ?line ?expect3(?v1_2(noSuchName, notWritable), 1, any), + ?expect3(?v1_2(noSuchName, notWritable), 1, any), s([{[sysLocation, 0], i, 3}]), - ?line ?expect3(?v1_2(badValue, wrongType), 1, any), + ?expect3(?v1_2(badValue, wrongType), 1, any), ?DBG("simple_standard_test -> done",[]), ok. @@ -4224,11 +4224,11 @@ db_notify_client(Config) when is_list(Config) -> db_notify_client_test() -> ?DBG("set first new sysLocation",[]), s([{[sysLocation, 0], "new_value"}]), - ?line ?expect1([{[sysLocation, 0], "new_value"}]), + ?expect1([{[sysLocation, 0], "new_value"}]), ?DBG("set second new sysLocation",[]), s([{[sysLocation, 0], "new_value"}]), - ?line ?expect1([{[sysLocation, 0], "new_value"}]). + ?expect1([{[sysLocation, 0], "new_value"}]). %% Callback function notify(Pid, What) -> @@ -4244,23 +4244,23 @@ big_test() -> ?DBG("big_test -> testing simple next/get/set @ subagent...",[]), gn([[klas1]]), - ?line ?expect1([{[fname,0], ""}]), + ?expect1([{[fname,0], ""}]), g([[fname,0]]), - ?line ?expect1([{[fname,0], ""}]), + ?expect1([{[fname,0], ""}]), s([{[fname,0], s, "test set"}]), - ?line ?expect1([{[fname,0], "test set"}]), + ?expect1([{[fname,0], "test set"}]), g([[fname,0]]), - ?line ?expect1([{[fname,0], "test set"}]), + ?expect1([{[fname,0], "test set"}]), ?DBG("big_test -> " "testing next from last instance in master to subagent...",[]), gn([[?v1_2(sysServices, sysORLastChange),0]]), - ?line ?expect1([{[fname,0], "test set"}]), + ?expect1([{[fname,0], "test set"}]), gn([[1,1], [?v1_2(sysServices, sysORLastChange),0]]), - ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"}, + ?expect1([{[sysDescr,0], "Erlang SNMP agent"}, {[fname,0], "test set"}]), s([{[fname,0], s, ""}]), - ?line ?expect1([{[fname,0], ""}]), + ?expect1([{[fname,0], ""}]), table_test(), @@ -4268,14 +4268,14 @@ big_test() -> _FTab = [friendsEntry], s([{[friendsEntry, [2, 3]], s, "kompis3"}, {[friendsEntry, [3, 3]], i, ?createAndGo}]), - ?line ?expect1([{[friendsEntry, [2, 3]], "kompis3"}, + ?expect1([{[friendsEntry, [2, 3]], "kompis3"}, {[friendsEntry, [3, 3]], ?createAndGo}]), g([[friendsEntry, [2, 3]], [friendsEntry, [3, 3]]]), - ?line ?expect1([{[friendsEntry, [2, 3]], "kompis3"}, + ?expect1([{[friendsEntry, [2, 3]], "kompis3"}, {[friendsEntry, [3, 3]], ?active}]), s([{[friendsEntry, [3, 3]], i, ?destroy}]), - ?line ?expect1([{[friendsEntry, [3, 3]], ?destroy}]), + ?expect1([{[friendsEntry, [3, 3]], ?destroy}]), otp_1131_test(), @@ -4283,28 +4283,28 @@ big_test() -> []), s([{[kompissEntry, [1, 3]], s, "kompis3"}, {[kompissEntry, [2, 3]], i, ?createAndGo}]), - ?line ?expect1([{[kompissEntry, [1, 3]], "kompis3"}, + ?expect1([{[kompissEntry, [1, 3]], "kompis3"}, {[kompissEntry, [2, 3]], ?createAndGo}]), g([[kompissEntry, [1, 3]], [kompissEntry, [2, 3]]]), - ?line ?expect1([{[kompissEntry, [1, 3]], "kompis3"}, + ?expect1([{[kompissEntry, [1, 3]], "kompis3"}, {[kompissEntry, [2, 3]], ?active}]), gn([[kompissEntry, [1]], [kompissEntry, [2]]]), - ?line ?expect1([{[kompissEntry, [1, 3]], "kompis3"}, + ?expect1([{[kompissEntry, [1, 3]], "kompis3"}, {[kompissEntry, [2, 3]], ?active}]), s([{[kompissEntry, [1, 2]], s, "kompis3"}, {[kompissEntry, [2, 2]], i, ?createAndGo}]), - ?line ?expect1([{[kompissEntry, [1, 2]], "kompis3"}, + ?expect1([{[kompissEntry, [1, 2]], "kompis3"}, {[kompissEntry, [2, 2]], ?createAndGo}]), gn([[kompissEntry, [1, 1]], [kompissEntry, [2, 1]]]), - ?line ?expect1([{[kompissEntry, [1, 2]], "kompis3"}, + ?expect1([{[kompissEntry, [1, 2]], "kompis3"}, {[kompissEntry, [2, 2]], ?active}]), s([{[kompissEntry, [2, 3]], i, ?destroy}]), - ?line ?expect1([{[kompissEntry, [2, 3]], ?destroy}]), + ?expect1([{[kompissEntry, [2, 3]], ?destroy}]), s([{[kompissEntry, [2, 2]], i, ?destroy}]), - ?line ?expect1([{[kompissEntry, [2, 2]], ?destroy}]), + ?expect1([{[kompissEntry, [2, 2]], ?destroy}]), ?DBG("big_test -> done",[]), ok. @@ -4315,21 +4315,21 @@ big_test_2() -> ?NPRINT("Testing simple next/get/set @ subagent (2)..."), gn([[klas2]]), - ?line ?expect1([{[fname2,0], ""}]), + ?expect1([{[fname2,0], ""}]), g([[fname2,0]]), - ?line ?expect1([{[fname2,0], ""}]), + ?expect1([{[fname2,0], ""}]), s([{[fname2,0], s, "test set"}]), - ?line ?expect1([{[fname2,0], "test set"}]), + ?expect1([{[fname2,0], "test set"}]), g([[fname2,0]]), - ?line ?expect1([{[fname2,0], "test set"}]), + ?expect1([{[fname2,0], "test set"}]), otp_1298_test(), ?NPRINT("Testing next from last object in master to subagent (2)..."), gn([[?v1_2(sysServices, sysORLastChange),0]]), - ?line ?expect1([{[fname2,0], "test set"}]), + ?expect1([{[fname2,0], "test set"}]), gn([[1,1], [?v1_2(sysServices, sysORLastChange),0]]), - ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"}, + ?expect1([{[sysDescr,0], "Erlang SNMP agent"}, {[fname2,0], "test set"}]), table_test(), @@ -4338,40 +4338,40 @@ big_test_2() -> _FTab = [friendsEntry2], s([{[friendsEntry2, [2, 3]], s, "kompis3"}, {[friendsEntry2, [3, 3]], i, ?createAndGo}]), - ?line ?expect1([{[friendsEntry2, [2, 3]], "kompis3"}, + ?expect1([{[friendsEntry2, [2, 3]], "kompis3"}, {[friendsEntry2, [3, 3]], ?createAndGo}]), g([[friendsEntry2, [2, 3]], [friendsEntry2, [3, 3]]]), - ?line ?expect1([{[friendsEntry2, [2, 3]], "kompis3"}, + ?expect1([{[friendsEntry2, [2, 3]], "kompis3"}, {[friendsEntry2, [3, 3]], ?active}]), s([{[friendsEntry2, [3, 3]], i, ?destroy}]), - ?line ?expect1([{[friendsEntry2, [3, 3]], ?destroy}]), + ?expect1([{[friendsEntry2, [3, 3]], ?destroy}]), ?NPRINT("Adding two rows in subagent table with special INDEX (2)"), s([{[kompissEntry2, [1, 3]], s, "kompis3"}, {[kompissEntry2, [2, 3]], i, ?createAndGo}]), - ?line ?expect1([{[kompissEntry2, [1, 3]], "kompis3"}, + ?expect1([{[kompissEntry2, [1, 3]], "kompis3"}, {[kompissEntry2, [2, 3]], ?createAndGo}]), g([[kompissEntry2, [1, 3]], [kompissEntry2, [2, 3]]]), - ?line ?expect1([{[kompissEntry2, [1, 3]], "kompis3"}, + ?expect1([{[kompissEntry2, [1, 3]], "kompis3"}, {[kompissEntry2, [2, 3]], ?active}]), gn([[kompissEntry2, [1]], [kompissEntry2, [2]]]), - ?line ?expect1([{[kompissEntry2, [1, 3]], "kompis3"}, + ?expect1([{[kompissEntry2, [1, 3]], "kompis3"}, {[kompissEntry2, [2, 3]], ?active}]), s([{[kompissEntry2, [1, 2]], s, "kompis3"}, {[kompissEntry2, [2, 2]], i, ?createAndGo}]), - ?line ?expect1([{[kompissEntry2, [1, 2]], "kompis3"}, + ?expect1([{[kompissEntry2, [1, 2]], "kompis3"}, {[kompissEntry2, [2, 2]], ?createAndGo}]), gn([[kompissEntry2, [1, 1]], [kompissEntry2, [2, 1]]]), - ?line ?expect1([{[kompissEntry2, [1, 2]], "kompis3"}, + ?expect1([{[kompissEntry2, [1, 2]], "kompis3"}, {[kompissEntry2, [2, 2]], ?active}]), s([{[kompissEntry2, [2, 3]], i, ?destroy}]), - ?line ?expect1([{[kompissEntry2, [2, 3]], ?destroy}]), + ?expect1([{[kompissEntry2, [2, 3]], ?destroy}]), s([{[kompissEntry2, [2, 2]], i, ?destroy}]), - ?line ?expect1([{[kompissEntry2, [2, 2]], ?destroy}]), + ?expect1([{[kompissEntry2, [2, 2]], ?destroy}]), ok. %% Req. Test1 @@ -4380,26 +4380,26 @@ multi_threaded_test() -> g([[multiStr,0]]), Pid = get_multi_pid(), g([[sysUpTime,0]]), - ?line ?expect1([{[sysUpTime,0], any}]), + ?expect1([{[sysUpTime,0], any}]), s([{[sysLocation, 0], s, "pelle"}]), - ?line ?expect1([{[sysLocation, 0], "pelle"}]), + ?expect1([{[sysLocation, 0], "pelle"}]), Pid ! continue, - ?line ?expect1([{[multiStr,0], "ok"}]), + ?expect1([{[multiStr,0], "ok"}]), s([{[multiStr, 0], s, "block"}]), Pid2 = get_multi_pid(), g([[sysUpTime,0]]), - ?line ?expect1([{[sysUpTime,0], any}]), + ?expect1([{[sysUpTime,0], any}]), g([[multiStr,0]]), Pid3 = get_multi_pid(), g([[sysUpTime,0]]), - ?line ?expect1([{[sysUpTime,0], any}]), + ?expect1([{[sysUpTime,0], any}]), s([{[sysLocation, 0], s, "kalle"}]), Pid3 ! continue, - ?line ?expect1([{[multiStr,0], "ok"}]), + ?expect1([{[multiStr,0], "ok"}]), Pid2 ! continue, - ?line ?expect1([{[multiStr,0], "block"}]), - ?line ?expect1([{[sysLocation,0], "kalle"}]). + ?expect1([{[multiStr,0], "block"}]), + ?expect1([{[sysLocation,0], "kalle"}]). %% Req. Test1, TestTrapv2 mt_trap_test(MA, MT) -> @@ -4407,7 +4407,7 @@ mt_trap_test(MA, MT) -> ?IPRINT("mt_trap_test(01) -> issue testTrapv22 (standard trap)", []), snmpa:send_trap(MA, testTrapv22, "standard trap"), ?IPRINT("mt_trap_test(02) -> await v2trap", []), - ?line ?expect2(v2trap, [{[sysUpTime, 0], any}, + ?expect2(v2trap, [{[sysUpTime, 0], any}, {[snmpTrapOID, 0], ?system ++ [0,1]}]), %% multi-threaded = true @@ -4421,7 +4421,7 @@ mt_trap_test(MA, MT) -> g([[sysUpTime,0]]), ?IPRINT("mt_trap_test(06) -> await sysUpTime", []), - ?line ?expect1([{[sysUpTime,0], any}]), + ?expect1([{[sysUpTime,0], any}]), %% This will *only* work if multi-threaded is 'true', not 'extended' %% since in the latter case all notifications are serialized through @@ -4432,7 +4432,7 @@ mt_trap_test(MA, MT) -> ?IPRINT("mt_trap_test(07) -> issue testTrapv22 (standard trap)", []), snmpa:send_trap(MA, testTrapv22, "standard trap"), ?IPRINT("mt_trap_test(08) -> await v2trap", []), - ?line ?expect2(v2trap, + ?expect2(v2trap, [{[sysUpTime, 0], any}, {[snmpTrapOID, 0], ?system ++ [0,1]}]); true -> @@ -4443,7 +4443,7 @@ mt_trap_test(MA, MT) -> Pid ! continue, ?IPRINT("mt_trap_test(10) -> await v2trap", []), - ?line ?expect2(v2trap, [{[sysUpTime, 0], any}, + ?expect2(v2trap, [{[sysUpTime, 0], any}, {[snmpTrapOID, 0], ?testTrap ++ [2]}, {[multiStr,0], "ok"}]), ?IPRINT("mt_trap_test(11) -> done", []), @@ -4453,7 +4453,7 @@ mt_trap_test(MA, MT) -> get_multi_pid() -> get_multi_pid(10). get_multi_pid(0) -> - ?line ?FAIL(no_global_name); + ?FAIL(no_global_name); get_multi_pid(N) -> ?SLEEP(1000), case global:whereis_name(snmp_multi_tester) of @@ -4466,26 +4466,26 @@ types_v2_test() -> ?NPRINT("Testing v2 types..."), s([{[bits1,0], 2#10}]), - ?line ?expect1([{[bits1,0], ?str(2#10)}]), + ?expect1([{[bits1,0], ?str(2#10)}]), g([[bits1,0]]), - ?line ?expect1([{[bits1,0], ?str(2#101)}]), + ?expect1([{[bits1,0], ?str(2#101)}]), s([{[bits2,0], 2#11000000110}]), - ?line ?expect1([{[bits2,0], ?str(2#11000000110)}]), + ?expect1([{[bits2,0], ?str(2#11000000110)}]), g([[bits2,0]]), - ?line ?expect1([{[bits2,0], ?str(2#11000000110)}]), + ?expect1([{[bits2,0], ?str(2#11000000110)}]), g([[bits3,0]]), - ?line ?expect3(genErr, 1, any), + ?expect3(genErr, 1, any), g([[bits4,0]]), - ?line ?expect3(genErr, 1, any), + ?expect3(genErr, 1, any), s([{[bits1,0], s, [2#10]}]), - ?line ?expect3(?v1_2(badValue, wrongValue), 1, any), + ?expect3(?v1_2(badValue, wrongValue), 1, any), s([{[bits2,0], 2#11001001101010011}]), - ?line ?expect3(?v1_2(badValue, wrongValue), 1, any). + ?expect3(?v1_2(badValue, wrongValue), 1, any). %% Req. Test1 @@ -4501,52 +4501,52 @@ implied_test(MA) -> Idx2 = "qq", ?DBG("implied_test -> (send) create row 1 '~s' in table 1",[Idx1]), s([{[testStatus, Idx1], i, ?createAndGo}, {[testDescr, Idx1],s,"row 1"}]), - ?line ?expect1([{[testStatus, Idx1], ?createAndGo}, + ?expect1([{[testStatus, Idx1], ?createAndGo}, {[testDescr, Idx1], "row 1"}]), ?DBG("implied_test -> (send) create row 2 '~s' in table 1",[Idx2]), s([{[testStatus, Idx2], i, ?createAndGo}, {[testDescr, Idx2],s,"row 2"}]), - ?line ?expect1([{[testStatus, Idx2], ?createAndGo}, + ?expect1([{[testStatus, Idx2], ?createAndGo}, {[testDescr, Idx2], "row 2"}]), ?DBG("implied_test -> get-next(testDescr)",[]), gn([[testDescr]]), - ?line ?expect1([{[testDescr,Idx1], "row 1"}]), + ?expect1([{[testDescr,Idx1], "row 1"}]), ?DBG("implied_test -> get-next(testDescr) of row 1",[]), gn([[testDescr,Idx1]]), - ?line ?expect1([{[testDescr,Idx2], "row 2"}]), + ?expect1([{[testDescr,Idx2], "row 2"}]), % Delete the rows ?DBG("implied_test -> (send) delete row 1 '~s' from table 1",[Idx1]), s([{[testStatus, Idx1], i, ?destroy}]), - ?line ?expect1([{[testStatus, Idx1], ?destroy}]), + ?expect1([{[testStatus, Idx1], ?destroy}]), ?DBG("implied_test -> (send) delete row 2 '~s' from table 1",[Idx2]), s([{[testStatus, Idx2], i, ?destroy}]), - ?line ?expect1([{[testStatus, Idx2], ?destroy}]), + ?expect1([{[testStatus, Idx2], ?destroy}]), %% Try the same in other table Idx3 = [1, "apa"], Idx4 = [1, "qq"], ?DBG("implied_test -> (send) create row 1 '~s' in table 2",[Idx3]), s([{[testStatus2, Idx3], i, ?createAndGo}, {[testDescr2,Idx3],s,"row 1"}]), - ?line ?expect1([{[testStatus2, Idx3], ?createAndGo}, + ?expect1([{[testStatus2, Idx3], ?createAndGo}, {[testDescr2, Idx3], "row 1"}]), ?DBG("implied_test -> (send) create row 2 '~s' in table 2",[Idx4]), s([{[testStatus2, Idx4], i, ?createAndGo}, {[testDescr2,Idx4],s,"row 2"}]), - ?line ?expect1([{[testStatus2, Idx4], ?createAndGo}, + ?expect1([{[testStatus2, Idx4], ?createAndGo}, {[testDescr2, Idx4], "row 2"}]), ?DBG("implied_test -> get-next(testDescr2)",[]), gn([[testDescr2]]), - ?line ?expect1([{[testDescr2,Idx3], "row 1"}]), + ?expect1([{[testDescr2,Idx3], "row 1"}]), ?DBG("implied_test -> get-next(testDescr2) of row 1",[]), gn([[testDescr2,Idx3]]), - ?line ?expect1([{[testDescr2,Idx4], "row 2"}]), + ?expect1([{[testDescr2,Idx4], "row 2"}]), % Delete the rows ?DBG("implied_test -> (send) delete row 1 '~s' from table 2",[Idx3]), s([{[testStatus2, Idx3], i, ?destroy}]), - ?line ?expect1([{[testStatus2, Idx3], ?destroy}]), + ?expect1([{[testStatus2, Idx3], ?destroy}]), ?DBG("implied_test -> (send) delete row 2 '~s' from table 2",[Idx4]), s([{[testStatus2, Idx4], i, ?destroy}]), - ?line ?expect1([{[testStatus2, Idx4], ?destroy}]), + ?expect1([{[testStatus2, Idx4], ?destroy}]), snmpa:verbosity(MA, log), @@ -4564,25 +4564,25 @@ sparse_table_test() -> Idx2 = 2, s([{[sparseStatus, Idx1], i, ?createAndGo}, {[sparseDescr, Idx1], s, "row 1"}]), - ?line ?expect1([{[sparseStatus, Idx1], ?createAndGo}, + ?expect1([{[sparseStatus, Idx1], ?createAndGo}, {[sparseDescr, Idx1], "row 1"}]), s([{[sparseStatus, Idx2], i, ?createAndGo}, {[sparseDescr, Idx2], s, "row 2"}]), - ?line ?expect1([{[sparseStatus, Idx2], ?createAndGo}, + ?expect1([{[sparseStatus, Idx2], ?createAndGo}, {[sparseDescr, Idx2], "row 2"}]), ?v1_2(gn([[sparseIndex], [sparseDescr,Idx1], [sparseDescr,Idx2], [sparseStatus,Idx1], [sparseStatus,Idx2]]), gb(0,5,[[sparseIndex]])), - ?line ?expect1([{[sparseDescr,Idx1], "row 1"}, + ?expect1([{[sparseDescr,Idx1], "row 1"}, {[sparseDescr,Idx2], "row 2"}, {[sparseStatus,Idx1], ?active}, {[sparseStatus,Idx2], ?active}, {[sparseStr,0], "slut"}]), %% Delete the rows s([{[sparseStatus, Idx1], i, ?destroy}]), - ?line ?expect1([{[sparseStatus, Idx1], ?destroy}]), + ?expect1([{[sparseStatus, Idx1], ?destroy}]), s([{[sparseStatus, Idx2], i, ?destroy}]), - ?line ?expect1([{[sparseStatus, Idx2], ?destroy}]). + ?expect1([{[sparseStatus, Idx2], ?destroy}]). %% Req. Test1 @@ -4597,12 +4597,12 @@ cnt_64_test(MA) -> ?DBG("get cnt64",[]), g([[cnt64,0]]), ?DBG("await response",[]), - ?line ?v1_2(?expect3(noSuchName, 1, any), + ?v1_2(?expect3(noSuchName, 1, any), ?expect1([{[cnt64,0],18446744073709551615}])), ?DBG("get-next cnt64",[]), gn([[cnt64]]), ?DBG("await response",[]), - ?line ?v1_2(?expect1([{[cnt64Str,0], "after cnt64"}]), + ?v1_2(?expect1([{[cnt64Str,0], "after cnt64"}]), ?expect1([{[cnt64,0],18446744073709551615}])), ?DBG("send cntTrap",[]), snmpa:send_trap(MA,cntTrap,"standard trap",[ @@ -4611,7 +4611,7 @@ cnt_64_test(MA) -> {sysLocation, "here"} ]), ?DBG("await response",[]), - ?line ?v1_2(?expect5(trap, [test], 6, 1, [{[sysContact,0], "pelle"}, + ?v1_2(?expect5(trap, [test], 6, 1, [{[sysContact,0], "pelle"}, {[sysLocation,0], "here"}]), ?expect2(v2trap, [{[sysUpTime, 0], any}, {[snmpTrapOID, 0], ?testTrap ++ [1]}, @@ -4625,26 +4625,26 @@ cnt_64_test(MA) -> ?DBG("create row (cntStatus): ~p",[Idx1]), s([{[cntStatus, Idx1], i, ?createAndGo}]), ?DBG("await response",[]), - ?line ?expect1([{[cntStatus, Idx1], ?createAndGo}]), + ?expect1([{[cntStatus, Idx1], ?createAndGo}]), ?DBG("create row (cntStatus): ~p",[Idx2]), s([{[cntStatus, Idx2], i, ?createAndGo}]), ?DBG("await response",[]), - ?line ?expect1([{[cntStatus, Idx2], ?createAndGo}]), + ?expect1([{[cntStatus, Idx2], ?createAndGo}]), ?DBG("get-next (cntIndex)",[]), gn([[cntIndex]]), ?DBG("await response",[]), - ?line ?v1_2(?expect1([{[cntStatus,Idx1], ?active}]), + ?v1_2(?expect1([{[cntStatus,Idx1], ?active}]), ?expect1([{[cntCnt,Idx1], 0}])), % Delete the rows ?DBG("delete row (cntStatus): ~p",[Idx1]), s([{[cntStatus, Idx1], i, ?destroy}]), ?DBG("await response",[]), - ?line ?expect1([{[cntStatus, Idx1], ?destroy}]), + ?expect1([{[cntStatus, Idx1], ?destroy}]), ?DBG("delete row (cntStatus): ~p",[Idx2]), s([{[cntStatus, Idx2], i, ?destroy}]), ?DBG("await response",[]), - ?line ?expect1([{[cntStatus, Idx2], ?destroy}]), + ?expect1([{[cntStatus, Idx2], ?destroy}]), catch snmpa:verbosity(MA, log), ?DBG("done",[]), ok. @@ -4653,40 +4653,40 @@ cnt_64_test(MA) -> opaque_test() -> ?NPRINT("Testing Opaque datatype..."), g([[opaqueObj,0]]), - ?line ?expect1([{[opaqueObj,0], "opaque-data"}]). + ?expect1([{[opaqueObj,0], "opaque-data"}]). %% Req. OLD-SNMPEA-MIB api_test(MaNode) -> - ?line {value, OID} = rpc:call(MaNode, snmpa, name_to_oid, + {value, OID} = rpc:call(MaNode, snmpa, name_to_oid, [intAgentIpAddress]), - ?line {value, intAgentIpAddress} = rpc:call(MaNode, snmpa, + {value, intAgentIpAddress} = rpc:call(MaNode, snmpa, oid_to_name, [OID]), - ?line false = rpc:call(MaNode, snmpa, name_to_oid, [intAgentIpAddres]), - ?line false = rpc:call(MaNode, snmpa, oid_to_name, + false = rpc:call(MaNode, snmpa, name_to_oid, [intAgentIpAddres]), + false = rpc:call(MaNode, snmpa, oid_to_name, [[1,5,32,3,54,3,3,34,4]]), - ?line {value, 2} = rpc:call(MaNode, snmpa, enum_to_int, + {value, 2} = rpc:call(MaNode, snmpa, enum_to_int, [intViewType, excluded]), - ?line {value, excluded} = rpc:call(MaNode, snmpa, int_to_enum, + {value, excluded} = rpc:call(MaNode, snmpa, int_to_enum, [intViewType, 2]), - ?line false = rpc:call(MaNode, snmpa, enum_to_int, [intViewType, exclude]), - ?line false = rpc:call(MaNode, snmpa, enum_to_int, + false = rpc:call(MaNode, snmpa, enum_to_int, [intViewType, exclude]), + false = rpc:call(MaNode, snmpa, enum_to_int, [intAgentIpAddress, exclude]), - ?line false = rpc:call(MaNode, snmpa, enum_to_int, + false = rpc:call(MaNode, snmpa, enum_to_int, [intAgentIpAddre, exclude]), - ?line false = rpc:call(MaNode, snmpa, int_to_enum, [intViewType, 3]), - ?line false = rpc:call(MaNode, snmpa, int_to_enum, [intAgentIpAddress, 2]), - ?line false = rpc:call(MaNode, snmpa, int_to_enum, [intAgentIpAddre, 2]), - ?line {value, active} = rpc:call(MaNode, snmpa, + false = rpc:call(MaNode, snmpa, int_to_enum, [intViewType, 3]), + false = rpc:call(MaNode, snmpa, int_to_enum, [intAgentIpAddress, 2]), + false = rpc:call(MaNode, snmpa, int_to_enum, [intAgentIpAddre, 2]), + {value, active} = rpc:call(MaNode, snmpa, int_to_enum, ['RowStatus', ?active]), - ?line {value, ?destroy} = rpc:call(MaNode, snmpa, + {value, ?destroy} = rpc:call(MaNode, snmpa, enum_to_int, ['RowStatus', destroy]), - ?line false = rpc:call(MaNode, snmpa, + false = rpc:call(MaNode, snmpa, enum_to_int, ['RowStatus', xxxdestroy]), - ?line false = rpc:call(MaNode, snmpa, + false = rpc:call(MaNode, snmpa, enum_to_int, ['xxRowStatus', destroy]), - ?line false = rpc:call(MaNode, snmpa, int_to_enum, ['RowStatus', 25]), - ?line false = rpc:call(MaNode, snmpa, int_to_enum, ['xxRowStatus', 1]), - ?line case snmp:date_and_time() of + false = rpc:call(MaNode, snmpa, int_to_enum, ['RowStatus', 25]), + false = rpc:call(MaNode, snmpa, int_to_enum, ['xxRowStatus', 1]), + case snmp:date_and_time() of List when is_list(List), length(List) == 8 -> ok; List when is_list(List), length(List) == 11 -> ok end. @@ -4694,42 +4694,42 @@ api_test(MaNode) -> %% Req. Klas3 api_test2() -> g([[fname3,0]]), - ?line ?expect1([{[fname3,0], "ok"}]), + ?expect1([{[fname3,0], "ok"}]), g([[fname4,0]]), - ?line ?expect1([{[fname4,0], 1}]). + ?expect1([{[fname4,0], 1}]). api_test3() -> g([[fname3,0]]), - ?line ?expect1([{[fname3,0], "ok"}]). + ?expect1([{[fname3,0], "ok"}]). unreg_test() -> gn([[?v1_2(sysServices, sysORLastChange),0]]), - ?line ?expect1([{[snmpInPkts, 0], any}]). + ?expect1([{[snmpInPkts, 0], any}]). load_test() -> gn([[?v1_2(sysServices, sysORLastChange),0]]), - ?line ?expect1([{[fname,0], ""}]). + ?expect1([{[fname,0], ""}]). %% Req. Klas1 load_test_sa() -> gn([[?v1_2(sysServices,sysORLastChange), 0]]), - ?line ?expect1([{[fname,0], any}]). + ?expect1([{[fname,0], any}]). %% Req. system group, Klas1, OLD-SNMPEA-MIB do_mul_get() -> Key1c3 = [intCommunityEntry,[3],get(mip),is("public")], Key1c4 = [intCommunityEntry,[4],get(mip),is("public")], s([{[fname,0], s, "test set"}]), - ?line ?expect1([{[fname,0], "test set"}]), + ?expect1([{[fname,0], "test set"}]), g([[sysDescr,0], Key1c4, [fname,0],Key1c3,[sysName,0]]), - ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"}, + ?expect1([{[sysDescr,0], "Erlang SNMP agent"}, {Key1c4, 2}, {[fname,0], "test set"}, {Key1c3, 2}, {[sysName,0], "test"}]), g([[1,3,7,1], Key1c4, [sysDescr,0], [1,3,7,2], Key1c3, [sysDescr,0]]), - ?line ?v1_2(?expect3(noSuchName, [1,4], any), + ?v1_2(?expect3(noSuchName, [1,4], any), ?expect1([{[1,3,7,1], noSuchObject}, {Key1c4, 2}, {[sysDescr,0], "Erlang SNMP agent"}, @@ -4742,16 +4742,16 @@ do_mul_get_err() -> Key1c3 = [intCommunityEntry,[3],get(mip),is("public")], Key1c4 = [intCommunityEntry,[4],get(mip),is("public")], s([{[fname,0], s, "test set"}]), - ?line ?expect1([{[fname,0], "test set"}]), + ?expect1([{[fname,0], "test set"}]), g([[sysDescr,0],Key1c4,[fname,0], Key1c3, [sysName,2]]), - ?line ?v1_2(?expect3(noSuchName, 5, any), + ?v1_2(?expect3(noSuchName, 5, any), ?expect1([{[sysDescr,0], "Erlang SNMP agent"}, {Key1c4, 2}, {[fname,0], "test set"}, {Key1c3, 2}, {[sysName,2], noSuchInstance}])), g([[sysDescr,0],Key1c4,[fname3,0], Key1c3, [sysName,1]]), - ?line ?v1_2(?expect3(noSuchName, [3,5], any), + ?v1_2(?expect3(noSuchName, [3,5], any), ?expect1([{[sysDescr,0], "Erlang SNMP agent"}, {Key1c4, 2}, {[fname3,0], noSuchObject}, @@ -4766,9 +4766,9 @@ do_mul_next() -> Key1c3 = [intCommunityEntry,[3],get(mip),is("public")], Key1c4 = [intCommunityEntry,[4],get(mip),is("public")], s([{[fname,0], s, "test set"}]), - ?line ?expect1([{[fname,0], "test set"}]), + ?expect1([{[fname,0], "test set"}]), gn([[sysDescr], Key1c4s, [fname],Key1c3s,[sysName]]), - ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"}, + ?expect1([{[sysDescr,0], "Erlang SNMP agent"}, {Key1c4, 2}, {[fname,0], "test set"}, {Key1c3, 2}, {[sysName,0], "test"}]). @@ -4779,9 +4779,9 @@ do_mul_next_err() -> Key1c3 = [intCommunityEntry,[3],get(mip),is("public")], Key1c4 = [intCommunityEntry,[4],get(mip),is("public")], s([{[fname,0], s, "test set"}]), - ?line ?expect1([{[fname,0], "test set"}]), + ?expect1([{[fname,0], "test set"}]), gn([[sysDescr], Key1c4s, [1,3,6,999], [fname],[1,3,90], Key1c3s,[sysName]]), - ?line ?v1_2(?expect3(noSuchName, [3,5], any), + ?v1_2(?expect3(noSuchName, [3,5], any), ?expect1([{[sysDescr,0], "Erlang SNMP agent"}, {Key1c4, 2}, {[1,3,6,999], endOfMibView}, @@ -4803,7 +4803,7 @@ do_mul_set() -> {NewKeyc5, ?createAndGo}, {NewKeyc4, 2}, {[friendsEntry, [3, 3]], ?createAndGo}]), - ?line ?expect1([{[friendsEntry, [2, 3]], "kompis3"}, + ?expect1([{[friendsEntry, [2, 3]], "kompis3"}, {NewKeyc3, 2}, {[sysLocation,0], "new_value"}, {NewKeyc5, ?createAndGo}, @@ -4812,14 +4812,14 @@ do_mul_set() -> g([[friendsEntry, [2, 3]], [sysLocation,0], [friendsEntry, [3, 3]]]), - ?line ?expect1([{[friendsEntry, [2, 3]], "kompis3"}, + ?expect1([{[friendsEntry, [2, 3]], "kompis3"}, {[sysLocation,0], "new_value"}, {[friendsEntry, [3, 3]], ?active}]), g([NewKeyc4]), - ?line ?expect1([{NewKeyc4, 2}]), + ?expect1([{NewKeyc4, 2}]), s([{[friendsEntry, [3, 3]], ?destroy}, {NewKeyc5, ?destroy}]), - ?line ?expect1([{[friendsEntry, [3, 3]], ?destroy}, + ?expect1([{[friendsEntry, [3, 3]], ?destroy}, {NewKeyc5, ?destroy}]). %% Req. system group, Klas1, OLD-SNMPEA-MIB @@ -4834,46 +4834,46 @@ do_mul_set_err() -> {NewKeyc5, ?createAndGo}, {NewKeyc4, 2}, {[friendsEntry, [3, 3]], ?createAndGo}]), - ?line ?expect3(?v1_2(noSuchName, notWritable), 3, any), + ?expect3(?v1_2(noSuchName, notWritable), 3, any), g([[friendsEntry, [2, 3]]]), - ?line ?v1_2(?expect3(noSuchName, 1, any), + ?v1_2(?expect3(noSuchName, 1, any), ?expect1([{[friendsEntry, [2,3]], noSuchInstance}])), g([NewKeyc4]), - ?line ?v1_2(?expect3(noSuchName, 1, any), + ?v1_2(?expect3(noSuchName, 1, any), ?expect1([{NewKeyc4, noSuchInstance}])). %% Req. SA-MIB sa_mib() -> g([[sa, [2,0]]]), - ?line ?expect1([{[sa, [2,0]], 3}]), + ?expect1([{[sa, [2,0]], 3}]), s([{[sa, [1,0]], s, "sa_test"}]), - ?line ?expect1([{[sa, [1,0]], "sa_test"}]), + ?expect1([{[sa, [1,0]], "sa_test"}]), ok. ma_trap1(MA) -> ok = snmpa:send_trap(MA, testTrap2, "standard trap"), - ?line ?expect5(trap, [system], 6, 1, [{[system, [4,0]], + ?expect5(trap, [system], 6, 1, [{[system, [4,0]], "{mbj,eklas}@erlang.ericsson.se"}]), ok = snmpa:send_trap(MA, testTrap1, "standard trap"), - ?line ?expect5(trap, [1,2,3] , 1, 0, [{[system, [4,0]], + ?expect5(trap, [1,2,3] , 1, 0, [{[system, [4,0]], "{mbj,eklas}@erlang.ericsson.se"}]), ok. ma_trap2(MA) -> snmpa:send_trap(MA,testTrap2,"standard trap",[{sysContact,"pelle"}]), - ?line ?expect5(trap, [system], 6, 1, [{[system, [4,0]], "pelle"}]), + ?expect5(trap, [system], 6, 1, [{[system, [4,0]], "pelle"}]), ok. ma_v2_2_v1_trap(MA) -> snmpa:send_trap(MA,testTrapv22,"standard trap",[{sysContact,"pelle"}]), - ?line ?expect5(trap, [system], 6, 1, [{[system, [4,0]], "pelle"}]), + ?expect5(trap, [system], 6, 1, [{[system, [4,0]], "pelle"}]), ok. ma_v2_2_v1_trap2(MA) -> snmpa:send_trap(MA,linkUp,"standard trap",[{ifIndex, [1], 1}, {ifAdminStatus, [1], 1}, {ifOperStatus, [1], 2}]), - ?line ?expect5(trap, [1,2,3], 3, 0, [{[ifIndex, 1], 1}, + ?expect5(trap, [1,2,3], 3, 0, [{[ifIndex, 1], 1}, {[ifAdminStatus, 1], 1}, {[ifOperStatus, 1], 2}]), ok. @@ -4893,7 +4893,7 @@ sa_trap1(SA) -> %% io:format("sa_trap1 -> SA trap send: " %% "~n TSRes: ~p" %% "~n", [TSRes]), - ?line ?expect5(trap, [ericsson], 6, 1, [{[system, [4,0]], + ?expect5(trap, [ericsson], 6, 1, [{[system, [4,0]], "{mbj,eklas}@erlang.ericsson.se"}, {[sa, [1,0]], "sa_test"}]), snmpa:verbosity(SA, {subagents, silence}), @@ -4901,14 +4901,14 @@ sa_trap1(SA) -> sa_trap2(SA) -> snmpa:send_trap(SA, saTrap, "standard trap",[{sysContact,"pelle"}]), - ?line ?expect5(trap, [ericsson], 6, 1, [{[system, [4,0]], "pelle"}, + ?expect5(trap, [ericsson], 6, 1, [{[system, [4,0]], "pelle"}, {[sa, [1,0]], "sa_test"}]), ok. sa_trap3(SA) -> snmpa:send_trap(SA, saTrap2, "standard trap", [{intViewSubtree, [4], [1,2,3,4]}]), - ?line ?expect5(trap, [ericsson], 6, 2, [{[system, [4,0]], + ?expect5(trap, [ericsson], 6, 2, [{[system, [4,0]], "{mbj,eklas}@erlang.ericsson.se"}, {[sa, [1,0]], "sa_test"}, {[intViewSubtree,4],[1,2,3,4]}]), @@ -4918,17 +4918,17 @@ ma_v2_trap1(MA) -> ?DBG("ma_v2_traps -> entry with MA = ~p => " "send standard trap: testTrapv22",[MA]), snmpa:send_trap(MA, testTrapv22, "standard trap"), - ?line ?expect2(v2trap, [{[sysUpTime, 0], any}, + ?expect2(v2trap, [{[sysUpTime, 0], any}, {[snmpTrapOID, 0], ?system ++ [0,1]}]), ?DBG("ma_v2_traps -> send standard trap: testTrapv21",[]), snmpa:send_trap(MA, testTrapv21, "standard trap"), - ?line ?expect2(v2trap, [{[sysUpTime, 0], any}, + ?expect2(v2trap, [{[sysUpTime, 0], any}, {[snmpTrapOID, 0], ?snmp ++ [1]}]), ok. ma_v2_trap2(MA) -> snmpa:send_trap(MA,testTrapv22,"standard trap",[{sysContact,"pelle"}]), - ?line ?expect2(v2trap, [{[sysUpTime, 0], any}, + ?expect2(v2trap, [{[sysUpTime, 0], any}, {[snmpTrapOID, 0], ?system ++ [0,1]}, {[system, [4,0]], "pelle"}]). @@ -5333,10 +5333,10 @@ command_handler([{_No, _Desc, Cmd}|Rest]) -> %% command_handler(Rest); %% {error, Reason} -> %% ?EPRINT("command_handler -> ~w error: ~n~p", [_No, Reason]), - %% ?line ?FAIL(Reason); + %% ?FAIL(Reason); %% Error -> %% ?EPRINT("command_handler -> ~w unexpected: ~n~p", [_No, Error]), - %% ?line ?FAIL({unexpected_command_result, Error}) + %% ?FAIL({unexpected_command_result, Error}) %% end. try Cmd() of ok -> @@ -5348,7 +5348,7 @@ command_handler([{_No, _Desc, Cmd}|Rest]) -> if (SysEvs =:= []) -> ?EPRINT("command_handler -> ~w error: ~n~p", [_No, Reason]), - ?line ?FAIL(Reason); + ?FAIL(Reason); true -> ?WPRINT("command_handler -> " "failed when we got system events: " @@ -5364,7 +5364,7 @@ command_handler([{_No, _Desc, Cmd}|Rest]) -> (SysEvs =:= []) -> ?EPRINT("command_handler -> " "~w unexpected: ~n~p", [_No, Error]), - ?line ?FAIL({unexpected_command_result, Error}); + ?FAIL({unexpected_command_result, Error}); true -> ?WPRINT("command_handler -> " "unexpected when we got system events: " @@ -5383,7 +5383,7 @@ command_handler([{_No, _Desc, Cmd}|Rest]) -> "~n Class: ~p" "~n Error: ~p" "~n Stack: ~p", [_No, C, E, S]), - ?line ?FAIL({catched_command_result, {C, E, S}}); + ?FAIL({catched_command_result, {C, E, S}}); true -> ?WPRINT("command_handler -> " "caught when we got system events: " @@ -5400,7 +5400,7 @@ command_handler([{_No, _Desc, Cmd}|Rest]) -> ma_v1_2_v2_trap(MA) -> snmpa:send_trap(MA,linkDown,"standard trap",[{ifIndex, [1], 1}]), - ?line ?expect2(v2trap, [{[sysUpTime, 0], any}, + ?expect2(v2trap, [{[sysUpTime, 0], any}, {[snmpTrapOID, 0], ?snmpTraps ++ [3]}, {[ifIndex, 1], 1}, {[snmpTrapEnterprise, 0], [1,2,3]}]). @@ -5408,7 +5408,7 @@ ma_v1_2_v2_trap(MA) -> ma_v1_2_v2_trap2(MA) -> snmpa:send_trap(MA,testTrap2,"standard trap",[{sysContact,"pelle"}]), - ?line ?expect2(v2trap, [{[sysUpTime, 0], any}, + ?expect2(v2trap, [{[sysUpTime, 0], any}, {[snmpTrapOID, 0], ?system ++ [0,1]}, {[system, [4,0]], "pelle"}, {[snmpTrapEnterprise, 0], ?system}]). @@ -5417,7 +5417,7 @@ ma_v1_2_v2_trap2(MA) -> sa_v1_2_v2_trap1(SA) -> snmpa:verbosity(SA, {subagents, trace}), snmpa:send_trap(SA, saTrap, "standard trap"), - ?line ?expect2(v2trap, [{[sysUpTime, 0], any}, + ?expect2(v2trap, [{[sysUpTime, 0], any}, {[snmpTrapOID, 0], ?ericsson ++ [0, 1]}, {[system, [4,0]], "{mbj,eklas}@erlang.ericsson.se"}, @@ -5429,7 +5429,7 @@ sa_v1_2_v2_trap1(SA) -> sa_v1_2_v2_trap2(SA) -> snmpa:verbosity(SA, {subagents, trace}), snmpa:send_trap(SA, saTrap, "standard trap",[{sysContact,"pelle"}]), - ?line ?expect2(v2trap, [{[sysUpTime, 0], any}, + ?expect2(v2trap, [{[sysUpTime, 0], any}, {[snmpTrapOID, 0], ?ericsson ++ [0, 1]}, {[system, [4,0]], "pelle"}, {[sa, [1,0]], "sa_test"}, @@ -5442,7 +5442,7 @@ sa_v1_2_v2_trap3(SA) -> snmpa:verbosity(SA, {subagents, trace}), snmpa:send_trap(SA, saTrap2, "standard trap", [{intViewSubtree, [4], [1,2,3,4]}]), - ?line ?expect2(v2trap, [{[sysUpTime, 0], any}, + ?expect2(v2trap, [{[sysUpTime, 0], any}, {[snmpTrapOID, 0], ?ericsson ++ [0, 2]}, {[system, [4,0]], "{mbj,eklas}@erlang.ericsson.se"}, @@ -5462,14 +5462,14 @@ sa_errs_bad_value() -> {[sa, [2,0]], 5}, % badValue (i is_set_ok) {NewKeyc5, ?createAndGo}, {NewKeyc4, 2}]), - ?line ?expect3(badValue, 2, any), + ?expect3(badValue, 2, any), s([{NewKeyc3, 2}, {[sa, [2,0]], 6}, % wrongValue (i is_set_ok) {NewKeyc5, ?createAndGo}, {NewKeyc4, 2}]), - ?line ?expect3(?v1_2(badValue, wrongValue), 2, any), + ?expect3(?v1_2(badValue, wrongValue), 2, any), g([NewKeyc4]), - ?line ?v1_2(?expect3(noSuchName, 1, any), + ?v1_2(?expect3(noSuchName, 1, any), ?expect1([{NewKeyc4, noSuchInstance}])). %% Req. SA-MIB, OLD-SNMPEA-MIB @@ -5479,22 +5479,22 @@ sa_errs_gen_err() -> NewKeyc5 = [intCommunityEntry,[5],get(mip),is("test")], s([{NewKeyc3, 2},{NewKeyc4, 2}, {NewKeyc5, ?createAndGo}, {[sa, [3,0]], 5}]), - ?line ?expect3(genErr, 4, any), + ?expect3(genErr, 4, any), % The row might have been added; we don't know. % (as a matter of fact we do - it is added, because the agent % first sets its own vars, and then th SAs. Lets destroy it. s([{NewKeyc5, ?destroy}]), - ?line ?expect1([{NewKeyc5, ?destroy}]). + ?expect1([{NewKeyc5, ?destroy}]). %% Req. SA-MIB, OLD-SNMPEA-MIB sa_too_big() -> g([[sa, [4,0]]]), - ?line ?expect1(tooBig). + ?expect1(tooBig). %% Req. Klas1, system group, snmp group (v1/v2) next_across_sa_test() -> gn([[sysDescr],[klas1,5]]), - ?line ?expect1([{[sysDescr,0], "Erlang SNMP agent"}, + ?expect1([{[sysDescr,0], "Erlang SNMP agent"}, {[snmpInPkts, 0], any}]). %% snmp_test_mgr:s([{[fStatus3, 1], 4}, {[fname3,0], "ok"}]). -> noError @@ -5506,40 +5506,40 @@ next_across_sa_test() -> %% Req. Klas3, Klas4 undo_test() -> s([{[fStatus3, 1], 4}, {[fname3,0], "ok"}]), - ?line ?expect1([{[fStatus3, 1], 4}, {[fname3,0], "ok"}]), + ?expect1([{[fStatus3, 1], 4}, {[fname3,0], "ok"}]), s([{[fStatus3, 1], 4}, {[fname3,0], "hoj"}]), - ?line ?expect3(?v1_2(badValue, inconsistentValue), 2, any), + ?expect3(?v1_2(badValue, inconsistentValue), 2, any), s([{[fStatus3, 3], 4}, {[fname3,0], "hoj"}]), - ?line ?expect3(?v1_2(genErr, undoFailed), 1, any), + ?expect3(?v1_2(genErr, undoFailed), 1, any), s([{[fStatus3, 4], 4}, {[fname3,0], "ok"}]), - ?line ?expect3(?v1_2(genErr, commitFailed), 1, any), + ?expect3(?v1_2(genErr, commitFailed), 1, any), % unfortunately we don't know if we'll get undoFailed or commitFailed. % it depends on which order the agent traverses the varbind list. % s([{[fStatus3, 4], 4}, {[fname3,0], "ufail"}]), -% ?line expect(5, ?v1_2(genErr, undoFailed), 1, any), +% expect(5, ?v1_2(genErr, undoFailed), 1, any), s([{[fStatus3, 1], 4}, {[fname3,0], "xfail"}]), - ?line ?expect3(genErr, 2, any). + ?expect3(genErr, 2, any). %% Req. Klas3, Klas4 bad_return() -> g([[fStatus4,4], [fName4,4]]), - ?line ?expect3(genErr, 2, any), + ?expect3(genErr, 2, any), g([[fStatus4,5], [fName4,5]]), - ?line ?expect3(genErr, 1, any), + ?expect3(genErr, 1, any), g([[fStatus4,6], [fName4,6]]), - ?line ?expect3(genErr, 2, any), + ?expect3(genErr, 2, any), gn([[fStatus4,7], [fName4,7]]), - ?line ?expect3(genErr, 2, any), + ?expect3(genErr, 2, any), gn([[fStatus4,8], [fName4,8]]), - ?line ?expect3(genErr, 1, any), + ?expect3(genErr, 1, any), gn([[fStatus4,9], [fName4,9]]), - ?line ?expect3(genErr, 2, any). + ?expect3(genErr, 2, any). %%%----------------------------------------------------------------- @@ -5614,9 +5614,9 @@ snmp_standard_mib(Config) when is_list(Config) -> %% Req. SNMP-STANDARD-MIB standard_mib_a() -> - ?line [OutPkts] = get_req(2, [[snmpOutPkts,0]]), - ?line [OutPkts2] = get_req(3, [[snmpOutPkts,0]]), - ?line OutPkts2 = OutPkts + 1, + [OutPkts] = get_req(2, [[snmpOutPkts,0]]), + [OutPkts2] = get_req(3, [[snmpOutPkts,0]]), + OutPkts2 = OutPkts + 1, %% There are some more counters we could test here, but it's not that %% important, since they are removed from SNMPv2-MIB. ok. @@ -5626,27 +5626,27 @@ std_mib_init() -> %% disable authentication failure traps. (otherwise w'd get many of %% them - this is also a test to see that it works). s([{[snmpEnableAuthenTraps,0], 2}]), - ?line ?expect1([{[snmpEnableAuthenTraps, 0], 2}]). + ?expect1([{[snmpEnableAuthenTraps, 0], 2}]). %% Req. SNMP-STANDARD-MIB | SNMPv2-MIB std_mib_finish() -> %% enable again s([{[snmpEnableAuthenTraps,0], 1}]), - ?line ?expect1([{[snmpEnableAuthenTraps, 0], 1}]). + ?expect1([{[snmpEnableAuthenTraps, 0], 1}]). %% Req. SNMP-STANDARD-MIB standard_mib_test_finish() -> %% force a authenticationFailure (should result in a trap) std_mib_write(), %% check that we got a trap - ?line ?expect5(trap, [1,2,3], 4, 0, []). + ?expect5(trap, [1,2,3], 4, 0, []). %% Req. SNMP-STANDARD-MIB | SNMPv2-MIB std_mib_read() -> ?DBG("std_mib_read -> entry", []), g([[sysUpTime,0]]), % try a bad <something>; msg dropped, no reply ?DBG("std_mib_read -> await timeout (i.e. no reply)", []), - ?line ?expect1(timeout). % make sure we don't get a trap! + ?expect1(timeout). % make sure we don't get a trap! %% Req. SNMP-STANDARD-MIB | SNMPv2-MIB @@ -5761,31 +5761,31 @@ snmpv2_mib_test_finish() -> %% check that we got a trap ?DBG("ma_v2_inform -> await trap",[]), - ?line ?expect2(v2trap, [{[sysUpTime,0], any}, + ?expect2(v2trap, [{[sysUpTime,0], any}, {[snmpTrapOID,0], ?authenticationFailure}]), %% and the the inform ?DBG("ma_v2_inform -> await inform",[]), - ?line ?expect2({inform,true}, [{[sysUpTime,0], any}, + ?expect2({inform,true}, [{[sysUpTime,0], any}, {[snmpTrapOID,0],?authenticationFailure}]). %% Req. SNMP-STANDARD-MIB | SNMPv2-MIB std_mib_a() -> - ?line [InPkts] = get_req(2, [[snmpInPkts,0]]), - ?line [InPkts2] = get_req(3, [[snmpInPkts,0]]), - ?line InPkts2 = InPkts + 1, + [InPkts] = get_req(2, [[snmpInPkts,0]]), + [InPkts2] = get_req(3, [[snmpInPkts,0]]), + InPkts2 = InPkts + 1, - ?line [InBadVsns] = get_req(4, [[snmpInBadVersions,0]]), + [InBadVsns] = get_req(4, [[snmpInBadVersions,0]]), InBadVsns. %% Req. SNMP-STANDARD-MIB | SNMPv2-MIB std_mib_b(InBadVsns) -> - ?line [InBadVsns2] = get_req(1, [[snmpInBadVersions,0]]), - ?line InBadVsns2 = InBadVsns + 1, - ?line [InPkts] = get_req(2, [[snmpInPkts,0]]), - ?line [InPkts2] = get_req(3, [[snmpInPkts,0]]), - ?line InPkts2 = InPkts + 1, - ?line [InBadCommunityNames, InBadCommunityUses, InASNErrs] = + [InBadVsns2] = get_req(1, [[snmpInBadVersions,0]]), + InBadVsns2 = InBadVsns + 1, + [InPkts] = get_req(2, [[snmpInPkts,0]]), + [InPkts2] = get_req(3, [[snmpInPkts,0]]), + InPkts2 = InPkts + 1, + [InBadCommunityNames, InBadCommunityUses, InASNErrs] = get_req(4, [[snmpInBadCommunityNames,0], [snmpInBadCommunityUses,0], [snmpInASNParseErrs, 0]]), @@ -5793,25 +5793,25 @@ std_mib_b(InBadVsns) -> %% Req. SNMP-STANDARD-MIB | SNMPv2-MIB std_mib_c({InBadCommunityNames, InBadCommunityUses, InASNErrs}) -> - ?line [InBadCommunityNames2, InBadCommunityUses2, InASNErrs2] = + [InBadCommunityNames2, InBadCommunityUses2, InASNErrs2] = get_req(1, [[snmpInBadCommunityNames,0], [snmpInBadCommunityUses,0], [snmpInASNParseErrs, 0]]), - ?line InBadCommunityNames2 = InBadCommunityNames + 1, - ?line InBadCommunityUses2 = InBadCommunityUses + 1, - ?line InASNErrs2 = InASNErrs + 1. + InBadCommunityNames2 = InBadCommunityNames + 1, + InBadCommunityUses2 = InBadCommunityUses + 1, + InASNErrs2 = InASNErrs + 1. %% Req. SNMPv2-MIB snmpv2_mib_a() -> - ?line [SetSerial] = get_req(2, [[snmpSetSerialNo,0]]), + [SetSerial] = get_req(2, [[snmpSetSerialNo,0]]), s([{[snmpSetSerialNo,0], SetSerial}, {[sysLocation, 0], "val2"}]), - ?line ?expect1([{[snmpSetSerialNo,0], SetSerial}, + ?expect1([{[snmpSetSerialNo,0], SetSerial}, {[sysLocation, 0], "val2"}]), s([{[sysLocation, 0], "val3"}, {[snmpSetSerialNo,0], SetSerial}]), - ?line ?expect3(inconsistentValue, 2, + ?expect3(inconsistentValue, 2, [{[sysLocation, 0], "val3"}, {[snmpSetSerialNo,0], SetSerial}]), - ?line ["val2"] = get_req(5, [[sysLocation,0]]), + ["val2"] = get_req(5, [[sysLocation,0]]), ok. @@ -5823,9 +5823,9 @@ snmpv2_mib_a() -> snmp_community_mib(Config) when is_list(Config) -> ?P(snmp_community_mib), init_case(Config), - ?line load_master_std("SNMP-COMMUNITY-MIB"), + load_master_std("SNMP-COMMUNITY-MIB"), try_test(snmp_community_mib_test), - ?line unload_master("SNMP-COMMUNITY-MIB"). + unload_master("SNMP-COMMUNITY-MIB"). snmp_community_mib_2(X) -> ?P(snmp_community_mib_2), snmp_community_mib(X). @@ -5841,9 +5841,9 @@ snmp_community_mib_test() -> snmp_framework_mib(Config) when is_list(Config) -> ?P(snmp_framework_mib), init_case(Config), - ?line load_master_std("SNMP-FRAMEWORK-MIB"), + load_master_std("SNMP-FRAMEWORK-MIB"), try_test(snmp_framework_mib_test), - ?line unload_master("SNMP-FRAMEWORK-MIB"). + unload_master("SNMP-FRAMEWORK-MIB"). snmp_framework_mib_2(X) -> ?P(snmp_framework_mib_2), snmp_framework_mib(X). @@ -5873,13 +5873,13 @@ snmp_framework_mib_test() -> ]), Sleep = 5, - ?line ["agentEngine"] = get_req(1, [[snmpEngineID,0]]), + ["agentEngine"] = get_req(1, [[snmpEngineID,0]]), T1 = snmp_misc:now(ms), - ?line [EngineTime] = get_req(2, [[snmpEngineTime,0]]), + [EngineTime] = get_req(2, [[snmpEngineTime,0]]), T2 = snmp_misc:now(ms), ?SLEEP(?SECS(Sleep)), T3 = snmp_misc:now(ms), - ?line [EngineTime2] = get_req(3, [[snmpEngineTime,0]]), + [EngineTime2] = get_req(3, [[snmpEngineTime,0]]), T4 = snmp_misc:now(ms), %% Ok, we tried to sleep 5 seconds, but how long did we actually sleep @@ -5926,18 +5926,18 @@ snmp_framework_mib_test() -> ?EPRINT("snmp_framework_mib -> (High) Engine Time diff (~w) too large: " "~n ~w < ~w", [EngineTimeDiff, HighEngineTime, EngineTime2]), - ?line ?FAIL({too_large_diff, EngineTime, EngineTime2}); + ?FAIL({too_large_diff, EngineTime, EngineTime2}); (LowEngineTime > EngineTime2) -> ?EPRINT("snmp_framework_mib -> (Low) Engine Time diff (~w) too large: " "~n ~w > ~w", [EngineTimeDiff, LowEngineTime, EngineTime2]), - ?line ?FAIL({too_large_diff, EngineTime, EngineTime2}); + ?FAIL({too_large_diff, EngineTime, EngineTime2}); true -> ok end, T5 = snmp_misc:now(ms), - ?line case get_req(4, [[snmpEngineBoots,0]]) of + case get_req(4, [[snmpEngineBoots,0]]) of [Boots] when is_integer(Boots) -> T6 = snmp_misc:now(ms), ?IPRINT("snmp_framework_mib -> " @@ -5970,7 +5970,7 @@ snmp_mpd_mib_3(Config) when is_list(Config) -> %% Req. SNMP-MPD-MIB snmp_mpd_mib_a() -> - ?line [UnknownSecs, InvalidMsgs] = + [UnknownSecs, InvalidMsgs] = get_req(1, [[snmpUnknownSecurityModels,0], [snmpInvalidMsgs,0]]), Pdu = #pdu{type = 'get-request', @@ -5981,7 +5981,7 @@ snmp_mpd_mib_a() -> SPdu = #scopedPdu{contextEngineID = "agentEngine", contextName = "", data = Pdu}, - ?line SPDUBytes = snmp_pdus:enc_scoped_pdu(SPdu), + SPDUBytes = snmp_pdus:enc_scoped_pdu(SPdu), V3Hdr1 = #v3_hdr{msgID = 21, msgMaxSize = 484, msgFlags = [7], @@ -5996,37 +5996,37 @@ snmp_mpd_mib_a() -> data = SPDUBytes}, Message2 = #message{version = 'version-3', vsn_hdr = V3Hdr2, data = SPDUBytes}, - ?line MsgBytes1 = snmp_pdus:enc_message_only(Message1), - ?line MsgBytes2 = snmp_pdus:enc_message_only(Message2), + MsgBytes1 = snmp_pdus:enc_message_only(Message1), + MsgBytes2 = snmp_pdus:enc_message_only(Message2), snmp_test_mgr:send_bytes(MsgBytes1), snmp_test_mgr:send_bytes(MsgBytes2), - ?line [UnknownSecs2, InvalidMsgs2, UnknownPDUHs] = + [UnknownSecs2, InvalidMsgs2, UnknownPDUHs] = get_req(1, [[snmpUnknownSecurityModels,0], [snmpInvalidMsgs,0], [snmpUnknownPDUHandlers, 0]]), - ?line UnknownSecs2 = UnknownSecs + 1, - ?line InvalidMsgs2 = InvalidMsgs + 1, + UnknownSecs2 = UnknownSecs + 1, + InvalidMsgs2 = InvalidMsgs + 1, UnknownPDUHs. -define(snmpUnknownPDUHandlers_instance, [1,3,6,1,6,3,11,2,1,3,0]). snmp_mpd_mib_b() -> g([[sysUpTime,0]]), - ?line ?expect2(report, [{?snmpUnknownPDUHandlers_instance, any}]). + ?expect2(report, [{?snmpUnknownPDUHandlers_instance, any}]). snmp_mpd_mib_c(UnknownPDUHs) -> - ?line [UnknownPDUHs2] = get_req(1, [[snmpUnknownPDUHandlers, 0]]), - ?line UnknownPDUHs2 = UnknownPDUHs + 1, + [UnknownPDUHs2] = get_req(1, [[snmpUnknownPDUHandlers, 0]]), + UnknownPDUHs2 = UnknownPDUHs + 1, ok. snmp_target_mib(Config) when is_list(Config) -> ?P(snmp_target_mib), init_case(Config), - ?line load_master_std("SNMP-TARGET-MIB"), + load_master_std("SNMP-TARGET-MIB"), try_test(snmp_target_mib_test), - ?line unload_master("SNMP-TARGET-MIB"). + unload_master("SNMP-TARGET-MIB"). snmp_target_mib_2(X) -> ?P(snmp_target_mib_2), snmp_target_mib(X). @@ -6039,9 +6039,9 @@ snmp_target_mib_test() -> snmp_notification_mib(Config) when is_list(Config) -> ?P(snmp_notification_mib), init_case(Config), - ?line load_master_std("SNMP-NOTIFICATION-MIB"), + load_master_std("SNMP-NOTIFICATION-MIB"), try_test(snmp_notification_mib_test), - ?line unload_master("SNMP-NOTIFICATION-MIB"). + unload_master("SNMP-NOTIFICATION-MIB"). snmp_notification_mib_2(X) -> ?P(snmp_notification_mib_2), snmp_notification_mib(X). @@ -6062,11 +6062,11 @@ snmp_view_based_acm_mib(Config) when is_list(Config) -> ?P(snmp_view_based_acm_mib), init_case(Config), - ?line load_master_std("SNMP-VIEW-BASED-ACM-MIB"), - ?line load_master("Test2"), + load_master_std("SNMP-VIEW-BASED-ACM-MIB"), + load_master("Test2"), snmp_view_based_acm_mib(), - ?line unload_master("Test2"), - ?line unload_master("SNMP-VIEW-BASED-ACM-MIB"). + unload_master("Test2"), + unload_master("SNMP-VIEW-BASED-ACM-MIB"). snmp_view_based_acm_mib_2(X) -> ?P(snmp_view_based_acm_mib_2), @@ -6101,7 +6101,7 @@ snmp_view_based_acm_mib() -> v3 -> {?SEC_USM, ?SEC_V1} end, ?DBG("assign rights for 'no-rights'",[]), - ?line try_test(use_no_rights, [], Opts), + try_test(use_no_rights, [], Opts), %% Now, add a mapping from "no-rights" -> "no-rights-group" GRow1Status = [vacmSecurityToGroupStatus,[SecMod, 9,"no-rights"]], @@ -6109,10 +6109,10 @@ snmp_view_based_acm_mib() -> [{[vacmGroupName, [SecMod, 9,"no-rights"]], "no-rights-group"}, {GRow1Status, ?createAndGo}], ?DBG("set '~p'",[GRow1]), - ?line try_test(do_set, [GRow1]), + try_test(do_set, [GRow1]), ?DBG("assign rights for 'no-rights'",[]), - ?line try_test(use_no_rights, [], Opts), + try_test(use_no_rights, [], Opts), %% Create a mapping for another sec model, and make sure it doesn't %% give us access @@ -6121,13 +6121,13 @@ snmp_view_based_acm_mib() -> {GRow2Status, ?createAndGo}], ?DBG("set '~p'",[GRow2]), - ?line try_test(do_set, [GRow2]), + try_test(do_set, [GRow2]), ?DBG("assign rights for 'no-rights'",[]), - ?line try_test(use_no_rights, [], Opts), + try_test(use_no_rights, [], Opts), %% Delete that row - ?line try_test(del_row, [GRow2Status]), + try_test(del_row, [GRow2Status]), RVName = "rv_name", WVName = "wv_name", @@ -6148,18 +6148,18 @@ snmp_view_based_acm_mib() -> {[vacmAccessWriteViewName, ARow2Idx], "internet"}, {ARow2Status, ?createAndGo}], - ?line try_test(do_set, [ARow2]), + try_test(do_set, [ARow2]), - ?line try_test(use_no_rights, [], Opts), + try_test(use_no_rights, [], Opts), %% Delete that row - ?line try_test(del_row, [ARow2Status]), + try_test(del_row, [ARow2Status]), %% Add valid row - ?line try_test(do_set, [ARow1]), + try_test(do_set, [ARow1]), - ?line try_test(use_no_rights, [], Opts), + try_test(use_no_rights, [], Opts), %% Create the view family VRow1Idx = mk_ln(RVName) ++ mk_ln(?xDescr), % object access @@ -6171,32 +6171,32 @@ snmp_view_based_acm_mib() -> VRow3Status = [vacmViewTreeFamilyStatus, VRow3Idx], VRow4Status = [vacmViewTreeFamilyStatus, VRow4Idx], - ?line try_test(add_row, [VRow1Status]), - ?line try_test(add_row, [VRow2Status]), - ?line try_test(add_row, [VRow3Status]), + try_test(add_row, [VRow1Status]), + try_test(add_row, [VRow2Status]), + try_test(add_row, [VRow3Status]), %% We're supposed to have access now... - ?line try_test(use_rights, [], Opts), + try_test(use_rights, [], Opts), %% Change Row3 to Row4 - ?line try_test(del_row, [VRow3Status]), - ?line try_test(add_row, [VRow4Status]), + try_test(del_row, [VRow3Status]), + try_test(add_row, [VRow4Status]), %% We should still have access... - ?line try_test(use_rights, [], Opts), + try_test(use_rights, [], Opts), %% Delete rows - ?line try_test(del_row, [GRow1Status]), + try_test(del_row, [GRow1Status]), - ?line try_test(use_no_rights, [], Opts), + try_test(use_no_rights, [], Opts), %% Delete rest of rows - ?line try_test(del_row, [ARow1Status]), - ?line try_test(del_row, [VRow1Status]), - ?line try_test(del_row, [VRow2Status]), - ?line try_test(del_row, [VRow4Status]), + try_test(del_row, [ARow1Status]), + try_test(del_row, [VRow1Status]), + try_test(del_row, [VRow2Status]), + try_test(del_row, [VRow4Status]), - ?line try_test(use_no_rights, [], Opts), + try_test(use_no_rights, [], Opts), snmpa:verbosity(master_agent,log). do_set(Row) -> @@ -6263,7 +6263,7 @@ snmp_user_based_sm_mib_3(Config) when is_list(Config) -> init_case(Config), _AgentDir = ?config(agent_conf_dir, Config), - ?line load_master_std("SNMP-USER-BASED-SM-MIB"), + load_master_std("SNMP-USER-BASED-SM-MIB"), %% The newUser used here already has VACM access. @@ -6272,10 +6272,10 @@ snmp_user_based_sm_mib_3(Config) when is_list(Config) -> [{sec_level, authPriv}, {user, "privDES"}]), %% Try to use the new user - ?line load_master("Test2"), + load_master("Test2"), try_test(v3_sync, [[{usm_use_user, []}]], [{sec_level, authPriv}, {user, "newUser"}]), - ?line unload_master("Test2"), + unload_master("Test2"), ShaKey1 = snmp:passwd2localized_key(sha, "new sha password", "agentEngine"), DesKey1 = lists:sublist(ShaKey1, 16), @@ -6286,55 +6286,55 @@ snmp_user_based_sm_mib_3(Config) when is_list(Config) -> %% Try to use the new keys MgrDir = ?config(mgr_dir, Config), - ?line rewrite_usm_mgr(MgrDir, ShaKey1, DesKey1), - ?line load_master("Test2"), + rewrite_usm_mgr(MgrDir, ShaKey1, DesKey1), + load_master("Test2"), try_test(v3_sync, [[{usm_use_user, []}]], [{sec_level, authPriv}, {user, "newUser"}]), - ?line unload_master("Test2"), + unload_master("Test2"), ShaKey2 = snmp:passwd2localized_key(sha, "newer password", "agentEngine"), DesKey2 = lists:sublist(ShaKey2, 16), %% Change the new user's keys - 2 - ?line try_test(v3_sync, + try_test(v3_sync, [[{usm_key_change2, [ShaKey1, DesKey1, ShaKey2, DesKey2]}]], [{sec_level, authPriv}, {user, "newUser"}]), %% Try to use the new keys reset_usm_mgr(MgrDir), - ?line rewrite_usm_mgr(MgrDir, ShaKey2, DesKey2), - ?line load_master("Test2"), - ?line try_test(v3_sync, [[{usm_use_user, []}]], + rewrite_usm_mgr(MgrDir, ShaKey2, DesKey2), + load_master("Test2"), + try_test(v3_sync, [[{usm_use_user, []}]], [{sec_level, authPriv}, {user, "newUser"}]), - ?line unload_master("Test2"), + unload_master("Test2"), reset_usm_mgr(MgrDir), %% Change the new user's keys - 3 - ?line try_test(v3_sync, + try_test(v3_sync, [[{usm_key_change3, [ShaKey2, DesKey2, ShaKey1, DesKey1]}]], [{sec_level, authPriv}, {user, "privDES"}]), %% Try to use the new keys - ?line rewrite_usm_mgr(MgrDir, ShaKey1, DesKey1), - ?line load_master("Test2"), + rewrite_usm_mgr(MgrDir, ShaKey1, DesKey1), + load_master("Test2"), try_test(v3_sync, [[{usm_use_user, []}]], [{sec_level, authPriv}, {user, "newUser"}]), - ?line unload_master("Test2"), + unload_master("Test2"), reset_usm_mgr(MgrDir), %% Try some read requests - ?line try_test(v3_sync, [[{usm_read, []}]], + try_test(v3_sync, [[{usm_read, []}]], [{sec_level, authPriv}, {user, "privDES"}]), %% Delete the new user - ?line try_test(v3_sync, [[{usm_del_user, []}]], + try_test(v3_sync, [[{usm_del_user, []}]], [{sec_level, authPriv}, {user, "privDES"}]), %% Try some bad requests - ?line try_test(v3_sync, [[{usm_bad, []}]], + try_test(v3_sync, [[{usm_bad, []}]], [{sec_level, authPriv}, {user, "privDES"}]), - ?line unload_master("SNMP-USER-BASED-SM-MIB"). + unload_master("SNMP-USER-BASED-SM-MIB"). -define(usmUserSecurityName, [1,3,6,1,6,3,15,1,2,2,1,3]). @@ -6343,8 +6343,8 @@ usm_add_user1() -> RowPointer = ?usmUserSecurityName ++ [11|"agentEngine"] ++ [7|"privDES"], Vbs1 = [{[usmUserCloneFrom, NewRowIndex], RowPointer}, {[usmUserStatus, NewRowIndex], ?createAndGo}], - ?line s(Vbs1), - ?line ?expect1(Vbs1), + s(Vbs1), + ?expect1(Vbs1), ok. usm_use_user() -> @@ -6363,7 +6363,7 @@ usm_key_change1(ShaKey, DesKey) -> Vbs1 = [{[usmUserAuthKeyChange, NewRowIndex], ShaKeyChange}, {[usmUserPrivKeyChange, NewRowIndex], DesKeyChange}], s(Vbs1), - ?line ?expect1(Vbs1). + ?expect1(Vbs1). %% Change own private keys usm_key_change2(OldShaKey, OldDesKey, ShaKey, DesKey) -> @@ -6377,7 +6377,7 @@ usm_key_change2(OldShaKey, OldDesKey, ShaKey, DesKey) -> Vbs1 = [{[usmUserOwnAuthKeyChange, NewRowIndex], ShaKeyChange}, {[usmUserOwnPrivKeyChange, NewRowIndex], DesKeyChange}], s(Vbs1), - ?line ?expect1(Vbs1). + ?expect1(Vbs1). %% Change other's public keys usm_key_change3(OldShaKey, OldDesKey, ShaKey, DesKey) -> @@ -6390,27 +6390,27 @@ usm_key_change3(OldShaKey, OldDesKey, ShaKey, DesKey) -> DesKey), Vbs1 = [{[usmUserOwnAuthKeyChange, NewRowIndex], ShaKeyChange}], s(Vbs1), - ?line ?expect3(noAccess, 1, any), + ?expect3(noAccess, 1, any), Vbs2 = [{[usmUserOwnPrivKeyChange, NewRowIndex], DesKeyChange}], s(Vbs2), - ?line ?expect3(noAccess, 1, any), + ?expect3(noAccess, 1, any), Vbs3 = [{[usmUserAuthKeyChange, NewRowIndex], ShaKeyChange}, {[usmUserPrivKeyChange, NewRowIndex], DesKeyChange}], s(Vbs3), - ?line ?expect1(Vbs3), + ?expect1(Vbs3), ok. usm_read() -> NewRowIndex = [11,"agentEngine", 7, "newUser"], - ?line g([[usmUserSecurityName, NewRowIndex], + g([[usmUserSecurityName, NewRowIndex], [usmUserCloneFrom, NewRowIndex], [usmUserAuthKeyChange, NewRowIndex], [usmUserOwnAuthKeyChange, NewRowIndex], [usmUserPrivKeyChange, NewRowIndex], [usmUserOwnPrivKeyChange, NewRowIndex]]), - ?line ?expect1([{[usmUserSecurityName, NewRowIndex], "newUser"}, + ?expect1([{[usmUserSecurityName, NewRowIndex], "newUser"}, {[usmUserCloneFrom, NewRowIndex], [0,0]}, {[usmUserAuthKeyChange, NewRowIndex], ""}, {[usmUserOwnAuthKeyChange, NewRowIndex], ""}, @@ -6423,8 +6423,8 @@ usm_read() -> usm_del_user() -> NewRowIndex = [11,"agentEngine", 7, "newUser"], Vbs1 = [{[usmUserStatus, NewRowIndex], ?destroy}], - ?line s(Vbs1), - ?line ?expect1(Vbs1), + s(Vbs1), + ?expect1(Vbs1), ok. -define(usmUserCloneFrom, [1,3,6,1,6,3,15,1,2,2,1,4]). @@ -6444,32 +6444,32 @@ usm_bad() -> RowPointer1 = ?usmUserSecurityName ++ [11|"agentEngine"] ++ [7|"privDOS"], Vbs1 = [{[usmUserCloneFrom, NewRowIndex], RowPointer1}, {[usmUserStatus, NewRowIndex], ?createAndGo}], - ?line s(Vbs1), - ?line ?expect3(inconsistentName, 1, any), + s(Vbs1), + ?expect3(inconsistentName, 1, any), RowPointer2 = ?usmUserCloneFrom ++ [11|"agentEngine"] ++ [7|"privDES"], Vbs2 = [{[usmUserCloneFrom, NewRowIndex], RowPointer2}, {[usmUserStatus, NewRowIndex], ?createAndGo}], - ?line s(Vbs2), - ?line ?expect3(wrongValue, 1, any), + s(Vbs2), + ?expect3(wrongValue, 1, any), RowPointer3 = ?usmUserSecurityName ++ [11|"agentEngine"] ++ [7|"privDES"], Vbs3 = [{[usmUserCloneFrom, NewRowIndex], RowPointer3}, {[usmUserStatus, NewRowIndex], ?createAndGo}], - ?line s(Vbs3), - ?line ?expect1(Vbs3), - ?line s([{[usmUserAuthProtocol, NewRowIndex], ?usmNoAuthProtocol}]), - ?line ?expect3(inconsistentValue, 1, any), - ?line s([{[usmUserAuthProtocol, NewRowIndex], ?usmHMACMD5AuthProtocol}]), - ?line ?expect3(inconsistentValue, 1, any), - ?line s([{[usmUserAuthProtocol, NewRowIndex], ?usmDESPrivProtocol}]), - ?line ?expect3(wrongValue, 1, any), - ?line s([{[usmUserPrivProtocol, NewRowIndex], ?usmHMACSHAAuthProtocol}]), - ?line ?expect3(wrongValue, 1, any), + s(Vbs3), + ?expect1(Vbs3), + s([{[usmUserAuthProtocol, NewRowIndex], ?usmNoAuthProtocol}]), + ?expect3(inconsistentValue, 1, any), + s([{[usmUserAuthProtocol, NewRowIndex], ?usmHMACMD5AuthProtocol}]), + ?expect3(inconsistentValue, 1, any), + s([{[usmUserAuthProtocol, NewRowIndex], ?usmDESPrivProtocol}]), + ?expect3(wrongValue, 1, any), + s([{[usmUserPrivProtocol, NewRowIndex], ?usmHMACSHAAuthProtocol}]), + ?expect3(wrongValue, 1, any), Vbs4 = [{[usmUserStatus, NewRowIndex], ?destroy}], - ?line s(Vbs4), - ?line ?expect1(Vbs4), + s(Vbs4), + ?expect1(Vbs4), ok. @@ -6488,33 +6488,33 @@ loop_mib_1(Config) when is_list(Config) -> "\tMgrNode: ~p~n" "\tMibDir: ~p",[_SaNode, _MgrNode, _MibDir]), ?DBG("loop_mib_1 -> load mib SNMP-COMMUNITY-MIB",[]), - ?line load_master_std("SNMP-COMMUNITY-MIB"), + load_master_std("SNMP-COMMUNITY-MIB"), ?DBG("loop_mib_1 -> load mib SNMP-MPD-MIB",[]), - ?line load_master_std("SNMP-MPD-MIB"), + load_master_std("SNMP-MPD-MIB"), ?DBG("loop_mib_1 -> load mib SNMP-TARGET-MIB",[]), - ?line load_master_std("SNMP-TARGET-MIB"), + load_master_std("SNMP-TARGET-MIB"), ?DBG("loop_mib_1 -> load mib SNMP-NOTIFICATION-MIB",[]), - ?line load_master_std("SNMP-NOTIFICATION-MIB"), + load_master_std("SNMP-NOTIFICATION-MIB"), ?DBG("loop_mib_1 -> load mib SNMP-FRAMEWORK-MIB",[]), - ?line load_master_std("SNMP-FRAMEWORK-MIB"), + load_master_std("SNMP-FRAMEWORK-MIB"), ?DBG("loop_mib_1 -> load mib SNMP-VIEW-BASED-ACM-MIB",[]), - ?line load_master_std("SNMP-VIEW-BASED-ACM-MIB"), + load_master_std("SNMP-VIEW-BASED-ACM-MIB"), ?DBG("loop_mib_1 -> try",[]), try_test(loop_mib_1_test), ?DBG("loop_mib_1 -> unload mib SNMP-COMMUNITY-MIB",[]), - ?line unload_master("SNMP-COMMUNITY-MIB"), + unload_master("SNMP-COMMUNITY-MIB"), ?DBG("loop_mib_1 -> unload mib SNMP-MPD-MIB",[]), - ?line unload_master("SNMP-MPD-MIB"), + unload_master("SNMP-MPD-MIB"), ?DBG("loop_mib_1 -> unload mib SNMP-TARGET-MIB",[]), - ?line unload_master("SNMP-TARGET-MIB"), + unload_master("SNMP-TARGET-MIB"), ?DBG("loop_mib_1 -> unload mib SNMP-NOTIFICATION-MIB",[]), - ?line unload_master("SNMP-NOTIFICATION-MIB"), + unload_master("SNMP-NOTIFICATION-MIB"), ?DBG("loop_mib_1 -> unload mib SNMP-FRAMEWORK-MIB",[]), - ?line unload_master("SNMP-FRAMEWORK-MIB"), + unload_master("SNMP-FRAMEWORK-MIB"), ?DBG("loop_mib_1 -> unload mib SNMP-VIEW-BASED-ACM-MIB",[]), - ?line unload_master("SNMP-VIEW-BASED-ACM-MIB"), + unload_master("SNMP-VIEW-BASED-ACM-MIB"), %% snmpa:verbosity(master_agent,log), %% snmpa:verbosity(mib_server,silence), ?IPRINT("loop_mib_1 -> done"), @@ -6530,22 +6530,22 @@ loop_mib_2(Config) when is_list(Config) -> "\tMgrNode: ~p~n" "\tMibDir: ~p", [_SaNode, _MgrNode, _MibDir]), ?DBG("loop_mib_2 -> load mibs",[]), - ?line load_master_std("SNMP-COMMUNITY-MIB"), - ?line load_master_std("SNMP-MPD-MIB"), - ?line load_master_std("SNMP-TARGET-MIB"), - ?line load_master_std("SNMP-NOTIFICATION-MIB"), - ?line load_master_std("SNMP-FRAMEWORK-MIB"), - ?line load_master_std("SNMP-VIEW-BASED-ACM-MIB"), + load_master_std("SNMP-COMMUNITY-MIB"), + load_master_std("SNMP-MPD-MIB"), + load_master_std("SNMP-TARGET-MIB"), + load_master_std("SNMP-NOTIFICATION-MIB"), + load_master_std("SNMP-FRAMEWORK-MIB"), + load_master_std("SNMP-VIEW-BASED-ACM-MIB"), try_test(loop_mib_2_test), ?DBG("loop_mib_2 -> unload mibs",[]), - ?line unload_master("SNMP-COMMUNITY-MIB"), - ?line unload_master("SNMP-MPD-MIB"), - ?line unload_master("SNMP-TARGET-MIB"), - ?line unload_master("SNMP-NOTIFICATION-MIB"), - ?line unload_master("SNMP-FRAMEWORK-MIB"), - ?line unload_master("SNMP-VIEW-BASED-ACM-MIB"), + unload_master("SNMP-COMMUNITY-MIB"), + unload_master("SNMP-MPD-MIB"), + unload_master("SNMP-TARGET-MIB"), + unload_master("SNMP-NOTIFICATION-MIB"), + unload_master("SNMP-FRAMEWORK-MIB"), + unload_master("SNMP-VIEW-BASED-ACM-MIB"), ?IPRINT("loop_mib_2 -> done"), ok. @@ -6559,18 +6559,18 @@ loop_mib_3(Config) when is_list(Config) -> "\tMgrNode: ~p~n" "\tMibDir: ~p", [_SaNode, _MgrNode, _MibDir]), ?DBG("loop_mib_3 -> load mibs",[]), - ?line load_master_std("SNMP-TARGET-MIB"), - ?line load_master_std("SNMP-NOTIFICATION-MIB"), - ?line load_master_std("SNMP-VIEW-BASED-ACM-MIB"), - ?line load_master_std("SNMP-USER-BASED-SM-MIB"), + load_master_std("SNMP-TARGET-MIB"), + load_master_std("SNMP-NOTIFICATION-MIB"), + load_master_std("SNMP-VIEW-BASED-ACM-MIB"), + load_master_std("SNMP-USER-BASED-SM-MIB"), try_test(loop_mib_3_test), ?DBG("loop_mib_3 -> unload mibs",[]), - ?line unload_master("SNMP-TARGET-MIB"), - ?line unload_master("SNMP-NOTIFICATION-MIB"), - ?line unload_master("SNMP-VIEW-BASED-ACM-MIB"), - ?line unload_master("SNMP-USER-BASED-SM-MIB"), + unload_master("SNMP-TARGET-MIB"), + unload_master("SNMP-NOTIFICATION-MIB"), + unload_master("SNMP-VIEW-BASED-ACM-MIB"), + unload_master("SNMP-USER-BASED-SM-MIB"), ?IPRINT("loop_mib_3 -> done"), ok. @@ -6580,7 +6580,7 @@ loop_mib_1_test() -> ?IPRINT("loop_mib_1_test -> entry"), N = loop_it_1([1,1], 0), ?IPRINT("found ~w variables", [N]), - ?line N = if N < 100 -> 100; + N = if N < 100 -> 100; true -> N end. @@ -6598,7 +6598,7 @@ loop_it_1(Oid, N) -> "expected intermediate (get-next) result: " "~n NOid: ~p" "~n Value: ~p", [NOid, _Value]), - ?line [_Value2] = get_req(1, [NOid]), % must not be same + [_Value2] = get_req(1, [NOid]), % must not be same ?IPRINT("loop_it_1_test -> expected intermediate (get) result: " "~n Value2: ~p", [_Value2]), loop_it_1(NOid, N+1); @@ -6609,7 +6609,7 @@ loop_it_1(Oid, N) -> varbinds = Vbs} -> ?EPRINT("loop_it_1_test -> unexpected (get-response) vbs: " "~n Vbs: ~p", [Vbs]), - ?line ?FAIL({unexpected_vbs, + ?FAIL({unexpected_vbs, [{get_next_oid, Oid}, {counter, N}, {varbinds, Vbs}]}); @@ -6629,7 +6629,7 @@ loop_it_1(Oid, N) -> "~n Err: ~p" "~n Idx: ~p" "~n Vbs: ~p", [Err, Idx, Vbs]), - ?line ?FAIL({unexpected_pdu, + ?FAIL({unexpected_pdu, [{get_next_oid, Oid}, {counter, N}, {error_status, Err}, @@ -6645,7 +6645,7 @@ loop_it_1(Oid, N) -> "~n Err: ~p" "~n Idx: ~p" "~n Vbs: ~p", [Type, Err, Idx, Vbs]), - ?line ?FAIL({unexpected_pdu, + ?FAIL({unexpected_pdu, [{get_next_oid, Oid}, {counter, N}, {type, Type}, @@ -6665,7 +6665,7 @@ loop_it_1(Oid, N) -> (SysEvs =:= []) -> ?EPRINT("loop_it_1_test -> error: " "~n ~p", [Reason]), - ?line ?FAIL([{get_next_oid, Oid}, + ?FAIL([{get_next_oid, Oid}, {counter, N}, {reason, Reason}]); @@ -6685,7 +6685,7 @@ loop_mib_2_test() -> ?IPRINT("loop_mib_2_test -> entry"), N = loop_it_2([1,1], 0), ?IPRINT("found ~w variables", [N]), - ?line N = if N < 100 -> 100; + N = if N < 100 -> 100; true -> N end. @@ -6711,7 +6711,7 @@ loop_it_2(Oid, N) -> "expected intermediate (get-next) result: " "~n NOid: ~p" "~n Value: ~p", [NOid, _Value]), - ?line [_Value2] = get_req(1, [NOid]), % must not be same + [_Value2] = get_req(1, [NOid]), % must not be same ?IPRINT("loop_it_2 -> expected intermediate (get) result: " "~n Value2: ~p", [_Value2]), loop_it_2(NOid, N+1); @@ -6722,7 +6722,7 @@ loop_it_2(Oid, N) -> varbinds = Vbs} -> ?EPRINT("loop_it_2 -> unexpected (get-response) vbs: " "~n Vbs: ~p", [Vbs]), - ?line ?FAIL({unexpected_vbs, + ?FAIL({unexpected_vbs, [{get_next_oid, Oid}, {counter, N}, {varbinds, Vbs}]}); @@ -6735,7 +6735,7 @@ loop_it_2(Oid, N) -> "~n ES: ~p" "~n EI: ~p" "~n Vbs: ~p", [ES, EI, Vbs]), - ?line ?FAIL({unexpected_pdu, + ?FAIL({unexpected_pdu, [{get_next_oid, Oid}, {counter, N}, {error_status, ES}, @@ -6751,7 +6751,7 @@ loop_it_2(Oid, N) -> "~n ES: ~p" "~n EI: ~p" "~n Vbs: ~p", [Type, ES, EI, Vbs]), - ?line ?FAIL({unexpected_pdu, + ?FAIL({unexpected_pdu, [{get_next_oid, Oid}, {counter, N}, {type, Type}, @@ -6771,7 +6771,7 @@ loop_it_2(Oid, N) -> (SysEvs =:= []) -> ?EPRINT("loop_it_2 -> error: " "~n ~p", [Reason]), - ?line ?FAIL([{get_next_oid, Oid}, + ?FAIL([{get_next_oid, Oid}, {counter, N}, {reason, Reason}]); @@ -6856,10 +6856,10 @@ otp_1128(Config) when is_list(Config) -> ?P(otp_1128), init_case(Config), - ?line load_master("OLD-SNMPEA-MIB"), - ?line init_old(), + load_master("OLD-SNMPEA-MIB"), + init_old(), try_test(otp_1128_test), - ?line unload_master("OLD-SNMPEA-MIB"), + unload_master("OLD-SNMPEA-MIB"), ok. otp_1128_2(X) -> ?P(otp_1128_2), otp_1128(X). @@ -6874,15 +6874,15 @@ otp_1128_test() -> NewKeyc5 = [intCommunityStatus,get(mip),is("test")], s([{NewKeyc5, ?createAndWait}, {NewKeyc4, 2}]), - ?line ?expect1([{NewKeyc5, ?createAndWait}, {NewKeyc4, 2}]), + ?expect1([{NewKeyc5, ?createAndWait}, {NewKeyc4, 2}]), g([NewKeyc5]), - ?line ?expect1([{NewKeyc5, ?notReady}]), + ?expect1([{NewKeyc5, ?notReady}]), s([{NewKeyc5, ?active}, {NewKeyc3, 2}]), - ?line ?expect1([{NewKeyc5, ?active}, {NewKeyc3, 2}]), + ?expect1([{NewKeyc5, ?active}, {NewKeyc3, 2}]), g([NewKeyc5]), - ?line ?expect1([{NewKeyc5, ?active}]), + ?expect1([{NewKeyc5, ?active}]), s([{NewKeyc5, ?destroy}]), - ?line ?expect1([{NewKeyc5, ?destroy}]), + ?expect1([{NewKeyc5, ?destroy}]), ok. @@ -6893,9 +6893,9 @@ otp_1128_test() -> otp_1129(Config) when is_list(Config) -> ?P(otp_1129), init_case(Config), - ?line load_master("Klas3"), + load_master("Klas3"), try_test(otp_1129_i, [node()]), - ?line unload_master("Klas3"), + unload_master("Klas3"), ok. otp_1129_2(X) -> ?P(otp_1129_2), otp_1129(X). @@ -6918,9 +6918,9 @@ otp_1131(Config) when is_list(Config) -> ?P(otp_1131), init_case(Config), - ?line load_master("Klas1"), + load_master("Klas1"), try_test(otp_1131_test), - ?line unload_master("Klas1"). + unload_master("Klas1"). otp_1131_2(X) -> ?P(otp_1131_2), otp_1131(X). @@ -6973,7 +6973,7 @@ otp_1131_test() -> io:format("Testing bug reported in ticket OTP-1131...~n"), s([{[friendsEntry, [2, 3, 1]], s, "kompis3"}, {[friendsEntry, [3, 3, 1]], i, ?createAndGo}]), - ?line ?expect3(?v1_2(noSuchName, noCreation), 2, any), + ?expect3(?v1_2(noSuchName, noCreation), 2, any), ok. @@ -6984,7 +6984,7 @@ otp_1131_test() -> otp_1162(Config) when is_list(Config) -> ?P(otp_1162), {SaNode, _MgrNode, _MibDir} = init_case(Config), - ?line {ok, SA} = start_subagent(SaNode, ?sa, "SA-MIB"), + {ok, SA} = start_subagent(SaNode, ?sa, "SA-MIB"), try_test(otp_1162_test), stop_subagent(SA). @@ -6994,7 +6994,7 @@ otp_1162_3(X) -> ?P(otp_1162_3), otp_1162(X). otp_1162_test() -> s([{[sa, [2,0]], 6}]), % wrongValue (i is_set_ok) - ?line ?expect3(?v1_2(badValue, wrongValue), 1, any), + ?expect3(?v1_2(badValue, wrongValue), 1, any), ok. @@ -7005,11 +7005,11 @@ otp_1162_test() -> otp_1222(Config) when is_list(Config) -> ?P(otp_1222), init_case(Config), - ?line load_master("Klas3"), - ?line load_master("Klas4"), + load_master("Klas3"), + load_master("Klas4"), try_test(otp_1222_test), - ?line unload_master("Klas3"), - ?line unload_master("Klas4"), + unload_master("Klas3"), + unload_master("Klas4"), ok. otp_1222_2(X) -> ?P(otp_1222_2), otp_1222(X). @@ -7019,9 +7019,9 @@ otp_1222_3(X) -> ?P(otp_1222_3), otp_1222(X). otp_1222_test() -> io:format("Testing bug reported in ticket OTP-1222...~n"), s([{[fStatus4,1], 4}, {[fName4,1], 1}]), - ?line ?expect3(genErr, 0, any), + ?expect3(genErr, 0, any), s([{[fStatus4,2], 4}, {[fName4,2], 1}]), - ?line ?expect3(genErr, 0, any), + ?expect3(genErr, 0, any), ok. @@ -7033,9 +7033,9 @@ otp_1298(Config) when is_list(Config) -> ?P(otp_1298), init_case(Config), - ?line load_master("Klas2"), + load_master("Klas2"), try_test(otp_1298_test), - ?line unload_master("Klas2"), + unload_master("Klas2"), ok. otp_1298_2(X) -> ?P(otp_1298_2), otp_1298(X). @@ -7045,7 +7045,7 @@ otp_1298_3(X) -> ?P(otp_1298_3), otp_1298(X). otp_1298_test() -> io:format("Testing bug reported in ticket OTP-1298...~n"), s([{[fint,0], -1}]), - ?line ?expect1([{[fint,0], -1}]), + ?expect1([{[fint,0], -1}]), ok. @@ -7056,10 +7056,10 @@ otp_1298_test() -> otp_1331(Config) when is_list(Config) -> ?P(otp_1331), init_case(Config), - ?line load_master("OLD-SNMPEA-MIB"), - ?line init_old(), + load_master("OLD-SNMPEA-MIB"), + init_old(), try_test(otp_1331_test), - ?line unload_master("OLD-SNMPEA-MIB"), + unload_master("OLD-SNMPEA-MIB"), ok. otp_1331_2(X) -> ?P(otp_1331_2), otp_1331(X). @@ -7069,7 +7069,7 @@ otp_1331_3(X) -> ?P(otp_1331_3), otp_1331(X). otp_1331_test() -> NewKeyc5 = [intCommunityStatus,[127,32,0,0],is("test")], s([{NewKeyc5, ?destroy}]), - ?line ?expect1([{NewKeyc5, ?destroy}]), + ?expect1([{NewKeyc5, ?destroy}]), ok. @@ -7081,9 +7081,9 @@ otp_1338(Config) when is_list(Config) -> ?P(otp_1338), init_case(Config), - ?line load_master("Klas2"), + load_master("Klas2"), try_test(otp_1338_test), - ?line unload_master("Klas2"). + unload_master("Klas2"). otp_1338_2(X) -> ?P(otp_1338_2), otp_1338(X). @@ -7091,9 +7091,9 @@ otp_1338_3(X) -> ?P(otp_1338_3), otp_1338(X). otp_1338_test() -> s([{[kStatus2, 7], i, ?createAndGo}]), - ?line ?expect1([{[kStatus2, 7], ?createAndGo}]), + ?expect1([{[kStatus2, 7], ?createAndGo}]), g([[kName2, 7]]), - ?line ?expect1([{[kName2, 7], "JJJ"}]). + ?expect1([{[kName2, 7], "JJJ"}]). %%----------------------------------------------------------------- @@ -7104,9 +7104,9 @@ otp_1338_test() -> otp_1342(Config) when is_list(Config) -> ?P(otp_1342), init_case(Config), - ?line load_master("Klas4"), + load_master("Klas4"), try_test(otp_1342_test), - ?line unload_master("Klas4"), + unload_master("Klas4"), ok. otp_1342_2(X) -> ?P(otp_1342_2), otp_1342(X). @@ -7117,7 +7117,7 @@ otp_1342_test() -> s([{[fIndex5, 1], i, 1}, {[fName5, 1], i, 3}, {[fStatus5, 1], i, ?createAndGo}]), - ?line ?expect3(?v1_2(noSuchName, noCreation), 3, any), + ?expect3(?v1_2(noSuchName, noCreation), 3, any), ok. @@ -7130,10 +7130,10 @@ otp_1342_test() -> otp_1366(Config) when is_list(Config) -> ?P(otp_1366), init_case(Config), - ?line load_master("OLD-SNMPEA-MIB"), - ?line init_old(), + load_master("OLD-SNMPEA-MIB"), + init_old(), try_test(otp_1366_test), - ?line unload_master("OLD-SNMPEA-MIB"), + unload_master("OLD-SNMPEA-MIB"), ok. otp_1366_2(X) -> ?P(otp_1366_2), otp_1366(X). @@ -7184,7 +7184,7 @@ otp_2776_test() -> {10, false, Dt10_invalid}, {11, false, Dt11_invalid}], - ?line ok = validate_dat(L). + ok = validate_dat(L). validate_dat(L) -> validate_dat(L,[]). @@ -7218,10 +7218,10 @@ validate_dat2(Id, E, Dat) -> otp_2979(Config) when is_list(Config) -> ?P(otp_2979), init_case(Config), - ?line load_master("Test1"), - ?line init_old(), + load_master("Test1"), + init_old(), try_test(otp_2979_test), - ?line unload_master("Test1"). + unload_master("Test1"). otp_2979_2(X) -> ?P(otp_2979_2), otp_2979(X). @@ -7229,7 +7229,7 @@ otp_2979_3(X) -> ?P(otp_2979_3), otp_2979(X). otp_2979_test() -> gn([[sparseDescr], [sparseStatus]]), - ?line ?expect1([{[sparseStr,0], "slut"}, + ?expect1([{[sparseStr,0], "slut"}, {[sparseStr,0], "slut"}]), ok. @@ -7242,19 +7242,19 @@ otp_2979_test() -> otp_3187(Config) when is_list(Config) -> ?P(otp_3187), init_case(Config), - ?line load_master_std("SNMP-VIEW-BASED-ACM-MIB"), + load_master_std("SNMP-VIEW-BASED-ACM-MIB"), otp_3187_test(), - ?line unload_master("SNMP-VIEW-BASED-ACM-MIB"). + unload_master("SNMP-VIEW-BASED-ACM-MIB"). otp_3187_2(X) -> ?P(otp_3187_2), otp_3187(X). otp_3187_3(X) -> ?P(otp_3187_3), otp_3187(X). otp_3187_test() -> - ?line Elements = + Elements = snmp_view_based_acm_mib:vacmAccessTable(get_next,[],[4,5,6]), lists:foreach(fun(E) -> - ?line if E == endOfTable -> + if E == endOfTable -> ?FAIL(endOfTable); true -> ok end @@ -7271,7 +7271,7 @@ otp_3542(Config) when is_list(Config) -> otp_3542_test() -> io:format("SNMP v3 discovery...~n"), - ?line Res = snmp_test_mgr:d(), + Res = snmp_test_mgr:d(), io:format("SNMP v3 discovery result: ~p~n",[Res]). @@ -7283,52 +7283,52 @@ otp_3725(Config) when is_list(Config) -> ?P(otp_3725), init_case(Config), - ?line load_master("OLD-SNMPEA-MIB"), - ?line init_old(), + load_master("OLD-SNMPEA-MIB"), + init_old(), try_test(otp_3725_test, [node()]), - ?line unload_master("OLD-SNMPEA-MIB"). + unload_master("OLD-SNMPEA-MIB"). %% Req. OLD-SNMPEA-MIB otp_3725_test(MaNode) -> io:format("Testing feature requested in ticket OTP-3725...~n"), - ?line rpc:call(MaNode,snmpa,verbosity,[symbolic_store,trace]), - ?line Db = rpc:call(MaNode, snmpa, get_symbolic_store_db, []), + rpc:call(MaNode,snmpa,verbosity,[symbolic_store,trace]), + Db = rpc:call(MaNode, snmpa, get_symbolic_store_db, []), ?DBG("otp_3725_test -> Db = ~p", [Db]), - ?line {value, OID} = rpc:call(MaNode, snmpa, name_to_oid, + {value, OID} = rpc:call(MaNode, snmpa, name_to_oid, [Db, intAgentIpAddress]), ?DBG("otp_3725_test -> name_to_oid for ~p: ~p", [intAgentIpAddress,OID]), - ?line {value, intAgentIpAddress} = rpc:call(MaNode, snmpa, oid_to_name, + {value, intAgentIpAddress} = rpc:call(MaNode, snmpa, oid_to_name, [Db,OID]), ?DBG("otp_3725_test -> oid_to_name for ~p: ~p", [OID, intAgentIpAddress]), - ?line false = rpc:call(MaNode, snmpa, name_to_oid, [Db, intAgentIpAddres]), - ?line false = rpc:call(MaNode, snmpa, oid_to_name, + false = rpc:call(MaNode, snmpa, name_to_oid, [Db, intAgentIpAddres]), + false = rpc:call(MaNode, snmpa, oid_to_name, [Db, [1,5,32,3,54,3,3,34,4]]), - ?line {value, 2} = rpc:call(MaNode, snmpa, enum_to_int, + {value, 2} = rpc:call(MaNode, snmpa, enum_to_int, [Db, intViewType, excluded]), - ?line {value, excluded} = rpc:call(MaNode, snmpa, int_to_enum, + {value, excluded} = rpc:call(MaNode, snmpa, int_to_enum, [Db, intViewType, 2]), - ?line false = rpc:call(MaNode, snmpa, enum_to_int, + false = rpc:call(MaNode, snmpa, enum_to_int, [Db, intViewType, exclude]), - ?line false = rpc:call(MaNode, snmpa, enum_to_int, + false = rpc:call(MaNode, snmpa, enum_to_int, [Db, intAgentIpAddress, exclude]), - ?line false = rpc:call(MaNode, snmpa, enum_to_int, + false = rpc:call(MaNode, snmpa, enum_to_int, [Db, intAgentIpAddre, exclude]), - ?line false = rpc:call(MaNode, snmpa, int_to_enum, [Db, intViewType, 3]), - ?line false = rpc:call(MaNode, snmpa, int_to_enum, + false = rpc:call(MaNode, snmpa, int_to_enum, [Db, intViewType, 3]), + false = rpc:call(MaNode, snmpa, int_to_enum, [Db, intAgentIpAddress, 2]), - ?line false = rpc:call(MaNode, snmpa, int_to_enum, + false = rpc:call(MaNode, snmpa, int_to_enum, [Db, intAgentIpAddre, 2]), - ?line {value, active} = rpc:call(MaNode, snmpa, int_to_enum, + {value, active} = rpc:call(MaNode, snmpa, int_to_enum, [Db, 'RowStatus', ?active]), - ?line {value, ?destroy} = rpc:call(MaNode, snmpa, enum_to_int, + {value, ?destroy} = rpc:call(MaNode, snmpa, enum_to_int, [Db, 'RowStatus', destroy]), - ?line false = rpc:call(MaNode, snmpa, enum_to_int, + false = rpc:call(MaNode, snmpa, enum_to_int, [Db, 'RowStatus', xxxdestroy]), - ?line false = rpc:call(MaNode, snmpa, enum_to_int, + false = rpc:call(MaNode, snmpa, enum_to_int, [Db, 'xxRowStatus', destroy]), - ?line false = rpc:call(MaNode, snmpa, int_to_enum, [Db, 'RowStatus', 25]), - ?line false = rpc:call(MaNode, snmpa, int_to_enum, [Db, 'xxRowStatus', 1]), + false = rpc:call(MaNode, snmpa, int_to_enum, [Db, 'RowStatus', 25]), + false = rpc:call(MaNode, snmpa, int_to_enum, [Db, 'xxRowStatus', 1]), ok. @@ -7340,10 +7340,10 @@ otp_3725_test(MaNode) -> otp_4394_init(Config) when is_list(Config) -> ?DBG("otp_4394_init -> entry with" "~n Config: ~p", [Config]), - ?line AgentConfDir = ?config(agent_conf_dir, Config), - ?line MgrDir = ?config(mgr_dir, Config), - ?line Ip = ?config(ip, Config), - ?line otp_4394_config(AgentConfDir, MgrDir, Ip), + AgentConfDir = ?config(agent_conf_dir, Config), + MgrDir = ?config(mgr_dir, Config), + Ip = ?config(ip, Config), + otp_4394_config(AgentConfDir, MgrDir, Ip), MasterAgentVerbosity = {master_agent_verbosity, trace}, NetIfVerbosity = {net_if_verbosity, trace}, Opts = [MasterAgentVerbosity, NetIfVerbosity], @@ -7356,21 +7356,21 @@ otp_4394_config(AgentConfDir, MgrDir, Ip0) -> "~n Ip0: ~p", [AgentConfDir, MgrDir, Ip0]), Vsn = [v1], Ip = tuple_to_list(Ip0), - ?line snmp_config:write_agent_snmp_files(AgentConfDir, Vsn, Ip, + snmp_config:write_agent_snmp_files(AgentConfDir, Vsn, Ip, ?TRAP_UDP, Ip, 4000, "OTP-4394 test"), - ?line case update_usm(Vsn, AgentConfDir) of + case update_usm(Vsn, AgentConfDir) of true -> - ?line copy_file(join(AgentConfDir, "usm.conf"), + copy_file(join(AgentConfDir, "usm.conf"), join(MgrDir, "usm.conf")), - ?line update_usm_mgr(Vsn, MgrDir); + update_usm_mgr(Vsn, MgrDir); false -> - ?line ok + ok end, C1 = {"a", "all-rights", "initial", "", "pc"}, C2 = {"c", "secret", "secret_name", "", "secret_tag"}, - ?line write_community_conf(AgentConfDir, [C1, C2]), - ?line update_vacm(Vsn, AgentConfDir), + write_community_conf(AgentConfDir, [C1, C2]), + update_vacm(Vsn, AgentConfDir), Ta1 = {"shelob v1", [134,138,177,177], 5000, 1500, 3, %% Use Ip and modify "pc1", @@ -7384,9 +7384,9 @@ otp_4394_config(AgentConfDir, MgrDir, Ip0) -> "target_v1", "", %% [255,255,255,255,0,0], [], 2048}, - ?line write_target_addr_conf(AgentConfDir, [Ta1, Ta2]), - ?line write_target_params_conf(AgentConfDir, Vsn), - ?line write_notify_conf(AgentConfDir), + write_target_addr_conf(AgentConfDir, [Ta1, Ta2]), + write_target_params_conf(AgentConfDir, Vsn), + write_notify_conf(AgentConfDir), ok. otp_4394_finish(Config) when is_list(Config) -> @@ -7433,10 +7433,10 @@ otp_7157_init(Config) when is_list(Config) -> ?DBG("init_otp_7157 -> entry with" "~n Config: ~p", [Config]), - ?line AgentConfDir = ?config(agent_conf_dir, Config), - ?line MgrDir = ?config(mgr_dir, Config), - ?line Ip = ?config(ip, Config), - ?line config([v2], MgrDir, AgentConfDir, + AgentConfDir = ?config(agent_conf_dir, Config), + MgrDir = ?config(mgr_dir, Config), + Ip = ?config(ip, Config), + config([v2], MgrDir, AgentConfDir, tuple_to_list(Ip), tuple_to_list(Ip)), MasterAgentVerbosity = {master_agent_verbosity, trace}, NetIfVerbosity = {net_if_verbosity, trace}, @@ -7456,9 +7456,9 @@ otp_7157(Config) -> ?DBG("otp_7157 -> entry", []), init_case(Config), MA = whereis(snmp_master_agent), - ?line load_master("Test1"), + load_master("Test1"), try_test(otp_7157_test, [MA]), - ?line unload_master("Test1"), + unload_master("Test1"), ?DBG("otp_7157 -> done", []), ok. @@ -7475,7 +7475,7 @@ otp_7157_test(MA) -> ?DBG("await response",[]), %% We don't really care about the values, just the vb order. - ?line ok = ?expect2(v2trap, [{[sysUpTime, 0], any}, + ok = ?expect2(v2trap, [{[sysUpTime, 0], any}, {[snmpTrapOID, 0], any}, {[sysContact, 0], any}, {[cnt64, 0], any}, @@ -7579,8 +7579,8 @@ otp_16092_try(TC) -> end. otp_16092_simple_start_and_stop(Config, ESO, Expected) -> - ?line ConfDir = ?config(agent_conf_dir, Config), - ?line DbDir = ?config(agent_db_dir, Config), + ConfDir = ?config(agent_conf_dir, Config), + DbDir = ?config(agent_db_dir, Config), ?NPRINT("try start agent node"), {ok, Peer, Node} = ?START_PEER("-agent"), @@ -8065,7 +8065,7 @@ otp16649(N, Config) -> AgentNode = ?config(agent_node, Config), ManagerNode = ?config(manager_node, Config), - ?line AInfo = rpc:call(AgentNode, snmpa, info, []), + AInfo = rpc:call(AgentNode, snmpa, info, []), ?IPRINT("Agent Info: " "~n ~p", [AInfo]), @@ -8098,25 +8098,25 @@ otp16649(N, Config) -> AgentTrapPortNo = otp16649_which_trap_port_no(TIs), ?IPRINT("(mgr) register user"), - ?line ok = otp16649_mgr_reg_user(ManagerNode), + ok = otp16649_mgr_reg_user(ManagerNode), ?IPRINT("(mgr) register agent"), TargetBase = "otp16649-agent-", ReqTarget = TargetBase ++ "req", TrapTarget = TargetBase ++ "trap", - ?line ok = otp16649_mgr_reg_agent(ManagerNode, + ok = otp16649_mgr_reg_agent(ManagerNode, ?config(ipfamily, Config), ?config(tdomain, Config), ReqTarget, AgentReqPortNo), - ?line ok = otp16649_mgr_reg_agent(ManagerNode, + ok = otp16649_mgr_reg_agent(ManagerNode, ?config(ipfamily, Config), ?config(tdomain, Config), TrapTarget, AgentTrapPortNo), ?IPRINT("(mgr) simple (sync) get request"), Oids = [?sysObjectID_instance, ?sysDescr_instance, ?sysUpTime_instance], - ?line ok = case otp16649_mgr_get_req(ManagerNode, Oids) of + ok = case otp16649_mgr_get_req(ManagerNode, Oids) of {ok, {noError, 0, ReplyOids}, _} -> ?IPRINT("(mgr) simple (sync) successful reply: " "~n ~p", [ReplyOids]), @@ -8133,10 +8133,10 @@ otp16649(N, Config) -> ?IPRINT("load TestTrap..."), MibDir = ?config(mib_dir, Config), - ?line ok = otp16649_agent_load_mib(AgentNode, MibDir, "TestTrap"), + ok = otp16649_agent_load_mib(AgentNode, MibDir, "TestTrap"), ?IPRINT("(agent) send trap (testTrap2)"), - ?line ok = otp16649_agent_send_trap(AgentNode, testTrap2), + ok = otp16649_agent_send_trap(AgentNode, testTrap2), TDomain = ?config(tdomain, Config), @@ -8154,7 +8154,7 @@ otp16649(N, Config) -> case TDomain of transportDomainUdpIpv4 -> ?IPRINT("TIMEOUT"), - ?line exit(timeout); + exit(timeout); transportDomainUdpIpv6 -> ?IPRINT("expected timeout - " "v1 trap's can only be sent on IPv4 domains"), @@ -8164,10 +8164,10 @@ otp16649(N, Config) -> ?IPRINT("load TestTrapv2..."), - ?line ok = otp16649_agent_load_mib(AgentNode, MibDir, "TestTrapv2"), + ok = otp16649_agent_load_mib(AgentNode, MibDir, "TestTrapv2"), ?IPRINT("(agent) send trap (testTrapv22)"), - ?line ok = otp16649_agent_send_trap(AgentNode, testTrapv22), + ok = otp16649_agent_send_trap(AgentNode, testTrapv22), receive {handle_trap, From_v2, TrapTarget, @@ -8179,7 +8179,7 @@ otp16649(N, Config) -> after 5000 -> ?IPRINT("TIMEOUT"), - ?line exit(timeout) + exit(timeout) end, ?IPRINT("done"), @@ -8247,7 +8247,7 @@ otp16649_init(N, AgentPreTransports, Config) -> AgentPreTransports2 = [F(T) || T <- AgentPreTransports], ?IPRINT("write agent config files"), - ?line ok = snmp_config:write_agent_snmp_files( + ok = snmp_config:write_agent_snmp_files( AgentConfDir, Vsns, TransportDomain, {ManagerIP, ?MGR_PORT}, AgentPreTransports2, "test"), @@ -8273,15 +8273,15 @@ otp16649_init(N, AgentPreTransports, Config) -> MgrTopDir = ?config(manager_top_dir, Config), MgrDbDir = filename:join(MgrTopDir, "db/"), MgrConfDir = filename:join(MgrTopDir, "conf/"), - ?line ok = file:make_dir(MgrConfDir), + ok = file:make_dir(MgrConfDir), MgrDbDir = filename:join(MgrTopDir, "db/"), - ?line ok = file:make_dir(MgrDbDir), + ok = file:make_dir(MgrDbDir), MgrLogDir = filename:join(MgrTopDir, "log/"), - ?line ok = file:make_dir(MgrLogDir), + ok = file:make_dir(MgrLogDir), ?IPRINT("write manager config files"), MgrTransports = [{TransportDomain, {ManagerIP0, ?MGR_PORT}}], - ?line ok = snmp_config:write_manager_snmp_files( + ok = snmp_config:write_manager_snmp_files( MgrConfDir, MgrTransports, ?MGR_MMS, ?MGR_ENGINE_ID), @@ -8291,7 +8291,7 @@ otp16649_init(N, AgentPreTransports, Config) -> {manager_log_dir, MgrLogDir} | Config2], ?IPRINT("start manager"), - ?line ok = start_manager(Config3), + ok = start_manager(Config3), ?DBG("otp16649_init -> done when" "~n Config2: ~p", [Config3]), @@ -8310,7 +8310,7 @@ otp16649_fin(N, Config) when is_integer(N) -> %% so logs and files can be closed in the proper way). %% - ?line AgentTopSup = ?config(agent_sup, Config), + AgentTopSup = ?config(agent_sup, Config), stop_standalone_agent(AgentTopSup), @@ -8525,7 +8525,7 @@ start_agent(Config, Opts) -> process_flag(trap_exit, true), - ?line {ok, AgentTopSup} = start_standalone_agent(AgentNode, AgentConfig), + {ok, AgentTopSup} = start_standalone_agent(AgentNode, AgentConfig), [{agent_sup, AgentTopSup} | Config]. @@ -8620,7 +8620,7 @@ start_manager(Config) -> {net_if, [{verbosity, trace}]}, {note_store, [{verbosity, trace}]}, {config, [{verbosity, trace}, {dir, ConfDir}, {db_dir, DbDir}]}], - ?line ok = start_standalone_manager(Node, Opts). + ok = start_standalone_manager(Node, Opts). start_standalone_manager(Node, Config) -> @@ -8661,13 +8661,13 @@ info_test(Config) when is_list(Config) -> ?P(info_test), init_case(Config), - ?line load_master("OLD-SNMPEA-MIB"), - ?line init_old(), + load_master("OLD-SNMPEA-MIB"), + init_old(), try_test(do_info, [node()]), - ?line unload_master("OLD-SNMPEA-MIB"). + unload_master("OLD-SNMPEA-MIB"). do_info(MaNode) -> - ?line Info = rpc:call(MaNode, snmpa, info, []), + Info = rpc:call(MaNode, snmpa, info, []), ?DBG("info_test1 -> Info: ~n~p", [Info]), Keys = [vsns, stats_counters, diff --git a/lib/snmp/test/snmp_agent_mibs_SUITE.erl b/lib/snmp/test/snmp_agent_mibs_SUITE.erl index db4699e6a9..5dc9ff213f 100644 --- a/lib/snmp/test/snmp_agent_mibs_SUITE.erl +++ b/lib/snmp/test/snmp_agent_mibs_SUITE.erl @@ -163,7 +163,7 @@ init_per_testcase(Case, Config0) when is_list(Config0) -> Config1 = ?LIB:fix_data_dir(Config0), CaseTopDir = ?LIB:init_testcase_top_dir(Case, Config1), DbDir = join(CaseTopDir, "db_dir/"), - ?line ok = file:make_dir(DbDir), + ok = file:make_dir(DbDir), init_per_testcase2(Case, [{db_dir, DbDir}, {case_top_dir, CaseTopDir} | Config1]). @@ -223,13 +223,13 @@ do_start_and_stop(_Config) -> Prio = normal, Verbosity = trace, - ?line sym_start(Prio, Verbosity), - ?line MibsPid = mibs_start(Prio, Verbosity), + sym_start(Prio, Verbosity), + MibsPid = mibs_start(Prio, Verbosity), - ?line mibs_info(MibsPid), + mibs_info(MibsPid), - ?line mibs_stop(MibsPid), - ?line sym_stop(), + mibs_stop(MibsPid), + sym_stop(), ok. @@ -248,44 +248,44 @@ do_load_unload(Config) -> MibDir = ?config(data_dir, Config), ?DBG("load_unload -> start symbolic store", []), - ?line sym_start(Prio, Verbosity), + sym_start(Prio, Verbosity), ?DBG("load_unload -> start mib server", []), - ?line MibsPid = mibs_start(Prio, Verbosity), + MibsPid = mibs_start(Prio, Verbosity), ?DBG("load_unload -> load one not already loaded mib", []), - ?line ok = verify_loaded_mibs(MibsPid, MibDir, []), - ?line ok = load_mibs(MibsPid, MibDir, ["Test2"]), - ?line ok = verify_loaded_mibs(MibsPid, MibDir, ["Test2"]), + ok = verify_loaded_mibs(MibsPid, MibDir, []), + ok = load_mibs(MibsPid, MibDir, ["Test2"]), + ok = verify_loaded_mibs(MibsPid, MibDir, ["Test2"]), ?DBG("load_unload -> try load one *already loaded* mib", []), EMib = join(MibDir, "Test2"), - ?line {error, {'load aborted at', EMib, already_loaded}} = + {error, {'load aborted at', EMib, already_loaded}} = load_mibs(MibsPid, MibDir, ["Test2"]), ?DBG("load_unload -> load 2 not already loaded mibs", []), - ?line ok = load_mibs(MibsPid, MibDir, ["TestTrap", "TestTrapv2"]), - ?line ok = verify_loaded_mibs(MibsPid, MibDir, + ok = load_mibs(MibsPid, MibDir, ["TestTrap", "TestTrapv2"]), + ok = verify_loaded_mibs(MibsPid, MibDir, ["Test2", "TestTrap", "TestTrapv2"]), ?DBG("load_unload -> unload one loaded mib", []), - ?line ok = unload_mibs(MibsPid, ["Test2"]), - ?line ok = verify_loaded_mibs(MibsPid, MibDir, ["TestTrap", "TestTrapv2"]), + ok = unload_mibs(MibsPid, ["Test2"]), + ok = verify_loaded_mibs(MibsPid, MibDir, ["TestTrap", "TestTrapv2"]), ?DBG("load_unload -> try unload two loaded mibs and one not loaded", []), - ?line {error, {'unload aborted at', "Test2", not_loaded}} = + {error, {'unload aborted at', "Test2", not_loaded}} = unload_mibs(MibsPid, ["TestTrap","Test2","TestTrapv2"]), - ?line ok = verify_loaded_mibs(MibsPid, MibDir, ["TestTrapv2"]), + ok = verify_loaded_mibs(MibsPid, MibDir, ["TestTrapv2"]), ?DBG("load_unload -> unload the remaining loaded mib", []), - ?line ok = unload_mibs(MibsPid, ["TestTrapv2"]), - ?line ok = verify_loaded_mibs(MibsPid, MibDir, []), + ok = unload_mibs(MibsPid, ["TestTrapv2"]), + ok = verify_loaded_mibs(MibsPid, MibDir, []), ?DBG("load_unload -> stop mib server", []), - ?line mibs_stop(MibsPid), + mibs_stop(MibsPid), ?DBG("load_unload -> stop symbolic store", []), - ?line sym_stop(), + sym_stop(), ?DBG("load_unload -> done", []), ok. @@ -369,9 +369,9 @@ do_size_check(Config) -> StdMibDir = filename:join(code:priv_dir(snmp), "mibs") ++ "/", ?IPRINT("do_size_check -> start symbolic store", []), - ?line sym_start(Prio, MibStorage, Verbosity), + sym_start(Prio, MibStorage, Verbosity), ?IPRINT("do_size_check -> start mib server", []), - ?line MibsPid = mibs_start(Prio, MibStorage, Verbosity), + MibsPid = mibs_start(Prio, MibStorage, Verbosity), Mibs = ["Test2", "TestTrap", "TestTrapv2"], StdMibs = ["OTP-SNMPEA-MIB", @@ -387,23 +387,23 @@ do_size_check(Config) -> "SNMPv2-TM"], ?IPRINT("do_size_check -> load std mibs", []), - ?line load_mibs(MibsPid, StdMibDir, StdMibs), + load_mibs(MibsPid, StdMibDir, StdMibs), ?IPRINT("do_size_check -> load (own) mibs", []), - ?line load_mibs(MibsPid, MibDir, Mibs), + load_mibs(MibsPid, MibDir, Mibs), ?SLEEP(2000), ?IPRINT("do_size_check -> display mem usage", []), - ?line display_memory_usage(MibsPid), + display_memory_usage(MibsPid), ?IPRINT("do_size_check -> unload (own) mibs", []), - ?line unload_mibs(MibsPid, Mibs), + unload_mibs(MibsPid, Mibs), ?IPRINT("do_size_check -> unload std mibs", []), - ?line unload_mibs(MibsPid, StdMibs), + unload_mibs(MibsPid, StdMibs), ?IPRINT("do_size_check -> stop mib server", []), - ?line mibs_stop(MibsPid), + mibs_stop(MibsPid), ?IPRINT("do_size_check -> stop symbolic store", []), - ?line sym_stop(), + sym_stop(), ?IPRINT("do_size_check -> done", []), ok. @@ -434,33 +434,33 @@ do_me_lookup(Config) -> "SNMPv2-TM"], ?DBG("me_lookup -> start symbolic store", []), - ?line sym_start(Prio, Verbosity), + sym_start(Prio, Verbosity), ?DBG("me_lookup -> start mib server", []), - ?line MibsPid = mibs_start(Prio, Verbosity), + MibsPid = mibs_start(Prio, Verbosity), ?DBG("me_lookup -> load mibs", []), - ?line load_mibs(MibsPid, MibDir, Mibs), + load_mibs(MibsPid, MibDir, Mibs), ?DBG("me_lookup -> load std mibs", []), - ?line load_mibs(MibsPid, StdMibDir, StdMibs), + load_mibs(MibsPid, StdMibDir, StdMibs), ?DBG("me_lookup -> find ~w from SNMP-COMMUNITY-MIB", [?snmpTrapCommunity_instance]), - ?line ok = me_lookup(MibsPid, ?snmpTrapCommunity_instance), + ok = me_lookup(MibsPid, ?snmpTrapCommunity_instance), ?DBG("me_lookup -> find ~w from SNMP-VIEW-BASED-ACM-MIB", [?vacmViewSpinLock_instance]), - ?line ok = me_lookup(MibsPid, ?vacmViewSpinLock_instance), + ok = me_lookup(MibsPid, ?vacmViewSpinLock_instance), ?DBG("me_lookup -> find ~w from SNMP-USER-BASED-SM-MIB", [?usmStatsNotInTimeWindows_instance]), - ?line {error, _} = me_lookup(MibsPid, ?usmStatsNotInTimeWindows_instance), + {error, _} = me_lookup(MibsPid, ?usmStatsNotInTimeWindows_instance), ?DBG("me_lookup -> stop mib server", []), - ?line mibs_stop(MibsPid), + mibs_stop(MibsPid), ?DBG("me_lookup -> stop symbolic store", []), - ?line sym_stop(), + sym_stop(), ok. @@ -490,36 +490,36 @@ do_which_mib(Config) -> "SNMPv2-TM"], ?DBG("which_mib -> start symbolic store", []), - ?line sym_start(Prio, Verbosity), + sym_start(Prio, Verbosity), ?DBG("which_mib -> start mib server", []), - ?line MibsPid = mibs_start(Prio, Verbosity), + MibsPid = mibs_start(Prio, Verbosity), ?DBG("which_mib -> load mibs", []), - ?line load_mibs(MibsPid, MibDir, Mibs), + load_mibs(MibsPid, MibDir, Mibs), ?DBG("which_mib -> load std mibs", []), - ?line load_mibs(MibsPid, StdMibDir, StdMibs), + load_mibs(MibsPid, StdMibDir, StdMibs), ?DBG("which_mib -> find ~w from SNMP-COMMUNITY-MIB", [?snmpTrapCommunity_instance]), - ?line ok = which_mib(MibsPid, ?snmpTrapCommunity_instance, + ok = which_mib(MibsPid, ?snmpTrapCommunity_instance, "SNMP-COMMUNITY-MIB"), ?DBG("which_mib -> find ~w from SNMP-VIEW-BASED-ACM-MIB", [?vacmViewSpinLock_instance]), - ?line ok = which_mib(MibsPid, ?vacmViewSpinLock_instance, + ok = which_mib(MibsPid, ?vacmViewSpinLock_instance, "SNMP-VIEW-BASED-ACM-MIB"), ?DBG("which_mib -> find ~w from SNMP-USER-BASED-SM-MIB (not loaded)", [?usmStatsNotInTimeWindows_instance]), - ?line {error, _} = which_mib(MibsPid, ?usmStatsNotInTimeWindows_instance, + {error, _} = which_mib(MibsPid, ?usmStatsNotInTimeWindows_instance, "SNMP-USER-BASED-SM-MIB"), ?DBG("which_mib -> stop mib server", []), - ?line mibs_stop(MibsPid), + mibs_stop(MibsPid), ?DBG("which_mib -> stop symbolic store", []), - ?line sym_stop(), + sym_stop(), ok. @@ -552,7 +552,7 @@ do_cache_test(Config) -> "SNMPv2-TM"], ?IPRINT("cache_test -> start symbolic store"), - ?line sym_start(Prio, MibStorage, silence), % Verbosity), + sym_start(Prio, MibStorage, silence), % Verbosity), ?IPRINT("cache_test -> start mib server"), GcLimit = 3, @@ -561,25 +561,25 @@ do_cache_test(Config) -> {age, Age}, {gclimit, GcLimit}, {gcverbose, true}], - ?line MibsPid = mibs_start(Prio, MibStorage, [], Verbosity, CacheOpts), + MibsPid = mibs_start(Prio, MibStorage, [], Verbosity, CacheOpts), ?NPRINT("Info before load mibs: " "~n ~p", [snmpa_mib:info(MibsPid)]), ?IPRINT("cache_test -> load mibs"), - ?line load_mibs(MibsPid, MibDir, Mibs), + load_mibs(MibsPid, MibDir, Mibs), ?NPRINT("Info before load std mibs: " "~n ~p", [snmpa_mib:info(MibsPid)]), ?IPRINT("cache_test -> load std mibs"), - ?line load_mibs(MibsPid, StdMibDir, StdMibs), + load_mibs(MibsPid, StdMibDir, StdMibs), ?NPRINT("Info (after mibs load but) before populate: " "~n ~p", [snmpa_mib:info(MibsPid)]), ?IPRINT("cache_test -> populate the cache"), - ?line ok = populate(MibsPid), + ok = populate(MibsPid), ?NPRINT("Info after populate: " "~n ~p", [snmpa_mib:info(MibsPid)]), @@ -606,10 +606,10 @@ do_cache_test(Config) -> ?IPRINT("cache_test -> subscribe to GC events"), - ?line ok = snmpa_mib:subscribe_gc_events(MibsPid), + ok = snmpa_mib:subscribe_gc_events(MibsPid), ?IPRINT("cache_test -> enable cache autogc"), - ?line ok = snmpa_mib:enable_cache_autogc(MibsPid), + ok = snmpa_mib:enable_cache_autogc(MibsPid), ?IPRINT("cache_test -> wait 65 seconds to allow gc to happen"), ?SLEEP(timer:seconds(65)), @@ -719,10 +719,10 @@ do_cache_test(Config) -> ?IPRINT("cache_test -> stop mib server"), - ?line mibs_stop(MibsPid), + mibs_stop(MibsPid), ?IPRINT("cache_test -> stop symbolic store"), - ?line sym_stop(), + sym_stop(), ?IPRINT("cache_test -> end"), ok. @@ -860,7 +860,7 @@ mnesia_start(Opts, Nodes) -> ?IPRINT("mnesia_start -> try load mnesia when:" "~n Loaded: ~p" "~n Running: ~p", [apps_loaded(), apps_running()]), - ?line ok = case application:load(mnesia) of + ok = case application:load(mnesia) of ok -> ok; {error, {already_loaded, mnesia}} -> @@ -871,11 +871,11 @@ mnesia_start(Opts, Nodes) -> F = fun({Key, Val}) -> ?IPRINT("mnesia_start -> try set mnesia env: " "~n ~p -> ~p", [Key, Val]), - ?line application_controller:set_env(mnesia, Key, Val) + application_controller:set_env(mnesia, Key, Val) end, lists:foreach(F, Opts), ?IPRINT("mnesia_start -> create mnesia schema on ~p", [Nodes]), - ?line case mnesia:create_schema(Nodes) of + case mnesia:create_schema(Nodes) of ok -> ok; {error, {_, {already_exist, _}}} -> @@ -885,7 +885,7 @@ mnesia_start(Opts, Nodes) -> ?F("Failed create mnesia schema: ~p", [SchemaReason])}) end, ?IPRINT("mnesia_start -> start mnesia", []), - ?line case application:start(mnesia) of + case application:start(mnesia) of ok -> ok; {error, {already_started, mnesia}} -> diff --git a/lib/snmp/test/snmp_agent_test_lib.erl b/lib/snmp/test/snmp_agent_test_lib.erl index 6c22891810..41e656e7dc 100644 --- a/lib/snmp/test/snmp_agent_test_lib.erl +++ b/lib/snmp/test/snmp_agent_test_lib.erl @@ -150,37 +150,37 @@ init_all(Config) when is_list(Config) -> ?IPRINT("init_all -> create agent dir"), AgentDir = join(GroupTopDir, "agent/"), - ?line ok = file:make_dir(AgentDir), + ok = file:make_dir(AgentDir), ?DBG("init_all -> AgentDir ~p", [AgentDir]), ?IPRINT("init_all -> create agent db dir"), AgentDbDir = join(AgentDir, "db/"), - ?line ok = file:make_dir(AgentDbDir), + ok = file:make_dir(AgentDbDir), ?DBG("init_all -> AgentDbDir ~p", [AgentDbDir]), ?IPRINT("init_all -> create agent log dir"), AgentLogDir = join(AgentDir, "log/"), - ?line ok = file:make_dir(AgentLogDir), + ok = file:make_dir(AgentLogDir), ?DBG("init_all -> AgentLogDir ~p", [AgentLogDir]), ?IPRINT("init_all -> create agent config dir"), AgentConfDir = join(AgentDir, "conf/"), - ?line ok = file:make_dir(AgentConfDir), + ok = file:make_dir(AgentConfDir), ?DBG("init_all -> AgentConfDir ~p", [AgentConfDir]), ?IPRINT("init_all -> create manager dir"), MgrDir = join(GroupTopDir, "mgr/"), - ?line ok = file:make_dir(MgrDir), + ok = file:make_dir(MgrDir), ?DBG("init_all -> MgrDir ~p", [MgrDir]), ?IPRINT("init_all -> create sub-agent dir"), SaDir = join(GroupTopDir, "sa/"), - ?line ok = file:make_dir(SaDir), + ok = file:make_dir(SaDir), ?DBG("init_all -> SaDir ~p", [SaDir]), ?IPRINT("init_all -> create sub-agent db dir"), SaDbDir = join(SaDir, "db/"), - ?line ok = file:make_dir(SaDbDir), + ok = file:make_dir(SaDbDir), ?DBG("init_all -> SaDbDir ~p", [SaDbDir]), %% MibDir = ?config(mib_dir, Config), @@ -192,27 +192,27 @@ init_all(Config) when is_list(Config) -> %% ?IPRINT("init_all -> load mnesia application (local)"), - ?line ok = application:load(mnesia), + ok = application:load(mnesia), ?IPRINT("init_all -> load application mnesia on node ~p", [SaNode]), - ?line ok = rpc:call(SaNode, application, load, [mnesia]), + ok = rpc:call(SaNode, application, load, [mnesia]), ?IPRINT("init_all -> application mnesia (local): set_env dir"), - ?line application_controller:set_env(mnesia, dir, + application_controller:set_env(mnesia, dir, join(AgentDbDir, "Mnesia1")), ?IPRINT("init_all -> application mnesia: set_env dir on node ~p", [SaNode]), - ?line rpc:call(SaNode, application_controller, set_env, + rpc:call(SaNode, application_controller, set_env, [mnesia, dir, join(SaDir, "Mnesia2")]), ?IPRINT("init_all -> create mnesia schema"), - ?line ok = mnesia:create_schema([SaNode, node()]), + ok = mnesia:create_schema([SaNode, node()]), ?IPRINT("init_all -> start application mnesia (local)"), - ?line ok = application:start(mnesia), + ok = application:start(mnesia), ?IPRINT("init_all -> start application mnesia on ~p", [SaNode]), - ?line ok = rpc:call(SaNode, application, start, [mnesia]), + ok = rpc:call(SaNode, application, start, [mnesia]), ?IPRINT("init_all -> get localhost"), Ip = ?LOCALHOST(), @@ -582,13 +582,13 @@ tc_run(Mod, Func, Args, Opts) -> ?EPRINT("Failed starting (test) manager: " "~n ~p", [Reason]), (catch snmp_test_mgr:stop()), - ?line ?FAIL({mgr_start_error, Reason}); + ?FAIL({mgr_start_error, Reason}); Err -> ?EPRINT("Failed starting (test) manager: " "~n ~p", [Err]), (catch snmp_test_mgr:stop()), - ?line ?FAIL({mgr_start_failure, Err}) + ?FAIL({mgr_start_failure, Err}) end. %% We have some crap machines that generate this every now and then @@ -673,11 +673,11 @@ start_agent(Config, Vsns, Opts) -> "~n Vsns: ~p" "~n Opts: ~p", [node(), Config, Vsns, Opts]), - ?line AgentLogDir = ?config(agent_log_dir, Config), - ?line AgentConfDir = ?config(agent_conf_dir, Config), - ?line AgentDbDir = ?config(agent_db_dir, Config), - ?line SaNode = ?config(snmp_sa, Config), - ?line InetBackend = ?config(socket_create_opts, Config), + AgentLogDir = ?config(agent_log_dir, Config), + AgentConfDir = ?config(agent_conf_dir, Config), + AgentDbDir = ?config(agent_db_dir, Config), + SaNode = ?config(snmp_sa, Config), + InetBackend = ?config(socket_create_opts, Config), Env = app_agent_env_init( [{versions, Vsns}, @@ -709,26 +709,26 @@ start_agent(Config, Vsns, Opts) -> ?DBG("start_agent -> snmp app supervisor: ~p", [AppSup]), ?IPRINT("start_agent -> try start master agent",[]), - ?line Sup = start_sup(Env), - ?line unlink(Sup), + Sup = start_sup(Env), + unlink(Sup), ?DBG("start_agent -> snmp supervisor: ~p", [Sup]), ?IPRINT("start_agent -> try (rpc) start sub agent on ~p", [SaNode]), - ?line SaDir = ?config(sa_dir, Config), - ?line {ok, Sub} = start_sub_sup(SaNode, SaDir), + SaDir = ?config(sa_dir, Config), + {ok, Sub} = start_sub_sup(SaNode, SaDir), ?DBG("start_agent -> done", []), - ?line [{snmp_app_sup, AppSup}, + [{snmp_app_sup, AppSup}, {snmp_sup, {Sup, self()}}, {snmp_sub, Sub} | Config]. app_agent_env_init(Env0, Opts) -> ?DBG("app_agent_env_init -> unload snmp",[]), - ?line application:unload(snmp), + application:unload(snmp), ?DBG("app_agent_env_init -> load snmp",[]), - ?line application:load(snmp), + application:load(snmp), ?DBG("app_agent_env_init -> " "merge or maybe replace (snmp agent) app env",[]), @@ -1659,13 +1659,13 @@ config(Vsns, MgrDir, AgentConfDir, MIp, AIp, IpFamily) -> "~n AIp: ~p" "~n IpFamily: ~p", [Vsns, MgrDir, AgentConfDir, MIp, AIp, IpFamily]), - ?line {Domain, ManagerAddr} = + {Domain, ManagerAddr} = case IpFamily of inet6 -> TransportDomain6 = transportDomainUdpIpv6, AgentAddr6 = {AIp, 4000}, ManagerAddr6 = {MIp, ?TRAP_UDP}, - ?line ok = + ok = snmp_config:write_agent_snmp_files( AgentConfDir, Vsns, TransportDomain6, ManagerAddr6, AgentAddr6, "test"), @@ -1678,32 +1678,32 @@ config(Vsns, MgrDir, AgentConfDir, MIp, AIp, IpFamily) -> %% [#{addr => {AIp2, 4000}, kind => req_responder}, %% #{addr => {AIp2, 4001}, kind => trap_sender}], AgentPreTransport = [#{addr => {AIp2, 4000}}], - ?line ok = + ok = snmp_config:write_agent_snmp_files( AgentConfDir, Vsns, TransportDomain4, ManagerAddr4, AgentPreTransport, "test"), {TransportDomain4, ManagerAddr4}; _ -> - ?line ok = + ok = snmp_config:write_agent_snmp_files( AgentConfDir, Vsns, MIp, ?TRAP_UDP, AIp, 4000, "test"), {snmpUDPDomain, {MIp, ?TRAP_UDP}} end, - ?line case update_usm(Vsns, AgentConfDir) of + case update_usm(Vsns, AgentConfDir) of true -> - ?line copy_file(join(AgentConfDir, "usm.conf"), + copy_file(join(AgentConfDir, "usm.conf"), join(MgrDir, "usm.conf")), - ?line update_usm_mgr(Vsns, MgrDir); + update_usm_mgr(Vsns, MgrDir); false -> - ?line ok + ok end, - ?line update_community(Vsns, AgentConfDir), - ?line update_vacm(Vsns, AgentConfDir), - ?line write_target_addr_conf(AgentConfDir, Domain, ManagerAddr, Vsns), - ?line write_target_params_conf(AgentConfDir, Vsns), - ?line write_notify_conf(AgentConfDir), + update_community(Vsns, AgentConfDir), + update_vacm(Vsns, AgentConfDir), + write_target_addr_conf(AgentConfDir, Domain, ManagerAddr, Vsns), + write_target_params_conf(AgentConfDir, Vsns), + write_notify_conf(AgentConfDir), ok. maybe_fix_addr(Addr) when is_list(Addr) -> @@ -1811,7 +1811,7 @@ update_usm(Vsns, Dir) -> usmHMACSHAAuthProtocol, "", "", usmDESPrivProtocol, "", "", "", "passwd_shaxxxxxxxxxx", "passwd_desxxxxxx"}], - ?line ok = snmp_config:update_agent_usm_config(Dir, Conf), + ok = snmp_config:update_agent_usm_config(Dir, Conf), true; false -> false @@ -1830,14 +1830,14 @@ update_usm_mgr(Vsns, Dir) -> usmDESPrivProtocol, "", "", "", "passwd_shaxxxxxxxxxx", "passwd_desxxxxxx"}], - ?line ok = snmp_config:update_agent_usm_config(Dir, Conf), + ok = snmp_config:update_agent_usm_config(Dir, Conf), true; false -> false end. rewrite_usm_mgr(Dir, ShaKey, DesKey) -> - ?line ok = file:rename(join(Dir,"usm.conf"), + ok = file:rename(join(Dir,"usm.conf"), join(Dir,"usm.old")), Conf = [{"agentEngine", "newUser", "newUser", zeroDotZero, usmHMACSHAAuthProtocol, "", "", @@ -1845,10 +1845,10 @@ rewrite_usm_mgr(Dir, ShaKey, DesKey) -> {"mgrEngine", "newUser", "newUser", zeroDotZero, usmHMACSHAAuthProtocol, "", "", usmDESPrivProtocol, "", "", "", ShaKey, DesKey}], - ?line ok = snmp_config:write_agent_usm_config(Dir, "", Conf). + ok = snmp_config:write_agent_usm_config(Dir, "", Conf). reset_usm_mgr(Dir) -> - ?line ok = file:rename(join(Dir,"usm.old"), + ok = file:rename(join(Dir,"usm.old"), join(Dir,"usm.conf")). @@ -1856,7 +1856,7 @@ update_community([v3], _Dir) -> ok; update_community(_, Dir) -> Conf = [{"no-rights", "no-rights", "no-rights", "", ""}], - ?line ok = snmp_config:update_agent_community_config(Dir, Conf). + ok = snmp_config:update_agent_community_config(Dir, Conf). -define(tDescr_instance, [1,3,6,1,2,1,16,1,0]). @@ -1871,17 +1871,17 @@ update_vacm(_Vsn, Dir) -> {vacmSecurityToGroup, usm, "newUser", "initial"}, {vacmViewTreeFamily, "internet", ?tDescr_instance, excluded, null}], - ?line ok = snmp_config:update_agent_vacm_config(Dir, Conf). + ok = snmp_config:update_agent_vacm_config(Dir, Conf). write_community_conf(Dir, Conf) -> - ?line ok = snmp_config:write_agent_community_config(Dir, "", Conf). + ok = snmp_config:write_agent_community_config(Dir, "", Conf). write_target_addr_conf(Dir, Conf) -> - ?line ok = snmp_config:write_agent_target_addr_config(Dir, "", Conf). + ok = snmp_config:write_agent_target_addr_config(Dir, "", Conf). write_target_addr_conf(Dir, Ip_or_Domain, Port_or_Addr, Vsns) -> - ?line ok = + ok = snmp_config:write_agent_snmp_target_addr_conf( Dir, Ip_or_Domain, Port_or_Addr, Vsns). @@ -1898,7 +1898,7 @@ rewrite_target_addr_conf(Dir, NewPort) -> ok end, - ?line [TrapAddr|Addrs] = + [TrapAddr|Addrs] = snmp_conf:read(TAFile, fun rewrite_target_addr_conf_check/1), ?DBG("rewrite_target_addr_conf -> TrapAddr: ~p",[TrapAddr]), @@ -1907,10 +1907,10 @@ rewrite_target_addr_conf(Dir, NewPort) -> ?DBG("rewrite_target_addr_conf -> NewAddrs: ~p",[NewAddrs]), - ?line ok = file:rename(join(Dir,"target_addr.conf"), + ok = file:rename(join(Dir,"target_addr.conf"), join(Dir,"target_addr.old")), - ?line ok = snmp_config:write_agent_target_addr_config(Dir, "", NewAddrs). + ok = snmp_config:write_agent_target_addr_config(Dir, "", NewAddrs). rewrite_target_addr_conf_check(O) -> {ok,O}. @@ -1926,7 +1926,7 @@ rewrite_target_addr_conf2(_NewPort,O) -> O. reset_target_addr_conf(Dir) -> - ?line ok = file:rename(join(Dir, "target_addr.old"), + ok = file:rename(join(Dir, "target_addr.old"), join(Dir, "target_addr.conf")). write_target_params_conf(Dir, Vsns) -> @@ -1935,28 +1935,28 @@ write_target_params_conf(Dir, Vsns) -> (v3) -> {"target_v3", v3, usm, "all-rights", noAuthNoPriv} end, Conf = [F(Vsn) || Vsn <- Vsns], - ?line ok = snmp_config:write_agent_target_params_config(Dir, "", Conf). + ok = snmp_config:write_agent_target_params_config(Dir, "", Conf). rewrite_target_params_conf(Dir, SecName, SecLevel) when is_list(SecName) andalso is_atom(SecLevel) -> - ?line ok = file:rename(join(Dir,"target_params.conf"), + ok = file:rename(join(Dir,"target_params.conf"), join(Dir,"target_params.old")), Conf = [{"target_v3", v3, usm, SecName, SecLevel}], - ?line ok = snmp_config:write_agent_target_params_config(Dir, "", Conf). + ok = snmp_config:write_agent_target_params_config(Dir, "", Conf). reset_target_params_conf(Dir) -> - ?line ok = file:rename(join(Dir,"target_params.old"), + ok = file:rename(join(Dir,"target_params.old"), join(Dir,"target_params.conf")). write_notify_conf(Dir) -> Conf = [{"standard trap", "std_trap", trap}, {"standard inform", "std_inform", inform}], - ?line ok = snmp_config:write_agent_notify_config(Dir, "", Conf). + ok = snmp_config:write_agent_notify_config(Dir, "", Conf). write_view_conf(Dir) -> Conf = [{2, [1,3,6], included, null}, {2, ?tDescr_instance, excluded, null}], - ?line ok = snmp_config:write_agent_view_config(Dir, "", Conf). + ok = snmp_config:write_agent_view_config(Dir, "", Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/snmp/test/snmp_compiler_SUITE.erl b/lib/snmp/test/snmp_compiler_SUITE.erl index f4053ac74c..9cc47397a8 100644 --- a/lib/snmp/test/snmp_compiler_SUITE.erl +++ b/lib/snmp/test/snmp_compiler_SUITE.erl @@ -197,14 +197,14 @@ description(Config) when is_list(Config) -> Desctext = "This is a test description", Oid = [1,3,6,1,2,1,15,1], write_mib(MibSrcName,Desctext), - ?line {ok,_} = snmpc:compile(MibSrcName, [{outdir, Dir}, + {ok,_} = snmpc:compile(MibSrcName, [{outdir, Dir}, {group_check, false}, {warnings, false}, {description, false}]), MIB1 = read_mib(MibBinName), %% ?IPRINT("description -> MIB1: ~n~p~n", [MIB1]), check_mib(MIB1#mib.mes, Oid, undefined), - ?line {ok,_} = snmpc:compile(MibSrcName, [{outdir, Dir}, + {ok,_} = snmpc:compile(MibSrcName, [{outdir, Dir}, {group_check, false}, {warnings, false}, {description, true}]), @@ -228,8 +228,8 @@ oid_conflicts(Config) when is_list(Config) -> Dir = ?config(case_top_dir, Config), Mib = join(Dir,"TESTv2.mib"), - ?line ok = write_oid_conflict_mib(Mib), - ?line {error,compilation_failed} = + ok = write_oid_conflict_mib(Mib), + {error,compilation_failed} = snmpc:compile(Mib,[{outdir, Dir},{verbosity,trace}]), ok. @@ -263,19 +263,19 @@ agent_capabilities(Config) when is_list(Config) -> SnmpMibsDir = join(SnmpPrivDir, "mibs"), Dir = ?config(mib_dir, Config), AcMib = join(Dir,"AC-TEST-MIB.mib"), - ?line {ok, MibFile1} = snmpc:compile(AcMib, [options, + {ok, MibFile1} = snmpc:compile(AcMib, [options, version, {i, [SnmpMibsDir]}, {outdir, Dir}, {verbosity, trace}]), - ?line {ok, Mib1} = snmp_misc:read_mib(MibFile1), - ?line {ok, MibFile2} = snmpc:compile(AcMib, [options, + {ok, Mib1} = snmp_misc:read_mib(MibFile1), + {ok, MibFile2} = snmpc:compile(AcMib, [options, version, agent_capabilities, {i, [SnmpMibsDir]}, {outdir, Dir}, {verbosity, trace}]), - ?line {ok, Mib2} = snmp_misc:read_mib(MibFile2), + {ok, Mib2} = snmp_misc:read_mib(MibFile2), MEDiff = Mib2#mib.mes -- Mib1#mib.mes, %% This is a rather pathetic test, but it is something... ?IPRINT("agent_capabilities -> " @@ -304,19 +304,19 @@ module_compliance(Config) when is_list(Config) -> SnmpMibsDir = join(SnmpPrivDir, "mibs"), Dir = ?config(mib_dir, Config), AcMib = join(Dir,"MC-TEST-MIB.mib"), - ?line {ok, MibFile1} = snmpc:compile(AcMib, [options, + {ok, MibFile1} = snmpc:compile(AcMib, [options, version, {i, [SnmpMibsDir]}, {outdir, Dir}, {verbosity, trace}]), - ?line {ok, Mib1} = snmp_misc:read_mib(MibFile1), - ?line {ok, MibFile2} = snmpc:compile(AcMib, [options, + {ok, Mib1} = snmp_misc:read_mib(MibFile1), + {ok, MibFile2} = snmpc:compile(AcMib, [options, version, module_compliance, {i, [SnmpMibsDir]}, {outdir, Dir}, {verbosity, trace}]), - ?line {ok, Mib2} = snmp_misc:read_mib(MibFile2), + {ok, Mib2} = snmp_misc:read_mib(MibFile2), MEDiff = Mib2#mib.mes -- Mib1#mib.mes, %% This is a rather pathetic test, but it is something... ?IPRINT("module_compliance -> " @@ -369,7 +369,7 @@ otp_6150(Config) when is_list(Config) -> Dir = ?config(case_top_dir, Config), MibDir = ?config(mib_dir, Config), MibFile = join(MibDir, "ERICSSON-TOP-MIB.mib"), - ?line {ok, Mib} = + {ok, Mib} = snmpc:compile(MibFile, [{outdir, Dir}, {verbosity, trace}]), ?IPRINT("otp_6150 -> Mib: " "~n ~p", [Mib]), @@ -422,7 +422,7 @@ otp_8595(Config) when is_list(Config) -> Dir = ?config(case_top_dir, Config), MibDir = ?config(mib_dir, Config), MibFile = join(MibDir, "OTP8595-MIB.mib"), - ?line {ok, Mib} = + {ok, Mib} = snmpc:compile(MibFile, [{outdir, Dir}, {verbosity, trace}, {group_check, false}]), @@ -442,7 +442,7 @@ otp_10799(Config) when is_list(Config) -> Dir = ?config(case_top_dir, Config), MibDir = ?config(mib_dir, Config), MibFile = join(MibDir, "OTP10799-MIB.mib"), - ?line {ok, Mib} = + {ok, Mib} = snmpc:compile(MibFile, [{outdir, Dir}, {verbosity, trace}]), ?IPRINT("Mib: " "~n ~p", [Mib]), @@ -461,7 +461,7 @@ otp_10808(Config) when is_list(Config) -> Dir = ?config(case_top_dir, Config), MibDir = ?config(mib_dir, Config), MibFile = join(MibDir, "OTP10808-MIB.mib"), - ?line {ok, Mib} = + {ok, Mib} = snmpc:compile(MibFile, [{outdir, Dir}, {verbosity, trace}, {group_check, false}]), @@ -483,7 +483,7 @@ otp_14145(Config) when is_list(Config) -> MibDir = ?config(mib_dir, Config), MibName = "OTP14145-MIB", MibFile = join(MibDir, MibName++".mib"), - ?line {ok, MibBin} = + {ok, MibBin} = snmpc:compile(MibFile, [{outdir, Dir}, {verbosity, trace}, {group_check, false}, @@ -509,7 +509,7 @@ otp_13014(Config) when is_list(Config) -> MibDir = ?config(mib_dir, Config), MibName = "Test-LLDP-MIB", MibFile = join(MibDir, MibName++".mib"), - ?line {ok, MibBin} = + {ok, MibBin} = snmpc:compile(MibFile, [{outdir, Dir}, {verbosity, log}, {group_check, false}, @@ -544,7 +544,7 @@ otp_14196(Config) when is_list(Config) -> Dir = ?config(case_top_dir, Config), MibDir = ?config(mib_dir, Config), MibFile = join(MibDir, "OTP14196-MIB.mib"), - ?line {ok, Mib} = + {ok, Mib} = snmpc:compile(MibFile, [{outdir, Dir}, {verbosity, trace}]), ?IPRINT("Mib: " "~n ~p", [Mib]), @@ -564,13 +564,13 @@ augments_extra_info(Config) when is_list(Config) -> MibDir = ?config(mib_dir, Config), Test2File = join(MibDir, "Test2.mib"), Test3File = join(MibDir, "Test3.mib"), - ?line {ok, Test2BinFile} = + {ok, Test2BinFile} = snmpc:compile(Test2File, [{outdir, Dir}, {verbosity, silence}, {group_check, false}]), ?IPRINT("Test2BinFile: " "~n ~p", [Test2BinFile]), - ?line {ok, Test3BinFile} = + {ok, Test3BinFile} = snmpc:compile(Test3File, [{i, [MibDir]}, {outdir, Dir}, {verbosity, silence}, diff --git a/lib/snmp/test/snmp_conf_SUITE.erl b/lib/snmp/test/snmp_conf_SUITE.erl index f5277669e0..ae5cbc9c5a 100644 --- a/lib/snmp/test/snmp_conf_SUITE.erl +++ b/lib/snmp/test/snmp_conf_SUITE.erl @@ -239,14 +239,14 @@ check_mandatory(Config) when is_list(Config) -> {b, mandatory}, {d, {value, 20202}}, {e, {value, "kalle"}}], - ?line {ok, _L1} = verify_mandatory(A1, B1), + {ok, _L1} = verify_mandatory(A1, B1), ?DBG("check_mandatory -> L1: ~p", [L1]), A2 = [{a, hej}, {c, 10}, {d, 10101}, {f, 10.88}], B2 = [{a, {value, hejsan}}, {b, mandatory}, {d, {value, 20202}}, {e, {value, "kalle"}}], - ?line ok = verify_not_mandatory(A2, B2), + ok = verify_not_mandatory(A2, B2), ok. verify_mandatory(A, B) -> @@ -283,16 +283,16 @@ verify_not_mandatory(A, B) -> check_integer1(suite) -> []; check_integer1(Config) when is_list(Config) -> ?P(check_integer1), - ?line ok = verify_int(0), - ?line ok = verify_int(16#FF), - ?line ok = verify_int(16#FFFF), - ?line ok = verify_int(16#FFFFFFFF), - ?line ok = verify_int(-1), - ?line ok = verify_int(-333), + ok = verify_int(0), + ok = verify_int(16#FF), + ok = verify_int(16#FFFF), + ok = verify_int(16#FFFFFFFF), + ok = verify_int(-1), + ok = verify_int(-333), - ?line ok = verify_not_int("kalle & hobbe"), - ?line ok = verify_not_int(kalle_och_hobbe), - ?line ok = verify_not_int(1.5), + ok = verify_not_int("kalle & hobbe"), + ok = verify_not_int(kalle_och_hobbe), + ok = verify_not_int(1.5), ok. @@ -318,49 +318,49 @@ check_integer2(suite) -> []; check_integer2(Config) when is_list(Config) -> ?P(check_integer2), - ?line ok = verify_int(0, any), - ?line ok = verify_int(-22222, any), - ?line ok = verify_int(33333, any), - ?line ok = verify_int(1, pos), - ?line ok = verify_int(9999, pos), - ?line ok = verify_int(-1, neg), - ?line ok = verify_int(-9999, neg), - ?line ok = verify_int(1, {gt, 0}), - ?line ok = verify_int(88888, {gt, -255}), - ?line ok = verify_int(88888, {gte, -255}), - ?line ok = verify_int(88888, {gte, 88888}), - ?line ok = verify_int(88888, {lt, 88889}), - ?line ok = verify_int(88888, {lte, 88888}), - ?line ok = verify_int(88888, {eq, 88888}), - ?line ok = verify_int(88888, {range, 88887,88889}), - - ?line ok = verify_not_int("kalle & hobbe", any), - ?line ok = verify_not_int(kalle_och_hobbe, any), - ?line ok = verify_not_int(1.5, any), - - ?line ok = verify_not_int(0, pos), - ?line ok = verify_not_int(-22222, pos), - ?line ok = verify_not_int(33333, neg), - ?line ok = verify_not_int(0, {gt, 0}), - ?line ok = verify_not_int(33333, {gt, 99999}), - ?line ok = verify_not_int(33333, {gt, 33333}), - ?line ok = verify_not_int(33333, {gte, 33334}), - ?line ok = verify_not_int(33333, {lt, 33333}), - ?line ok = verify_not_int(33333, {lte, 33332}), - ?line ok = verify_not_int(33333, {eq, 33332}), - ?line ok = verify_not_int(33333, {eq, -33333}), - ?line ok = verify_not_int(33333, {range, 33334, 33338}), - ?line ok = verify_not_int(33339, {range, 33334, 33338}), - ?line ok = verify_not_int(33333, {gt, kalle}), - ?line ok = verify_not_int(33333, {gt, 1.55}), - ?line ok = verify_not_int(33333, {gte, "hejsan"}), - ?line ok = verify_not_int(33333, {lt, hobbe}), - ?line ok = verify_not_int(33333, {lte, 1.7666}), - ?line ok = verify_not_int(33333, {eq, 33333.0}), - ?line ok = verify_not_int(33333, {eq, -33333.0}), - ?line ok = verify_not_int(33333, {range, kalle, 33338}), - ?line ok = verify_not_int(33339, {range, 33334, kalle}), - ?line ok = verify_not_int(33339, {kalle, 33334, kalle}), + ok = verify_int(0, any), + ok = verify_int(-22222, any), + ok = verify_int(33333, any), + ok = verify_int(1, pos), + ok = verify_int(9999, pos), + ok = verify_int(-1, neg), + ok = verify_int(-9999, neg), + ok = verify_int(1, {gt, 0}), + ok = verify_int(88888, {gt, -255}), + ok = verify_int(88888, {gte, -255}), + ok = verify_int(88888, {gte, 88888}), + ok = verify_int(88888, {lt, 88889}), + ok = verify_int(88888, {lte, 88888}), + ok = verify_int(88888, {eq, 88888}), + ok = verify_int(88888, {range, 88887,88889}), + + ok = verify_not_int("kalle & hobbe", any), + ok = verify_not_int(kalle_och_hobbe, any), + ok = verify_not_int(1.5, any), + + ok = verify_not_int(0, pos), + ok = verify_not_int(-22222, pos), + ok = verify_not_int(33333, neg), + ok = verify_not_int(0, {gt, 0}), + ok = verify_not_int(33333, {gt, 99999}), + ok = verify_not_int(33333, {gt, 33333}), + ok = verify_not_int(33333, {gte, 33334}), + ok = verify_not_int(33333, {lt, 33333}), + ok = verify_not_int(33333, {lte, 33332}), + ok = verify_not_int(33333, {eq, 33332}), + ok = verify_not_int(33333, {eq, -33333}), + ok = verify_not_int(33333, {range, 33334, 33338}), + ok = verify_not_int(33339, {range, 33334, 33338}), + ok = verify_not_int(33333, {gt, kalle}), + ok = verify_not_int(33333, {gt, 1.55}), + ok = verify_not_int(33333, {gte, "hejsan"}), + ok = verify_not_int(33333, {lt, hobbe}), + ok = verify_not_int(33333, {lte, 1.7666}), + ok = verify_not_int(33333, {eq, 33333.0}), + ok = verify_not_int(33333, {eq, -33333.0}), + ok = verify_not_int(33333, {range, kalle, 33338}), + ok = verify_not_int(33339, {range, 33334, kalle}), + ok = verify_not_int(33339, {kalle, 33334, kalle}), ok. @@ -385,10 +385,10 @@ verify_not_int(Val, Cond) -> check_string1(suite) -> []; check_string1(Config) when is_list(Config) -> ?P(check_string1), - ?line ok = verify_string("kalle & hobbe"), - ?line ok = verify_not_string(kalle_hobbe), - ?line ok = verify_not_string(1000), - ?line ok = verify_not_string(1.0), + ok = verify_string("kalle & hobbe"), + ok = verify_not_string(kalle_hobbe), + ok = verify_not_string(1000), + ok = verify_not_string(1.0), ok. verify_string(Val) -> @@ -414,21 +414,21 @@ check_string2(suite) -> []; check_string2(Config) when is_list(Config) -> ?P(check_string2), Str = "kalle & hobbe", - ?line ok = verify_string(Str, any), - ?line ok = verify_string(Str, {gt, length(Str) - 1}), - ?line ok = verify_string(Str, {gte, length(Str)}), - ?line ok = verify_string(Str, {lt, length(Str) + 1}), - ?line ok = verify_string(Str, {lte, length(Str)}), - ?line ok = verify_string(Str, length(Str)), - - ?line ok = verify_not_string(kalle_hobbe, any), - ?line ok = verify_not_string(1000, any), - ?line ok = verify_not_string(1.0, any), - ?line ok = verify_not_string(Str, {gt, length(Str)}), - ?line ok = verify_not_string(Str, {gte, length(Str) + 1}), - ?line ok = verify_not_string(Str, {lt, length(Str)}), - ?line ok = verify_not_string(Str, {lte, length(Str) - 1}), - ?line ok = verify_not_string(Str, length(Str) + 1), + ok = verify_string(Str, any), + ok = verify_string(Str, {gt, length(Str) - 1}), + ok = verify_string(Str, {gte, length(Str)}), + ok = verify_string(Str, {lt, length(Str) + 1}), + ok = verify_string(Str, {lte, length(Str)}), + ok = verify_string(Str, length(Str)), + + ok = verify_not_string(kalle_hobbe, any), + ok = verify_not_string(1000, any), + ok = verify_not_string(1.0, any), + ok = verify_not_string(Str, {gt, length(Str)}), + ok = verify_not_string(Str, {gte, length(Str) + 1}), + ok = verify_not_string(Str, {lt, length(Str)}), + ok = verify_not_string(Str, {lte, length(Str) - 1}), + ok = verify_not_string(Str, length(Str) + 1), ok. verify_string(Val, Limit) -> @@ -454,10 +454,10 @@ check_atom(suite) -> []; check_atom(Config) when is_list(Config) -> ?P(check_atom), Atoms = [{kalle, "kalle"}, {hobbe, "hobbe"}, {dummy, "dummy"}], - ?line ok = verify_atom(kalle, Atoms), - ?line ok = verify_not_atom(anka, Atoms), - ?line ok = verify_not_atom("kalle", Atoms), - ?line ok = verify_not_atom(1000, Atoms), + ok = verify_atom(kalle, Atoms), + ok = verify_not_atom(anka, Atoms), + ok = verify_not_atom("kalle", Atoms), + ok = verify_not_atom(1000, Atoms), ok. verify_atom(Val, Atoms) -> @@ -482,13 +482,13 @@ verify_not_atom(Val, Atoms) -> check_ip(suite) -> []; check_ip(Config) when is_list(Config) -> ?P(check_ip), - ?line ok = verify_ip([1,2,3,4]), - ?line ok = verify_not_ip([1,2,3]), - ?line ok = verify_not_ip([1,2,3,4,5]), - ?line ok = verify_not_ip(kalle), - ?line ok = verify_not_ip(1000), - ?line ok = verify_not_ip([1,2,3.0,4]), - ?line ok = verify_not_ip([1,two,3,4]), + ok = verify_ip([1,2,3,4]), + ok = verify_not_ip([1,2,3]), + ok = verify_not_ip([1,2,3,4,5]), + ok = verify_not_ip(kalle), + ok = verify_not_ip(1000), + ok = verify_not_ip([1,2,3.0,4]), + ok = verify_not_ip([1,two,3,4]), ok. verify_ip(Val) -> @@ -515,13 +515,13 @@ verify_not_ip(Val) -> check_taddress(suite) -> []; check_taddress(Config) when is_list(Config) -> ?P(check_taddress), - ?line ok = verify_taddress([1,2,3,4,5,6]), - ?line ok = verify_not_taddress([1,2,3,4,5]), - ?line ok = verify_not_taddress([1,2,3,4,5,6,7]), - ?line ok = verify_not_taddress(kalle), - ?line ok = verify_not_taddress(1000), - ?line ok = verify_not_taddress([1,2,3.0,4,5,6]), - ?line ok = verify_not_taddress([1,two,3,4,5,6]), + ok = verify_taddress([1,2,3,4,5,6]), + ok = verify_not_taddress([1,2,3,4,5]), + ok = verify_not_taddress([1,2,3,4,5,6,7]), + ok = verify_not_taddress(kalle), + ok = verify_not_taddress(1000), + ok = verify_not_taddress([1,2,3.0,4,5,6]), + ok = verify_not_taddress([1,two,3,4,5,6]), ok. verify_taddress(Val) -> @@ -548,15 +548,15 @@ check_packet_size(Config) when is_list(Config) -> ?P(check_packet_size), Min = 484, Max = 2147483647, - ?line ok = verify_packet_size(Min), - ?line ok = verify_packet_size(2*Min), - ?line ok = verify_packet_size(Max), - ?line ok = verify_not_packet_size(Min-1), - ?line ok = verify_not_packet_size(Max+1), - ?line ok = verify_not_packet_size(kalle), - ?line ok = verify_not_packet_size("kalle"), - ?line ok = verify_not_packet_size(1.0), - ?line ok = verify_not_packet_size(1.0*Max), + ok = verify_packet_size(Min), + ok = verify_packet_size(2*Min), + ok = verify_packet_size(Max), + ok = verify_not_packet_size(Min-1), + ok = verify_not_packet_size(Max+1), + ok = verify_not_packet_size(kalle), + ok = verify_not_packet_size("kalle"), + ok = verify_not_packet_size(1.0), + ok = verify_not_packet_size(1.0*Max), ok. verify_packet_size(Val) -> @@ -583,14 +583,14 @@ check_oid(Config) when is_list(Config) -> ?P(check_oid), [_,_|Rest] = ?otpSnmpeaModule, ErrOid = [6,16|Rest], - ?line ok = verify_oid(?system), - ?line ok = verify_oid(?sysDescr_instance), - ?line ok = verify_oid(?otpSnmpeaModule), - ?line ok = verify_not_oid(kalle), - ?line ok = verify_not_oid("kalle"), - ?line ok = verify_not_oid(1000), - ?line ok = verify_not_oid(1.0), - ?line ok = verify_not_oid(ErrOid), + ok = verify_oid(?system), + ok = verify_oid(?sysDescr_instance), + ok = verify_oid(?otpSnmpeaModule), + ok = verify_not_oid(kalle), + ok = verify_not_oid("kalle"), + ok = verify_not_oid(1000), + ok = verify_not_oid(1.0), + ok = verify_not_oid(ErrOid), ok. verify_oid(Val) -> @@ -618,15 +618,15 @@ check_sec_model1(Config) when is_list(Config) -> Exclude1 = [], Exclude2 = [v1], Exclude3 = [v1,usm], - ?line ok = verify_sec_model(any, Exclude1), - ?line ok = verify_sec_model(v1, Exclude1), - ?line ok = verify_sec_model(v2c, Exclude1), - ?line ok = verify_sec_model(usm, Exclude1), - ?line ok = verify_sec_model(any, Exclude2), - ?line ok = verify_sec_model(v2c, Exclude2), - ?line ok = verify_not_sec_model(v1, Exclude2), - ?line ok = verify_not_sec_model(v1, Exclude3), - ?line ok = verify_not_sec_model(usm, Exclude3), + ok = verify_sec_model(any, Exclude1), + ok = verify_sec_model(v1, Exclude1), + ok = verify_sec_model(v2c, Exclude1), + ok = verify_sec_model(usm, Exclude1), + ok = verify_sec_model(any, Exclude2), + ok = verify_sec_model(v2c, Exclude2), + ok = verify_not_sec_model(v1, Exclude2), + ok = verify_not_sec_model(v1, Exclude3), + ok = verify_not_sec_model(usm, Exclude3), ok. verify_sec_model(Val, Exclude) -> @@ -651,24 +651,24 @@ verify_not_sec_model(Val, Exclude) -> check_sec_model2(suite) -> []; check_sec_model2(Config) when is_list(Config) -> ?P(check_sec_model2), - ?line ok = verify_sec_model(v1, v1, []), - ?line ok = verify_sec_model(v1, v1, [v2c]), - ?line ok = verify_sec_model(v2c, v2c, []), - ?line ok = verify_sec_model(v2c, v2c, [v1]), - ?line ok = verify_sec_model(v3, usm, []), - ?line ok = verify_sec_model(v3, usm, [v2c]), - ?line ok = verify_not_sec_model(v1, v2c, []), - ?line ok = verify_not_sec_model(v1, v3, [v2c]), - ?line ok = verify_not_sec_model(v1, v1, [v1]), - ?line ok = verify_not_sec_model(v2c, v1, []), - ?line ok = verify_not_sec_model(v2c, v3, [v3]), - ?line ok = verify_not_sec_model(v2c, v2c, [v2c]), - ?line ok = verify_not_sec_model(v3, v1, []), - ?line ok = verify_not_sec_model(v3, v2c, [v1]), - ?line ok = verify_not_sec_model(v3, v3, [v2c]), - ?line ok = verify_not_sec_model(kalle, v3, []), - ?line ok = verify_not_sec_model(1000, v3, []), - ?line ok = verify_not_sec_model(1.0, v3, []), + ok = verify_sec_model(v1, v1, []), + ok = verify_sec_model(v1, v1, [v2c]), + ok = verify_sec_model(v2c, v2c, []), + ok = verify_sec_model(v2c, v2c, [v1]), + ok = verify_sec_model(v3, usm, []), + ok = verify_sec_model(v3, usm, [v2c]), + ok = verify_not_sec_model(v1, v2c, []), + ok = verify_not_sec_model(v1, v3, [v2c]), + ok = verify_not_sec_model(v1, v1, [v1]), + ok = verify_not_sec_model(v2c, v1, []), + ok = verify_not_sec_model(v2c, v3, [v3]), + ok = verify_not_sec_model(v2c, v2c, [v2c]), + ok = verify_not_sec_model(v3, v1, []), + ok = verify_not_sec_model(v3, v2c, [v1]), + ok = verify_not_sec_model(v3, v3, [v2c]), + ok = verify_not_sec_model(kalle, v3, []), + ok = verify_not_sec_model(1000, v3, []), + ok = verify_not_sec_model(1.0, v3, []), ok. @@ -694,13 +694,13 @@ verify_not_sec_model(M1, M2, Exclude) -> check_sec_level(suite) -> []; check_sec_level(Config) when is_list(Config) -> ?P(check_sec_level), - ?line ok = verify_sec_level(noAuthNoPriv), - ?line ok = verify_sec_level(authNoPriv), - ?line ok = verify_sec_level(authPriv), - ?line ok = verify_not_sec_level(kalle), - ?line ok = verify_not_sec_level("noAuthNoPriv"), - ?line ok = verify_not_sec_level(1000), - ?line ok = verify_not_sec_level(1.0), + ok = verify_sec_level(noAuthNoPriv), + ok = verify_sec_level(authNoPriv), + ok = verify_sec_level(authPriv), + ok = verify_not_sec_level(kalle), + ok = verify_not_sec_level("noAuthNoPriv"), + ok = verify_not_sec_level(1000), + ok = verify_not_sec_level(1.0), ok. @@ -730,30 +730,30 @@ verify_not_sec_level(Val) -> check_timer(suite) -> []; check_timer(Config) when is_list(Config) -> ?P(check_timer), - ?line ok = verify_timer(infinity), - ?line ok = verify_timer(1), - ?line ok = verify_timer(10), - ?line ok = verify_timer(2147483647), - ?line ok = verify_timer(2*2147483647), - ?line ok = verify_timer({1,1,0,0}), - ?line ok = verify_timer({10,10,10,10}), - ?line ok = verify_timer({2147483647,2147483647,2147483647,2147483647}), - ?line ok = verify_not_timer(ytinifni), - ?line ok = verify_not_timer("ytinifni"), - ?line ok = verify_not_timer(0), - ?line ok = verify_not_timer(-10), - ?line ok = verify_not_timer({0,1,0,0}), - ?line ok = verify_not_timer({1,0,0,0}), - ?line ok = verify_not_timer({1,1,-1,0}), - ?line ok = verify_not_timer({1,1,0,-1}), - ?line ok = verify_not_timer({1.0,1,0,0}), - ?line ok = verify_not_timer({1,1.0,0,0}), - ?line ok = verify_not_timer({1,1,1.0,0}), - ?line ok = verify_not_timer({1,1,0,1.0}), - ?line ok = verify_not_timer({"1",1,0,0}), - ?line ok = verify_not_timer({1,"1",0,0}), - ?line ok = verify_not_timer({1,1,"0",0}), - ?line ok = verify_not_timer({1,1,0,"0"}), + ok = verify_timer(infinity), + ok = verify_timer(1), + ok = verify_timer(10), + ok = verify_timer(2147483647), + ok = verify_timer(2*2147483647), + ok = verify_timer({1,1,0,0}), + ok = verify_timer({10,10,10,10}), + ok = verify_timer({2147483647,2147483647,2147483647,2147483647}), + ok = verify_not_timer(ytinifni), + ok = verify_not_timer("ytinifni"), + ok = verify_not_timer(0), + ok = verify_not_timer(-10), + ok = verify_not_timer({0,1,0,0}), + ok = verify_not_timer({1,0,0,0}), + ok = verify_not_timer({1,1,-1,0}), + ok = verify_not_timer({1,1,0,-1}), + ok = verify_not_timer({1.0,1,0,0}), + ok = verify_not_timer({1,1.0,0,0}), + ok = verify_not_timer({1,1,1.0,0}), + ok = verify_not_timer({1,1,0,1.0}), + ok = verify_not_timer({"1",1,0,0}), + ok = verify_not_timer({1,"1",0,0}), + ok = verify_not_timer({1,1,"0",0}), + ok = verify_not_timer({1,1,0,"0"}), ok. verify_timer(Val) -> diff --git a/lib/snmp/test/snmp_log_SUITE.erl b/lib/snmp/test/snmp_log_SUITE.erl index caa7a10076..a3cf6605cf 100644 --- a/lib/snmp/test/snmp_log_SUITE.erl +++ b/lib/snmp/test/snmp_log_SUITE.erl @@ -169,7 +169,7 @@ init_per_testcase(Case, Config) when is_list(Config) -> Error -> ?FAIL({failed_creating_subsuite_top_dir, Error}) end, - ?line ok = file:make_dir(CaseDir), + ok = file:make_dir(CaseDir), Dog = ?WD_START(?MINS(5)), [{log_dir, CaseDir}, {watchdog, Dog}|Config]. @@ -199,11 +199,11 @@ open_and_close(Config) when is_list(Config) -> File = join(Dir, "snmp_test.log"), Size = {1024, 10}, Repair = true, - ?line {ok, Log} = snmp_log:create(Name, File, Size, Repair), - ?line ok = snmp_log:sync(Log), - ?line {ok, Info} = snmp_log:info(Log), + {ok, Log} = snmp_log:create(Name, File, Size, Repair), + ok = snmp_log:sync(Log), + {ok, Info} = snmp_log:info(Log), display_info(Info), - ?line ok = snmp_log:close(Log). + ok = snmp_log:close(Log). %%====================================================================== @@ -219,7 +219,7 @@ open_write_and_close1(Config) when is_list(Config) -> ?DBG("open_write_and_close1 -> start", []), SeqNoGen = none, - ?line ok = open_write_and_close(SeqNoGen, Config), + ok = open_write_and_close(SeqNoGen, Config), ?DBG("open_write_and_close1 -> done", []), ok. @@ -238,7 +238,7 @@ open_write_and_close2(Config) when is_list(Config) -> ?DBG("open_write_and_close2 -> start", []), SeqNoGen = disabled, - ?line ok = open_write_and_close(SeqNoGen, Config), + ok = open_write_and_close(SeqNoGen, Config), ?DBG("open_write_and_close2 -> done", []), ok. @@ -258,7 +258,7 @@ open_write_and_close3(Config) when is_list(Config) -> seqno_init(), SeqNoGen = {?MODULE, next_seqno, [10, 100]}, - ?line ok = open_write_and_close(SeqNoGen, Config), + ok = open_write_and_close(SeqNoGen, Config), seqno_finish(), ?DBG("open_write_and_close2 -> done", []), @@ -279,7 +279,7 @@ open_write_and_close4(Config) when is_list(Config) -> seqno_init(), SeqNoGen = fun() -> next_seqno(10, 100) end, - ?line ok = open_write_and_close(SeqNoGen, Config), + ok = open_write_and_close(SeqNoGen, Config), seqno_finish(), ?DBG("open_write_and_close2 -> done", []), @@ -319,7 +319,7 @@ open_write_and_close(SeqNoGen, Config) -> Repair = true, ?DBG("open_write_and_close -> create log", []), - ?line {ok, Log} = + {ok, Log} = case SeqNoGen of none -> snmp_log:create(Name, File, Size, Repair); @@ -332,10 +332,10 @@ open_write_and_close(SeqNoGen, Config) -> ?DBG("open_write_and_close1 -> create messages to log", []), %% A request - ?line Req = get_next_request(Vsn, Community, [1,1], 1, 235779012), + Req = get_next_request(Vsn, Community, [1,1], 1, 235779012), %% A reply - ?line Rep = get_response(Vsn, Community, + Rep = get_response(Vsn, Community, [1,3,6,1,2,1,1,1,0], 'OCTET STRING', "Erlang SNMP agent", 1, 235779012), @@ -348,17 +348,17 @@ open_write_and_close(SeqNoGen, Config) -> Addr = ?LOCALHOST(), Port = 162, Logger = fun(Packet) -> - ?line ok = snmp_log:log(Log, Packet, Addr, Port) + ok = snmp_log:log(Log, Packet, Addr, Port) end, lists:foreach(Logger, Msgs), check_notify(), ?DBG("open_write_and_close1 -> display info", []), - ?line {ok, Info} = snmp_log:info(Log), + {ok, Info} = snmp_log:info(Log), display_info(Info), ?DBG("open_write_and_close1 -> close log", []), - ?line ok = snmp_log:close(Log), + ok = snmp_log:close(Log), ?DBG("open_write_and_close -> done", []), ok. @@ -381,7 +381,7 @@ log_to_io1(Config) when is_list(Config) -> Size = {1024, 10}, Repair = true, ?DBG("log_to_io1 -> create log", []), - ?line {ok, Log} = snmp_log:create(Name, File, Size, Repair), + {ok, Log} = snmp_log:create(Name, File, Size, Repair), ?DBG("log_to_io1 -> create messages to log", []), Msgs = messages(), @@ -390,7 +390,7 @@ log_to_io1(Config) when is_list(Config) -> Addr = ?LOCALHOST(), Port = 162, Logger = fun(Packet) -> - ?line ok = snmp_log:log(Log, Packet, Addr, Port) + ok = snmp_log:log(Log, Packet, Addr, Port) end, BatchLogger = fun(Time) -> lists:foreach(Logger, Msgs), @@ -403,14 +403,14 @@ log_to_io1(Config) when is_list(Config) -> lists:foreach(BatchLogger, To), ?DBG("log_to_io1 -> display info", []), - ?line {ok, Info} = snmp_log:info(Log), + {ok, Info} = snmp_log:info(Log), display_info(Info), ?DBG("log_to_io1 -> do the convert to io (stdout)", []), ? line ok = snmp:log_to_io(Dir, [], Name, File, false), ?DBG("log_to_io1 -> close log", []), - ?line ok = snmp_log:close(Log), + ok = snmp_log:close(Log), ?DBG("log_to_io1 -> done", []), ok. @@ -438,20 +438,20 @@ log_to_io2(Config) when is_list(Config) -> Repair = true, ?DBG("log_to_io2 -> create log writer process", []), - ?line {ok, Log, Logger} = + {ok, Log, Logger} = log_writer_start(Name, File, Size, Repair, Factor), ?DBG("log_to_io2 -> create log reader process", []), - ?line {ok, Reader} = log_reader_start(), + {ok, Reader} = log_reader_start(), ?DBG("log_to_io2 -> wait some time", []), ?SLEEP(5000), ?DBG("log_to_io2 -> display log info", []), - ?line log_writer_info(Logger), + log_writer_info(Logger), ?DBG("log_to_io2 -> instruct the log writer to sleep some", []), - ?line ok = log_writer_sleep(Logger, 5000), + ok = log_writer_sleep(Logger, 5000), ?DBG("log_to_io2 -> instruct the log reader to log to io", []), Res = @@ -470,14 +470,14 @@ log_to_io2(Config) when is_list(Config) -> ?DBG("log_to_io2 -> log to io failed: " "~n Error: ~p" "~n Info: ~p", [Error, Info]), - ?line ?FAIL({log_lo_io_failed, Error, Info}) + ?FAIL({log_lo_io_failed, Error, Info}) end, ?DBG("log_to_io2 -> instruct the log writer to stop", []), - ?line log_writer_stop(Logger), + log_writer_stop(Logger), ?DBG("log_to_io2 -> instruct the log reader to stop", []), - ?line log_reader_stop(Reader), + log_reader_stop(Reader), ?DBG("log_to_io2 -> done", []), ok. @@ -494,7 +494,7 @@ log_to_txt1(Config) when is_list(Config) -> Name = "snmp_test_l2t1", SeqNoGen = disabled, - ?line ok = log_to_txt(Name, SeqNoGen, Config), + ok = log_to_txt(Name, SeqNoGen, Config), ?DBG("log_to_txt1 -> done", []), ok. @@ -513,7 +513,7 @@ log_to_txt2(Config) when is_list(Config) -> Name = "snmp_test_l2t2", seqno_init(), SeqNoGen = {?MODULE, next_seqno, [1, 100]}, - ?line ok = log_to_txt(Name, SeqNoGen, Config), + ok = log_to_txt(Name, SeqNoGen, Config), seqno_finish(), ?DBG("log_to_txt2 -> done", []), @@ -531,7 +531,7 @@ log_to_txt(Name, SeqNoGen, Config) when is_list(Config) -> Repair = true, ?DBG("log_to_txt -> create log", []), - ?line {ok, Log} = + {ok, Log} = case SeqNoGen of none -> snmp_log:create(Name, File, Size, Repair); @@ -546,7 +546,7 @@ log_to_txt(Name, SeqNoGen, Config) when is_list(Config) -> Addr = ?LOCALHOST(), Port = 162, Logger = fun(Packet) -> - ?line ok = snmp_log:log(Log, Packet, Addr, Port) + ok = snmp_log:log(Log, Packet, Addr, Port) end, BatchLogger = fun(Time) -> lists:foreach(Logger, Msgs), @@ -561,22 +561,22 @@ log_to_txt(Name, SeqNoGen, Config) when is_list(Config) -> Stop = calendar:local_time(), ?DBG("log_to_txt -> display info", []), - ?line {ok, Info} = snmp_log:info(Log), + {ok, Info} = snmp_log:info(Log), display_info(Info), Out1a = join(Dir, "snmp_text-1-unblocked.txt"), ?DBG("log_to_txt -> do the convert to a text file (~s) unblocked", [Out1a]), - ?line ok = snmp:log_to_txt(Dir, [], Out1a, Log, File, false), + ok = snmp:log_to_txt(Dir, [], Out1a, Log, File, false), - ?line {ok, #file_info{size = Size1a}} = file:read_file_info(Out1a), + {ok, #file_info{size = Size1a}} = file:read_file_info(Out1a), ?DBG("log_to_txt -> text file size: ~p", [Size1a]), validate_size(Size1a), Out1b = join(Dir, "snmp_text-1-blocked.txt"), ?DBG("log_to_txt -> do the convert to a text file (~s) blocked", [Out1b]), - ?line ok = snmp:log_to_txt(Dir, [], Out1b, Log, File, true), + ok = snmp:log_to_txt(Dir, [], Out1b, Log, File, true), - ?line {ok, #file_info{size = Size1b}} = file:read_file_info(Out1b), + {ok, #file_info{size = Size1b}} = file:read_file_info(Out1b), ?DBG("log_to_txt -> text file size: ~p", [Size1b]), validate_size(Size1b, {eq, Size1a}), @@ -585,9 +585,9 @@ log_to_txt(Name, SeqNoGen, Config) when is_list(Config) -> "~n Start: ~p" "~n Stop: ~p" "~n Out2: ~p", [Start, Stop, Out2]), - ?line ok = snmp:log_to_txt(Dir, [], Out2, Log, File, Start, Stop), + ok = snmp:log_to_txt(Dir, [], Out2, Log, File, Start, Stop), - ?line {ok, #file_info{size = Size2}} = file:read_file_info(Out2), + {ok, #file_info{size = Size2}} = file:read_file_info(Out2), ?DBG("log_to_txt -> text file size: ~p", [Size2]), validate_size(Size2, {le, Size1a}), @@ -615,14 +615,14 @@ log_to_txt(Name, SeqNoGen, Config) when is_list(Config) -> "~n Start2: ~p" "~n Stop2: ~p" "~n Out3: ~p", [Start2, Stop2, Out3]), - ?line ok = snmp:log_to_txt(Dir, [], Out3, Log, File, Start2, Stop2), + ok = snmp:log_to_txt(Dir, [], Out3, Log, File, Start2, Stop2), - ?line {ok, #file_info{size = Size3}} = file:read_file_info(Out3), + {ok, #file_info{size = Size3}} = file:read_file_info(Out3), ?DBG("log_to_txt -> text file size: ~p", [Size3]), validate_size(Size3, {l, Size1a}), ?DBG("log_to_txt -> close log", []), - ?line ok = snmp_log:close(Log), + ok = snmp_log:close(Log), ?DBG("log_to_txt -> done", []), ok. @@ -659,20 +659,20 @@ log_to_txt3(Config) when is_list(Config) -> Mibs = [join(StdMibDir, "SNMPv2-MIB")], ?DBG("log_to_txt3 -> create log writer process", []), - ?line {ok, Log, Logger} = + {ok, Log, Logger} = log_writer_start(Name, LogFile, Size, Repair, Factor), ?DBG("log_to_txt3 -> create log reader process", []), - ?line {ok, Reader} = log_reader_start(), + {ok, Reader} = log_reader_start(), ?DBG("log_to_txt3 -> wait some time", []), ?SLEEP(5000), ?DBG("log_to_txt3 -> display log info", []), - ?line log_writer_info(Logger), + log_writer_info(Logger), ?DBG("log_to_txt3 -> instruct the log writer to sleep some", []), - ?line ok = log_writer_sleep(Logger, 5000), + ok = log_writer_sleep(Logger, 5000), ?DBG("log_to_txt3 -> instruct the log reader to log to txt", []), Res = @@ -690,7 +690,7 @@ log_to_txt3(Config) when is_list(Config) -> case Res of {ok, _Info} -> ?DBG("log_to_txt3 -> ~n Info: ~p", [_Info]), - ?line {ok, #file_info{size = FileSize}} = + {ok, #file_info{size = FileSize}} = file:read_file_info(TxtFile), ?DBG("log_to_txt3 -> text file size: ~p", [FileSize]), validate_size(FileSize); @@ -698,14 +698,14 @@ log_to_txt3(Config) when is_list(Config) -> ?EPRINT("log to txt failed: " "~n Error: ~p" "~n Info: ~p", [Error, Info]), - ?line ?FAIL({log_lo_txt_failed, Error, Info}) + ?FAIL({log_lo_txt_failed, Error, Info}) end, ?DBG("log_to_txt3 -> instruct the log writer to stop", []), - ?line log_writer_stop(Logger), + log_writer_stop(Logger), ?DBG("log_to_txt3 -> instruct the log reader to stop", []), - ?line log_reader_stop(Reader), + log_reader_stop(Reader), ?IPRINT("log_to_txt3 -> done", []), ok. @@ -801,7 +801,7 @@ log_writer_main(Name, File, Size, Repair, P, Factor) -> Addr = ?LOCALHOST(), Port = 162, Logger = fun(Packet) -> - ?line ok = snmp_log:log(Log, Packet, Addr, Port) + ok = snmp_log:log(Log, Packet, Addr, Port) end, BatchLogger = fun(Time) -> lists:foreach(Logger, Msgs), diff --git a/lib/snmp/test/snmp_manager_SUITE.erl b/lib/snmp/test/snmp_manager_SUITE.erl index 584d935f0d..58e344e4bd 100644 --- a/lib/snmp/test/snmp_manager_SUITE.erl +++ b/lib/snmp/test/snmp_manager_SUITE.erl @@ -598,29 +598,29 @@ init_per_testcase2(Case, Config) -> MgrTopDir = filename:join(CaseTopDir, "manager/"), ?DBG("init_per_testcase2 -> try create manager top dir: ~n~p", [MgrTopDir]), - ?line ok = file:make_dir(MgrTopDir), + ok = file:make_dir(MgrTopDir), MgrConfDir = filename:join(MgrTopDir, "conf/"), - ?line ok = file:make_dir(MgrConfDir), + ok = file:make_dir(MgrConfDir), MgrDbDir = filename:join(MgrTopDir, "db/"), - ?line ok = file:make_dir(MgrDbDir), + ok = file:make_dir(MgrDbDir), MgrLogDir = filename:join(MgrTopDir, "log/"), - ?line ok = file:make_dir(MgrLogDir), + ok = file:make_dir(MgrLogDir), %% -- Agent dirs -- AgTopDir = filename:join(CaseTopDir, "agent/"), - ?line ok = file:make_dir(AgTopDir), + ok = file:make_dir(AgTopDir), AgConfDir = filename:join(AgTopDir, "conf/"), - ?line ok = file:make_dir(AgConfDir), + ok = file:make_dir(AgConfDir), AgDbDir = filename:join(AgTopDir, "db/"), - ?line ok = file:make_dir(AgDbDir), + ok = file:make_dir(AgDbDir), AgLogDir = filename:join(AgTopDir, "log/"), - ?line ok = file:make_dir(AgLogDir), + ok = file:make_dir(AgLogDir), Family = proplists:get_value(ipfamily, Config, inet), @@ -956,20 +956,20 @@ do_simple_start_and_stop2([{_ManagerPeer, ManagerNode}], Config) -> ?IPRINT("try load snmp application"), - ?line ok = load_snmp(ManagerNode), + ok = load_snmp(ManagerNode), ?IPRINT("try set manager env for the snmp application"), - ?line ok = set_mgr_env(ManagerNode, Opts), + ok = set_mgr_env(ManagerNode, Opts), ?IPRINT("try starting snmp application (with only manager)"), - ?line ok = start_snmp(ManagerNode), + ok = start_snmp(ManagerNode), ?IPRINT("started"), ?SLEEP(1000), ?IPRINT("try stopping snmp application (with only manager)"), - ?line ok = stop_snmp(ManagerNode), + ok = stop_snmp(ManagerNode), ?SLEEP(1000), ?IPRINT("end"), @@ -1935,13 +1935,13 @@ do_register_user1([{_ManagerPeer, ManagerNode}], Config) -> ?IPRINT("load snmp application"), - ?line ok = load_snmp(ManagerNode), + ok = load_snmp(ManagerNode), ?IPRINT("set manager env for the snmp application"), - ?line ok = set_mgr_env(ManagerNode, Opts), + ok = set_mgr_env(ManagerNode, Opts), ?IPRINT("starting snmp application (with only manager)"), - ?line ok = start_snmp(ManagerNode), + ok = start_snmp(ManagerNode), ?IPRINT("started"), @@ -1950,41 +1950,41 @@ do_register_user1([{_ManagerPeer, ManagerNode}], Config) -> ?IPRINT("manager info: ~p~n", [mgr_info(ManagerNode)]), ?IPRINT("try register user(s)"), - ?line ok = mgr_register_user(ManagerNode, calvin, snmpm_user_default, + ok = mgr_register_user(ManagerNode, calvin, snmpm_user_default, [self(), "various misc info"]), Users1 = mgr_which_users(ManagerNode), ?IPRINT("users: ~p~n", [Users1]), - ?line ok = verify_users(Users1, [calvin]), + ok = verify_users(Users1, [calvin]), ?IPRINT("manager info: ~p~n", [mgr_info(ManagerNode)]), - ?line ok = mgr_register_user(ManagerNode, hobbe, snmpm_user_default, + ok = mgr_register_user(ManagerNode, hobbe, snmpm_user_default, {"misc info", self()}), Users2 = mgr_which_users(ManagerNode), ?IPRINT("users: ~p~n", [Users2]), - ?line ok = verify_users(Users2, [calvin, hobbe]), + ok = verify_users(Users2, [calvin, hobbe]), ?IPRINT("manager info: ~p~n", [mgr_info(ManagerNode)]), ?IPRINT("try unregister user(s)"), - ?line ok = mgr_unregister_user(ManagerNode, calvin), + ok = mgr_unregister_user(ManagerNode, calvin), Users3 = mgr_which_users(ManagerNode), ?IPRINT("users: ~p~n", [Users3]), - ?line ok = verify_users(Users3, [hobbe]), + ok = verify_users(Users3, [hobbe]), ?IPRINT("manager info: ~p~n", [mgr_info(ManagerNode)]), - ?line ok = mgr_unregister_user(ManagerNode, hobbe), + ok = mgr_unregister_user(ManagerNode, hobbe), Users4 = mgr_which_users(ManagerNode), ?IPRINT("users: ~p~n", [Users4]), - ?line ok = verify_users(Users4, []), + ok = verify_users(Users4, []), ?IPRINT("manager info: ~p~n", [mgr_info(ManagerNode)]), ?SLEEP(1000), ?IPRINT("stop snmp application (with only manager)"), - ?line ok = stop_snmp(ManagerNode), + ok = stop_snmp(ManagerNode), ?SLEEP(1000), @@ -2035,13 +2035,13 @@ do_register_agent_old([{_ManagerPeer, ManagerNode}], Config) -> ?IPRINT("load snmp application"), - ?line ok = load_snmp(ManagerNode), + ok = load_snmp(ManagerNode), ?IPRINT("set manager env for the snmp application"), - ?line ok = set_mgr_env(ManagerNode, Opts), + ok = set_mgr_env(ManagerNode, Opts), ?IPRINT("starting snmp application (with only manager)"), - ?line ok = start_snmp(ManagerNode), + ok = start_snmp(ManagerNode), ?IPRINT("started"), @@ -2050,15 +2050,15 @@ do_register_agent_old([{_ManagerPeer, ManagerNode}], Config) -> ?IPRINT("manager info: ~p~n", [mgr_info(ManagerNode)]), ?IPRINT("register user(s) user_alfa & user_beta"), - ?line ok = mgr_register_user(ManagerNode, user_alfa, snmpm_user_default, []), - ?line ok = mgr_register_user(ManagerNode, user_beta, snmpm_user_default, []), + ok = mgr_register_user(ManagerNode, user_alfa, snmpm_user_default, []), + ok = mgr_register_user(ManagerNode, user_beta, snmpm_user_default, []), ?IPRINT("manager info: ~p~n", [mgr_info(ManagerNode)]), ?IPRINT("register agent(s)"), - ?line ok = mgr_register_agent(ManagerNode, user_alfa, 5000, []), - ?line ok = mgr_register_agent(ManagerNode, user_alfa, 5001, []), - ?line ok = mgr_register_agent(ManagerNode, user_beta, 5002, []), - ?line ok = mgr_register_agent(ManagerNode, user_beta, 5003, []), + ok = mgr_register_agent(ManagerNode, user_alfa, 5000, []), + ok = mgr_register_agent(ManagerNode, user_alfa, 5001, []), + ok = mgr_register_agent(ManagerNode, user_beta, 5002, []), + ok = mgr_register_agent(ManagerNode, user_beta, 5003, []), ?IPRINT("verify all agent(s): expect 4"), case mgr_which_agents(ManagerNode) of @@ -2091,7 +2091,7 @@ do_register_agent_old([{_ManagerPeer, ManagerNode}], Config) -> "~n ~p", [mgr_info(ManagerNode)]), ?IPRINT("unregister user user_alfa"), - ?line ok = mgr_unregister_user(ManagerNode, user_alfa), + ok = mgr_unregister_user(ManagerNode, user_alfa), ?IPRINT("verify all agent(s): expect 2"), case mgr_which_agents(ManagerNode) of @@ -2105,8 +2105,8 @@ do_register_agent_old([{_ManagerPeer, ManagerNode}], Config) -> "~n ~p~n", [mgr_info(ManagerNode)]), ?IPRINT("unregister user_beta agents"), - ?line ok = mgr_unregister_agent(ManagerNode, user_beta, 5002), - ?line ok = mgr_unregister_agent(ManagerNode, user_beta, 5003), + ok = mgr_unregister_agent(ManagerNode, user_beta, 5002), + ok = mgr_unregister_agent(ManagerNode, user_beta, 5003), ?IPRINT("verify all agent(s): expect 0"), case mgr_which_agents(ManagerNode) of @@ -2121,7 +2121,7 @@ do_register_agent_old([{_ManagerPeer, ManagerNode}], Config) -> "~n ~p", [mgr_info(ManagerNode)]), ?IPRINT("unregister user hobbe"), - ?line ok = mgr_unregister_user(ManagerNode, user_beta), + ok = mgr_unregister_user(ManagerNode, user_beta), ?IPRINT("manager info: " "~n ~p", [mgr_info(ManagerNode)]), @@ -2129,7 +2129,7 @@ do_register_agent_old([{_ManagerPeer, ManagerNode}], Config) -> ?SLEEP(1000), ?IPRINT("stop snmp application (with only manager)"), - ?line ok = stop_snmp(ManagerNode), + ok = stop_snmp(ManagerNode), ?SLEEP(1000), ?IPRINT("end"), @@ -2168,13 +2168,13 @@ do_register_agent2([{_ManagerPeer, ManagerNode}], Config) -> {config, [{verbosity, trace}, {dir, ConfDir}, {db_dir, DbDir}]}], ?IPRINT("load snmp application"), - ?line ok = load_snmp(ManagerNode), + ok = load_snmp(ManagerNode), ?IPRINT("set manager env for the snmp application"), - ?line ok = set_mgr_env(ManagerNode, Opts), + ok = set_mgr_env(ManagerNode, Opts), ?IPRINT("starting snmp application (with only manager)"), - ?line ok = start_snmp(ManagerNode), + ok = start_snmp(ManagerNode), ?IPRINT("started"), @@ -2183,28 +2183,28 @@ do_register_agent2([{_ManagerPeer, ManagerNode}], Config) -> ?IPRINT("manager info: ~p~n", [mgr_info(ManagerNode)]), ?IPRINT("register user(s) user_alfa & user_beta"), - ?line ok = mgr_register_user(ManagerNode, user_alfa, snmpm_user_default, []), - ?line ok = mgr_register_user(ManagerNode, user_beta, snmpm_user_default, []), + ok = mgr_register_user(ManagerNode, user_alfa, snmpm_user_default, []), + ok = mgr_register_user(ManagerNode, user_beta, snmpm_user_default, []), ?IPRINT("manager info: ~p~n", [mgr_info(ManagerNode)]), ?IPRINT("register agent(s)"), TargetName1 = "agent1", - ?line ok = mgr_register_agent(ManagerNode, user_alfa, TargetName1, + ok = mgr_register_agent(ManagerNode, user_alfa, TargetName1, [{address, LocalHost}, {port, 5001}, {engine_id, "agentEngineId-1"}]), TargetName2 = "agent2", - ?line ok = mgr_register_agent(ManagerNode, user_alfa, TargetName2, + ok = mgr_register_agent(ManagerNode, user_alfa, TargetName2, [{address, LocalHost}, {port, 5002}, {engine_id, "agentEngineId-2"}]), TargetName3 = "agent3", - ?line ok = mgr_register_agent(ManagerNode, user_beta, TargetName3, + ok = mgr_register_agent(ManagerNode, user_beta, TargetName3, [{address, LocalHost}, {port, 5003}, {engine_id, "agentEngineId-3"}]), TargetName4 = "agent4", - ?line ok = mgr_register_agent(ManagerNode, user_beta, TargetName4, + ok = mgr_register_agent(ManagerNode, user_beta, TargetName4, [{address, LocalHost}, {port, 5004}, {engine_id, "agentEngineId-4"}]), @@ -2239,7 +2239,7 @@ do_register_agent2([{_ManagerPeer, ManagerNode}], Config) -> ?IPRINT("manager info: ~p~n", [mgr_info(ManagerNode)]), ?IPRINT("unregister user user_alfa"), - ?line ok = mgr_unregister_user(ManagerNode, user_alfa), + ok = mgr_unregister_user(ManagerNode, user_alfa), ?IPRINT("verify all agent(s): expect 2"), case mgr_which_agents(ManagerNode) of @@ -2252,8 +2252,8 @@ do_register_agent2([{_ManagerPeer, ManagerNode}], Config) -> ?IPRINT("manager info: ~p~n", [mgr_info(ManagerNode)]), ?IPRINT("unregister user_beta agents"), - ?line ok = mgr_unregister_agent(ManagerNode, user_beta, TargetName3), - ?line ok = mgr_unregister_agent(ManagerNode, user_beta, TargetName4), + ok = mgr_unregister_agent(ManagerNode, user_beta, TargetName3), + ok = mgr_unregister_agent(ManagerNode, user_beta, TargetName4), ?IPRINT("verify all agent(s): expect 0"), case mgr_which_agents(ManagerNode) of @@ -2267,14 +2267,14 @@ do_register_agent2([{_ManagerPeer, ManagerNode}], Config) -> ?IPRINT("manager info: ~p~n", [mgr_info(ManagerNode)]), ?IPRINT("unregister user user_beta"), - ?line ok = mgr_unregister_user(ManagerNode, user_beta), + ok = mgr_unregister_user(ManagerNode, user_beta), ?IPRINT("manager info: ~p~n", [mgr_info(ManagerNode)]), ?SLEEP(1000), ?IPRINT("stop snmp application (with only manager)"), - ?line ok = stop_snmp(ManagerNode), + ok = stop_snmp(ManagerNode), ?SLEEP(1000), @@ -2315,13 +2315,13 @@ do_register_agent3([{_ManagerPeer, ManagerNode}], Config) -> ?IPRINT("load snmp application"), - ?line ok = load_snmp(ManagerNode), + ok = load_snmp(ManagerNode), ?IPRINT("set manager env for the snmp application"), - ?line ok = set_mgr_env(ManagerNode, Opts), + ok = set_mgr_env(ManagerNode, Opts), ?IPRINT("starting snmp application (with only manager)"), - ?line ok = start_snmp(ManagerNode), + ok = start_snmp(ManagerNode), ?IPRINT("started"), @@ -2330,25 +2330,25 @@ do_register_agent3([{_ManagerPeer, ManagerNode}], Config) -> ?IPRINT("manager info: ~p~n", [mgr_info(ManagerNode)]), ?IPRINT("register user(s) user_alfa & user_beta"), - ?line ok = mgr_register_user(ManagerNode, user_alfa, snmpm_user_default, []), - ?line ok = mgr_register_user(ManagerNode, user_beta, snmpm_user_default, []), + ok = mgr_register_user(ManagerNode, user_alfa, snmpm_user_default, []), + ok = mgr_register_user(ManagerNode, user_beta, snmpm_user_default, []), ?IPRINT("manager info: ~p~n", [mgr_info(ManagerNode)]), ?IPRINT("register agent(s)"), TargetName1 = "agent2", - ?line ok = mgr_register_agent(ManagerNode, user_alfa, TargetName1, + ok = mgr_register_agent(ManagerNode, user_alfa, TargetName1, [{tdomain, transportDomainUdpIpv4}, {address, LocalHost}, {port, 5001}, {engine_id, "agentEngineId-1"}]), TargetName2 = "agent3", - ?line ok = mgr_register_agent(ManagerNode, user_alfa, TargetName2, + ok = mgr_register_agent(ManagerNode, user_alfa, TargetName2, [{tdomain, transportDomainUdpIpv6}, {address, {0,0,0,0,0,0,0,1}}, {port, 5002}, {engine_id, "agentEngineId-2"}]), TargetName3 = "agent4", - ?line {error, {unsupported_domain, _} = Reason4} = + {error, {unsupported_domain, _} = Reason4} = mgr_register_agent(ManagerNode, user_beta, TargetName3, [{tdomain, transportDomainTcpIpv4}, {address, LocalHost}, @@ -2356,7 +2356,7 @@ do_register_agent3([{_ManagerPeer, ManagerNode}], Config) -> {engine_id, "agentEngineId-3"}]), ?IPRINT("Expected registration failure: ~p", [Reason4]), TargetName4 = "agent5", - ?line {error, {unknown_domain, _} = Reason5} = + {error, {unknown_domain, _} = Reason5} = mgr_register_agent(ManagerNode, user_beta, TargetName4, [{tdomain, transportDomainUdpIpv4_bad}, {address, LocalHost}, @@ -2394,7 +2394,7 @@ do_register_agent3([{_ManagerPeer, ManagerNode}], Config) -> ?IPRINT("manager info: ~p~n", [mgr_info(ManagerNode)]), ?IPRINT("unregister user user_alfa"), - ?line ok = mgr_unregister_user(ManagerNode, user_alfa), + ok = mgr_unregister_user(ManagerNode, user_alfa), ?IPRINT("verify all agent(s): expect 0"), case mgr_which_agents(ManagerNode) of @@ -2418,14 +2418,14 @@ do_register_agent3([{_ManagerPeer, ManagerNode}], Config) -> ?IPRINT("manager info: ~p~n", [mgr_info(ManagerNode)]), ?IPRINT("unregister user user_beta"), - ?line ok = mgr_unregister_user(ManagerNode, user_beta), + ok = mgr_unregister_user(ManagerNode, user_beta), ?IPRINT("manager info: ~p~n", [mgr_info(ManagerNode)]), ?SLEEP(1000), ?IPRINT("stop snmp application (with only manager)"), - ?line ok = stop_snmp(ManagerNode), + ok = stop_snmp(ManagerNode), ?SLEEP(1000), @@ -2476,12 +2476,12 @@ do_simple_sync_get3(Config, Get, PostVerify) -> ?IPRINT("issue get-request without loading the mib"), Oids1 = [?sysObjectID_instance, ?sysDescr_instance, ?sysUpTime_instance], - ?line ok = do_simple_sync_get3(Node, TargetName, Oids1, Get, PostVerify), + ok = do_simple_sync_get3(Node, TargetName, Oids1, Get, PostVerify), ?IPRINT("issue get-request after first loading the mibs"), - ?line ok = mgr_user_load_mib(Node, std_mib()), + ok = mgr_user_load_mib(Node, std_mib()), Oids2 = [[sysObjectID, 0], [sysDescr, 0], [sysUpTime, 0]], - ?line ok = do_simple_sync_get3(Node, TargetName, Oids2, Get, PostVerify), + ok = do_simple_sync_get3(Node, TargetName, Oids2, Get, PostVerify), ok. do_simple_sync_get3(Node, TargetName, Oids, Get, PostVerify) @@ -2489,7 +2489,7 @@ do_simple_sync_get3(Node, TargetName, Oids, Get, PostVerify) ?IPRINT("try get for ~p (on ~p):" "~n Oids: ~p", [TargetName, Node, Oids]), - ?line Reply = + Reply = case Get(Node, TargetName, Oids) of {ok, R, _Rem} -> ?IPRINT("get reply: " @@ -2505,7 +2505,7 @@ do_simple_sync_get3(Node, TargetName, Oids, Get, PostVerify) %% verify that the operation actually worked: %% The order should be the same, so no need to search - ?line ok = case Reply of + ok = case Reply of {noError, 0, [#varbind{oid = ?sysObjectID_instance, value = SysObjectID}, #varbind{oid = ?sysDescr_instance, @@ -2596,10 +2596,10 @@ do_simple_async_get3(Config) -> Res. do_simple_async_sync_get3(Config, MgrNode, AgentNode, Get, PostVerify) -> - ?line ok = mgr_user_load_mib(MgrNode, std_mib()), + ok = mgr_user_load_mib(MgrNode, std_mib()), Test2Mib = test2_mib(Config), - ?line ok = mgr_user_load_mib(MgrNode, Test2Mib), - ?line ok = agent_load_mib(AgentNode, Test2Mib), + ok = mgr_user_load_mib(MgrNode, Test2Mib), + ok = agent_load_mib(AgentNode, Test2Mib), do_simple_async_sync_get3(fun() -> mgr_info(MgrNode) end, fun() -> agent_info(AgentNode) end, Get, PostVerify). @@ -2649,7 +2649,7 @@ do_simple_async_sync_get3(MgrInfo, AgentInfo, Get, PostVerify) ?IPRINT("agent info when starting test: " "~n ~p", [AgentInfo()]), - ?line ok = async_exec(Requests, []), + ok = async_exec(Requests, []), ?IPRINT("manager info when ending test: " "~n ~p", [MgrInfo()]), @@ -2736,32 +2736,32 @@ do_simple_sync_get_next3(Config, GetNext, PostVerify) %% -- 1 -- Oids01 = [[1,3,7,1]], VF01 = fun(X) -> verify_ssgn_reply1(X, [{[1,3,7,1],endOfMibView}]) end, - ?line ok = do_simple_get_next(1, + ok = do_simple_get_next(1, MgrNode, TargetName, Oids01, VF01, GetNext, PostVerify), - ?line ok = mgr_user_load_mib(MgrNode, std_mib()), + ok = mgr_user_load_mib(MgrNode, std_mib()), %% -- 2 -- Oids02 = [[sysDescr], [1,3,7,1]], VF02 = fun(X) -> verify_ssgn_reply1(X, [?sysDescr_instance, endOfMibView]) end, - ?line ok = do_simple_get_next(2, + ok = do_simple_get_next(2, MgrNode, TargetName, Oids02, VF02, GetNext, PostVerify), Test2Mib = test2_mib(Config), - ?line ok = mgr_user_load_mib(MgrNode, Test2Mib), - ?line ok = agent_load_mib(AgentNode, Test2Mib), + ok = mgr_user_load_mib(MgrNode, Test2Mib), + ok = agent_load_mib(AgentNode, Test2Mib), %% -- 3 -- - ?line {ok, [TCnt2|_]} = mgr_user_name_to_oid(MgrNode, tCnt2), + {ok, [TCnt2|_]} = mgr_user_name_to_oid(MgrNode, tCnt2), Oids03 = [[TCnt2, 1]], VF03 = fun(X) -> verify_ssgn_reply1(X, [{fl([TCnt2,2]), 100}]) end, - ?line ok = do_simple_get_next(3, + ok = do_simple_get_next(3, MgrNode, TargetName, Oids03, VF03, GetNext, PostVerify), @@ -2770,48 +2770,48 @@ do_simple_sync_get_next3(Config, GetNext, PostVerify) VF04 = fun(X) -> verify_ssgn_reply1(X, [{fl([TCnt2,2]), endOfMibView}]) end, - ?line ok = do_simple_get_next(4, + ok = do_simple_get_next(4, MgrNode, TargetName, Oids04, VF04, GetNext, PostVerify), %% -- 5 -- - ?line {ok, [TGenErr1|_]} = mgr_user_name_to_oid(MgrNode, tGenErr1), + {ok, [TGenErr1|_]} = mgr_user_name_to_oid(MgrNode, tGenErr1), Oids05 = [TGenErr1], VF05 = fun(X) -> verify_ssgn_reply2(X, {genErr, 1, [TGenErr1]}) end, - ?line ok = do_simple_get_next(5, + ok = do_simple_get_next(5, MgrNode, TargetName, Oids05, VF05, GetNext, PostVerify), %% -- 6 -- - ?line {ok, [TGenErr2|_]} = mgr_user_name_to_oid(MgrNode, tGenErr2), + {ok, [TGenErr2|_]} = mgr_user_name_to_oid(MgrNode, tGenErr2), Oids06 = [TGenErr2], VF06 = fun(X) -> verify_ssgn_reply2(X, {genErr, 1, [TGenErr2]}) end, - ?line ok = do_simple_get_next(6, + ok = do_simple_get_next(6, MgrNode, TargetName, Oids06, VF06, GetNext, PostVerify), %% -- 7 -- - ?line {ok, [TGenErr3|_]} = mgr_user_name_to_oid(MgrNode, tGenErr3), + {ok, [TGenErr3|_]} = mgr_user_name_to_oid(MgrNode, tGenErr3), Oids07 = [[sysDescr], TGenErr3], VF07 = fun(X) -> verify_ssgn_reply2(X, {genErr, 2, [?sysDescr, TGenErr3]}) end, - ?line ok = do_simple_get_next(7, + ok = do_simple_get_next(7, MgrNode, TargetName, Oids07, VF07, GetNext, PostVerify), %% -- 8 -- - ?line {ok, [TTooBig|_]} = mgr_user_name_to_oid(MgrNode, tTooBig), + {ok, [TTooBig|_]} = mgr_user_name_to_oid(MgrNode, tTooBig), Oids08 = [TTooBig], VF08 = fun(X) -> verify_ssgn_reply2(X, {tooBig, 0, []}) end, - ?line ok = do_simple_get_next(8, + ok = do_simple_get_next(8, MgrNode, TargetName, Oids08, VF08, GetNext, PostVerify), ok. @@ -2867,10 +2867,10 @@ do_simple_async_get_next3(Config) -> AgentNode = ?config(agent_node, Config), TargetName = ?config(manager_agent_target_name, Config), - ?line ok = mgr_user_load_mib(MgrNode, std_mib()), + ok = mgr_user_load_mib(MgrNode, std_mib()), Test2Mib = test2_mib(Config), - ?line ok = mgr_user_load_mib(MgrNode, Test2Mib), - ?line ok = agent_load_mib(AgentNode, Test2Mib), + ok = mgr_user_load_mib(MgrNode, Test2Mib), + ok = agent_load_mib(AgentNode, Test2Mib), Self = self(), Msg = simple_async_get_next3, @@ -2894,11 +2894,11 @@ do_simple_async_get_next3(Config) -> do_simple_async_get_next3(MgrNode, AgentNode, GetNext, PostVerify) when is_function(GetNext, 1) andalso is_function(PostVerify, 1) -> - ?line {ok, [TCnt2|_]} = mgr_user_name_to_oid(MgrNode, tCnt2), - ?line {ok, [TGenErr1|_]} = mgr_user_name_to_oid(MgrNode, tGenErr1), - ?line {ok, [TGenErr2|_]} = mgr_user_name_to_oid(MgrNode, tGenErr2), - ?line {ok, [TGenErr3|_]} = mgr_user_name_to_oid(MgrNode, tGenErr3), - ?line {ok, [TTooBig|_]} = mgr_user_name_to_oid(MgrNode, tTooBig), + {ok, [TCnt2|_]} = mgr_user_name_to_oid(MgrNode, tCnt2), + {ok, [TGenErr1|_]} = mgr_user_name_to_oid(MgrNode, tGenErr1), + {ok, [TGenErr2|_]} = mgr_user_name_to_oid(MgrNode, tGenErr2), + {ok, [TGenErr3|_]} = mgr_user_name_to_oid(MgrNode, tGenErr3), + {ok, [TTooBig|_]} = mgr_user_name_to_oid(MgrNode, tTooBig), Requests = [ @@ -2966,7 +2966,7 @@ do_simple_async_get_next3(MgrNode, AgentNode, GetNext, PostVerify) ?IPRINT("agent info when starting test: " "~n ~p", [agent_info(AgentNode)]), - ?line ok = async_exec(Requests, []), + ok = async_exec(Requests, []), ?IPRINT("manager info when ending test: " "~n ~p", [mgr_info(MgrNode)]), @@ -3037,22 +3037,22 @@ do_simple_sync_set3(Config, Set, PostVerify) {?sysName_instance, s, Val11}, {?sysLocation_instance, s, Val12} ], - ?line ok = do_simple_set3(Node, TargetName, VAVs1, Set, PostVerify), + ok = do_simple_set3(Node, TargetName, VAVs1, Set, PostVerify), ?IPRINT("issue set-request after first loading the mibs"), - ?line ok = mgr_user_load_mib(Node, std_mib()), + ok = mgr_user_load_mib(Node, std_mib()), Val21 = "Sune Anka", Val22 = "Gothenburg", VAVs2 = [ {[sysName, 0], Val21}, {[sysLocation, 0], Val22} ], - ?line ok = do_simple_set3(Node, TargetName, VAVs2, Set, PostVerify), + ok = do_simple_set3(Node, TargetName, VAVs2, Set, PostVerify), ok. do_simple_set3(Node, TargetName, VAVs, Set, PostVerify) -> [SysName, SysLoc] = value_of_vavs(VAVs), - ?line {ok, Reply, _Rem} = Set(Node, TargetName, VAVs), + {ok, Reply, _Rem} = Set(Node, TargetName, VAVs), ?DBG("~n Reply: ~p" "~n Rem: ~w", [Reply, _Rem]), @@ -3060,7 +3060,7 @@ do_simple_set3(Node, TargetName, VAVs, Set, PostVerify) -> %% verify that the operation actually worked: %% The order should be the same, so no need to search %% The value we get should be exactly the same as we sent - ?line ok = case Reply of + ok = case Reply of {noError, 0, [#varbind{oid = ?sysName_instance, value = SysName}, #varbind{oid = ?sysLocation_instance, @@ -3140,10 +3140,10 @@ do_simple_async_set3(Config) -> AgentNode = ?config(agent_node, Config), TargetName = ?config(manager_agent_target_name, Config), - ?line ok = mgr_user_load_mib(MgrNode, std_mib()), + ok = mgr_user_load_mib(MgrNode, std_mib()), Test2Mib = test2_mib(Config), - ?line ok = mgr_user_load_mib(MgrNode, Test2Mib), - ?line ok = agent_load_mib(AgentNode, Test2Mib), + ok = mgr_user_load_mib(MgrNode, Test2Mib), + ok = agent_load_mib(AgentNode, Test2Mib), Self = self(), Msg = simple_async_set3, @@ -3200,7 +3200,7 @@ do_simple_async_set3(MgrNode, AgentNode, Set, PostVerify) -> ?IPRINT("agent info when starting test: " "~n ~p", [agent_info(AgentNode)]), - ?line ok = async_exec(Requests, []), + ok = async_exec(Requests, []), ?IPRINT("manager info when ending test: " "~n ~p", [mgr_info(MgrNode)]), @@ -3293,34 +3293,34 @@ do_simple_sync_get_bulk3(Config) -> do_simple_sync_get_bulk3(Config, MgrNode, AgentNode, GetBulk, PostVerify) -> %% -- 1 -- - ?line ok = do_simple_get_bulk3(1, + ok = do_simple_get_bulk3(1, 1, 1, [], fun verify_ssgb_reply1/1, GetBulk, PostVerify), %% -- 2 -- - ?line ok = do_simple_get_bulk3(2, + ok = do_simple_get_bulk3(2, -1, 1, [], fun verify_ssgb_reply1/1, GetBulk, PostVerify), %% -- 3 -- - ?line ok = do_simple_get_bulk3(3, + ok = do_simple_get_bulk3(3, -1, -1, [], fun verify_ssgb_reply1/1, GetBulk, PostVerify), - ?line ok = mgr_user_load_mib(MgrNode, std_mib()), + ok = mgr_user_load_mib(MgrNode, std_mib()), %% -- 4 -- VF04 = fun(X) -> verify_ssgb_reply2(X, [?sysDescr_instance, endOfMibView]) end, - ?line ok = do_simple_get_bulk3(4, + ok = do_simple_get_bulk3(4, 2, 0, [[sysDescr],[1,3,7,1]], VF04, GetBulk, PostVerify), %% -- 5 -- - ?line ok = do_simple_get_bulk3(5, + ok = do_simple_get_bulk3(5, 1, 2, [[sysDescr],[1,3,7,1]], VF04, GetBulk, PostVerify), @@ -3330,7 +3330,7 @@ do_simple_sync_get_bulk3(Config, MgrNode, AgentNode, GetBulk, PostVerify) -> [?sysDescr_instance, endOfMibView, ?sysObjectID_instance, endOfMibView]) end, - ?line ok = do_simple_get_bulk3(6, + ok = do_simple_get_bulk3(6, 0, 2, [[sysDescr],[1,3,7,1]], VF06, GetBulk, PostVerify), @@ -3341,15 +3341,15 @@ do_simple_sync_get_bulk3(Config, MgrNode, AgentNode, GetBulk, PostVerify) -> ?sysDescr_instance, endOfMibView, ?sysObjectID_instance, endOfMibView]) end, - ?line ok = do_simple_get_bulk3(7, + ok = do_simple_get_bulk3(7, 2, 2, [[sysDescr],[1,3,7,1],[sysDescr],[1,3,7,1]], VF07, GetBulk, PostVerify), Test2Mib = test2_mib(Config), - ?line ok = mgr_user_load_mib(MgrNode, Test2Mib), - ?line ok = agent_load_mib(AgentNode, Test2Mib), + ok = mgr_user_load_mib(MgrNode, Test2Mib), + ok = agent_load_mib(AgentNode, Test2Mib), %% -- 8 -- VF08 = fun(X) -> @@ -3357,14 +3357,14 @@ do_simple_sync_get_bulk3(Config, MgrNode, AgentNode, GetBulk, PostVerify) -> [?sysDescr_instance, ?sysDescr_instance]) end, - ?line ok = do_simple_get_bulk3(8, + ok = do_simple_get_bulk3(8, 1, 2, [[sysDescr],[sysDescr],[tTooBig]], VF08, GetBulk, PostVerify), %% -- 9 -- - ?line ok = do_simple_get_bulk3(9, + ok = do_simple_get_bulk3(9, 1, 12, [[tDescr2], [sysDescr]], fun verify_ssgb_reply1/1, @@ -3378,7 +3378,7 @@ do_simple_sync_get_bulk3(Config, MgrNode, AgentNode, GetBulk, PostVerify) -> {?tGenErr1, 'NULL'}, {?sysDescr, 'NULL'}]) end, - ?line ok = do_simple_get_bulk3(10, + ok = do_simple_get_bulk3(10, 2, 2, [[sysDescr], [sysObjectID], @@ -3388,14 +3388,14 @@ do_simple_sync_get_bulk3(Config, MgrNode, AgentNode, GetBulk, PostVerify) -> GetBulk, PostVerify), %% -- 11 -- - ?line {ok, [TCnt2|_]} = mgr_user_name_to_oid(MgrNode, tCnt2), + {ok, [TCnt2|_]} = mgr_user_name_to_oid(MgrNode, tCnt2), ?IPRINT("TCnt2: ~p", [TCnt2]), VF11 = fun(X) -> verify_ssgb_reply2(X, [{fl([TCnt2,2]), 100}, {fl([TCnt2,2]), endOfMibView}]) end, - ?line ok = do_simple_get_bulk3(11, + ok = do_simple_get_bulk3(11, 0, 2, [[TCnt2, 1]], VF11, GetBulk, PostVerify), @@ -3443,10 +3443,10 @@ do_simple_async_get_bulk3(Config) -> AgentNode = ?config(agent_node, Config), TargetName = ?config(manager_agent_target_name, Config), - ?line ok = mgr_user_load_mib(MgrNode, std_mib()), + ok = mgr_user_load_mib(MgrNode, std_mib()), Test2Mib = test2_mib(Config), - ?line ok = mgr_user_load_mib(MgrNode, Test2Mib), - ?line ok = agent_load_mib(AgentNode, Test2Mib), + ok = mgr_user_load_mib(MgrNode, Test2Mib), + ok = agent_load_mib(AgentNode, Test2Mib), Self = self(), Msg = simple_async_get_bulk3, @@ -3502,7 +3502,7 @@ do_simple_async_get_bulk3(MgrNode, AgentNode, GetBulk, PostVerify) -> {?tGenErr1, 'NULL'}, {?sysDescr, 'NULL'}])) end, - ?line {ok, [TCnt2|_]} = mgr_user_name_to_oid(MgrNode, tCnt2), + {ok, [TCnt2|_]} = mgr_user_name_to_oid(MgrNode, tCnt2), VF11 = fun(X) -> PostVerify( verify_ssgb_reply2(X, @@ -3585,7 +3585,7 @@ do_simple_async_get_bulk3(MgrNode, AgentNode, GetBulk, PostVerify) -> ?IPRINT("agent info when starting test: " "~n ~p", [agent_info(AgentNode)]), - ?line ok = async_exec(Requests, []), + ok = async_exec(Requests, []), ?IPRINT("manager info when ending test: " "~n ~p", [mgr_info(MgrNode)]), @@ -3766,16 +3766,16 @@ do_trap1(Config) -> MgrNode = ?config(manager_node, Config), AgentNode = ?config(agent_node, Config), - ?line ok = mgr_user_load_mib(MgrNode, snmpv2_mib()), + ok = mgr_user_load_mib(MgrNode, snmpv2_mib()), Test2Mib = test2_mib(Config), TestTrapMib = test_trap_mib(Config), TestTrapv2Mib = test_trap_v2_mib(Config), - ?line ok = mgr_user_load_mib(MgrNode, Test2Mib), - ?line ok = mgr_user_load_mib(MgrNode, TestTrapMib), - ?line ok = mgr_user_load_mib(MgrNode, TestTrapv2Mib), - ?line ok = agent_load_mib(AgentNode, Test2Mib), - ?line ok = agent_load_mib(AgentNode, TestTrapMib), - ?line ok = agent_load_mib(AgentNode, TestTrapv2Mib), + ok = mgr_user_load_mib(MgrNode, Test2Mib), + ok = mgr_user_load_mib(MgrNode, TestTrapMib), + ok = mgr_user_load_mib(MgrNode, TestTrapv2Mib), + ok = agent_load_mib(AgentNode, Test2Mib), + ok = agent_load_mib(AgentNode, TestTrapMib), + ok = agent_load_mib(AgentNode, TestTrapv2Mib), %% Version 1 trap verification function: VerifyTrap_v1 = @@ -3926,16 +3926,16 @@ do_trap2(Config) -> MgrNode = ?config(manager_node, Config), AgentNode = ?config(agent_node, Config), - ?line ok = mgr_user_load_mib(MgrNode, snmpv2_mib()), + ok = mgr_user_load_mib(MgrNode, snmpv2_mib()), Test2Mib = test2_mib(Config), TestTrapMib = test_trap_mib(Config), TestTrapv2Mib = test_trap_v2_mib(Config), - ?line ok = mgr_user_load_mib(MgrNode, Test2Mib), - ?line ok = mgr_user_load_mib(MgrNode, TestTrapMib), - ?line ok = mgr_user_load_mib(MgrNode, TestTrapv2Mib), - ?line ok = agent_load_mib(AgentNode, Test2Mib), - ?line ok = agent_load_mib(AgentNode, TestTrapMib), - ?line ok = agent_load_mib(AgentNode, TestTrapv2Mib), + ok = mgr_user_load_mib(MgrNode, Test2Mib), + ok = mgr_user_load_mib(MgrNode, TestTrapMib), + ok = mgr_user_load_mib(MgrNode, TestTrapv2Mib), + ok = agent_load_mib(AgentNode, Test2Mib), + ok = agent_load_mib(AgentNode, TestTrapMib), + ok = agent_load_mib(AgentNode, TestTrapv2Mib), %% Version 1 trap verification function: VerifyTrap_v1 = @@ -4124,16 +4124,16 @@ do_inform1(Config) -> MgrNode = ?config(manager_node, Config), AgentNode = ?config(agent_node, Config), - ?line ok = mgr_user_load_mib(MgrNode, snmpv2_mib()), + ok = mgr_user_load_mib(MgrNode, snmpv2_mib()), Test2Mib = test2_mib(Config), TestTrapMib = test_trap_mib(Config), TestTrapv2Mib = test_trap_v2_mib(Config), - ?line ok = mgr_user_load_mib(MgrNode, Test2Mib), - ?line ok = mgr_user_load_mib(MgrNode, TestTrapMib), - ?line ok = mgr_user_load_mib(MgrNode, TestTrapv2Mib), - ?line ok = agent_load_mib(AgentNode, Test2Mib), - ?line ok = agent_load_mib(AgentNode, TestTrapMib), - ?line ok = agent_load_mib(AgentNode, TestTrapv2Mib), + ok = mgr_user_load_mib(MgrNode, Test2Mib), + ok = mgr_user_load_mib(MgrNode, TestTrapMib), + ok = mgr_user_load_mib(MgrNode, TestTrapv2Mib), + ok = agent_load_mib(AgentNode, Test2Mib), + ok = agent_load_mib(AgentNode, TestTrapMib), + ok = agent_load_mib(AgentNode, TestTrapv2Mib), Cmd1 = @@ -4259,16 +4259,16 @@ do_inform2(Config) -> %% Addr = ?config(ip, Config), %% Port = ?AGENT_PORT, - ?line ok = mgr_user_load_mib(MgrNode, snmpv2_mib()), + ok = mgr_user_load_mib(MgrNode, snmpv2_mib()), Test2Mib = test2_mib(Config), TestTrapMib = test_trap_mib(Config), TestTrapv2Mib = test_trap_v2_mib(Config), - ?line ok = mgr_user_load_mib(MgrNode, Test2Mib), - ?line ok = mgr_user_load_mib(MgrNode, TestTrapMib), - ?line ok = mgr_user_load_mib(MgrNode, TestTrapv2Mib), - ?line ok = agent_load_mib(AgentNode, Test2Mib), - ?line ok = agent_load_mib(AgentNode, TestTrapMib), - ?line ok = agent_load_mib(AgentNode, TestTrapv2Mib), + ok = mgr_user_load_mib(MgrNode, Test2Mib), + ok = mgr_user_load_mib(MgrNode, TestTrapMib), + ok = mgr_user_load_mib(MgrNode, TestTrapv2Mib), + ok = agent_load_mib(AgentNode, Test2Mib), + ok = agent_load_mib(AgentNode, TestTrapMib), + ok = agent_load_mib(AgentNode, TestTrapv2Mib), Cmd1 = fun() -> @@ -4433,16 +4433,16 @@ do_inform3(Config) -> MgrNode = ?config(manager_node, Config), AgentNode = ?config(agent_node, Config), - ?line ok = mgr_user_load_mib(MgrNode, snmpv2_mib()), + ok = mgr_user_load_mib(MgrNode, snmpv2_mib()), Test2Mib = test2_mib(Config), TestTrapMib = test_trap_mib(Config), TestTrapv2Mib = test_trap_v2_mib(Config), - ?line ok = mgr_user_load_mib(MgrNode, Test2Mib), - ?line ok = mgr_user_load_mib(MgrNode, TestTrapMib), - ?line ok = mgr_user_load_mib(MgrNode, TestTrapv2Mib), - ?line ok = agent_load_mib(AgentNode, Test2Mib), - ?line ok = agent_load_mib(AgentNode, TestTrapMib), - ?line ok = agent_load_mib(AgentNode, TestTrapv2Mib), + ok = mgr_user_load_mib(MgrNode, Test2Mib), + ok = mgr_user_load_mib(MgrNode, TestTrapMib), + ok = mgr_user_load_mib(MgrNode, TestTrapv2Mib), + ok = agent_load_mib(AgentNode, Test2Mib), + ok = agent_load_mib(AgentNode, TestTrapMib), + ok = agent_load_mib(AgentNode, TestTrapv2Mib), Cmd1 = fun() -> @@ -4572,16 +4572,16 @@ do_inform4(Config) -> MgrNode = ?config(manager_node, Config), AgentNode = ?config(agent_node, Config), - ?line ok = mgr_user_load_mib(MgrNode, snmpv2_mib()), + ok = mgr_user_load_mib(MgrNode, snmpv2_mib()), Test2Mib = test2_mib(Config), TestTrapMib = test_trap_mib(Config), TestTrapv2Mib = test_trap_v2_mib(Config), - ?line ok = mgr_user_load_mib(MgrNode, Test2Mib), - ?line ok = mgr_user_load_mib(MgrNode, TestTrapMib), - ?line ok = mgr_user_load_mib(MgrNode, TestTrapv2Mib), - ?line ok = agent_load_mib(AgentNode, Test2Mib), - ?line ok = agent_load_mib(AgentNode, TestTrapMib), - ?line ok = agent_load_mib(AgentNode, TestTrapv2Mib), + ok = mgr_user_load_mib(MgrNode, Test2Mib), + ok = mgr_user_load_mib(MgrNode, TestTrapMib), + ok = mgr_user_load_mib(MgrNode, TestTrapv2Mib), + ok = agent_load_mib(AgentNode, Test2Mib), + ok = agent_load_mib(AgentNode, TestTrapMib), + ok = agent_load_mib(AgentNode, TestTrapv2Mib), Cmd1 = fun() -> @@ -4709,16 +4709,16 @@ do_inform_swarm(NumI, Config) -> AgentNode = ?config(agent_node, Config), Factor = ?config(snmp_factor, Config), - ?line ok = mgr_user_load_mib(MgrNode, snmpv2_mib()), + ok = mgr_user_load_mib(MgrNode, snmpv2_mib()), Test2Mib = test2_mib(Config), TestTrapMib = test_trap_mib(Config), TestTrapv2Mib = test_trap_v2_mib(Config), - ?line ok = mgr_user_load_mib(MgrNode, Test2Mib), - ?line ok = mgr_user_load_mib(MgrNode, TestTrapMib), - ?line ok = mgr_user_load_mib(MgrNode, TestTrapv2Mib), - ?line ok = agent_load_mib(AgentNode, Test2Mib), - ?line ok = agent_load_mib(AgentNode, TestTrapMib), - ?line ok = agent_load_mib(AgentNode, TestTrapv2Mib), + ok = mgr_user_load_mib(MgrNode, Test2Mib), + ok = mgr_user_load_mib(MgrNode, TestTrapMib), + ok = mgr_user_load_mib(MgrNode, TestTrapv2Mib), + ok = agent_load_mib(AgentNode, Test2Mib), + ok = agent_load_mib(AgentNode, TestTrapMib), + ok = agent_load_mib(AgentNode, TestTrapv2Mib), NumInforms = NumI div Factor, Collector = self(), @@ -4958,7 +4958,7 @@ async_exec([], Acc) -> async_verify(async_collector(Acc, [])); async_exec([{Id, Data, Exec, Ver}|Reqs], Acc) -> ?IPRINT("issue async request ~w", [Id]), - ?line {ok, ReqId} = Exec(Data), + {ok, ReqId} = Exec(Data), async_exec(Reqs, [{ReqId, Id, Ver}|Acc]). async_collector([], Acc) -> @@ -5053,11 +5053,11 @@ command_handler([{No, Desc, Cmd}|Cmds]) -> {error, Reason} -> ?EPRINT("Command_handler -> ~w error: " "~n ~p", [No, Reason]), - ?line ?FAIL({command_failed, No, Reason}); + ?FAIL({command_failed, No, Reason}); Error -> ?EPRINT("Command_handler -> ~w unexpected: " "~n ~p", [No, Error]), - ?line ?FAIL({unexpected_command_result, No, Error}) + ?FAIL({unexpected_command_result, No, Error}) end. @@ -5088,13 +5088,13 @@ init_manager(Case, AutoInform, Config) -> %% Start and initiate crypto on manager node %% - ?line ok = init_crypto(Node), + ok = init_crypto(Node), %% %% Write manager config %% - ?line ok = write_manager_config(Config), + ok = write_manager_config(Config), IRB = case AutoInform of true -> @@ -5148,7 +5148,7 @@ init_v3_manager(Case, Config) -> %% Start and initiate crypto on manager node %% - ?line ok = init_crypto(Node), + ok = init_crypto(Node), %% %% Write manager config @@ -5156,7 +5156,7 @@ init_v3_manager(Case, Config) -> %% DomainType is just a "dummy" arg to make the %% function choose transportDomainUdpIpv4 as transport domain. - ?line ok = write_manager_config(transport, Config), + ok = write_manager_config(transport, Config), IRB = auto, Conf = [{manager_node, Node}, {manager_peer, Peer}, {irb, IRB} | Config], @@ -5228,14 +5228,14 @@ init_agent(Case, Config) -> %% Start and initiate mnesia on agent node %% - ?line ok = init_mnesia(Node, Dir, ?config(mnesia_debug, Config)), + ok = init_mnesia(Node, Dir, ?config(mnesia_debug, Config)), %% -- %% Start and initiate crypto on agent node %% - ?line ok = init_crypto(Node), + ok = init_crypto(Node), %% @@ -5243,7 +5243,7 @@ init_agent(Case, Config) -> %% Vsns = [v1,v2], - ?line ok = write_agent_config(Vsns, Config), + ok = write_agent_config(Vsns, Config), Conf = [{agent_node, Node}, {agent_peer, Peer}, {mib_dir, MibDir} | Config], @@ -5303,7 +5303,7 @@ init_v3_agent(Case, Config) -> %% Start and initiate crypto on agent node %% - ?line ok = init_crypto(Node), + ok = init_crypto(Node), %% @@ -5311,7 +5311,7 @@ init_v3_agent(Case, Config) -> %% Vsns = [v3], - ?line ok = write_agent_config(Vsns, Config), + ok = write_agent_config(Vsns, Config), Conf = [{agent_node, Node}, {agent_peer, Peer}, {mib_dir, MibDir} | Config], @@ -5373,52 +5373,52 @@ init_mnesia(Node, Dir, MnesiaDebug) init_mnesia(Node, Dir, ?DEFAULT_MNESIA_DEBUG); init_mnesia(Node, Dir, MnesiaDebug) -> ?DBG("init_mnesia -> load application mnesia", []), - ?line ok = load_mnesia(Node), + ok = load_mnesia(Node), ?DBG("init_mnesia -> application mnesia: set_env dir: ~n~p",[Dir]), - ?line ok = set_mnesia_env(Node, dir, filename:join(Dir, "mnesia")), + ok = set_mnesia_env(Node, dir, filename:join(Dir, "mnesia")), %% Just in case, only set (known to be) valid values for debug if ((MnesiaDebug =:= debug) orelse (MnesiaDebug =:= trace)) -> ?DBG("init_mnesia -> application mnesia: set_env debug: ~w", [MnesiaDebug]), - ?line ok = set_mnesia_env(Node, debug, MnesiaDebug); + ok = set_mnesia_env(Node, debug, MnesiaDebug); true -> ok end, ?DBG("init_mnesia -> create mnesia schema",[]), - ?line case create_schema(Node) of + case create_schema(Node) of ok -> ok; {error, {Node, {already_exists, Node}}} -> - ?line ok = delete_schema(Node), - ?line ok = create_schema(Node); + ok = delete_schema(Node), + ok = create_schema(Node); Error -> ?FAIL({failed_creating_mnesia_schema, Error}) end, ?DBG("init_mnesia -> start application mnesia",[]), - ?line ok = start_mnesia(Node), + ok = start_mnesia(Node), ?DBG("init_mnesia -> create tables",[]), - ?line ok = create_tables(Node), + ok = create_tables(Node), ok. fin_mnesia(Node) -> - ?line ok = delete_tables(Node), - ?line ok = stop_mnesia(Node), + ok = delete_tables(Node), + ok = stop_mnesia(Node), ok. init_crypto(Node) -> - ?line ok = load_crypto(Node), - ?line ok = start_crypto(Node), + ok = load_crypto(Node), + ok = start_crypto(Node), ok. fin_crypto(Node) -> - ?line ok = stop_crypto(Node), + ok = stop_crypto(Node), ok. @@ -5635,7 +5635,7 @@ init_mgr_user(Conf) -> Node = ?config(manager_node, Conf), %% UserId = ?config(user_id, Conf), - ?line {ok, User} = mgr_user_start(Node), + {ok, User} = mgr_user_start(Node), ?DBG("start_mgr_user -> User: ~p", [User]), link(User), @@ -5648,7 +5648,7 @@ init_mgr_v3_user(Conf) -> Node = ?config(manager_node, Conf), %% UserId = ?config(user_id, Conf), - ?line {ok, User} = mgr_user_start(Node), + {ok, User} = mgr_user_start(Node), ?IPRINT("start_mgr_v3_user -> User: ~p", [User]), link(User), @@ -5660,7 +5660,7 @@ init_mgr_v3_user(Conf) -> [ {auth, select_auth_proto(AuthAlg)}, {auth_key, AuthKey} ], - ?line ok = mgr_register_usm_user(Node, EngineID, SecName, Credentials), + ok = mgr_register_usm_user(Node, EngineID, SecName, Credentials), ?IPRINT("start_mgr_v3_user -> done"), [{user_pid, User} | Conf]. @@ -5696,7 +5696,7 @@ fin_mgr_user(Conf) -> User = ?config(user_pid, Conf), unlink(User), Node = ?config(manager_node, Conf), - ?line ok = mgr_user_stop(Node), + ok = mgr_user_stop(Node), Conf. init_mgr_user_data1(Conf) -> @@ -5705,7 +5705,7 @@ init_mgr_user_data1(Conf) -> IpFamily = ?config(ipfamily, Conf), Ip = ?config(ip, Conf), Port = ?AGENT_PORT, - ?line ok = + ok = case IpFamily of inet -> mgr_user_register_agent( @@ -5723,19 +5723,19 @@ init_mgr_user_data1(Conf) -> _Agents = mgr_user_which_own_agents(Node), ?DBG("Own agents: ~p", [_Agents]), - ?line {ok, _DefAgentConf} = mgr_user_agent_info(Node, TargetName, all), + {ok, _DefAgentConf} = mgr_user_agent_info(Node, TargetName, all), ?DBG("Default agent config: ~n~p", [_DefAgentConf]), - ?line ok = mgr_user_update_agent_info(Node, TargetName, + ok = mgr_user_update_agent_info(Node, TargetName, community, "all-rights"), - ?line ok = mgr_user_update_agent_info(Node, TargetName, + ok = mgr_user_update_agent_info(Node, TargetName, sec_name, "all-rights"), - ?line ok = mgr_user_update_agent_info(Node, TargetName, + ok = mgr_user_update_agent_info(Node, TargetName, engine_id, "agentEngine"), - ?line ok = mgr_user_update_agent_info(Node, TargetName, + ok = mgr_user_update_agent_info(Node, TargetName, max_message_size, 1024), - ?line {ok, _AgentConf} = mgr_user_agent_info(Node, TargetName, all), + {ok, _AgentConf} = mgr_user_agent_info(Node, TargetName, all), ?DBG("Updated agent config: ~n~p", [_AgentConf]), Conf. @@ -5747,7 +5747,7 @@ init_mgr_user_data2(Conf) -> IpFamily = ?config(ipfamily, Conf), Ip = ?config(ip, Conf), Port = ?AGENT_PORT, - ?line ok = + ok = case IpFamily of inet -> mgr_user_register_agent( @@ -5765,17 +5765,17 @@ init_mgr_user_data2(Conf) -> _Agents = mgr_user_which_own_agents(Node), ?DBG("Own agents: ~p", [_Agents]), - ?line {ok, _DefAgentConf} = mgr_user_agent_info(Node, TargetName, all), + {ok, _DefAgentConf} = mgr_user_agent_info(Node, TargetName, all), ?DBG("Default agent config: ~n~p", [_DefAgentConf]), - ?line ok = mgr_user_update_agent_info(Node, TargetName, + ok = mgr_user_update_agent_info(Node, TargetName, community, "all-rights"), - ?line ok = mgr_user_update_agent_info(Node, TargetName, + ok = mgr_user_update_agent_info(Node, TargetName, sec_name, "all-rights"), - ?line ok = mgr_user_update_agent_info(Node, TargetName, + ok = mgr_user_update_agent_info(Node, TargetName, max_message_size, 1024), - ?line {ok, _AgentConf} = mgr_user_agent_info(Node, TargetName, all), + {ok, _AgentConf} = mgr_user_agent_info(Node, TargetName, all), ?DBG("Updated agent config: ~n~p", [_AgentConf]), Conf. @@ -5787,7 +5787,7 @@ init_mgr_v3_user_data(Conf) -> IpFamily = ?config(ipfamily, Conf), Ip = ?config(ip, Conf), Port = ?AGENT_PORT, - ?line ok = + ok = case IpFamily of inet -> mgr_user_register_agent( @@ -5807,22 +5807,22 @@ init_mgr_v3_user_data(Conf) -> _Agents = mgr_user_which_own_agents(Node), ?IPRINT("Own agents: ~p", [_Agents]), - ?line {ok, _DefAgentConf} = mgr_user_agent_info(Node, TargetName, all), + {ok, _DefAgentConf} = mgr_user_agent_info(Node, TargetName, all), ?IPRINT("Default agent config: ~n~p", [_DefAgentConf]), - ?line ok = mgr_user_update_agent_info(Node, TargetName, + ok = mgr_user_update_agent_info(Node, TargetName, community, "all-rights"), SecName = select_secname_from_authalg(?config(auth_alg, Conf)), - ?line ok = mgr_user_update_agent_info(Node, TargetName, + ok = mgr_user_update_agent_info(Node, TargetName, sec_name, SecName), - ?line ok = mgr_user_update_agent_info(Node, TargetName, + ok = mgr_user_update_agent_info(Node, TargetName, sec_level, authNoPriv), - ?line ok = mgr_user_update_agent_info(Node, TargetName, + ok = mgr_user_update_agent_info(Node, TargetName, sec_model, usm), - ?line ok = mgr_user_update_agent_info(Node, TargetName, + ok = mgr_user_update_agent_info(Node, TargetName, max_message_size, 1024), - ?line {ok, _AgentConf} = mgr_user_agent_info(Node, TargetName, all), + {ok, _AgentConf} = mgr_user_agent_info(Node, TargetName, all), ?IPRINT("Updated agent config: ~n~p", [_AgentConf]), Conf. @@ -5965,9 +5965,9 @@ start_manager(Node, Vsns, Conf0, _Opts) -> {cbproxy, CBP}, {netif_sup, NIS}]}, {net_if, NetIfConf}], - ?line ok = set_mgr_env(Node, Env), + ok = set_mgr_env(Node, Env), - ?line ok = try start_snmp(Node) of + ok = try start_snmp(Node) of ok -> ok; {error, Reason} -> @@ -6032,9 +6032,9 @@ start_agent(Node, Vsns, Conf0, _Opts) -> %% (which will cause problems for some test cases). {options, [{bind_to, true}]}]}, {multi_threaded, true}], - ?line ok = set_agent_env(Node, Env), + ok = set_agent_env(Node, Env), - ?line try start_snmp(Node) of + try start_snmp(Node) of ok -> ok; {error, Reason} -> @@ -6122,21 +6122,21 @@ write_manager_conf(Dir, Str) -> write_agent_config(Vsns, Conf) -> Dir = ?config(agent_conf_dir, Conf), - ?line Ip = tuple_to_list(?config(ip, Conf)), - ?line Domain = + Ip = tuple_to_list(?config(ip, Conf)), + Domain = case ?config(ipfamily, Conf) of inet -> transportDomainUdpIpv4; inet6 -> transportDomainUdpIpv6 end, - ?line ok = write_agent_config_files(Dir, Vsns, Domain, Ip), - ?line ok = update_agent_usm(Vsns, Dir), - ?line ok = update_agent_community(Vsns, Dir), - ?line ok = update_agent_vacm(Vsns, Dir), - ?line ok = write_agent_target_addr_conf(Dir, Domain, Ip, Vsns), - ?line ok = write_agent_target_params_conf(Dir, Vsns), - ?line ok = write_agent_notify_conf(Dir), + ok = write_agent_config_files(Dir, Vsns, Domain, Ip), + ok = update_agent_usm(Vsns, Dir), + ok = update_agent_community(Vsns, Dir), + ok = update_agent_vacm(Vsns, Dir), + ok = write_agent_target_addr_conf(Dir, Domain, Ip, Vsns), + ok = write_agent_target_params_conf(Dir, Vsns), + ok = write_agent_notify_conf(Dir), ok. write_agent_config_files(Dir, Vsns, Domain, Ip) -> @@ -6279,8 +6279,8 @@ write_agent_notify_conf(Dir) -> write_conf_file(Dir, File, Str) -> - ?line {ok, Fd} = file:open(filename:join(Dir, File), write), - ?line ok = io:format(Fd, "~s", [Str]), + {ok, Fd} = file:open(filename:join(Dir, File), write), + ok = io:format(Fd, "~s", [Str]), file:close(Fd). diff --git a/lib/snmp/test/snmp_manager_config_SUITE.erl b/lib/snmp/test/snmp_manager_config_SUITE.erl index ae47744fe8..2d3b2b3c0b 100644 --- a/lib/snmp/test/snmp_manager_config_SUITE.erl +++ b/lib/snmp/test/snmp_manager_config_SUITE.erl @@ -272,22 +272,22 @@ init_per_testcase(Case, Config) when is_list(Config) -> SuiteTopDir = ?config(snmp_suite_top_dir, Config), CaseTopDir = filename:join(SuiteTopDir, atom_to_list(Case)), - ?line ok = file:make_dir(CaseTopDir), + ok = file:make_dir(CaseTopDir), ?IPRINT("init_per_testcase -> CaseTopDir: ~p", [CaseTopDir]), MgrTopDir = filename:join(CaseTopDir, "manager/"), - ?line ok = file:make_dir(MgrTopDir), + ok = file:make_dir(MgrTopDir), MgrConfDir = filename:join(MgrTopDir, "conf/"), - ?line ok = file:make_dir(MgrConfDir), + ok = file:make_dir(MgrConfDir), MgrDbDir = filename:join(MgrTopDir, "db/"), case Case of start_with_create_db_and_dir_opt -> ok; _ -> - ?line ok = file:make_dir(MgrDbDir) + ok = file:make_dir(MgrDbDir) end, MgrLogDir = filename:join(MgrTopDir, "log/"), - ?line ok = file:make_dir(MgrLogDir), + ok = file:make_dir(MgrLogDir), Config1 = [{case_top_dir, CaseTopDir}, {manager_dir, MgrTopDir}, {manager_conf_dir, MgrConfDir}, @@ -338,8 +338,8 @@ simple_start_and_stop(Conf) when is_list(Conf) -> Opts = [{versions, [v1]}, {config, [{verbosity, trace}, {dir, ConfDir}, {db_dir, DbDir}]}], - ?line {ok, _Pid} = snmpm_config:start_link(Opts), - ?line ok = snmpm_config:stop(), + {ok, _Pid} = snmpm_config:start_link(Opts), + ok = snmpm_config:stop(), ok. @@ -367,7 +367,7 @@ start_without_mandatory_opts1(Conf) when is_list(Conf) -> ?IPRINT("config option, but no dir"), Opts = [{priority, normal}, {config, [{verbosity, trace}, {db_dir, DbDir}]}, {mibs, []}], - ?line {error, {missing_mandatory,dir}} = config_start(Opts), + {error, {missing_mandatory,dir}} = config_start(Opts), ?IPRINT("done"), ok. @@ -395,7 +395,7 @@ start_without_mandatory_opts2(Conf) when is_list(Conf) -> ?IPRINT("no config option"), Opts = [{priority, normal}, {mibs, []}], - ?line {error, {missing_mandatory,config,[dir, db_dir]}} = + {error, {missing_mandatory,config,[dir, db_dir]}} = config_start(Opts), ?IPRINT("done"), @@ -456,8 +456,8 @@ start_with_all_valid_opts(Conf) when is_list(Conf) -> {priority, Prio}, {mibs, Mibs}, {versions, Vsns}], - ?line {ok, _Pid} = config_start(Opts), - ?line ok = config_stop(), + {ok, _Pid} = config_start(Opts), + ok = config_stop(), ?IPRINT("done"), ok. @@ -510,10 +510,10 @@ start_with_unknown_opts(Conf) when is_list(Conf) -> {priority, Prio}, {mibs, Mibs}, {versions, Vsns}], - ?line {ok, _Pid} = config_start(Opts), + {ok, _Pid} = config_start(Opts), ?IPRINT("(config) started - now stop"), - ?line ok = config_stop(), + ok = config_stop(), ?IPRINT("done"), ok. @@ -544,35 +544,35 @@ start_with_incorrect_opts(Conf) when is_list(Conf) -> NetIfOpts1 = [{module, snmpm_user}], %% Behaviour check will fail Opts01 = [{config, ConfigOpts}, {versions, [v1]}, {net_if, NetIfOpts1}], - ?line {error, Reason01} = config_start(Opts01), + {error, Reason01} = config_start(Opts01), ?IPRINT("net-if (module) res: ~p", [Reason01]), ?IPRINT("net-if - incorrect verbosity"), NetIfOpts2 = [{verbosity, invalid_verbosity}], Opts02 = [{config, ConfigOpts}, {versions, [v1]}, {net_if, NetIfOpts2}], - ?line {error, Reason02} = config_start(Opts02), + {error, Reason02} = config_start(Opts02), ?IPRINT("net-if (verbosity) res: ~p", [Reason02]), ?IPRINT("net-if - incorrect options"), NetIfOpts3 = [{options, invalid_options}], Opts03 = [{config, ConfigOpts}, {versions, [v1]}, {net_if, NetIfOpts3}], - ?line {error, Reason03} = config_start(Opts03), + {error, Reason03} = config_start(Opts03), ?IPRINT("net-if (options) res: ~p", [Reason03]), ?IPRINT("server - incorrect timeout (1)"), ServerOpts1 = [{timeout, invalid_timeout}], Opts08 = [{config, ConfigOpts}, {versions, [v1]}, {server, ServerOpts1}], - ?line {error, Reason08} = config_start(Opts08), + {error, Reason08} = config_start(Opts08), ?IPRINT("server (timeout) res: ~p", [Reason08]), ?IPRINT("server - incorrect timeout (2)"), ServerOpts2 = [{timeout, 0}], Opts09 = [{config, ConfigOpts}, {versions, [v1]}, {server, ServerOpts2}], - ?line {error, Reason09} = config_start(Opts09), + {error, Reason09} = config_start(Opts09), ?IPRINT("server (timeout) res: ~p", [Reason09]), ?IPRINT("server - incorrect timeout (3)"), @@ -580,7 +580,7 @@ start_with_incorrect_opts(Conf) when is_list(Conf) -> Opts10 = [{config, ConfigOpts}, {versions, [v1]}, {server, ServerOpts3}], - ?line {error, Reason10} = config_start(Opts10), + {error, Reason10} = config_start(Opts10), ?IPRINT("server (timeout) res: ~p", [Reason10]), ?IPRINT("server - incorrect verbosity"), @@ -588,7 +588,7 @@ start_with_incorrect_opts(Conf) when is_list(Conf) -> Opts11 = [{config, ConfigOpts}, {versions, [v1]}, {server, ServerOpts4}], - ?line {error, Reason11} = config_start(Opts11), + {error, Reason11} = config_start(Opts11), ?IPRINT("server (verbosity) res: ~p", [Reason11]), ?IPRINT("note-store - incorrect timeout (1)"), @@ -596,7 +596,7 @@ start_with_incorrect_opts(Conf) when is_list(Conf) -> Opts12 = [{config, ConfigOpts}, {versions, [v1]}, {note_store, NoteStoreOpts1}], - ?line {error, Reason12} = config_start(Opts12), + {error, Reason12} = config_start(Opts12), ?IPRINT("note-store (timeout) res: ~p", [Reason12]), ?IPRINT("note-store - incorrect timeout (2)"), @@ -604,7 +604,7 @@ start_with_incorrect_opts(Conf) when is_list(Conf) -> Opts13 = [{config, ConfigOpts}, {versions, [v1]}, {note_store, NoteStoreOpts2}], - ?line {error, Reason13} = config_start(Opts13), + {error, Reason13} = config_start(Opts13), ?IPRINT("note-store (timeout) res: ~p", [Reason13]), ?IPRINT("note-store - incorrect timeout (3)"), @@ -612,7 +612,7 @@ start_with_incorrect_opts(Conf) when is_list(Conf) -> Opts14 = [{config, ConfigOpts}, {versions, [v1]}, {note_store, NoteStoreOpts3}], - ?line {error, Reason14} = config_start(Opts14), + {error, Reason14} = config_start(Opts14), ?IPRINT("note-store (timeout) res: ~p", [Reason14]), ?IPRINT("note-store - incorrect verbosity"), @@ -620,28 +620,28 @@ start_with_incorrect_opts(Conf) when is_list(Conf) -> Opts15 = [{config, ConfigOpts}, {versions, [v1]}, {note_store, NoteStoreOpts4}], - ?line {error, Reason15} = config_start(Opts15), + {error, Reason15} = config_start(Opts15), ?IPRINT("note-store (verbosity) res: ~p", [Reason15]), ?IPRINT("config - incorrect dir (1)"), ConfigOpts1 = [{dir, invalid_dir}], Opts16 = [{config, ConfigOpts1}, {versions, [v1]}], - ?line {error, Reason16} = config_start(Opts16), + {error, Reason16} = config_start(Opts16), ?IPRINT("config (dir) res: ~p", [Reason16]), ?IPRINT("config - incorrect dir (2)"), ConfigOpts2 = [{dir, "/invalid/dir"}], Opts17 = [{config, ConfigOpts2}, {versions, [v1]}], - ?line {error, Reason17} = config_start(Opts17), + {error, Reason17} = config_start(Opts17), ?IPRINT("config (dir) res: ~p", [Reason17]), ?IPRINT("config - incorrect verbosity"), ConfigOpts3 = [{dir, ConfDir}, {verbosity, invalid_verbosity}], Opts18 = [{config, ConfigOpts3}, {versions, [v1]}], - ?line {error, Reason18} = config_start(Opts18), + {error, Reason18} = config_start(Opts18), ?IPRINT("config (verbosity) res: ~p", [Reason18]), ?IPRINT("mibs - incorrect mibs (1)"), @@ -649,7 +649,7 @@ start_with_incorrect_opts(Conf) when is_list(Conf) -> Opts19 = [{config, ConfigOpts}, {versions, [v1]}, {mibs, Mibs1}], - ?line {error, Reason19} = config_start(Opts19), + {error, Reason19} = config_start(Opts19), ?IPRINT("mibs (mibs) res: ~p", [Reason19]), ?IPRINT("mibs - incorrect mibs (2)"), @@ -657,7 +657,7 @@ start_with_incorrect_opts(Conf) when is_list(Conf) -> Opts20 = [{config, ConfigOpts}, {versions, [v1]}, {mibs, Mibs2}], - ?line {error, Reason20} = config_start(Opts20), + {error, Reason20} = config_start(Opts20), ?IPRINT("mibs (mibs) res: ~p", [Reason20]), ?IPRINT("prio - incorrect prio"), @@ -665,7 +665,7 @@ start_with_incorrect_opts(Conf) when is_list(Conf) -> Opts21 = [{config, ConfigOpts}, {versions, [v1]}, {priority, Prio1}], - ?line {error, Reason21} = config_start(Opts21), + {error, Reason21} = config_start(Opts21), ?IPRINT("prio (prio) res: ~p", [Reason21]), ?IPRINT("atl - incorrect type"), @@ -676,7 +676,7 @@ start_with_incorrect_opts(Conf) when is_list(Conf) -> Opts22 = [{config, ConfigOpts}, {versions, [v1]}, {audit_trail_log, ATL1}], - ?line {error, Reason22} = config_start(Opts22), + {error, Reason22} = config_start(Opts22), ?IPRINT("atl (type) res: ~p", [Reason22]), ?IPRINT("atl - incorrect dir (1)"), @@ -687,7 +687,7 @@ start_with_incorrect_opts(Conf) when is_list(Conf) -> Opts23 = [{config, ConfigOpts}, {versions, [v1]}, {audit_trail_log, ATL2}], - ?line {error, Reason23} = config_start(Opts23), + {error, Reason23} = config_start(Opts23), ?IPRINT("atl (dir) res: ~p", [Reason23]), ?IPRINT("atl - incorrect dir (2)"), @@ -698,7 +698,7 @@ start_with_incorrect_opts(Conf) when is_list(Conf) -> Opts24 = [{config, ConfigOpts}, {versions, [v1]}, {audit_trail_log, ATL3}], - ?line {error, Reason24} = config_start(Opts24), + {error, Reason24} = config_start(Opts24), ?IPRINT("atl (dir) res: ~p", [Reason24]), ?IPRINT("atl - incorrect size (1)"), @@ -709,7 +709,7 @@ start_with_incorrect_opts(Conf) when is_list(Conf) -> Opts25 = [{config, ConfigOpts}, {versions, [v1]}, {audit_trail_log, ATL4}], - ?line {error, Reason25} = config_start(Opts25), + {error, Reason25} = config_start(Opts25), ?IPRINT("atl (size) res: ~p", [Reason25]), ?IPRINT("atl - incorrect size (2)"), @@ -720,7 +720,7 @@ start_with_incorrect_opts(Conf) when is_list(Conf) -> Opts26 = [{config, ConfigOpts}, {versions, [v1]}, {audit_trail_log, ATL5}], - ?line {error, Reason26} = config_start(Opts26), + {error, Reason26} = config_start(Opts26), ?IPRINT("atl (size) res: ~p", [Reason26]), ?IPRINT("atl - incorrect size (3)"), @@ -731,7 +731,7 @@ start_with_incorrect_opts(Conf) when is_list(Conf) -> Opts27 = [{config, ConfigOpts}, {versions, [v1]}, {audit_trail_log, ATL6}], - ?line {error, Reason27} = config_start(Opts27), + {error, Reason27} = config_start(Opts27), ?IPRINT("atl (size) res: ~p", [Reason27]), ?IPRINT("atl - incorrect repair"), @@ -742,21 +742,21 @@ start_with_incorrect_opts(Conf) when is_list(Conf) -> Opts28 = [{config, ConfigOpts}, {versions, [v1]}, {audit_trail_log, ATL7}], - ?line {error, Reason28} = config_start(Opts28), + {error, Reason28} = config_start(Opts28), ?IPRINT("atl (repair) res: ~p", [Reason28]), ?IPRINT("version - incorrect versions (1)"), Vsns1 = invalid_vsns, Opts29 = [{config, ConfigOpts}, {versions, Vsns1}], - ?line {error, Reason29} = config_start(Opts29), + {error, Reason29} = config_start(Opts29), ?IPRINT("versions (versions) res: ~p", [Reason29]), ?IPRINT("version - incorrect versions (2)"), Vsns2 = [v1,v2,v3,v9], Opts30 = [{config, ConfigOpts}, {versions, Vsns2}], - ?line {error, Reason30} = config_start(Opts30), + {error, Reason30} = config_start(Opts30), ?IPRINT("versions (versions) res: ~p", [Reason30]), ?IPRINT("done"), @@ -784,136 +784,136 @@ start_with_invalid_manager_conf_file1(Conf) when is_list(Conf) -> ?IPRINT("write manager config file with invalid IP address (1)"), write_manager_conf(ConfDir, "arne-anka", "4001", "500", "\"bmkEngine\""), - ?line {error, Reason11} = config_start(Opts), + {error, Reason11} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason11]), - ?line {failed_reading, _, _, 1, {parse_error, _}} = Reason11, + {failed_reading, _, _, 1, {parse_error, _}} = Reason11, config_ensure_not_running(), %% -- ?IPRINT("write manager config file with invalid IP address (2)"), write_manager_conf(ConfDir, "arne_anka", "4001", "500", "\"bmkEngine\""), - ?line {error, Reason12} = config_start(Opts), + {error, Reason12} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason12]), - ?line {failed_check, _, _, 2, {bad_address, _}} = Reason12, + {failed_check, _, _, 2, {bad_address, _}} = Reason12, config_ensure_not_running(), %% -- ?IPRINT("write manager config file with invalid IP address (3)"), write_manager_conf(ConfDir, "9999", "4001", "500", "\"bmkEngine\""), - ?line {error, Reason13} = config_start(Opts), + {error, Reason13} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason13]), - ?line {failed_check, _, _, 2, {bad_address, _}} = Reason13, + {failed_check, _, _, 2, {bad_address, _}} = Reason13, config_ensure_not_running(), %% -- ?IPRINT("write manager config file with invalid port (2)"), write_manager_conf(ConfDir, "[134,138,177,189]", "kalle-anka", "500", "\"bmkEngine\""), - ?line {error, Reason21} = config_start(Opts), + {error, Reason21} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason21]), - ?line {failed_reading, _, _, 2, {parse_error, _}} = Reason21, + {failed_reading, _, _, 2, {parse_error, _}} = Reason21, config_ensure_not_running(), %% -- ?IPRINT("write manager config file with invalid port (1)"), write_manager_conf(ConfDir, "[134,138,177,189]", "-1", "500", "\"bmkEngine\""), - ?line {error, Reason22} = config_start(Opts), + {error, Reason22} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason22]), io:format("Reason22: ~p~n", [Reason22]), - ?line {failed_check, _, _, 3, {bad_port, _}} = Reason22, + {failed_check, _, _, 3, {bad_port, _}} = Reason22, config_ensure_not_running(), %% -- ?IPRINT("write manager config file with invalid port (3)"), write_manager_conf(ConfDir, "[134,138,177,189]", "\"kalle-anka\"", "500", "\"bmkEngine\""), - ?line {error, Reason23} = config_start(Opts), + {error, Reason23} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason23]), - ?line {failed_check, _, _, 3, {bad_port, _}} = Reason23, + {failed_check, _, _, 3, {bad_port, _}} = Reason23, config_ensure_not_running(), %% -- ?IPRINT("write manager config file with invalid EngineID (1)"), write_manager_conf(ConfDir, "[134,138,177,189]", "4001", "500", "bmkEngine"), - ?line {error, Reason31} = config_start(Opts), + {error, Reason31} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason31]), - ?line {failed_check, _, _, 5, {invalid_string, _}} = Reason31, + {failed_check, _, _, 5, {invalid_string, _}} = Reason31, config_ensure_not_running(), %% -- ?IPRINT("write manager config file with invalid EngineID (2)"), write_manager_conf(ConfDir, "[134,138,177,189]", "4001", "500", "{1,2,3}"), - ?line {error, Reason32} = config_start(Opts), + {error, Reason32} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason32]), - ?line {failed_check, _, _, 5, {invalid_string, _}} = Reason32, + {failed_check, _, _, 5, {invalid_string, _}} = Reason32, config_ensure_not_running(), %% -- ?IPRINT("write manager config file with invalid EngineID (3)"), write_manager_conf(ConfDir, "[134,138,177,189]", "4001", "500", "10101"), - ?line {error, Reason33} = config_start(Opts), + {error, Reason33} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason33]), - ?line {failed_check, _, _, 5, {invalid_string, _}} = Reason33, + {failed_check, _, _, 5, {invalid_string, _}} = Reason33, config_ensure_not_running(), %% -- ?IPRINT("write manager config file with invalid MMS (1)"), write_manager_conf(ConfDir, "[134,138,177,189]", "4001", "483", "\"bmkEngine\""), - ?line {error, Reason41} = config_start(Opts), + {error, Reason41} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason41]), - ?line {failed_check, _, _, 4, {invalid_integer, _}} = Reason41, + {failed_check, _, _, 4, {invalid_integer, _}} = Reason41, config_ensure_not_running(), %% -- ?IPRINT("write manager config file with invalid MMS (2)"), write_manager_conf(ConfDir, "[134,138,177,189]", "4001", "-1", "\"bmkEngine\""), - ?line {error, Reason42} = config_start(Opts), + {error, Reason42} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason42]), - ?line {failed_check, _, _, 4, {invalid_integer, _}} = Reason42, + {failed_check, _, _, 4, {invalid_integer, _}} = Reason42, config_ensure_not_running(), %% -- ?IPRINT("write manager config file with invalid MMS (3)"), write_manager_conf(ConfDir, "[134,138,177,189]", "4001", "\"kalle-anka\"", "\"bmkEngine\""), - ?line {error, Reason43} = config_start(Opts), + {error, Reason43} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason43]), - ?line {failed_check, _, _, 4, {invalid_integer, _}} = Reason43, + {failed_check, _, _, 4, {invalid_integer, _}} = Reason43, config_ensure_not_running(), %% -- ?IPRINT("write manager config file with invalid MMS (4)"), write_manager_conf(ConfDir, "[134,138,177,189]", "4001", "kalle_anka", "\"bmkEngine\""), - ?line {error, Reason44} = config_start(Opts), + {error, Reason44} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason44]), - ?line {failed_check, _, _, 4, {invalid_integer, _}} = Reason44, + {failed_check, _, _, 4, {invalid_integer, _}} = Reason44, config_ensure_not_running(), %% -- ?IPRINT("write manager config file with unknown option"), write_manager_conf(ConfDir, "{kalle, anka}."), - ?line {error, Reason51} = config_start(Opts), + {error, Reason51} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason51]), - ?line {failed_check, _, _, 1, {unknown_config, _}} = Reason51, + {failed_check, _, _, 1, {unknown_config, _}} = Reason51, config_ensure_not_running(), %% -- ?IPRINT("write manager config file with unknown option"), write_manager_conf(ConfDir, "kalle_anka."), - ?line {error, Reason52} = config_start(Opts), + {error, Reason52} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason52]), - ?line {failed_check, _, _, 1, {unknown_config, _}} = Reason52, + {failed_check, _, _, 1, {unknown_config, _}} = Reason52, config_ensure_not_running(), ?IPRINT("done"), @@ -945,73 +945,73 @@ start_with_invalid_users_conf_file1(Conf) when is_list(Conf) -> %% -- ?IPRINT("write users config file with invalid module (1)"), write_users_conf(ConfDir, [{"kalle", "kalle", "dummy"}]), - ?line {error, Reason11} = config_start(Opts), + {error, Reason11} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason11]), - ?line {failed_check, _, _, _, {bad_module, kalle}} = Reason11, + {failed_check, _, _, _, {bad_module, kalle}} = Reason11, config_ensure_not_running(), %% -- ?IPRINT("write users config file with invalid module (1)"), write_users_conf(ConfDir, [{"kalle", "snmpm", "dummy"}]), - ?line {error, Reason12} = config_start(Opts), + {error, Reason12} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason12]), - ?line {failed_check, _, _, _, {bad_module, _}} = Reason12, + {failed_check, _, _, _, {bad_module, _}} = Reason12, config_ensure_not_running(), %% -- ?IPRINT("write users config file with invalid module (2)"), write_users_conf(ConfDir, [{"kalle1", "10101", "dummy"}]), - ?line {error, Reason13} = config_start(Opts), + {error, Reason13} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason13]), - ?line {failed_check, _, _, _, {bad_module, _}} = Reason13, + {failed_check, _, _, _, {bad_module, _}} = Reason13, config_ensure_not_running(), %% -- ?IPRINT("write users config file with invalid user tuple (1)"), write_users_conf2(ConfDir, "{kalle, snmpm_user_default}."), - ?line {error, Reason21} = config_start(Opts), + {error, Reason21} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason21]), - ?line {failed_check, _, _, _, {bad_user_config, _}} = Reason21, + {failed_check, _, _, _, {bad_user_config, _}} = Reason21, config_ensure_not_running(), %% -- ?IPRINT("write users config file with invalid user tuple (2)"), write_users_conf2(ConfDir, "{kalle, snmpm_user_default, kalle, [], olle}."), - ?line {error, Reason22} = config_start(Opts), + {error, Reason22} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason22]), - ?line {failed_check, _, _, _, {bad_user_config, _}} = Reason22, + {failed_check, _, _, _, {bad_user_config, _}} = Reason22, config_ensure_not_running(), %% -- ?IPRINT("write users config file with invalid user tuple (3)"), write_users_conf2(ConfDir, "snmpm_user_default."), - ?line {error, Reason23} = config_start(Opts), + {error, Reason23} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason23]), - ?line {failed_check, _, _, _, {bad_user_config, _}} = Reason23, + {failed_check, _, _, _, {bad_user_config, _}} = Reason23, config_ensure_not_running(), %% -- ?IPRINT("write users config file with invalid user tuple (4)"), write_users_conf2(ConfDir, "[kalle, snmpm_user_default, kalle]."), - ?line {error, Reason24} = config_start(Opts), + {error, Reason24} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason24]), - ?line {failed_check, _, _, _, {bad_user_config, _}} = Reason24, + {failed_check, _, _, _, {bad_user_config, _}} = Reason24, config_ensure_not_running(), %% -- ?IPRINT("write users config file with invalid user agent default config (1)"), write_users_conf2(ConfDir, "{kalle, snmpm_user_default, kalle, olle}."), - ?line {error, Reason31} = config_start(Opts), + {error, Reason31} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason31]), - ?line {failed_check, _, _, _, {bad_default_agent_config, _}} = Reason31, + {failed_check, _, _, _, {bad_default_agent_config, _}} = Reason31, config_ensure_not_running(), %% -- ?IPRINT("write users config file with invalid user agent default config (2)"), write_users_conf2(ConfDir, "{kalle, snmpm_user_default, kalle, [olle]}."), - ?line {error, Reason32} = config_start(Opts), + {error, Reason32} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason32]), - %% ?line {failed_check, _, _, _, {bad_default_agent_config, _}} = Reason32, + %% {failed_check, _, _, _, {bad_default_agent_config, _}} = Reason32, case Reason32 of {failed_check, _, _, _, {bad_default_agent_config, _}} -> ok; @@ -1059,7 +1059,7 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) -> case config_start(Opts) of {error, Reason11} -> ?IPRINT("start failed (as expected): ~p", [Reason11]), - ?line {failed_reading, _, _, _, {parse_error, _}} = Reason11, + {failed_reading, _, _, _, {parse_error, _}} = Reason11, config_ensure_not_running(); OK_11 -> config_ensure_not_running(), @@ -1073,7 +1073,7 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) -> case config_start(Opts) of {error, Reason21} -> ?IPRINT("start failed (as expected): ~p", [Reason21]), - ?line {failed_reading, _, _, _, {parse_error, _}} = Reason21, + {failed_reading, _, _, _, {parse_error, _}} = Reason21, config_ensure_not_running(); OK_21 -> config_ensure_not_running(), @@ -1087,7 +1087,7 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) -> case config_start(Opts) of {error, Reason22} -> ?IPRINT("start failed (as expected): ~p", [Reason22]), - ?line {failed_check, _, _, _, {invalid_string, _}} = Reason22, + {failed_check, _, _, _, {invalid_string, _}} = Reason22, config_ensure_not_running(); OK_22 -> config_ensure_not_running(), @@ -1101,7 +1101,7 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) -> case config_start(Opts) of {error, Reason23} -> ?IPRINT("start failed (as expected): ~p", [Reason23]), - ?line {failed_check, _, _, _, {invalid_string, _}} = Reason23, + {failed_check, _, _, _, {invalid_string, _}} = Reason23, config_ensure_not_running(); OK_23 -> config_ensure_not_running(), @@ -1115,7 +1115,7 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) -> case config_start(Opts) of {error, Reason31} -> ?IPRINT("start failed (as expected): ~p", [Reason31]), - ?line {failed_reading, _, _, _, {parse_error, _}} = Reason31, + {failed_reading, _, _, _, {parse_error, _}} = Reason31, config_ensure_not_running(); OK_31 -> config_ensure_not_running(), @@ -1129,7 +1129,7 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) -> case config_start(Opts) of {error, Reason32} -> ?IPRINT("start failed (as expected): ~p", [Reason32]), - ?line {failed_check, _, _, _, {invalid_string, _}} = Reason32, + {failed_check, _, _, _, {invalid_string, _}} = Reason32, config_ensure_not_running(); OK_32 -> config_ensure_not_running(), @@ -1143,7 +1143,7 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) -> case config_start(Opts) of {error, Reason33} -> ?IPRINT("start failed (as expected): ~p", [Reason33]), - ?line {failed_check, _, _, _, {invalid_string, _}} = Reason33, + {failed_check, _, _, _, {invalid_string, _}} = Reason33, config_ensure_not_running(); OK_33 -> config_ensure_not_running(), @@ -1157,7 +1157,7 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) -> case config_start(Opts) of {error, Reason51} -> ?IPRINT("start failed (as expected): ~p", [Reason51]), - ?line {failed_check, _, _, _, {bad_domain, _}} = Reason51, + {failed_check, _, _, _, {bad_domain, _}} = Reason51, config_ensure_not_running(); OK_51 -> config_ensure_not_running(), @@ -1171,7 +1171,7 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) -> case config_start(Opts) of {error, Reason52} -> ?IPRINT("start failed (as expected): ~p", [Reason52]), - ?line {failed_check, _, _, _, {bad_address, _}} = Reason52, + {failed_check, _, _, _, {bad_address, _}} = Reason52, config_ensure_not_running(); OK_52 -> config_ensure_not_running(), @@ -1185,7 +1185,7 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) -> case config_start(Opts) of {error, Reason53} -> ?IPRINT("start failed (as expected): ~p", [Reason53]), - ?line {failed_check, _, _, _, {bad_address, _}} = Reason53, + {failed_check, _, _, _, {bad_address, _}} = Reason53, config_ensure_not_running(); OK_53 -> config_ensure_not_running(), @@ -1199,7 +1199,7 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) -> case config_start(Opts) of {error, Reason54} -> ?IPRINT("start failed (as expected): ~p", [Reason54]), - ?line {failed_check, _, _, _, {bad_address, _}} = Reason54, + {failed_check, _, _, _, {bad_address, _}} = Reason54, config_ensure_not_running(); OK_54 -> config_ensure_not_running(), @@ -1210,162 +1210,162 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) -> ?IPRINT("[test 55] write agents config file with invalid ip (5)"), Agent55 = setelement(4, Agent0, "[192,168,0,arne]"), write_agents_conf(ConfDir, [Agent55]), - ?line {error, Reason55} = config_start(Opts), + {error, Reason55} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason55]), - ?line {failed_check, _, _, _, {bad_address, _}} = Reason55, + {failed_check, _, _, _, {bad_address, _}} = Reason55, config_ensure_not_running(), %% -- ?IPRINT("[test 61] write agents config file with invalid port (1)"), Agent61 = setelement(5, Agent0, "kalle_anka"), write_agents_conf(ConfDir, [Agent61]), - ?line {error, Reason61} = config_start(Opts), + {error, Reason61} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason61]), - ?line {failed_check, _, _, _, {bad_address, _}} = Reason61, + {failed_check, _, _, _, {bad_address, _}} = Reason61, config_ensure_not_running(), %% -- ?IPRINT("[test 62] write agents config file with invalid port (2)"), Agent62 = setelement(5, Agent0, "-1"), write_agents_conf(ConfDir, [Agent62]), - ?line {error, Reason62} = config_start(Opts), + {error, Reason62} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason62]), - ?line {failed_check, _, _, _, {bad_address, _}} = Reason62, + {failed_check, _, _, _, {bad_address, _}} = Reason62, config_ensure_not_running(), %% -- ?IPRINT("[test 63] write agents config file with invalid port (3)"), Agent63 = setelement(5, Agent0, "\"100\""), write_agents_conf(ConfDir, [Agent63]), - ?line {error, Reason63} = config_start(Opts), + {error, Reason63} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason63]), - ?line {failed_check, _, _, _, {bad_address, _}} = Reason63, + {failed_check, _, _, _, {bad_address, _}} = Reason63, config_ensure_not_running(), %% -- ?IPRINT("[test 71] write agents config file with invalid engine-id (1)"), Agent71 = setelement(6, Agent0, "kalle_anka"), write_agents_conf(ConfDir, [Agent71]), - ?line {error, Reason71} = config_start(Opts), + {error, Reason71} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason71]), - ?line {failed_check, _, _, _, {invalid_string, _}} = Reason71, + {failed_check, _, _, _, {invalid_string, _}} = Reason71, config_ensure_not_running(), %% -- ?IPRINT("[test 72] write agents config file with invalid engine-id (2)"), Agent72 = setelement(6, Agent0, "10101"), write_agents_conf(ConfDir, [Agent72]), - ?line {error, Reason72} = config_start(Opts), + {error, Reason72} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason72]), - ?line {failed_check, _, _, _, {invalid_string, _}} = Reason72, + {failed_check, _, _, _, {invalid_string, _}} = Reason72, config_ensure_not_running(), %% -- ?IPRINT("[test 81] write agents config file with invalid timeout (1)"), Agent81 = setelement(7, Agent0, "kalle_anka"), write_agents_conf(ConfDir, [Agent81]), - ?line {error, Reason81} = config_start(Opts), + {error, Reason81} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason81]), - ?line {failed_check, _, _, _, {invalid_timer, _}} = Reason81, + {failed_check, _, _, _, {invalid_timer, _}} = Reason81, config_ensure_not_running(), %% -- ?IPRINT("[test 82] write agents config file with invalid timeout (2)"), Agent82 = setelement(7, Agent0, "-1"), write_agents_conf(ConfDir, [Agent82]), - ?line {error, Reason82} = config_start(Opts), + {error, Reason82} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason82]), - ?line {failed_check, _, _, _, {invalid_timer, _}} = Reason82, + {failed_check, _, _, _, {invalid_timer, _}} = Reason82, config_ensure_not_running(), %% -- ?IPRINT("[test 83] write agents config file with invalid timeout (3)"), Agent83 = setelement(7, Agent0, "{1000, 1, 10, kalle}"), write_agents_conf(ConfDir, [Agent83]), - ?line {error, Reason83} = config_start(Opts), + {error, Reason83} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason83]), - ?line {failed_check, _, _, _, {invalid_timer, _}} = Reason83, + {failed_check, _, _, _, {invalid_timer, _}} = Reason83, config_ensure_not_running(), %% -- ?IPRINT("[test 84] write agents config file with invalid timeout (4)"), Agent84 = setelement(7, Agent0, "{1000, -1, 10, 10}"), write_agents_conf(ConfDir, [Agent84]), - ?line {error, Reason84} = config_start(Opts), + {error, Reason84} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason84]), - ?line {failed_check, _, _, _, {invalid_timer, _}} = Reason84, + {failed_check, _, _, _, {invalid_timer, _}} = Reason84, config_ensure_not_running(), %% -- ?IPRINT("[test 85] write agents config file with invalid timeout (5)"), Agent85 = setelement(7, Agent0, "{1000, 1, -100, 10}"), write_agents_conf(ConfDir, [Agent85]), - ?line {error, Reason85} = config_start(Opts), + {error, Reason85} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason85]), - ?line {failed_check, _, _, _, {invalid_timer, _}} = Reason85, + {failed_check, _, _, _, {invalid_timer, _}} = Reason85, config_ensure_not_running(), %% -- ?IPRINT("[test 86] write agents config file with invalid timeout (6)"), Agent86 = setelement(7, Agent0, "{1000, 1, 100, -1}"), write_agents_conf(ConfDir, [Agent86]), - ?line {error, Reason86} = config_start(Opts), + {error, Reason86} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason86]), - ?line {failed_check, _, _, _, {invalid_timer, _}} = Reason86, + {failed_check, _, _, _, {invalid_timer, _}} = Reason86, config_ensure_not_running(), %% -- ?IPRINT("[test 91] write agents config file with invalid max-message-size (1)"), Agent91 = setelement(8, Agent0, "483"), write_agents_conf(ConfDir, [Agent91]), - ?line {error, Reason91} = config_start(Opts), + {error, Reason91} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason91]), - ?line {failed_check, _, _, _, {invalid_packet_size, _}} = Reason91, + {failed_check, _, _, _, {invalid_packet_size, _}} = Reason91, config_ensure_not_running(), %% -- ?IPRINT("[test 92] write agents config file with invalid max-message-size (2)"), Agent92 = setelement(8, Agent0, "kalle_anka"), write_agents_conf(ConfDir, [Agent92]), - ?line {error, Reason92} = config_start(Opts), + {error, Reason92} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason92]), - ?line {failed_check, _, _, _, {invalid_packet_size, _}} = Reason92, + {failed_check, _, _, _, {invalid_packet_size, _}} = Reason92, config_ensure_not_running(), %% -- ?IPRINT("[test A1] write agents config file with invalid version (1)"), AgentA1 = setelement(9, Agent0, "1"), write_agents_conf(ConfDir, [AgentA1]), - ?line {error, ReasonA1} = config_start(Opts), + {error, ReasonA1} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [ReasonA1]), - ?line {failed_check, _, _, _, {bad_version, _}} = ReasonA1, + {failed_check, _, _, _, {bad_version, _}} = ReasonA1, config_ensure_not_running(), %% -- ?IPRINT("[test A2] write agents config file with invalid version (2)"), AgentA2 = setelement(9, Agent0, "v30"), write_agents_conf(ConfDir, [AgentA2]), - ?line {error, ReasonA2} = config_start(Opts), + {error, ReasonA2} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [ReasonA2]), - ?line {failed_check, _, _, _, {bad_version, _}} = ReasonA2, + {failed_check, _, _, _, {bad_version, _}} = ReasonA2, config_ensure_not_running(), %% -- ?IPRINT("[test B1] write agents config file with invalid sec-model (1)"), AgentB1 = setelement(10, Agent0, "\"any\""), write_agents_conf(ConfDir, [AgentB1]), - ?line {error, ReasonB1} = config_start(Opts), + {error, ReasonB1} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [ReasonB1]), - ?line {failed_check, _, _, _, {invalid_sec_model, _}} = ReasonB1, + {failed_check, _, _, _, {invalid_sec_model, _}} = ReasonB1, config_ensure_not_running(), %% -- ?IPRINT("[test B2] write agents config file with invalid sec-model (2)"), AgentB2 = setelement(10, Agent0, "v3"), write_agents_conf(ConfDir, [AgentB2]), - ?line {error, ReasonB2} = config_start(Opts), + {error, ReasonB2} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [ReasonB2]), - ?line {failed_check, _, _, _, {invalid_sec_model, _}} = ReasonB2, + {failed_check, _, _, _, {invalid_sec_model, _}} = ReasonB2, config_ensure_not_running(), %% -- @@ -1375,7 +1375,7 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) -> case config_start(Opts) of {error, ReasonC1} -> ?IPRINT("start failed (as expected): ~p", [ReasonC1]), - ?line {failed_check, _, _, _, {bad_sec_name, _}} = ReasonC1, + {failed_check, _, _, _, {bad_sec_name, _}} = ReasonC1, config_ensure_not_running(); OK_C1 -> config_ensure_not_running(), @@ -1389,7 +1389,7 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) -> case config_start(Opts) of {error, ReasonC2} -> ?IPRINT("start failed (as expected): ~p", [ReasonC2]), - ?line {failed_check, _, _, _, {bad_sec_name, _}} = ReasonC2, + {failed_check, _, _, _, {bad_sec_name, _}} = ReasonC2, config_ensure_not_running(); OK_C2 -> config_ensure_not_running(), @@ -1403,7 +1403,7 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) -> case config_start(Opts) of {error, ReasonD1} -> ?IPRINT("start failed (as expected): ~p", [ReasonD1]), - ?line {failed_check, _, _, _, {invalid_sec_level, _}} = ReasonD1, + {failed_check, _, _, _, {invalid_sec_level, _}} = ReasonD1, config_ensure_not_running(); OK_D1 -> config_ensure_not_running(), @@ -1417,7 +1417,7 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) -> case config_start(Opts) of {error, ReasonD2} -> ?IPRINT("start failed (as expected): ~p", [ReasonD2]), - ?line {failed_check, _, _, _, {invalid_sec_level, _}} = ReasonD2, + {failed_check, _, _, _, {invalid_sec_level, _}} = ReasonD2, config_ensure_not_running(); OK_D2 -> config_ensure_not_running(), @@ -1430,7 +1430,7 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) -> case config_start(Opts) of {error, ReasonE1} -> ?IPRINT("start failed (as expected): ~p", [ReasonE1]), - ?line {failed_check, _, _, _, {bad_agent_config, _}} = ReasonE1, + {failed_check, _, _, _, {bad_agent_config, _}} = ReasonE1, config_ensure_not_running(); OK_E1 -> config_ensure_not_running(), @@ -1487,146 +1487,146 @@ start_with_invalid_usm_conf_file1(Conf) when is_list(Conf) -> ?IPRINT("[test 11] write usm config file with invalid engine-id (1)"), Usm11 = setelement(1, Usm0, "kalle-anka"), write_usm_conf(ConfDir, [Usm11]), - ?line {error, Reason11} = config_start(Opts), + {error, Reason11} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason11]), - ?line {failed_reading, _, _, _, {parse_error, _}} = Reason11, + {failed_reading, _, _, _, {parse_error, _}} = Reason11, config_ensure_not_running(), %% -- ?IPRINT("[test 12] write usm config file with invalid engine-id (2)"), Usm12 = setelement(1, Usm0, "kalle_anka"), write_usm_conf(ConfDir, [Usm12]), - ?line {error, Reason12} = config_start(Opts), + {error, Reason12} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason12]), - ?line {failed_check, _, _, _, {bad_usm_engine_id, _}} = Reason12, + {failed_check, _, _, _, {bad_usm_engine_id, _}} = Reason12, config_ensure_not_running(), %% -- ?IPRINT("[test 13] write usm config file with invalid engine-id (3)"), Usm13 = setelement(1, Usm1, "10101"), write_usm_conf(ConfDir, [Usm13]), - ?line {error, Reason13} = config_start(Opts), + {error, Reason13} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason13]), - ?line {failed_check, _, _, _, {bad_usm_engine_id, _}} = Reason13, + {failed_check, _, _, _, {bad_usm_engine_id, _}} = Reason13, config_ensure_not_running(), %% -- ?IPRINT("[test 21] write usm config file with invalid user-name (1)"), Usm21 = setelement(2, Usm0, "kalle_anka"), write_usm_conf(ConfDir, [Usm21]), - ?line {error, Reason21} = config_start(Opts), + {error, Reason21} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason21]), - ?line {failed_check, _, _, _, {bad_usm_user_name, _}} = Reason21, + {failed_check, _, _, _, {bad_usm_user_name, _}} = Reason21, config_ensure_not_running(), %% -- ?IPRINT("[test 22] write usm config file with invalid user-name (1)"), Usm22 = setelement(2, Usm1, "10101"), write_usm_conf(ConfDir, [Usm22]), - ?line {error, Reason22} = config_start(Opts), + {error, Reason22} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason22]), - ?line {failed_check, _, _, _, {bad_usm_user_name, _}} = Reason22, + {failed_check, _, _, _, {bad_usm_user_name, _}} = Reason22, config_ensure_not_running(), %% -- ?IPRINT("[test 31] write usm config file with invalid sec-name (1)"), Usm31 = setelement(3, Usm1, "kalle_anka"), write_usm_conf(ConfDir, [Usm31]), - ?line {error, Reason31} = config_start(Opts), + {error, Reason31} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason31]), - ?line {failed_check, _, _, _, {bad_usm_sec_name, _}} = Reason31, + {failed_check, _, _, _, {bad_usm_sec_name, _}} = Reason31, config_ensure_not_running(), %% -- ?IPRINT("[test 32] write usm config file with invalid sec-name (2)"), Usm32 = setelement(3, Usm1, "10101"), write_usm_conf(ConfDir, [Usm32]), - ?line {error, Reason32} = config_start(Opts), + {error, Reason32} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason32]), - ?line {failed_check, _, _, _, {bad_usm_sec_name, _}} = Reason32, + {failed_check, _, _, _, {bad_usm_sec_name, _}} = Reason32, config_ensure_not_running(), %% -- ?IPRINT("[test 41] write usm config file with invalid auth-protocol (1)"), Usm41 = setelement(3, Usm0, "\"usmNoAuthProtocol\""), write_usm_conf(ConfDir, [Usm41]), - ?line {error, Reason41} = config_start(Opts), + {error, Reason41} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason41]), - ?line {failed_check, _, _, _, {invalid_auth_protocol, _}} = Reason41, + {failed_check, _, _, _, {invalid_auth_protocol, _}} = Reason41, config_ensure_not_running(), %% -- ?IPRINT("[test 42] write usm config file with invalid auth-protocol (2)"), Usm42 = setelement(3, Usm0, "kalle"), write_usm_conf(ConfDir, [Usm42]), - ?line {error, Reason42} = config_start(Opts), + {error, Reason42} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason42]), - ?line {failed_check, _, _, _, {invalid_auth_protocol, _}} = Reason42, + {failed_check, _, _, _, {invalid_auth_protocol, _}} = Reason42, config_ensure_not_running(), %% -- ?IPRINT("[test 43] write usm config file with invalid auth-protocol (3)"), Usm43 = setelement(3, Usm0, "10101"), write_usm_conf(ConfDir, [Usm43]), - ?line {error, Reason43} = config_start(Opts), + {error, Reason43} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason43]), - ?line {failed_check, _, _, _, {invalid_auth_protocol, _}} = Reason43, + {failed_check, _, _, _, {invalid_auth_protocol, _}} = Reason43, config_ensure_not_running(), %% -- ?IPRINT("[test 51.1] write (auth md5) usm config file with invalid auth-key (1)"), Usm51_1 = setelement(3, Usm0, "usmHMACMD5AuthProtocol"), write_usm_conf(ConfDir, [Usm51_1]), - ?line {error, Reason51_1} = config_start(Opts), + {error, Reason51_1} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason51_1]), - ?line {failed_check, _, _, _, {invalid_auth_key, _, _}} = Reason51_1, + {failed_check, _, _, _, {invalid_auth_key, _, _}} = Reason51_1, config_ensure_not_running(), %% -- ?IPRINT("[test 51.2] write (auth md5) usm config file with invalid auth-key (2)"), Usm51_2 = setelement(4, Usm51_1, "[1,2,3,4,5,6,7,8,9,0,1,2,3,4,5]"), write_usm_conf(ConfDir, [Usm51_2]), - ?line {error, Reason51_2} = config_start(Opts), + {error, Reason51_2} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason51_2]), - ?line {failed_check, _, _, _, {invalid_auth_key, _, 15}} = Reason51_2, + {failed_check, _, _, _, {invalid_auth_key, _, 15}} = Reason51_2, config_ensure_not_running(), %% -- ?IPRINT("[test 51.3] write (auth md5) usm config file with invalid auth-key (3)"), Usm51_3 = setelement(4, Usm51_1, "[1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7]"), write_usm_conf(ConfDir, [Usm51_3]), - ?line {error, Reason51_3} = config_start(Opts), + {error, Reason51_3} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason51_3]), - ?line {failed_check, _, _, _, {invalid_auth_key, _, 17}} = Reason51_3, + {failed_check, _, _, _, {invalid_auth_key, _, 17}} = Reason51_3, config_ensure_not_running(), %% -- ?IPRINT("[test 51.4] write (auth md5) usm config file with invalid auth-key (4)"), Usm51_4 = setelement(4, Usm51_1, "[1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,kalle]"), write_usm_conf(ConfDir, [Usm51_4]), - ?line maybe_start_crypto(), %% Make sure it's started... - ?line {error, Reason51_4} = config_start(Opts), - ?line ok = maybe_stop_crypto(), + maybe_start_crypto(), %% Make sure it's started... + {error, Reason51_4} = config_start(Opts), + ok = maybe_stop_crypto(), ?IPRINT("start failed (as expected): ~p", [Reason51_4]), - ?line {failed_check, _, _, _, {invalid_auth_key, _}} = Reason51_4, + {failed_check, _, _, _, {invalid_auth_key, _}} = Reason51_4, config_ensure_not_running(), %% -- ?IPRINT("[test 51.5] write (auth md5) usm config file with invalid auth-key (5)"), Usm51_5 = setelement(4, Usm51_1, "arne_anka"), write_usm_conf(ConfDir, [Usm51_5]), - ?line {error, Reason51_5} = config_start(Opts), + {error, Reason51_5} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason51_5]), - ?line {failed_check, _, _, _, {invalid_auth_key, _}} = Reason51_5, + {failed_check, _, _, _, {invalid_auth_key, _}} = Reason51_5, config_ensure_not_running(), %% -- ?IPRINT("[test 51.6] write (auth md5) usm config file with invalid auth-key (6)"), Usm51_6 = setelement(4, Usm51_1, "10101"), write_usm_conf(ConfDir, [Usm51_6]), - ?line {error, Reason51_6} = config_start(Opts), + {error, Reason51_6} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason51_6]), - ?line {failed_check, _, _, _, {invalid_auth_key, _}} = Reason51_6, + {failed_check, _, _, _, {invalid_auth_key, _}} = Reason51_6, config_ensure_not_running(), @@ -1635,29 +1635,29 @@ start_with_invalid_usm_conf_file1(Conf) when is_list(Conf) -> ?IPRINT("[test 52.1] write (auth sha) usm config file with invalid auth-key (1)"), Usm52_1 = setelement(3, Usm0, "usmHMACSHAAuthProtocol"), write_usm_conf(ConfDir, [Usm52_1]), - ?line {error, Reason52_1} = config_start(Opts), + {error, Reason52_1} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason52_1]), - ?line {failed_check, _, _, _, {invalid_auth_key, _, _}} = Reason52_1, + {failed_check, _, _, _, {invalid_auth_key, _, _}} = Reason52_1, config_ensure_not_running(), %% -- ?IPRINT("[test 52.2] write (auth sha) usm config file with invalid auth-key (2)"), Usm52_2 = setelement(4, Usm52_1, "[1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6]"), write_usm_conf(ConfDir, [Usm52_2]), - ?line {error, Reason52_2} = config_start(Opts), + {error, Reason52_2} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason52_2]), - ?line {failed_check, _, _, _, {invalid_auth_key, _, 16}} = Reason52_2, + {failed_check, _, _, _, {invalid_auth_key, _, 16}} = Reason52_2, config_ensure_not_running(), %% -- ?IPRINT("[test 52.3] write (auth sha) usm config file with invalid auth-key (3)"), Usm52_3 = setelement(4, Usm52_1, "[1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,ka]"), write_usm_conf(ConfDir, [Usm52_3]), - ?line ok = maybe_start_crypto(), - ?line {error, Reason52_3} = config_start(Opts), - ?line ok = maybe_stop_crypto(), + ok = maybe_start_crypto(), + {error, Reason52_3} = config_start(Opts), + ok = maybe_stop_crypto(), ?IPRINT("start failed (as expected): ~p", [Reason52_3]), - ?line {failed_check, _, _, _, {invalid_auth_key, _}} = Reason52_3, + {failed_check, _, _, _, {invalid_auth_key, _}} = Reason52_3, config_ensure_not_running(), @@ -1666,9 +1666,9 @@ start_with_invalid_usm_conf_file1(Conf) when is_list(Conf) -> ?IPRINT("[test 53.1] write (auth sha224) usm config file with invalid auth-key (1)"), Usm53_1 = setelement(3, Usm0, "usmHMAC128SHA224AuthProtocol"), write_usm_conf(ConfDir, [Usm53_1]), - ?line {error, Reason53_1} = config_start(Opts), + {error, Reason53_1} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason53_1]), - ?line {failed_check, _, _, _, {invalid_auth_key, _, _}} = Reason53_1, + {failed_check, _, _, _, {invalid_auth_key, _, _}} = Reason53_1, config_ensure_not_running(), %% -- @@ -1676,7 +1676,7 @@ start_with_invalid_usm_conf_file1(Conf) when is_list(Conf) -> Usm53_2 = setelement(4, Usm53_1, "[1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8]"), write_usm_conf(ConfDir, [Usm53_2]), - ?line {ok, _} = config_start(Opts), + {ok, _} = config_start(Opts), ?IPRINT("expected start success"), config_ensure_not_running(), @@ -1685,9 +1685,9 @@ start_with_invalid_usm_conf_file1(Conf) when is_list(Conf) -> Usm53_3 = setelement(4, Usm53_1, "[1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7]"), write_usm_conf(ConfDir, [Usm53_3]), - ?line {error, Reason53_3} = config_start(Opts), + {error, Reason53_3} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason53_3]), - ?line {failed_check, _, _, _, {invalid_auth_key, _, 27}} = Reason53_3, + {failed_check, _, _, _, {invalid_auth_key, _, 27}} = Reason53_3, config_ensure_not_running(), %% -- @@ -1695,11 +1695,11 @@ start_with_invalid_usm_conf_file1(Conf) when is_list(Conf) -> Usm53_4 = setelement(4, Usm53_1, "[1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,ka]"), write_usm_conf(ConfDir, [Usm53_4]), - ?line ok = maybe_start_crypto(), - ?line {error, Reason53_4} = config_start(Opts), - ?line ok = maybe_stop_crypto(), + ok = maybe_start_crypto(), + {error, Reason53_4} = config_start(Opts), + ok = maybe_stop_crypto(), ?IPRINT("start failed (as expected): ~p", [Reason53_4]), - ?line {failed_check, _, _, _, {invalid_auth_key, _}} = Reason53_4, + {failed_check, _, _, _, {invalid_auth_key, _}} = Reason53_4, config_ensure_not_running(), @@ -1707,9 +1707,9 @@ start_with_invalid_usm_conf_file1(Conf) when is_list(Conf) -> ?IPRINT("[test 54.1] write (auth sha256) usm config file with invalid auth-key (1)"), Usm54_1 = setelement(3, Usm0, "usmHMAC192SHA256AuthProtocol"), write_usm_conf(ConfDir, [Usm54_1]), - ?line {error, Reason54_1} = config_start(Opts), + {error, Reason54_1} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason54_1]), - ?line {failed_check, _, _, _, {invalid_auth_key, _, _}} = Reason54_1, + {failed_check, _, _, _, {invalid_auth_key, _, _}} = Reason54_1, config_ensure_not_running(), %% -- @@ -1717,7 +1717,7 @@ start_with_invalid_usm_conf_file1(Conf) when is_list(Conf) -> Usm54_2 = setelement(4, Usm54_1, "[1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2]"), write_usm_conf(ConfDir, [Usm54_2]), - ?line {ok, _} = config_start(Opts), + {ok, _} = config_start(Opts), ?IPRINT("expected start success"), config_ensure_not_running(), @@ -1726,9 +1726,9 @@ start_with_invalid_usm_conf_file1(Conf) when is_list(Conf) -> Usm54_3 = setelement(4, Usm54_1, "[1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1]"), write_usm_conf(ConfDir, [Usm54_3]), - ?line {error, Reason54_3} = config_start(Opts), + {error, Reason54_3} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason54_3]), - ?line {failed_check, _, _, _, {invalid_auth_key, _, 31}} = Reason54_3, + {failed_check, _, _, _, {invalid_auth_key, _, 31}} = Reason54_3, config_ensure_not_running(), %% -- @@ -1736,11 +1736,11 @@ start_with_invalid_usm_conf_file1(Conf) when is_list(Conf) -> Usm54_4 = setelement(4, Usm54_1, "[1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,ka]"), write_usm_conf(ConfDir, [Usm54_4]), - ?line ok = maybe_start_crypto(), - ?line {error, Reason54_4} = config_start(Opts), - ?line ok = maybe_stop_crypto(), + ok = maybe_start_crypto(), + {error, Reason54_4} = config_start(Opts), + ok = maybe_stop_crypto(), ?IPRINT("start failed (as expected): ~p", [Reason54_4]), - ?line {failed_check, _, _, _, {invalid_auth_key, _}} = Reason54_4, + {failed_check, _, _, _, {invalid_auth_key, _}} = Reason54_4, config_ensure_not_running(), @@ -1748,9 +1748,9 @@ start_with_invalid_usm_conf_file1(Conf) when is_list(Conf) -> ?IPRINT("[test 55.1] write (auth sha384) usm config file with invalid auth-key (1)"), Usm55_1 = setelement(3, Usm0, "usmHMAC256SHA384AuthProtocol"), write_usm_conf(ConfDir, [Usm55_1]), - ?line {error, Reason55_1} = config_start(Opts), + {error, Reason55_1} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason55_1]), - ?line {failed_check, _, _, _, {invalid_auth_key, _, _}} = Reason55_1, + {failed_check, _, _, _, {invalid_auth_key, _, _}} = Reason55_1, config_ensure_not_running(), %% -- @@ -1758,7 +1758,7 @@ start_with_invalid_usm_conf_file1(Conf) when is_list(Conf) -> Usm55_2 = setelement(4, Usm55_1, "[1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8]"), write_usm_conf(ConfDir, [Usm55_2]), - ?line {ok, _} = config_start(Opts), + {ok, _} = config_start(Opts), ?IPRINT("expected start success"), config_ensure_not_running(), @@ -1767,9 +1767,9 @@ start_with_invalid_usm_conf_file1(Conf) when is_list(Conf) -> Usm55_3 = setelement(4, Usm55_1, "[1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7]"), write_usm_conf(ConfDir, [Usm55_3]), - ?line {error, Reason55_3} = config_start(Opts), + {error, Reason55_3} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason55_3]), - ?line {failed_check, _, _, _, {invalid_auth_key, _, 47}} = Reason55_3, + {failed_check, _, _, _, {invalid_auth_key, _, 47}} = Reason55_3, config_ensure_not_running(), %% -- @@ -1777,11 +1777,11 @@ start_with_invalid_usm_conf_file1(Conf) when is_list(Conf) -> Usm55_4 = setelement(4, Usm55_1, "[1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,ka]"), write_usm_conf(ConfDir, [Usm55_4]), - ?line ok = maybe_start_crypto(), - ?line {error, Reason55_4} = config_start(Opts), - ?line ok = maybe_stop_crypto(), + ok = maybe_start_crypto(), + {error, Reason55_4} = config_start(Opts), + ok = maybe_stop_crypto(), ?IPRINT("start failed (as expected): ~p", [Reason55_4]), - ?line {failed_check, _, _, _, {invalid_auth_key, _}} = Reason55_4, + {failed_check, _, _, _, {invalid_auth_key, _}} = Reason55_4, config_ensure_not_running(), @@ -1789,9 +1789,9 @@ start_with_invalid_usm_conf_file1(Conf) when is_list(Conf) -> ?IPRINT("[test 56.1] write (auth sha512) usm config file with invalid auth-key (1)"), Usm56_1 = setelement(3, Usm0, "usmHMAC384SHA512AuthProtocol"), write_usm_conf(ConfDir, [Usm56_1]), - ?line {error, Reason56_1} = config_start(Opts), + {error, Reason56_1} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason56_1]), - ?line {failed_check, _, _, _, {invalid_auth_key, _, _}} = Reason56_1, + {failed_check, _, _, _, {invalid_auth_key, _, _}} = Reason56_1, config_ensure_not_running(), %% -- @@ -1799,7 +1799,7 @@ start_with_invalid_usm_conf_file1(Conf) when is_list(Conf) -> Usm56_2 = setelement(4, Usm56_1, "[1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4]"), write_usm_conf(ConfDir, [Usm56_2]), - ?line {ok, _} = config_start(Opts), + {ok, _} = config_start(Opts), ?IPRINT("expected start success"), config_ensure_not_running(), @@ -1808,9 +1808,9 @@ start_with_invalid_usm_conf_file1(Conf) when is_list(Conf) -> Usm56_3 = setelement(4, Usm56_1, "[1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3]"), write_usm_conf(ConfDir, [Usm56_3]), - ?line {error, Reason56_3} = config_start(Opts), + {error, Reason56_3} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason56_3]), - ?line {failed_check, _, _, _, {invalid_auth_key, _, 63}} = Reason56_3, + {failed_check, _, _, _, {invalid_auth_key, _, 63}} = Reason56_3, config_ensure_not_running(), %% -- @@ -1818,11 +1818,11 @@ start_with_invalid_usm_conf_file1(Conf) when is_list(Conf) -> Usm56_4 = setelement(4, Usm56_1, "[1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,ka]"), write_usm_conf(ConfDir, [Usm56_4]), - ?line ok = maybe_start_crypto(), - ?line {error, Reason56_4} = config_start(Opts), - ?line ok = maybe_stop_crypto(), + ok = maybe_start_crypto(), + {error, Reason56_4} = config_start(Opts), + ok = maybe_stop_crypto(), ?IPRINT("start failed (as expected): ~p", [Reason56_4]), - ?line {failed_check, _, _, _, {invalid_auth_key, _}} = Reason56_4, + {failed_check, _, _, _, {invalid_auth_key, _}} = Reason56_4, config_ensure_not_running(), @@ -1830,83 +1830,83 @@ start_with_invalid_usm_conf_file1(Conf) when is_list(Conf) -> ?IPRINT("[test 61] write usm config file with invalid priv-protocol (1)"), Usm61 = setelement(5, Usm0, "\"usmNoPrivProtocol\""), write_usm_conf(ConfDir, [Usm61]), - ?line {error, Reason61} = config_start(Opts), + {error, Reason61} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason61]), - ?line {failed_check, _, _, _, {invalid_priv_protocol, _}} = Reason61, + {failed_check, _, _, _, {invalid_priv_protocol, _}} = Reason61, config_ensure_not_running(), %% -- ?IPRINT("[test 62] write usm config file with invalid priv-protocol (2)"), Usm62 = setelement(5, Usm0, "kalle"), write_usm_conf(ConfDir, [Usm62]), - ?line {error, Reason62} = config_start(Opts), + {error, Reason62} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason62]), - ?line {failed_check, _, _, _, {invalid_priv_protocol, _}} = Reason62, + {failed_check, _, _, _, {invalid_priv_protocol, _}} = Reason62, config_ensure_not_running(), %% -- ?IPRINT("[test 63] write usm config file with invalid priv-protocol (3)"), Usm63 = setelement(5, Usm0, "10101"), write_usm_conf(ConfDir, [Usm63]), - ?line {error, Reason63} = config_start(Opts), + {error, Reason63} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason63]), - ?line {failed_check, _, _, _, {invalid_priv_protocol, _}} = Reason63, + {failed_check, _, _, _, {invalid_priv_protocol, _}} = Reason63, config_ensure_not_running(), %% -- ?IPRINT("[test 71] write usm config file with invalid priv-key (1)"), Usm71 = setelement(5, Usm0, "usmDESPrivProtocol"), write_usm_conf(ConfDir, [Usm71]), - ?line {error, Reason71} = config_start(Opts), + {error, Reason71} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason71]), - ?line {failed_check, _, _, _, {invalid_priv_key, _, _}} = Reason71, + {failed_check, _, _, _, {invalid_priv_key, _, _}} = Reason71, config_ensure_not_running(), %% -- ?IPRINT("[test 72] write usm config file with invalid priv-key (2)"), Usm72 = setelement(6, Usm71, "[1,2,3,4,5,6,7,8,9,0,1,2,3,4,5]"), write_usm_conf(ConfDir, [Usm72]), - ?line {error, Reason72} = config_start(Opts), + {error, Reason72} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason72]), - ?line {failed_check, _, _, _, {invalid_priv_key, _, 15}} = Reason72, + {failed_check, _, _, _, {invalid_priv_key, _, 15}} = Reason72, config_ensure_not_running(), %% -- ?IPRINT("[test 73] write usm config file with invalid priv-key (3)"), Usm73 = setelement(6, Usm71, "[1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7]"), write_usm_conf(ConfDir, [Usm73]), - ?line {error, Reason73} = config_start(Opts), + {error, Reason73} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason73]), - ?line {failed_check, _, _, _, {invalid_priv_key, _, 17}} = Reason73, + {failed_check, _, _, _, {invalid_priv_key, _, 17}} = Reason73, config_ensure_not_running(), %% -- ?IPRINT("[test 74] write usm config file with invalid priv-key (4)"), Usm74 = setelement(6, Usm71, "[1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,kalle]"), write_usm_conf(ConfDir, [Usm74]), - ?line ok = maybe_start_crypto(), - ?line {error, Reason74} = config_start(Opts), - ?line ok = maybe_stop_crypto(), + ok = maybe_start_crypto(), + {error, Reason74} = config_start(Opts), + ok = maybe_stop_crypto(), ?IPRINT("start failed (as expected): ~p", [Reason74]), - ?line {failed_check, _, _, _, {invalid_priv_key, _}} = Reason74, + {failed_check, _, _, _, {invalid_priv_key, _}} = Reason74, config_ensure_not_running(), %% -- ?IPRINT("[test 75] write usm config file with invalid priv-key (5)"), Usm75 = setelement(6, Usm71, "arne_anka"), write_usm_conf(ConfDir, [Usm75]), - ?line {error, Reason75} = config_start(Opts), + {error, Reason75} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason75]), - ?line {failed_check, _, _, _, {invalid_priv_key, _}} = Reason75, + {failed_check, _, _, _, {invalid_priv_key, _}} = Reason75, config_ensure_not_running(), %% -- ?IPRINT("[test 76] write usm config file with invalid priv-key (6)"), Usm76 = setelement(6, Usm71, "10101"), write_usm_conf(ConfDir, [Usm76]), - ?line {error, Reason76} = config_start(Opts), + {error, Reason76} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason76]), - ?line {failed_check, _, _, _, {invalid_priv_key, _}} = Reason76, + {failed_check, _, _, _, {invalid_priv_key, _}} = Reason76, config_ensure_not_running(), %% -- @@ -1919,9 +1919,9 @@ start_with_invalid_usm_conf_file1(Conf) when is_list(Conf) -> "when crypto not started (7)"), Usm77 = setelement(6, Usm71, "[1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6]"), write_usm_conf(ConfDir, [Usm77]), - ?line {error, Reason77} = config_start(Opts), + {error, Reason77} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason77]), - ?line {failed_check, _, _, _, {unsupported_crypto, _}} = Reason77, + {failed_check, _, _, _, {unsupported_crypto, _}} = Reason77, config_ensure_not_running(); _ -> %% This function is only present in version 2.0 or greater. @@ -1933,9 +1933,9 @@ start_with_invalid_usm_conf_file1(Conf) when is_list(Conf) -> %% -- ?IPRINT("[test 78] write usm config file with invalid usm (1)"), write_usm_conf2(ConfDir, "{\"bmkEngine\", \"swiusmcf\"}."), - ?line {error, Reason81} = config_start(Opts), + {error, Reason81} = config_start(Opts), ?IPRINT("start failed (as expected): ~p", [Reason81]), - ?line {failed_check, _, _, _, {bad_usm_config, _}} = Reason81, + {failed_check, _, _, _, {bad_usm_config, _}} = Reason81, config_ensure_not_running(), ?IPRINT("done"), @@ -1996,17 +1996,17 @@ simple_system_op(Conf) when is_list(Conf) -> {config, [{verbosity, trace}, {dir, ConfDir}, {db_dir, DbDir}]}], ?IPRINT("start config"), - ?line {ok, _Pid} = config_start(Opts), + {ok, _Pid} = config_start(Opts), ?IPRINT("retrieve various configs"), - ?line {ok, _Time} = snmpm_config:system_start_time(), - ?line {ok, _EngineId} = snmpm_config:get_engine_id(), - ?line {ok, _MMS} = snmpm_config:get_engine_max_message_size(), + {ok, _Time} = snmpm_config:system_start_time(), + {ok, _EngineId} = snmpm_config:get_engine_id(), + {ok, _MMS} = snmpm_config:get_engine_max_message_size(), ?IPRINT("attempt to retrieve nonexisting"), - ?line {error, not_found} = snmpm_config:system_info(kalle), + {error, not_found} = snmpm_config:system_info(kalle), - ?line ok = config_stop(), + ok = config_stop(), config_ensure_not_running(), ?IPRINT("done"), @@ -2092,7 +2092,7 @@ register_agent_using_file(Conf) when is_list(Conf) -> Case = fun(_) -> do_register_agent_using_file(Conf) end, Post = fun(_) -> ?IPRINT("stop config process"), - ?line ok = snmpm_config:stop(), + ok = snmpm_config:stop(), config_ensure_not_running(), ok end, @@ -2151,49 +2151,49 @@ do_register_agent_using_file(Conf) -> %% -- ?IPRINT("start the config process"), - ?line {ok, _Pid} = config_start(Opts), + {ok, _Pid} = config_start(Opts), %% -- ?IPRINT("which agents"), - ?line [_, _] = All = snmpm_config:which_agents(), + [_, _] = All = snmpm_config:which_agents(), ?IPRINT("all agents: ~n ~p", [All]), - ?line [A1] = snmpm_config:which_agents(UserId1), + [A1] = snmpm_config:which_agents(UserId1), ?IPRINT("agents belonging to ~w: ~n ~p", [UserId1, A1]), - ?line [A2] = snmpm_config:which_agents(UserId2), + [A2] = snmpm_config:which_agents(UserId2), ?IPRINT("agents belonging to ~w: ~n ~p", [UserId2, A2]), %% -- ?IPRINT("All info for agent <~w,~w>", [AgentAddr1, AgentPort1]), - ?line {ok, AllInfo1} = + {ok, AllInfo1} = snmpm_config:agent_info(AgentAddr1, AgentPort1, all), ?IPRINT("all agent info for agent: ~n ~p", [AllInfo1]), %% -- ?IPRINT("EngineID (~p) for agent <~w,~w>", [EngineID1, AgentAddr1, AgentPort1]), - ?line {ok, EngineID1} = + {ok, EngineID1} = snmpm_config:agent_info(AgentAddr1, AgentPort1, engine_id), %% -- ?IPRINT("All info for agent <~w,~w>", [AgentAddr2, AgentPort2]), - ?line {ok, AllInfo2} = + {ok, AllInfo2} = snmpm_config:agent_info(AgentAddr2, AgentPort2, all), ?IPRINT("all agent info for agent: ~n ~p", [AllInfo2]), %% -- ?IPRINT("EngineID (~p) for agent <~w,~w>", [EngineID2, AgentAddr2, AgentPort2]), - ?line {ok, EngineID2} = + {ok, EngineID2} = snmpm_config:agent_info(AgentAddr2, AgentPort2, engine_id), %% -- - ?line {ok, MMS2} = + {ok, MMS2} = snmpm_config:agent_info(AgentAddr2, AgentPort2, max_message_size), NewMMS21 = 2048, ?IPRINT("try update agent info max-message-size to ~w for agent <~w,~w>", [NewMMS21, AgentAddr2, AgentPort2]), - ?line ok = update_agent_info(UserId2, AgentAddr2, AgentPort2, + ok = update_agent_info(UserId2, AgentAddr2, AgentPort2, max_message_size, NewMMS21), - ?line {ok, NewMMS21} = + {ok, NewMMS21} = snmpm_config:agent_info(AgentAddr2, AgentPort2, max_message_size), %% -- @@ -2201,11 +2201,11 @@ do_register_agent_using_file(Conf) -> "for agent <~w,~w> " "with user ~w (not owner)", [NewMMS21, AgentAddr2, AgentPort2, UserId1]), - ?line {error, Reason01} = + {error, Reason01} = update_agent_info(UserId1, AgentAddr2, AgentPort2, max_message_size, NewMMS21), ?IPRINT("expected failure. Reason01: ~p", [Reason01]), - ?line {ok, NewMMS21} = + {ok, NewMMS21} = snmpm_config:agent_info(AgentAddr2, AgentPort2, max_message_size), %% -- @@ -2213,7 +2213,7 @@ do_register_agent_using_file(Conf) -> ?IPRINT("try (and fail) to update agent info max-message-size to ~w " "for agent <~w,~w>", [NewMMS22, AgentAddr2, AgentPort2]), - ?line {error, Reason02} = + {error, Reason02} = update_agent_info(UserId1, AgentAddr2, AgentPort2, max_message_size, NewMMS22), ?IPRINT("expected failure. Reason02: ~p", [Reason02]), @@ -2318,26 +2318,26 @@ register_usm_user_using_file(Conf) when is_list(Conf) -> %% -- ?IPRINT("start the config process"), - ?line {ok, _Pid} = config_start(Opts), + {ok, _Pid} = config_start(Opts), %% -- ?IPRINT("lookup 1 (ok)"), - ?line {ok, #usm_user{name = UserName1} = User1} = + {ok, #usm_user{name = UserName1} = User1} = snmpm_config:get_usm_user_from_sec_name(SecEngineID, SecName1), ?IPRINT("User: ~p", [User1]), ?IPRINT("lookup 2 (ok)"), - ?line {ok, #usm_user{name = UserName2} = User2} = + {ok, #usm_user{name = UserName2} = User2} = snmpm_config:get_usm_user_from_sec_name(SecEngineID, SecName2), ?IPRINT("User: ~p", [User2]), ?IPRINT("lookup 3 (error)"), - ?line {error, not_found} = + {error, not_found} = snmpm_config:get_usm_user_from_sec_name(SecEngineID, SecName2 ++ "_1"), %% -- ?IPRINT("stop config process"), - ?line ok = snmpm_config:stop(), + ok = snmpm_config:stop(), config_ensure_not_running(), %% -- @@ -2386,7 +2386,7 @@ register_usm_user_using_function(Conf) when is_list(Conf) -> %% -- ?IPRINT("start the config process"), - ?line {ok, _Pid} = config_start(Opts), + {ok, _Pid} = config_start(Opts), %% -- ?IPRINT("register usm user's"), @@ -2400,9 +2400,9 @@ register_usm_user_using_function(Conf) when is_list(Conf) -> {auth_key, [1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6]}, {priv, usmNoPrivProtocol}], - ?line ok = snmpm_config:register_usm_user(EngineID, UserName1, UsmConfig1), + ok = snmpm_config:register_usm_user(EngineID, UserName1, UsmConfig1), ?IPRINT("try register user 1 again (error)"), - ?line {error, {already_registered, EngineID, UserName1}} = + {error, {already_registered, EngineID, UserName1}} = snmpm_config:register_usm_user(EngineID, UserName1, UsmConfig1), ?IPRINT("register user 2 (ok)"), @@ -2411,7 +2411,7 @@ register_usm_user_using_function(Conf) when is_list(Conf) -> UsmConfig2 = [{auth, usmHMACMD5AuthProtocol}, {auth_key, [1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6]}, {priv, usmNoPrivProtocol}], - ?line ok = snmpm_config:register_usm_user(EngineID, UserName2, UsmConfig2), + ok = snmpm_config:register_usm_user(EngineID, UserName2, UsmConfig2), ?IPRINT("register user 3 (ok)"), UserName3 = "samu3", @@ -2420,7 +2420,7 @@ register_usm_user_using_function(Conf) when is_list(Conf) -> {auth, usmHMACMD5AuthProtocol}, {auth_key, [1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6]}, {priv, usmNoPrivProtocol}], - ?line ok = snmpm_config:register_usm_user(EngineID, UserName3, UsmConfig3), + ok = snmpm_config:register_usm_user(EngineID, UserName3, UsmConfig3), ?IPRINT("register user 4 (ok)"), UserName4 = "samu4", @@ -2430,35 +2430,35 @@ register_usm_user_using_function(Conf) when is_list(Conf) -> {auth_key, [1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6]}, {priv, usmAesCfb128Protocol}, {priv_key, [190,54,66,227,33,171,152,0,133,223,204,155,109,111,77,44]}], - ?line ok = snmpm_config:register_usm_user(EngineID, UserName4, UsmConfig4), + ok = snmpm_config:register_usm_user(EngineID, UserName4, UsmConfig4), ?IPRINT("lookup 1 (ok)"), - ?line {ok, #usm_user{name = UserName1} = User1} = + {ok, #usm_user{name = UserName1} = User1} = snmpm_config:get_usm_user_from_sec_name(EngineID, SecName1), ?IPRINT("User: ~p", [User1]), ?IPRINT("lookup 2 (ok)"), - ?line {ok, #usm_user{name = UserName2} = User2} = + {ok, #usm_user{name = UserName2} = User2} = snmpm_config:get_usm_user_from_sec_name(EngineID, SecName2), ?IPRINT("User: ~p", [User2]), ?IPRINT("lookup 3 (ok)"), - ?line {ok, #usm_user{name = UserName3} = User3} = + {ok, #usm_user{name = UserName3} = User3} = snmpm_config:get_usm_user_from_sec_name(EngineID, SecName3), ?IPRINT("User: ~p", [User3]), ?IPRINT("lookup 4 (ok)"), - ?line {ok, #usm_user{name = UserName4} = User4} = + {ok, #usm_user{name = UserName4} = User4} = snmpm_config:get_usm_user_from_sec_name(EngineID, SecName4), ?IPRINT("User: ~p", [User4]), ?IPRINT("lookup 5 (error)"), - ?line {error, not_found} = + {error, not_found} = snmpm_config:get_usm_user_from_sec_name(EngineID, SecName4 ++ "_1"), %% -- ?IPRINT("stop config process"), - ?line ok = snmpm_config:stop(), + ok = snmpm_config:stop(), config_ensure_not_running(), %% -- @@ -2535,7 +2535,7 @@ update_usm_user_info(Conf) when is_list(Conf) -> {config, [{verbosity, trace}, {dir, ConfDir}, {db_dir, DbDir}]}], ?IPRINT("Start config server"), - ?line {ok, _Pid} = snmpm_config:start_link(Opts), + {ok, _Pid} = snmpm_config:start_link(Opts), ?IPRINT("Register usm user"), EngineID = "engine", @@ -2551,9 +2551,9 @@ update_usm_user_info(Conf) when is_list(Conf) -> ok = snmpm_config:register_usm_user(EngineID, UsmUser, UsmConfig), ?IPRINT("verify user user config"), - ?line {ok, AuthProto} = snmpm_config:usm_user_info(EngineID, UsmUser, auth), - ?line {ok, AuthKey} = snmpm_config:usm_user_info(EngineID, UsmUser, auth_key), - ?line {ok, PrivProto1} = snmpm_config:usm_user_info(EngineID, UsmUser, priv), + {ok, AuthProto} = snmpm_config:usm_user_info(EngineID, UsmUser, auth), + {ok, AuthKey} = snmpm_config:usm_user_info(EngineID, UsmUser, auth_key), + {ok, PrivProto1} = snmpm_config:usm_user_info(EngineID, UsmUser, priv), ?IPRINT("usm user update 1"), PrivProto2 = usmAesCfb128Protocol, @@ -2562,22 +2562,22 @@ update_usm_user_info(Conf) when is_list(Conf) -> ok = snmpm_config:update_usm_user_info(EngineID, UsmUser, priv_key, PrivKey2), ?IPRINT("verify updated user user config after update 1"), - ?line {ok, AuthProto} = snmpm_config:usm_user_info(EngineID, UsmUser, auth), - ?line {ok, AuthKey} = snmpm_config:usm_user_info(EngineID, UsmUser, auth_key), - ?line {ok, PrivProto2} = snmpm_config:usm_user_info(EngineID, UsmUser, priv), - ?line {ok, PrivKey2} = snmpm_config:usm_user_info(EngineID, UsmUser, priv_key), + {ok, AuthProto} = snmpm_config:usm_user_info(EngineID, UsmUser, auth), + {ok, AuthKey} = snmpm_config:usm_user_info(EngineID, UsmUser, auth_key), + {ok, PrivProto2} = snmpm_config:usm_user_info(EngineID, UsmUser, priv), + {ok, PrivKey2} = snmpm_config:usm_user_info(EngineID, UsmUser, priv_key), ?IPRINT("usm user update 2"), PrivProto3 = PrivProto1, ok = snmpm_config:update_usm_user_info(EngineID, UsmUser, priv, PrivProto3), ?IPRINT("verify updated user user config after update 2"), - ?line {ok, AuthProto} = snmpm_config:usm_user_info(EngineID, UsmUser, auth), - ?line {ok, AuthKey} = snmpm_config:usm_user_info(EngineID, UsmUser, auth_key), - ?line {ok, PrivProto3} = snmpm_config:usm_user_info(EngineID, UsmUser, priv), + {ok, AuthProto} = snmpm_config:usm_user_info(EngineID, UsmUser, auth), + {ok, AuthKey} = snmpm_config:usm_user_info(EngineID, UsmUser, auth_key), + {ok, PrivProto3} = snmpm_config:usm_user_info(EngineID, UsmUser, priv), ?IPRINT("Stop config server"), - ?line ok = snmpm_config:stop(), + ok = snmpm_config:stop(), ?IPRINT("done"), ok. @@ -2609,7 +2609,7 @@ create_and_increment(Conf) when is_list(Conf) -> Opts = [{versions, [v1]}, {config, [{verbosity, trace}, {dir, ConfDir}, {db_dir, DbDir}]}], - ?line {ok, _Pid} = snmpm_config:start_link(Opts), + {ok, _Pid} = snmpm_config:start_link(Opts), %% Random init ?SNMP_RAND_SEED(), @@ -2618,10 +2618,10 @@ create_and_increment(Conf) when is_list(Conf) -> IncVal = 42, EndVal = StartVal + IncVal, - ?line StartVal = snmpm_config:cre_counter(test_id, StartVal), - ?line EndVal = snmpm_config:incr_counter(test_id, IncVal), + StartVal = snmpm_config:cre_counter(test_id, StartVal), + EndVal = snmpm_config:incr_counter(test_id, IncVal), - ?line ok = snmpm_config:stop(), + ok = snmpm_config:stop(), config_ensure_not_running(), ok. @@ -2652,27 +2652,27 @@ stats_create_and_increment(Conf) when is_list(Conf) -> Opts = [{versions, [v1]}, {config, [{verbosity, trace}, {dir, ConfDir}, {db_dir, DbDir}]}], - ?line {ok, _Pid} = snmpm_config:start_link(Opts), + {ok, _Pid} = snmpm_config:start_link(Opts), ?IPRINT("stats table (1): ~p", [ets:tab2list(snmpm_stats_table)]), - ?line 0 = snmpm_config:maybe_cre_stats_counter(stats1, 0), + 0 = snmpm_config:maybe_cre_stats_counter(stats1, 0), ?IPRINT("stats table (2): ~p", [ets:tab2list(snmpm_stats_table)]), - ?line ok = snmpm_config:maybe_cre_stats_counter(stats1, 0), + ok = snmpm_config:maybe_cre_stats_counter(stats1, 0), ?IPRINT("stats table (3): ~p", [ets:tab2list(snmpm_stats_table)]), - ?line 1 = snmpm_config:maybe_cre_stats_counter(stats2, 1), + 1 = snmpm_config:maybe_cre_stats_counter(stats2, 1), ?IPRINT("stats table (4): ~p", [ets:tab2list(snmpm_stats_table)]), - ?line 10 = snmpm_config:cre_stats_counter(stats3, 10), + 10 = snmpm_config:cre_stats_counter(stats3, 10), ?IPRINT("stats table (5): ~p", [ets:tab2list(snmpm_stats_table)]), Stats1Inc = fun() -> snmpm_config:incr_stats_counter(stats1, 1) end, - ?line 10 = loop(10, -1, Stats1Inc), + 10 = loop(10, -1, Stats1Inc), ?IPRINT("stats table (6): ~p", [ets:tab2list(snmpm_stats_table)]), - ?line ok = snmpm_config:reset_stats_counter(stats1), + ok = snmpm_config:reset_stats_counter(stats1), - ?line 10 = loop(10, -1, Stats1Inc), + 10 = loop(10, -1, Stats1Inc), - ?line ok = snmpm_config:stop(), + ok = snmpm_config:stop(), config_ensure_not_running(), ok. @@ -2710,13 +2710,13 @@ otp_7219(Config) when is_list(Config) -> {config, [{verbosity, trace}, {dir, ConfDir}, {db_dir, DbDir}]}], ?IPRINT("start manager config"), - ?line {ok, _Pid1} = snmpm_config:start_link(Opts1), + {ok, _Pid1} = snmpm_config:start_link(Opts1), ?IPRINT("get some manager config"), {ok, {user, _}} = snmpm_config:system_info(net_if_irb), ?IPRINT("stop manager config"), - ?line ok = snmpm_config:stop(), + ok = snmpm_config:stop(), config_ensure_not_running(), IRB_TO = 15322, @@ -2725,13 +2725,13 @@ otp_7219(Config) when is_list(Config) -> {config, [{verbosity, trace}, {dir, ConfDir}, {db_dir, DbDir}]}], ?IPRINT("start manager config"), - ?line {ok, _Pid2} = snmpm_config:start_link(Opts2), + {ok, _Pid2} = snmpm_config:start_link(Opts2), ?IPRINT("get some manager config"), {ok, {user, IRB_TO}} = snmpm_config:system_info(net_if_irb), ?IPRINT("stop manager config"), - ?line ok = snmpm_config:stop(), + ok = snmpm_config:stop(), config_ensure_not_running(), ?IPRINT("done"), @@ -2808,7 +2808,7 @@ otp8395(Conf, SeqNoVal, Expect) -> case config_start(Opts) of {ok, _Pid} when (Expect =:= ok) -> - ?line ok = config_stop(), + ok = config_stop(), ok; {ok, _Pid} when (Expect =/= ok) -> config_stop(), @@ -2867,7 +2867,7 @@ otp_8395_4(Conf) when is_list(Conf) -> {mibs, Mibs}, {versions, Vsns}], - ?line {ok, _Pid} = config_start(Opts), + {ok, _Pid} = config_start(Opts), Counter = otp_8395_4, Initial = 10, @@ -2885,7 +2885,7 @@ otp_8395_4(Conf) when is_list(Conf) -> Val2 = Initial + Increment, Val2 = otp8395_incr_counter(Counter, Initial, Increment, Max), - ?line ok = config_stop(), + ok = config_stop(), ?IPRINT("done"), ok. @@ -3024,7 +3024,7 @@ write_usm_conf2(Dir, Str) -> write_conf_file(Dir, File, Str) -> case file:open(filename:join(Dir, File), write) of {ok, Fd} -> - ?line ok = io:format(Fd, "~s", [Str]), + ok = io:format(Fd, "~s", [Str]), file:close(Fd); {error, Reason} -> Info = diff --git a/lib/snmp/test/snmp_manager_user_SUITE.erl b/lib/snmp/test/snmp_manager_user_SUITE.erl index 04a75232b7..6e18e92650 100644 --- a/lib/snmp/test/snmp_manager_user_SUITE.erl +++ b/lib/snmp/test/snmp_manager_user_SUITE.erl @@ -202,16 +202,16 @@ init_per_testcase(Case, Config) when is_list(Config) -> SuiteTopDir = ?config(snmp_suite_top_dir, Config), CaseTopDir = filename:join(SuiteTopDir, atom_to_list(Case)), - ?line ok = file:make_dir(CaseTopDir), + ok = file:make_dir(CaseTopDir), ?IPRINT("init_per_testcase -> CaseTopDir: ~p", [CaseTopDir]), MgrTopDir = filename:join(CaseTopDir, "manager/"), - ?line ok = file:make_dir(MgrTopDir), + ok = file:make_dir(MgrTopDir), MgrConfDir = filename:join(MgrTopDir, "conf/"), - ?line ok = file:make_dir(MgrConfDir), + ok = file:make_dir(MgrConfDir), MgrDbDir = filename:join(MgrTopDir, "db/"), - ?line ok = file:make_dir(MgrDbDir), + ok = file:make_dir(MgrDbDir), MgrLogDir = filename:join(MgrTopDir, "log/"), - ?line ok = file:make_dir(MgrLogDir), + ok = file:make_dir(MgrLogDir), Config1 = [{case_top_dir, CaseTopDir}, {manager_dir, MgrTopDir}, @@ -267,24 +267,24 @@ simple_register_and_unregister1(Conf) when is_list(Conf) -> Id = make_ref(), - ?line Pid = start_user(), + Pid = start_user(), - ?line [] = Users1 = which_users(), + [] = Users1 = which_users(), ?IPRINT("Users1: ~p", [Users1]), - ?line ok = register_user(Pid, Id), + ok = register_user(Pid, Id), - ?line [Id] = Users2 = which_users(), + [Id] = Users2 = which_users(), ?IPRINT("Users2: ~p", [Users2]), - ?line ok = unregister_user(Pid), + ok = unregister_user(Pid), - ?line [] = Users3 = which_users(), + [] = Users3 = which_users(), ?IPRINT("Users3: ~p", [Users3]), - ?line stop_user(Pid), + stop_user(Pid), - ?line ok = snmpm:stop(), + ok = snmpm:stop(), ?IPRINT("end"), ok. @@ -319,15 +319,15 @@ simple_register_and_unregister2(Conf) when is_list(Conf) -> Id1 = make_ref(), Id2 = make_ref(), - ?line Pid = start_user(), + Pid = start_user(), - ?line [] = Users1 = which_users(), + [] = Users1 = which_users(), ?IPRINT("Users1: ~p", [Users1]), - ?line ok = register_user(Pid, Id1), - ?line ok = register_user(Pid, Id2), + ok = register_user(Pid, Id1), + ok = register_user(Pid, Id2), - ?line Users2 = case which_users() of + Users2 = case which_users() of [Id1, Id2] = U1 -> U1; [Id2, Id1] = U2 -> @@ -338,15 +338,15 @@ simple_register_and_unregister2(Conf) when is_list(Conf) -> ?IPRINT("Users2: ~p", [Users2]), - ?line ok = unregister_user(Pid, Id1), - ?line ok = unregister_user(Pid, Id2), + ok = unregister_user(Pid, Id1), + ok = unregister_user(Pid, Id2), - ?line [] = Users3 = which_users(), + [] = Users3 = which_users(), ?IPRINT("Users3: ~p", [Users3]), - ?line stop_user(Pid), + stop_user(Pid), - ?line ok = snmpm:stop(), + ok = snmpm:stop(), ?IPRINT("end"), ok. @@ -381,16 +381,16 @@ simple_register_and_unregister3(Conf) when is_list(Conf) -> Id1 = make_ref(), Id2 = make_ref(), - ?line Pid1 = start_user(), - ?line Pid2 = start_user(), + Pid1 = start_user(), + Pid2 = start_user(), - ?line [] = Users1 = which_users(), + [] = Users1 = which_users(), ?IPRINT("Users1: ~p", [Users1]), - ?line ok = register_user(Pid1, Id1), - ?line ok = register_user(Pid2, Id2), + ok = register_user(Pid1, Id1), + ok = register_user(Pid2, Id2), - ?line Users2 = case which_users() of + Users2 = case which_users() of [Id1, Id2] = U1 -> U1; [Id2, Id1] = U2 -> @@ -401,16 +401,16 @@ simple_register_and_unregister3(Conf) when is_list(Conf) -> ?IPRINT("Users2: ~p", [Users2]), - ?line ok = unregister_user(Pid1, Id1), - ?line ok = unregister_user(Pid2, Id2), + ok = unregister_user(Pid1, Id1), + ok = unregister_user(Pid2, Id2), - ?line [] = Users3 = which_users(), + [] = Users3 = which_users(), ?IPRINT("Users3: ~p", [Users3]), - ?line stop_user(Pid1), - ?line stop_user(Pid2), + stop_user(Pid1), + stop_user(Pid2), - ?line ok = snmpm:stop(), + ok = snmpm:stop(), ?IPRINT("end"), ok. @@ -437,29 +437,29 @@ register_and_crash1(Conf) when is_list(Conf) -> {config, [{verbosity, trace}, {dir, ConfDir}, {db_dir, DbDir}]}], ?IPRINT("try starting manager"), - ?line ok = snmpm:start_link(Opts), + ok = snmpm:start_link(Opts), ?SLEEP(1000), Id = make_ref(), - ?line Pid = start_user(), + Pid = start_user(), - ?line [] = Users1 = which_users(), + [] = Users1 = which_users(), ?IPRINT("Users1: ~p", [Users1]), - ?line ok = register_user(Pid, Id), + ok = register_user(Pid, Id), - ?line [Id] = Users2 = which_users(), + [Id] = Users2 = which_users(), ?IPRINT("Users2: ~p", [Users2]), - ?line ok = simulate_crash(Pid), + ok = simulate_crash(Pid), - ?line [Id] = Users3 = which_users(), + [Id] = Users3 = which_users(), ?IPRINT("Users3: ~p", [Users3]), ?IPRINT("stop manager"), - ?line ok = snmpm:stop(), + ok = snmpm:stop(), ?IPRINT("end"), ok. @@ -487,22 +487,22 @@ register_and_crash2(Conf) when is_list(Conf) -> {config, [{verbosity, trace}, {dir, ConfDir}, {db_dir, DbDir}]}], ?IPRINT("try starting manager"), - ?line ok = snmpm:start_link(Opts), + ok = snmpm:start_link(Opts), ?SLEEP(1000), Id1 = make_ref(), Id2 = make_ref(), - ?line Pid = start_user(), + Pid = start_user(), - ?line [] = Users1 = which_users(), + [] = Users1 = which_users(), ?IPRINT("Users1: ~p", [Users1]), - ?line ok = register_user(Pid, Id1), - ?line ok = register_user(Pid, Id2), + ok = register_user(Pid, Id1), + ok = register_user(Pid, Id2), - ?line Users2 = case which_users() of + Users2 = case which_users() of [Id1, Id2] = U1 -> U1; [Id2, Id1] = U2 -> @@ -512,9 +512,9 @@ register_and_crash2(Conf) when is_list(Conf) -> end, ?IPRINT("Users2: ~p", [Users2]), - ?line ok = simulate_crash(Pid), + ok = simulate_crash(Pid), - ?line Users3 = case which_users() of + Users3 = case which_users() of [Id1, Id2] = U3 -> U3; [Id2, Id1] = U4 -> @@ -525,7 +525,7 @@ register_and_crash2(Conf) when is_list(Conf) -> ?IPRINT("Users3: ~p", [Users3]), ?IPRINT("stop manager"), - ?line ok = snmpm:stop(), + ok = snmpm:stop(), ?IPRINT("end"), ok. @@ -614,31 +614,31 @@ simple_register_monitor_and_unregister1(Conf) when is_list(Conf) -> Id = make_ref(), ?IPRINT("start user"), - ?line Pid = start_user(), + Pid = start_user(), ?IPRINT("get users (=0)"), - ?line [] = Users1 = which_users(), + [] = Users1 = which_users(), ?IPRINT("Users1: ~p", [Users1]), ?IPRINT("register monitored user"), - ?line ok = register_user_monitor(Pid, Id), + ok = register_user_monitor(Pid, Id), ?IPRINT("get users (=1)"), - ?line [Id] = Users2 = which_users(), + [Id] = Users2 = which_users(), ?IPRINT("Users2: ~p", [Users2]), ?IPRINT("unregister monitored user"), - ?line unregister_user(Pid), + unregister_user(Pid), ?IPRINT("get users (=0)"), - ?line [] = Users3 = which_users(), + [] = Users3 = which_users(), ?IPRINT("Users3: ~p", [Users3]), ?IPRINT("start user"), - ?line stop_user(Pid), + stop_user(Pid), ?IPRINT("stop manager"), - ?line ok = snmpm:stop(), + ok = snmpm:stop(), ?IPRINT("end"), ok. @@ -674,15 +674,15 @@ simple_register_monitor_and_unregister2(Conf) when is_list(Conf) -> Id1 = make_ref(), Id2 = make_ref(), - ?line Pid = start_user(), + Pid = start_user(), - ?line [] = Users1 = which_users(), + [] = Users1 = which_users(), ?IPRINT("Users1: ~p", [Users1]), - ?line ok = register_user_monitor(Pid, Id1), - ?line ok = register_user_monitor(Pid, Id2), + ok = register_user_monitor(Pid, Id1), + ok = register_user_monitor(Pid, Id2), - ?line Users2 = case which_users() of + Users2 = case which_users() of [Id1, Id2] = U1 -> U1; [Id2, Id1] = U2 -> @@ -692,15 +692,15 @@ simple_register_monitor_and_unregister2(Conf) when is_list(Conf) -> end, ?IPRINT("Users2: ~p", [Users2]), - ?line ok = unregister_user(Pid, Id1), - ?line ok = unregister_user(Pid, Id2), + ok = unregister_user(Pid, Id1), + ok = unregister_user(Pid, Id2), - ?line [] = Users3 = which_users(), + [] = Users3 = which_users(), ?IPRINT("Users3: ~p", [Users3]), - ?line stop_user(Pid), + stop_user(Pid), - ?line ok = snmpm:stop(), + ok = snmpm:stop(), ?IPRINT("end"), ok. @@ -737,15 +737,15 @@ simple_register_monitor_and_unregister3(Conf) when is_list(Conf) -> Id1 = make_ref(), Id2 = make_ref(), - ?line Pid = start_user(), + Pid = start_user(), - ?line [] = Users1 = which_users(), + [] = Users1 = which_users(), ?IPRINT("Users1: ~p", [Users1]), - ?line ok = register_user(Pid, Id1), - ?line ok = register_user_monitor(Pid, Id2), + ok = register_user(Pid, Id1), + ok = register_user_monitor(Pid, Id2), - ?line Users2 = case which_users() of + Users2 = case which_users() of [Id1, Id2] = U1 -> U1; [Id2, Id1] = U2 -> @@ -755,14 +755,14 @@ simple_register_monitor_and_unregister3(Conf) when is_list(Conf) -> end, ?IPRINT("Users2: ~p", [Users2]), - ?line unregister_user(Pid), + unregister_user(Pid), - ?line [] = Users3 = which_users(), + [] = Users3 = which_users(), ?IPRINT("Users3: ~p", [Users3]), - ?line stop_user(Pid), + stop_user(Pid), - ?line ok = snmpm:stop(), + ok = snmpm:stop(), ?IPRINT("end"), ok. @@ -789,31 +789,31 @@ register_monitor_and_crash1(Conf) when is_list(Conf) -> {config, [{verbosity, trace}, {dir, ConfDir}, {db_dir, DbDir}]}], ?IPRINT("try starting manager"), - ?line ok = snmpm:start_link(Opts), + ok = snmpm:start_link(Opts), ?SLEEP(1000), Id = make_ref(), - ?line Pid = start_user(), + Pid = start_user(), - ?line [] = Users1 = which_users(), + [] = Users1 = which_users(), ?IPRINT("Users1: ~p", [Users1]), - ?line ok = register_user_monitor(Pid, Id), + ok = register_user_monitor(Pid, Id), - ?line [Id] = Users2 = which_users(), + [Id] = Users2 = which_users(), ?IPRINT("Users2: ~p", [Users2]), - ?line ok = simulate_crash(Pid), + ok = simulate_crash(Pid), ?SLEEP(1000), - ?line [] = Users3 = which_users(), + [] = Users3 = which_users(), ?IPRINT("Users3: ~p", [Users3]), ?IPRINT("stop manager"), - ?line ok = snmpm:stop(), + ok = snmpm:stop(), ?IPRINT("end"), ok. @@ -842,22 +842,22 @@ register_monitor_and_crash2(Conf) when is_list(Conf) -> {config, [{verbosity, trace}, {dir, ConfDir}, {db_dir, DbDir}]}], ?IPRINT("try starting manager"), - ?line ok = snmpm:start_link(Opts), + ok = snmpm:start_link(Opts), ?SLEEP(1000), Id1 = make_ref(), Id2 = make_ref(), - ?line Pid = start_user(), + Pid = start_user(), - ?line [] = Users1 = which_users(), + [] = Users1 = which_users(), ?IPRINT("Users1: ~p", [Users1]), - ?line ok = register_user_monitor(Pid, Id1), - ?line ok = register_user_monitor(Pid, Id2), + ok = register_user_monitor(Pid, Id1), + ok = register_user_monitor(Pid, Id2), - ?line Users2 = case which_users() of + Users2 = case which_users() of [Id1, Id2] = U1 -> U1; [Id2, Id1] = U2 -> @@ -867,15 +867,15 @@ register_monitor_and_crash2(Conf) when is_list(Conf) -> end, ?IPRINT("Users2: ~p", [Users2]), - ?line ok = simulate_crash(Pid), + ok = simulate_crash(Pid), ?SLEEP(1000), - ?line [] = Users3 = which_users(), + [] = Users3 = which_users(), ?IPRINT("Users3: ~p", [Users3]), ?IPRINT("stop manager"), - ?line ok = snmpm:stop(), + ok = snmpm:stop(), ?IPRINT("end"), ok. @@ -924,22 +924,22 @@ register_monitor_and_crash3(Conf) when is_list(Conf) -> {config, [{verbosity, trace}, {dir, ConfDir}, {db_dir, DbDir}]}], ?IPRINT("try starting manager"), - ?line ok = snmpm:start_link(Opts), + ok = snmpm:start_link(Opts), ?SLEEP(1000), Id1 = make_ref(), Id2 = make_ref(), - ?line Pid = start_user(), + Pid = start_user(), - ?line [] = Users1 = which_users(), + [] = Users1 = which_users(), ?IPRINT("Users1: ~p", [Users1]), - ?line ok = register_user(Pid, Id1), - ?line ok = register_user_monitor(Pid, Id2), + ok = register_user(Pid, Id1), + ok = register_user_monitor(Pid, Id2), - ?line Users2 = case which_users() of + Users2 = case which_users() of [Id1, Id2] = U1 -> U1; [Id2, Id1] = U2 -> @@ -949,15 +949,15 @@ register_monitor_and_crash3(Conf) when is_list(Conf) -> end, ?IPRINT("Users2: ~p", [Users2]), - ?line ok = simulate_crash(Pid), + ok = simulate_crash(Pid), ?SLEEP(1000), - ?line [Id1] = Users3 = which_users(), + [Id1] = Users3 = which_users(), ?IPRINT("Users3: ~p", [Users3]), ?IPRINT("stop manager"), - ?line ok = snmpm:stop(), + ok = snmpm:stop(), ?IPRINT("end"), ok. @@ -986,7 +986,7 @@ register_monitor_and_crash4(Conf) when is_list(Conf) -> {config, [{verbosity, trace}, {dir, ConfDir}, {db_dir, DbDir}]}], ?IPRINT("start manager"), - ?line ok = snmpm:start_link(Opts), + ok = snmpm:start_link(Opts), ?SLEEP(1000), @@ -994,16 +994,16 @@ register_monitor_and_crash4(Conf) when is_list(Conf) -> Id2 = make_ref(), ?IPRINT("start user processes"), - ?line Pid1 = start_user(), - ?line Pid2 = start_user(), + Pid1 = start_user(), + Pid2 = start_user(), - ?line [] = Users1 = which_users(), + [] = Users1 = which_users(), ?IPRINT("Users1: ~p", [Users1]), - ?line ok = register_user_monitor(Pid1, Id1), - ?line ok = register_user_monitor(Pid2, Id2), + ok = register_user_monitor(Pid1, Id1), + ok = register_user_monitor(Pid2, Id2), - ?line Users2 = case which_users() of + Users2 = case which_users() of [Id1, Id2] = U1 -> U1; [Id2, Id1] = U2 -> @@ -1013,17 +1013,17 @@ register_monitor_and_crash4(Conf) when is_list(Conf) -> end, ?IPRINT("Users2: ~p", [Users2]), - ?line ok = simulate_crash(Pid1), + ok = simulate_crash(Pid1), ?SLEEP(1000), - ?line [Id2] = Users3 = which_users(), + [Id2] = Users3 = which_users(), ?IPRINT("Users3: ~p", [Users3]), - ?line stop_user(Pid2), + stop_user(Pid2), ?IPRINT("stop manager"), - ?line ok = snmpm:stop(), + ok = snmpm:stop(), ?IPRINT("end"), ok. @@ -1054,7 +1054,7 @@ register_monitor_and_crash5(Conf) when is_list(Conf) -> {config, [{verbosity, trace}, {dir, ConfDir}, {db_dir, DbDir}]}], ?IPRINT("start manager"), - ?line ok = snmpm:start_link(Opts), + ok = snmpm:start_link(Opts), ?SLEEP(1000), @@ -1062,14 +1062,14 @@ register_monitor_and_crash5(Conf) when is_list(Conf) -> Id2 = tomat, %% make_ref(), ?IPRINT("start user processes"), - ?line Pid1 = start_user(), - ?line Pid2 = start_user(), + Pid1 = start_user(), + Pid2 = start_user(), - ?line [] = Users1 = which_users(), + [] = Users1 = which_users(), ?IPRINT("Users1: ~p", [Users1]), - ?line ok = register_user_monitor(Pid1, Id1), - ?line ok = register_user_monitor(Pid2, Id2), + ok = register_user_monitor(Pid1, Id1), + ok = register_user_monitor(Pid2, Id2), LocalHost = snmp_test_lib:localhost(), @@ -1083,16 +1083,16 @@ register_monitor_and_crash5(Conf) when is_list(Conf) -> Port2 = 5002, EngineId2 = "agentEngineId-2", - ?line ok = register_agent(Pid1, + ok = register_agent(Pid1, Id1, TargetName1, [{address, Address1}, {port, Port1}, {engine_id, EngineId1}]), - ?line ok = register_agent(Pid2, + ok = register_agent(Pid2, Id2, TargetName2, [{address, Address2}, {port, Port2}, {engine_id, EngineId2}]), - ?line Users2 = case which_users() of + Users2 = case which_users() of [Id1, Id2] = U1 -> U1; [Id2, Id1] = U2 -> @@ -1103,7 +1103,7 @@ register_monitor_and_crash5(Conf) when is_list(Conf) -> ?IPRINT("Users2: ~p", [Users2]), ?IPRINT("verify all agent(s): expect 2"), - ?line Agents1 = case which_agents() of + Agents1 = case which_agents() of [TargetName1, TargetName2] = A1 -> A1; [TargetName2, TargetName1] = A2 -> @@ -1113,21 +1113,21 @@ register_monitor_and_crash5(Conf) when is_list(Conf) -> end, ?IPRINT("Agents1: ~p", [Agents1]), - ?line ok = simulate_crash(Pid1), + ok = simulate_crash(Pid1), ?IPRINT("wait some time"), ?SLEEP(1000), - ?line [Id2] = Users3 = which_users(), + [Id2] = Users3 = which_users(), ?IPRINT("Users3: ~p", [Users3]), - ?line [TargetName2] = Agents2 = which_agents(), + [TargetName2] = Agents2 = which_agents(), ?IPRINT("Agents2: ~p", [Agents2]), - ?line stop_user(Pid2), + stop_user(Pid2), ?IPRINT("stop manager"), - ?line ok = snmpm:stop(), + ok = snmpm:stop(), ?IPRINT("end"), ok. @@ -1217,20 +1217,20 @@ otp7902(Conf) when is_list(Conf) -> ?SLEEP(1000), - ?line [] = Users1 = which_users(), + [] = Users1 = which_users(), ?IPRINT("Users1: ~p", [Users1]), - ?line ok = snmp_manager_user_old:start(), + ok = snmp_manager_user_old:start(), - ?line [_] = Users2 = which_users(), + [_] = Users2 = which_users(), ?IPRINT("Users2: ~p", [Users2]), - ?line ok = snmp_manager_user_old:stop(), + ok = snmp_manager_user_old:stop(), - ?line [] = Users3 = which_users(), + [] = Users3 = which_users(), ?IPRINT("Users3: ~p", [Users3]), - ?line ok = snmpm:stop(), + ok = snmpm:stop(), ?IPRINT("end"), ok. @@ -1312,7 +1312,7 @@ write_manager_conf(Dir, Str) -> write_conf_file(Dir, File, Str) -> - ?line {ok, Fd} = file:open(filename:join(Dir, File), write), - ?line ok = io:format(Fd, "~s", [Str]), + {ok, Fd} = file:open(filename:join(Dir, File), write), + ok = io:format(Fd, "~s", [Str]), file:close(Fd). |