From c36e45f8faa5ffb24479e4ab268ab151e305e779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Fri, 1 Apr 2016 18:09:14 +0200 Subject: Eliminate use of doc and suite clauses Those clause are obsolete and never used by common_test. --- lib/os_mon/test/cpu_sup_SUITE.erl | 29 ++------- lib/os_mon/test/disksup_SUITE.erl | 30 +++------ lib/os_mon/test/memsup_SUITE.erl | 46 +++----------- lib/os_mon/test/os_mon_SUITE.erl | 10 +-- lib/os_mon/test/os_mon_mib_SUITE.erl | 115 ++++++----------------------------- lib/os_mon/test/os_sup_SUITE.erl | 15 +---- 6 files changed, 47 insertions(+), 198 deletions(-) (limited to 'lib/os_mon/test') diff --git a/lib/os_mon/test/cpu_sup_SUITE.erl b/lib/os_mon/test/cpu_sup_SUITE.erl index dcd689407c..69c7414630 100644 --- a/lib/os_mon/test/cpu_sup_SUITE.erl +++ b/lib/os_mon/test/cpu_sup_SUITE.erl @@ -67,10 +67,7 @@ all() -> _OS -> [unavailable] end. -load_api(suite) -> - []; -load_api(doc) -> - ["Test of load API functions"]; +%% Test of load API functions load_api(Config) when is_list(Config) -> %% nprocs() @@ -96,10 +93,7 @@ load_api(Config) when is_list(Config) -> ok. -util_api(suite) -> - []; -util_api(doc) -> - ["Test of utilization API functions"]; +%% Test of utilization API functions util_api(Config) when is_list(Config) -> %% Some useful funs when testing util/1 BusyP = fun({user, _Share}) -> true; @@ -156,10 +150,7 @@ util_api(Config) when is_list(Config) -> -define(SPIN_TIME, 1000). -util_values(suite) -> - []; -util_values(doc) -> - ["Test utilization values"]; +%% Test utilization values util_values(Config) when is_list(Config) -> Tester = self(), @@ -204,10 +195,7 @@ util_values(Config) when is_list(Config) -> % Outdated % The portprogram is now restarted if killed, and not by os_mon... -port(suite) -> - []; -port(doc) -> - ["Test that cpu_sup handles a terminating port program"]; +%% Test that cpu_sup handles a terminating port program port(Config) when is_list(Config) -> case cpu_sup_os_pid() of {ok, PidStr} -> @@ -243,17 +231,12 @@ port(Config) when is_list(Config) -> {skip, os_pid_not_found } end. -terminate(suite) -> - []; terminate(Config) when is_list(Config) -> ok = application:set_env(os_mon, start_cpu_sup, false), _ = supervisor:terminate_child(os_mon_sup, cpu_sup), ok. -unavailable(suite) -> - []; -unavailable(doc) -> - ["Test correct behaviour when service is unavailable"]; +%% Test correct behaviour when service is unavailable unavailable(Config) when is_list(Config) -> %% Make sure all API functions return their dummy values @@ -269,8 +252,6 @@ unavailable(Config) when is_list(Config) -> ok. -restart(suite) -> - []; restart(Config) when is_list(Config) -> ok = application:set_env(os_mon, start_cpu_sup, true), {ok, _Pid} = supervisor:restart_child(os_mon_sup, cpu_sup), diff --git a/lib/os_mon/test/disksup_SUITE.erl b/lib/os_mon/test/disksup_SUITE.erl index 0f0561571a..871f7cb3d2 100644 --- a/lib/os_mon/test/disksup_SUITE.erl +++ b/lib/os_mon/test/disksup_SUITE.erl @@ -66,8 +66,7 @@ all() -> _OS -> [unavailable] end. -api(suite) -> []; -api(doc) -> ["Test of API functions"]; +%% Test of API functions api(Config) when is_list(Config) -> %% get_disk_data() @@ -96,8 +95,7 @@ api(Config) when is_list(Config) -> ok. -config(suite) -> []; -config(doc) -> ["Test configuration"]; +%% Test configuration config(Config) when is_list(Config) -> %% Change configuration parameters and make sure change is reflected @@ -133,8 +131,8 @@ config(Config) when is_list(Config) -> %% changes too much during its course, or if there are timing problems %% with the alarm_handler receiving the alarms too late %%---------------------------------------------------------------------- -alarm(suite) -> []; -alarm(doc) -> ["Test that alarms are set and cleared"]; + +%% Test that alarms are set and cleared alarm(Config) when is_list(Config) -> %% Find out how many disks exceed the threshold @@ -257,9 +255,7 @@ until(Fun, [H|T]) -> end; until(_Fun, []) -> false. -port(suite) -> []; -port(doc) -> - ["Test that disksup handles a terminating port program"]; +%% Test that disksup handles a terminating port program port(Config) when is_list(Config) -> Str = os:cmd("ps -ef | grep '[d]isksup'"), case io_lib:fread("~s ~s", Str) of @@ -300,15 +296,12 @@ port(Config) when is_list(Config) -> {skip, {os_pid_not_found, Str}} end. -terminate(suite) -> []; terminate(Config) when is_list(Config) -> ok = application:set_env(os_mon, start_disksup, false), ok = supervisor:terminate_child(os_mon_sup, disksup), ok. -unavailable(suite) -> []; -unavailable(doc) -> - ["Test correct behaviour when service is unavailable"]; +%% Test correct behaviour when service is unavailable unavailable(Config) when is_list(Config) -> %% Make sure all API functions return their dummy values @@ -319,18 +312,14 @@ unavailable(Config) when is_list(Config) -> ok = disksup:set_almost_full_threshold(0.9), ok. -restart(suite) -> - []; restart(Config) when is_list(Config) -> ok = application:set_env(os_mon, start_disksup, true), ok = application:set_env(os_mon, disksup_posix_only, false), {ok, _Pid} = supervisor:restart_child(os_mon_sup, disksup), ok. -otp_5910(suite) -> []; -otp_5910(doc) -> - ["Test that alarms are cleared if disksup crashes or " - "if OS_Mon is stopped"]; +%% Test that alarms are cleared if disksup crashes or +%% if OS_Mon is stopped otp_5910(Config) when is_list(Config) -> %% Make sure disksup sets at least one alarm @@ -389,8 +378,7 @@ otp_5910(Config) when is_list(Config) -> ok = application:start(os_mon), ok. -posix_only(suite) -> []; -posix_only(doc) -> ["Test disksup_posix_only option"]; +%% Test disksup_posix_only option posix_only(Config) when is_list(Config) -> %% Set option and restart disksup ok = application:set_env(os_mon, disksup_posix_only, true), diff --git a/lib/os_mon/test/memsup_SUITE.erl b/lib/os_mon/test/memsup_SUITE.erl index 8c31a8c39a..ed78b1ab1c 100644 --- a/lib/os_mon/test/memsup_SUITE.erl +++ b/lib/os_mon/test/memsup_SUITE.erl @@ -61,10 +61,7 @@ all() -> All ++ Bugs. -api(suite) -> - []; -api(doc) -> - ["Test of API functions"]; +%% Test of API functions api(Config) when is_list(Config) -> %% get_memory_data() @@ -154,10 +151,8 @@ api(Config) when is_list(Config) -> %% NOTE: The test case is a bit weak as it will fail if the memory %% usage changes too much during its course. %%---------------------------------------------------------------------- -alarm1(suite) -> - []; -alarm1(doc) -> - ["Test alarms when memsup_system_only==false"]; + +%% Test alarms when memsup_system_only==false alarm1(Config) when is_list(Config) -> %% If system memory usage is too high, the testcase cannot @@ -298,10 +293,7 @@ alarm1(_Config, SysUsage) -> ok = memsup:set_check_interval(1), ok. -alarm2(suite) -> - []; -alarm2(doc) -> - ["Test alarms when memsup_system_only==true"]; +%% Test alarms when memsup_system_only==true alarm2(Config) when is_list(Config) -> %% If system memory usage is too high, the testcase cannot @@ -406,10 +398,7 @@ alarm_set(Alarm, [_|T]) -> alarm_set(_Alarm, []) -> false. -process(suite) -> - []; -process(doc) -> - ["Make sure memsup discovers a process grown very large"]; +%% Make sure memsup discovers a process grown very large process(Config) when is_list(Config) -> %% Set a long memory check interval, we will force memory checks @@ -452,10 +441,7 @@ new_hog_1(List) -> _Any -> exit(List) end. -config(suite) -> - []; -config(doc) -> - ["Test configuration"]; +%% Test configuration config(Config) when is_list(Config) -> %% Change configuration parameters and make sure change is reflected @@ -504,10 +490,7 @@ config(Config) when is_list(Config) -> ok. -unavailable(suite) -> - []; -unavailable(doc) -> - ["Test correct behaviour when service is unavailable"]; +%% Test correct behaviour when service is unavailable unavailable(Config) when is_list(Config) -> %% Close memsup @@ -536,10 +519,7 @@ unavailable(Config) when is_list(Config) -> ok. -timeout(suite) -> - []; -timeout(doc) -> - ["Test stability of memsup when data collection times out"]; +%% Test stability of memsup when data collection times out timeout(Config) when is_list(Config) -> %% Set a long memory check interval and memsup_helper timeout, @@ -591,10 +571,7 @@ timeout(Config) when is_list(Config) -> ok. -port(suite) -> - []; -port(doc) -> - ["Test that memsup handles a terminating port program"]; +%% Test that memsup handles a terminating port program port(Config) when is_list(Config) -> Str = os:cmd("ps -e | grep '[m]emsup'"), case io_lib:fread("~s", Str) of @@ -636,10 +613,7 @@ port(Config) when is_list(Config) -> {skip, {os_pid_not_found, Str}} end. -otp_5910(suite) -> - []; -otp_5910(doc) -> - ["Test that alarms are cleared and not set twice"]; +%% Test that alarms are cleared and not set twice otp_5910(Config) when is_list(Config) -> Alarms = [system_memory_high_watermark, process_memory_high_watermark], diff --git a/lib/os_mon/test/os_mon_SUITE.erl b/lib/os_mon/test/os_mon_SUITE.erl index af70dc2a6c..ace06796d6 100644 --- a/lib/os_mon/test/os_mon_SUITE.erl +++ b/lib/os_mon/test/os_mon_SUITE.erl @@ -36,10 +36,7 @@ all() -> _OS -> [app_file, appup_file] end. -app_file(suite) -> - []; -app_file(doc) -> - ["Testing .app file"]; +%% Testing .app file app_file(Config) when is_list(Config) -> ok = test_server:app_test(os_mon), ok. @@ -47,10 +44,7 @@ app_file(Config) when is_list(Config) -> appup_file(Config) when is_list(Config) -> ok = test_server:appup_test(os_mon). -config(suite) -> - []; -config(doc) -> - ["Test OS_Mon configuration"]; +%% Test OS_Mon configuration config(Config) when is_list(Config) -> IsReg = fun(Name) -> is_pid(whereis(Name)) end, diff --git a/lib/os_mon/test/os_mon_mib_SUITE.erl b/lib/os_mon/test/os_mon_mib_SUITE.erl index 3f5d2210a4..84487cd751 100644 --- a/lib/os_mon/test/os_mon_mib_SUITE.erl +++ b/lib/os_mon/test/os_mon_mib_SUITE.erl @@ -138,19 +138,15 @@ end_per_suite(Config) -> %%--------------------------------------------------------------------- %% Test cases %%--------------------------------------------------------------------- -load_unload(doc) -> - ["Test to unload and the reload the OTP.mib "]; -load_unload(suite) -> []; + +%% Test to unload and the reload the OTP.mib load_unload(Config) when is_list(Config) -> os_mon_mib:unload(snmp_master_agent), os_mon_mib:load(snmp_master_agent), ok. %%--------------------------------------------------------------------- -update_load_table(doc) -> - ["check os_mon_mib:update_load_table error handling"]; -update_load_table(suite) -> - []; +%% check os_mon_mib:update_load_table error handling update_load_table(Config) when is_list(Config) -> Node = start_node(), ok = rpc:call(Node,application,start,[sasl]), @@ -161,10 +157,7 @@ update_load_table(Config) when is_list(Config) -> stop_node(Node), ok. -otp_6351(doc) -> - ["like update_load_table, when memsup_system_only==true"]; -otp_6351(suite) -> - []; +%% like update_load_table, when memsup_system_only==true otp_6351(Config) when is_list(Config) -> Node = start_node(), ok = rpc:call(Node,application,start,[sasl]), @@ -185,11 +178,8 @@ otp_6351(Config) when is_list(Config) -> %%--------------------------------------------------------------------- -get_mem_sys_mark(doc) -> - ["Simulates a get call to test the instrumentation function " - "for the loadMemorySystemWatermark variable."]; -get_mem_sys_mark(suite) -> - []; +%% Simulates a get call to test the instrumentation function +%% for the loadMemorySystemWatermark variable. get_mem_sys_mark(Config) when is_list(Config) -> case os_mon_mib:mem_sys_mark(get) of {value, SysMark} when is_integer(SysMark) -> @@ -198,11 +188,8 @@ get_mem_sys_mark(Config) when is_list(Config) -> ct:fail(sys_mark_value_not_integer) end. %%--------------------------------------------------------------------- -get_mem_proc_mark(doc) -> - ["Simulates a get call to test the instrumentation function " - "for the loadMemoryErlProcWatermark variable."]; -get_mem_proc_mark(suite) -> - []; +%% Simulates a get call to test the instrumentation function +%% for the loadMemoryErlProcWatermark variable. get_mem_proc_mark(Config) when is_list(Config) -> case os_mon_mib:mem_proc_mark(get) of {value, ProcMark} when is_integer(ProcMark) -> @@ -211,11 +198,8 @@ get_mem_proc_mark(Config) when is_list(Config) -> ct:fail(proc_mark_value_not_integer) end. %%--------------------------------------------------------------------- -get_disk_threshold(doc) -> - ["Simulates a get call to test the instrumentation function " - "for the diskAlmostFullThreshold variable."]; -get_disk_threshold(suite) -> - []; +%% Simulates a get call to test the instrumentation function +%% for the diskAlmostFullThreshold variable. get_disk_threshold(Config) when is_list(Config) -> case os_mon_mib:disk_threshold(get) of {value, ProcMark} when is_integer(ProcMark) -> @@ -231,11 +215,8 @@ get_disk_threshold(Config) when is_list(Config) -> %%% instrumentation functions directly as done in most test cases in %%% this test suite -get_load_table(doc) -> - ["Simulates get calls to test the instrumentation function " - "for the loadTable"]; -get_load_table(suite) -> - []; +%% Simulates get calls to test the instrumentation function +%% for the loadTable get_load_table(Config) when is_list(Config) -> NodeStr = atom_to_list(node()), @@ -297,10 +278,6 @@ get_load_table(Config) when is_list(Config) -> ok. %%--------------------------------------------------------------------- -sys_tot_mem(doc) -> - []; -sys_tot_mem(suite) -> - []; sys_tot_mem(Config) when is_list(Config) -> [{[?loadSystemTotalMemory, Len | NodeStr], Mem}] = os_mon_mib:load_table(get_next, [], [?loadSystemTotalMemory]), @@ -314,9 +291,6 @@ sys_tot_mem(Config) when is_list(Config) -> ct:fail(sys_tot_mem_value_not_integer) end. -sys_used_mem(doc) -> - []; -sys_used_mem(suite) -> []; sys_used_mem(Config) when is_list(Config) -> [{[?loadSystemUsedMemory, Len | NodeStr], Mem}] = os_mon_mib:load_table(get_next,[], [?loadSystemUsedMemory]), @@ -330,10 +304,6 @@ sys_used_mem(Config) when is_list(Config) -> ct:fail(sys_used_mem_value_not_integer) end. -large_erl_process(doc) -> - []; -large_erl_process(suite) -> - []; large_erl_process(Config) when is_list(Config) -> {_, _, {Pid, _}} = memsup:get_memory_data(), PidStr = lists:flatten(io_lib:format("~w", [Pid])), @@ -343,10 +313,6 @@ large_erl_process(Config) when is_list(Config) -> true = lists:member(list_to_atom(NodeStr), [node() | nodes()]), ok. -large_erl_process_mem(doc) -> - []; -large_erl_process_mem(suite) -> - []; large_erl_process_mem(Config) when is_list(Config) -> [{[?loadLargestErlProcessUsedMemory, Len | NodeStr], Mem}] = @@ -362,10 +328,6 @@ large_erl_process_mem(Config) when is_list(Config) -> ct:fail(erl_pid_mem_value_not_integer) end. -cpu_load(doc) -> - []; -cpu_load(suite) -> - []; cpu_load(Config) when is_list(Config) -> [{[?loadCpuLoad, Len | NodeStr], Load}] = os_mon_mib:load_table(get_next,[], [?loadCpuLoad]), @@ -379,10 +341,6 @@ cpu_load(Config) when is_list(Config) -> ct:fail(cpu_load_value_not_integer) end. -cpu_load5(doc) -> - []; -cpu_load5(suite) -> - []; cpu_load5(Config) when is_list(Config) -> [{[?loadCpuLoad5, Len | NodeStr], Load}] = os_mon_mib:load_table(get_next,[], [?loadCpuLoad5]), @@ -396,10 +354,6 @@ cpu_load5(Config) when is_list(Config) -> ct:fail(cpu_load5_value_not_integer) end. -cpu_load15(doc) -> - []; -cpu_load15(suite) -> - []; cpu_load15(Config) when is_list(Config) -> [{[?loadCpuLoad15, Len | NodeStr], Load}] = os_mon_mib:load_table(get_next,[], [?loadCpuLoad15]), @@ -413,10 +367,6 @@ cpu_load15(Config) when is_list(Config) -> ct:fail(cpu_load15_value_not_integer) end. -os_wordsize(doc) -> - []; -os_wordsize(suite) -> - []; os_wordsize(Config) when is_list(Config) -> [{[?loadOsWordsize, Len | NodeStr], Wordsize}] = os_mon_mib:load_table(get_next,[], [?loadOsWordsize]), @@ -430,10 +380,6 @@ os_wordsize(Config) when is_list(Config) -> ct:fail(os_wordsize_value_not_integer) end. -sys_tot_mem64(doc) -> - []; -sys_tot_mem64(suite) -> - []; sys_tot_mem64(Config) when is_list(Config) -> [{[?loadSystemTotalMemory64, Len | NodeStr], Mem}] = os_mon_mib:load_table(get_next, [], [?loadSystemTotalMemory64]), @@ -447,9 +393,6 @@ sys_tot_mem64(Config) when is_list(Config) -> ct:fail(sys_tot_mem_value_not_integer) end. -sys_used_mem64(doc) -> - []; -sys_used_mem64(suite) -> []; sys_used_mem64(Config) when is_list(Config) -> [{[?loadSystemUsedMemory64, Len | NodeStr], Mem}] = os_mon_mib:load_table(get_next,[], [?loadSystemUsedMemory64]), @@ -463,10 +406,6 @@ sys_used_mem64(Config) when is_list(Config) -> ct:fail(sys_used_mem_value_not_integer) end. -large_erl_process_mem64(doc) -> - []; -large_erl_process_mem64(suite) -> - []; large_erl_process_mem64(Config) when is_list(Config) -> [{[?loadLargestErlProcessUsedMemory64, Len | NodeStr], Mem}] = @@ -482,11 +421,8 @@ large_erl_process_mem64(Config) when is_list(Config) -> ct:fail(erl_pid_mem_value_not_integer) end. %%--------------------------------------------------------------------- -get_disk_table(doc) -> - ["Simulates get calls to test the instrumentation function " - "for the diskTable."]; -get_disk_table(suite) -> - []; +%% Simulates get calls to test the instrumentation function +%% for the diskTable. get_disk_table(Config) when is_list(Config) -> DiskData = disksup:get_disk_data(), @@ -536,10 +472,6 @@ get_disk_table(Config) when is_list(Config) -> %%--------------------------------------------------------------------- -disk_descr(doc) -> - []; -disk_descr(suite) -> - []; disk_descr(Config) when is_list(Config) -> [{[?diskDescr, 1,1], Descr}] = os_mon_mib:disk_table(get_next, [], [?diskDescr]), @@ -551,9 +483,6 @@ disk_descr(Config) when is_list(Config) -> ct:fail(disk_descr_value_not_a_string) end. -disk_kbytes(doc) -> - []; -disk_kbytes(suite) -> []; disk_kbytes(Config) when is_list(Config) -> [{[?diskKBytes, 1,1], Kbytes}] = os_mon_mib:disk_table(get_next,[], [?diskKBytes]), @@ -566,9 +495,6 @@ disk_kbytes(Config) when is_list(Config) -> end. -disk_capacity(doc) -> - []; -disk_capacity(suite) -> []; disk_capacity(Config) when is_list(Config) -> [{[?diskCapacity, 1,1], Capacity}] = os_mon_mib:disk_table(get_next,[], [?diskCapacity]), @@ -581,10 +507,8 @@ disk_capacity(Config) when is_list(Config) -> end. %%--------------------------------------------------------------------- -real_snmp_request(doc) -> - ["Starts an snmp manager and sends a real snmp-request. i.e. " - "sends a udp message on the correct format."]; -real_snmp_request(suite) -> []; +%% Starts an snmp manager and sends a real snmp-request. i.e. +%% sends a udp message on the correct format. real_snmp_request(Config) when is_list(Config) -> NodStr = atom_to_list(node()), Len = length(NodStr), @@ -602,11 +526,8 @@ real_snmp_request(Config) when is_list(Config) -> s, "<0.101.0>", Config), ok. -otp_7441(doc) -> - ["Starts an snmp manager and requests total memory. Was previously - integer32 which was errornous on 64 bit machines."]; -otp_7441(suite) -> - []; +%% Starts an snmp manager and requests total memory. Was previously +%% integer32 which was errornous on 64 bit machines. otp_7441(Config) when is_list(Config) -> NodStr = atom_to_list(node()), Len = length(NodStr), diff --git a/lib/os_mon/test/os_sup_SUITE.erl b/lib/os_mon/test/os_sup_SUITE.erl index 8065b0b50c..82c04ceaae 100644 --- a/lib/os_mon/test/os_sup_SUITE.erl +++ b/lib/os_mon/test/os_sup_SUITE.erl @@ -66,10 +66,7 @@ all() -> end. -message(suite) -> - []; -message(doc) -> - ["Test OS message handling"]; +%% Test OS message handling message(Config) when is_list(Config) -> %% Fake an OS message @@ -95,10 +92,7 @@ message(Config) when is_list(Config) -> ok. -config(suite) -> - []; -config(doc) -> - ["Test configuration"]; +%% Test configuration config(Config) when is_list(Config) -> %% os_sup_enable==true and os_sup_own/os_sup_syslogconf cannot @@ -110,10 +104,7 @@ config(Config) when is_list(Config) -> ok. -port(suite) -> - []; -port(doc) -> - ["Test that os_sup handles a terminating port program"]; +%% Test that os_sup handles a terminating port program port(Config) when is_list(Config) -> Str = os:cmd("ps -e | grep '[f]errule'"), case io_lib:fread("~s", Str) of -- cgit v1.2.3