aboutsummaryrefslogtreecommitdiffstats
path: root/lib/os_mon/test
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2016-04-01 17:50:22 +0200
committerBjörn-Egil Dahlberg <[email protected]>2016-04-01 17:50:22 +0200
commitab8b414921a2fe2738d7fcc0e66fe382a39ed247 (patch)
treee643bcf4671be7f95668221067cbfedaf44ae960 /lib/os_mon/test
parentddff69ac445fe073682ac8aa9b9951b41ee450ef (diff)
downloadotp-ab8b414921a2fe2738d7fcc0e66fe382a39ed247.tar.gz
otp-ab8b414921a2fe2738d7fcc0e66fe382a39ed247.tar.bz2
otp-ab8b414921a2fe2738d7fcc0e66fe382a39ed247.zip
Eliminate use of test_server:fail/0,1
Diffstat (limited to 'lib/os_mon/test')
-rw-r--r--lib/os_mon/test/cpu_sup_SUITE.erl2
-rw-r--r--lib/os_mon/test/disksup_SUITE.erl18
-rw-r--r--lib/os_mon/test/memsup_SUITE.erl45
-rw-r--r--lib/os_mon/test/os_mon_mib_SUITE.erl40
-rw-r--r--lib/os_mon/test/os_sup_SUITE.erl6
5 files changed, 55 insertions, 56 deletions
diff --git a/lib/os_mon/test/cpu_sup_SUITE.erl b/lib/os_mon/test/cpu_sup_SUITE.erl
index 597e53044d..bbdd46c21e 100644
--- a/lib/os_mon/test/cpu_sup_SUITE.erl
+++ b/lib/os_mon/test/cpu_sup_SUITE.erl
@@ -222,7 +222,7 @@ port(Config) when is_list(Config) ->
%% cpu_sup should not terminate
receive
{'DOWN', MonRef, _, _, Reason} ->
- ?t:fail({unexpected_exit_reason, Reason})
+ ct:fail({unexpected_exit_reason, Reason})
after 3000 ->
ok
end,
diff --git a/lib/os_mon/test/disksup_SUITE.erl b/lib/os_mon/test/disksup_SUITE.erl
index 8e44122f47..6ce88ac10d 100644
--- a/lib/os_mon/test/disksup_SUITE.erl
+++ b/lib/os_mon/test/disksup_SUITE.erl
@@ -148,7 +148,7 @@ alarm(Config) when is_list(Config) ->
true;
true ->
dump_info(),
- ?t:fail({bad_alarms, Threshold1, Data1, Alarms1})
+ ct:fail({bad_alarms, Threshold1, Data1, Alarms1})
end,
%% Try to find a disk with space usage below Threshold1,
@@ -173,7 +173,7 @@ alarm(Config) when is_list(Config) ->
true;
true ->
dump_info(),
- ?t:fail({bad_alarms, Threshold2, Data2, Alarms2})
+ ct:fail({bad_alarms, Threshold2, Data2, Alarms2})
end;
false ->
ignore
@@ -201,7 +201,7 @@ alarm(Config) when is_list(Config) ->
ok;
true ->
dump_info(),
- ?t:fail({bad_alarms, Threshold3, Data3, Alarms3})
+ ct:fail({bad_alarms, Threshold3, Data3, Alarms3})
end;
100 ->
ignore
@@ -279,10 +279,10 @@ port(Config) when is_list(Config) ->
{'DOWN', MonRef, _, _, {port_died, _Reason}} ->
ok;
{'DOWN', MonRef, _, _, Reason} ->
- ?t:fail({unexpected_exit_reason, Reason})
+ ct:fail({unexpected_exit_reason, Reason})
after
3000 ->
- ?t:fail({still_alive, Str})
+ ct:fail({still_alive, Str})
end,
%% Give os_mon_sup time to restart disksup
@@ -351,12 +351,12 @@ otp_5910(Config) when is_list(Config) ->
Alarms = get_alarms(),
if
Over==0 ->
- ?t:fail({threshold_too_low, Data2, Threshold});
+ ct:fail({threshold_too_low, Data2, Threshold});
Over==length(Alarms) ->
ok;
true ->
dump_info(),
- ?t:fail({bad_alarms, Threshold, Data2, Alarms})
+ ct:fail({bad_alarms, Threshold, Data2, Alarms})
end,
%% Kill disksup
@@ -371,7 +371,7 @@ otp_5910(Config) when is_list(Config) ->
length(Alarms2)==length(Alarms) -> ok;
true ->
dump_info(),
- ?t:fail({bad_alarms,Threshold,Data3,Alarms,Alarms2})
+ ct:fail({bad_alarms,Threshold,Data3,Alarms,Alarms2})
end,
%% Stop OS_Mon and make sure all disksup alarms are cleared
@@ -380,7 +380,7 @@ otp_5910(Config) when is_list(Config) ->
Alarms3 = get_alarms(),
case get_alarms() of
[] -> ok;
- _ -> ?t:fail({alarms_not_cleared, Alarms3})
+ _ -> ct:fail({alarms_not_cleared, Alarms3})
end,
%% Reset threshold and restart OS_Mon
diff --git a/lib/os_mon/test/memsup_SUITE.erl b/lib/os_mon/test/memsup_SUITE.erl
index 4a740a1c17..2ad542042d 100644
--- a/lib/os_mon/test/memsup_SUITE.erl
+++ b/lib/os_mon/test/memsup_SUITE.erl
@@ -76,9 +76,9 @@ api(Config) when is_list(Config) ->
is_integer(PidBytes) ->
ok;
{0, 0, _WorstPid} ->
- ?t:fail(first_data_collection_failed);
+ ct:fail(first_data_collection_failed);
_ ->
- ?t:fail({bad_return, RegMemData})
+ ct:fail({bad_return, RegMemData})
end,
%% get_system_memory_data()
@@ -195,7 +195,7 @@ alarm1(_Config, SysUsage) ->
false when not SysP ->
ok;
_ ->
- ?t:fail({sys_alarm, SysUsage, SysThreshold})
+ ct:fail({sys_alarm, SysUsage, SysThreshold})
end,
%% Lower/raise the threshold to clear/set the alarm
@@ -222,7 +222,7 @@ alarm1(_Config, SysUsage) ->
false when SysP ->
ok;
_ ->
- ?t:fail({sys_alarm, SysUsage, NewSysThreshold})
+ ct:fail({sys_alarm, SysUsage, NewSysThreshold})
end,
%% Reset the threshold to set/clear the alarm again
@@ -235,7 +235,7 @@ alarm1(_Config, SysUsage) ->
false when not SysP ->
ok;
_ ->
- ?t:fail({sys_alarm, SysUsage, SysThreshold})
+ ct:fail({sys_alarm, SysUsage, SysThreshold})
end,
%% Check memory usage
@@ -255,9 +255,9 @@ alarm1(_Config, SysUsage) ->
false when not ProcP ->
ok;
{true, BadPid1} when ProcP ->
- ?t:fail({proc_alarm, WorstPid, BadPid1});
+ ct:fail({proc_alarm, WorstPid, BadPid1});
_ ->
- ?t:fail({proc_alarm, PidUsage, ProcThreshold})
+ ct:fail({proc_alarm, PidUsage, ProcThreshold})
end,
%% Lower/raise the threshold to clear/set the alarm
@@ -274,9 +274,9 @@ alarm1(_Config, SysUsage) ->
false when ProcP ->
ok;
{true, BadPid2} when not ProcP ->
- test_server:fail({proc_alarm, WorstPid, BadPid2});
+ ct:fail({proc_alarm, WorstPid, BadPid2});
_ ->
- ?t:fail({proc_alarm, PidUsage, ProcThreshold})
+ ct:fail({proc_alarm, PidUsage, ProcThreshold})
end,
%% Reset the threshold to clear/set the alarm
@@ -289,9 +289,9 @@ alarm1(_Config, SysUsage) ->
false when not ProcP ->
ok;
{true, BadPid3} when ProcP ->
- test_server:fail({proc_alarm, WorstPid, BadPid3});
+ ct:fail({proc_alarm, WorstPid, BadPid3});
_ ->
- ?t:fail({proc_alarm, PidUsage, ProcThreshold})
+ ct:fail({proc_alarm, PidUsage, ProcThreshold})
end,
%% Reset memory check interval
@@ -346,7 +346,7 @@ alarm2(_Config, _SysUsage) ->
false when not SysP ->
ok;
_ ->
- ?t:fail({sys_alarm, SysUsage, SysThreshold})
+ ct:fail({sys_alarm, SysUsage, SysThreshold})
end,
%% Lower/raise the threshold to clear/set the alarm
@@ -373,7 +373,7 @@ alarm2(_Config, _SysUsage) ->
false when SysP ->
ok;
_ ->
- ?t:fail({sys_alarm, SysUsage, NewSysThreshold})
+ ct:fail({sys_alarm, SysUsage, NewSysThreshold})
end,
%% Reset the threshold to set/clear the alarm again
@@ -386,7 +386,7 @@ alarm2(_Config, _SysUsage) ->
false when not SysP ->
ok;
_ ->
- ?t:fail({sys_alarm, SysUsage, SysThreshold})
+ ct:fail({sys_alarm, SysUsage, SysThreshold})
end,
%% Reset memsup_system_only and restart memsup
@@ -433,7 +433,7 @@ process(Config) when is_list(Config) ->
{_, _, {WorsePid, _MoreBytes}} ->
ok;
{_, _, BadWorst} ->
- ?t:fail({worst_pid, BadWorst})
+ ct:fail({worst_pid, BadWorst})
end,
%% Reset memory check interval
@@ -577,9 +577,9 @@ timeout(Config) when is_list(Config) ->
ok;
{Mref, Res} ->
erlang:demonitor(Mref),
- ?t:fail({unexpected_result, Res});
+ ct:fail({unexpected_result, Res});
{'DOWN', Mref, _, _, _} ->
- ?t:fail(no_result)
+ ct:fail(no_result)
end,
%% Reset memory check interval and memsup_helper timeout
@@ -614,10 +614,10 @@ port(Config) when is_list(Config) ->
{'DOWN', MonRef, _, _, {port_died, _Reason}} ->
ok;
{'DOWN', MonRef, _, _, Reason} ->
- ?t:fail({unexpected_exit_reason, Reason})
+ ct:fail({unexpected_exit_reason, Reason})
after
3000 ->
- ?t:fail(still_alive)
+ ct:fail(still_alive)
end,
%% Give os_mon_sup time to restart memsup
@@ -689,8 +689,7 @@ otp_5910(Config) when is_list(Config) ->
case alarm_set(AlarmId) of
{true, _} -> ok;
false ->
- ?t:fail({alarm_not_set,
- AlarmId})
+ ct:fail({alarm_not_set, AlarmId})
end
end,
Alarms),
@@ -716,7 +715,7 @@ otp_5910(Config) when is_list(Config) ->
{0, 0} ->
ok;
_ ->
- ?t:fail({bad_number_of_alarms, SetAlarms, MemUsage})
+ ct:fail({bad_number_of_alarms, SetAlarms, MemUsage})
end,
%% Stop OS_Mon and make sure all memsup alarms are cleared
@@ -726,7 +725,7 @@ otp_5910(Config) when is_list(Config) ->
case alarm_set(AlarmId) of
false -> ok;
{true, _} ->
- ?t:fail({alarm_is_set, AlarmId})
+ ct:fail({alarm_is_set, AlarmId})
end
end,
Alarms),
diff --git a/lib/os_mon/test/os_mon_mib_SUITE.erl b/lib/os_mon/test/os_mon_mib_SUITE.erl
index 4a94c5998b..3f5d2210a4 100644
--- a/lib/os_mon/test/os_mon_mib_SUITE.erl
+++ b/lib/os_mon/test/os_mon_mib_SUITE.erl
@@ -177,7 +177,7 @@ otp_6351(Config) when is_list(Config) ->
is_tuple(Res), element(1, Res)==loadTable ->
ok;
true ->
- ?t:fail(Res)
+ ct:fail(Res)
end,
rpc:call(Node,application,stop,[os_mon]),
stop_node(Node),
@@ -195,7 +195,7 @@ get_mem_sys_mark(Config) when is_list(Config) ->
{value, SysMark} when is_integer(SysMark) ->
ok;
_ ->
- test_server:fail(sys_mark_value_not_integer)
+ ct:fail(sys_mark_value_not_integer)
end.
%%---------------------------------------------------------------------
get_mem_proc_mark(doc) ->
@@ -208,7 +208,7 @@ get_mem_proc_mark(Config) when is_list(Config) ->
{value, ProcMark} when is_integer(ProcMark) ->
ok;
_ ->
- test_server:fail(proc_mark_value_not_integer)
+ ct:fail(proc_mark_value_not_integer)
end.
%%---------------------------------------------------------------------
get_disk_threshold(doc) ->
@@ -221,7 +221,7 @@ get_disk_threshold(Config) when is_list(Config) ->
{value, ProcMark} when is_integer(ProcMark) ->
ok;
_ ->
- test_server:fail(disk_threshold_value_not_integer)
+ ct:fail(disk_threshold_value_not_integer)
end.
%%---------------------------------------------------------------------
@@ -271,7 +271,7 @@ get_load_table(Config) when is_list(Config) ->
10 ->
ok;
_ ->
- test_server:fail(value_not_integer)
+ ct:fail(value_not_integer)
end,
[{noValue,noSuchInstance}, {noValue,noSuchInstance},
@@ -311,7 +311,7 @@ sys_tot_mem(Config) when is_list(Config) ->
Mem when is_integer(Mem) ->
ok;
_ ->
- test_server:fail(sys_tot_mem_value_not_integer)
+ ct:fail(sys_tot_mem_value_not_integer)
end.
sys_used_mem(doc) ->
@@ -327,7 +327,7 @@ sys_used_mem(Config) when is_list(Config) ->
Mem when is_integer(Mem) ->
ok;
_ ->
- test_server:fail(sys_used_mem_value_not_integer)
+ ct:fail(sys_used_mem_value_not_integer)
end.
large_erl_process(doc) ->
@@ -359,7 +359,7 @@ large_erl_process_mem(Config) when is_list(Config) ->
Mem when is_integer(Mem) ->
ok;
_ ->
- test_server:fail(erl_pid_mem_value_not_integer)
+ ct:fail(erl_pid_mem_value_not_integer)
end.
cpu_load(doc) ->
@@ -376,7 +376,7 @@ cpu_load(Config) when is_list(Config) ->
Load when is_integer(Load) ->
ok;
_ ->
- test_server:fail(cpu_load_value_not_integer)
+ ct:fail(cpu_load_value_not_integer)
end.
cpu_load5(doc) ->
@@ -393,7 +393,7 @@ cpu_load5(Config) when is_list(Config) ->
Load when is_integer(Load) ->
ok;
_ ->
- test_server:fail(cpu_load5_value_not_integer)
+ ct:fail(cpu_load5_value_not_integer)
end.
cpu_load15(doc) ->
@@ -410,7 +410,7 @@ cpu_load15(Config) when is_list(Config) ->
Load when is_integer(Load) ->
ok;
_ ->
- test_server:fail(cpu_load15_value_not_integer)
+ ct:fail(cpu_load15_value_not_integer)
end.
os_wordsize(doc) ->
@@ -427,7 +427,7 @@ os_wordsize(Config) when is_list(Config) ->
Wordsize when is_integer(Wordsize) ->
ok;
_ ->
- test_server:fail(os_wordsize_value_not_integer)
+ ct:fail(os_wordsize_value_not_integer)
end.
sys_tot_mem64(doc) ->
@@ -444,7 +444,7 @@ sys_tot_mem64(Config) when is_list(Config) ->
Mem when is_integer(Mem) ->
ok;
_ ->
- test_server:fail(sys_tot_mem_value_not_integer)
+ ct:fail(sys_tot_mem_value_not_integer)
end.
sys_used_mem64(doc) ->
@@ -460,7 +460,7 @@ sys_used_mem64(Config) when is_list(Config) ->
Mem when is_integer(Mem) ->
ok;
_ ->
- test_server:fail(sys_used_mem_value_not_integer)
+ ct:fail(sys_used_mem_value_not_integer)
end.
large_erl_process_mem64(doc) ->
@@ -479,7 +479,7 @@ large_erl_process_mem64(Config) when is_list(Config) ->
Mem when is_integer(Mem) ->
ok;
_ ->
- test_server:fail(erl_pid_mem_value_not_integer)
+ ct:fail(erl_pid_mem_value_not_integer)
end.
%%---------------------------------------------------------------------
get_disk_table(doc) ->
@@ -501,7 +501,7 @@ get_disk_table(Config) when is_list(Config) ->
true ->
ok;
false ->
- test_server:fail(value_not_a_string)
+ ct:fail(value_not_a_string)
end,
Values = os_mon_mib:disk_table(get, [1,1],
@@ -521,7 +521,7 @@ get_disk_table(Config) when is_list(Config) ->
3 ->
ok;
_ ->
- test_server:fail(value_not_integer)
+ ct:fail(value_not_integer)
end
end,
@@ -548,7 +548,7 @@ disk_descr(Config) when is_list(Config) ->
Descr when is_list(Descr) ->
ok;
_ ->
- test_server:fail(disk_descr_value_not_a_string)
+ ct:fail(disk_descr_value_not_a_string)
end.
disk_kbytes(doc) ->
@@ -562,7 +562,7 @@ disk_kbytes(Config) when is_list(Config) ->
Kbytes when is_integer(Kbytes) ->
ok;
_ ->
- test_server:fail(disk_kbytes_value_not_integer)
+ ct:fail(disk_kbytes_value_not_integer)
end.
@@ -577,7 +577,7 @@ disk_capacity(Config) when is_list(Config) ->
Capacity when is_integer(Capacity) ->
ok;
_ ->
- test_server:fail(disk_capacity_value_not_integer)
+ ct:fail(disk_capacity_value_not_integer)
end.
%%---------------------------------------------------------------------
diff --git a/lib/os_mon/test/os_sup_SUITE.erl b/lib/os_mon/test/os_sup_SUITE.erl
index 39e3c7e815..fb30e479a7 100644
--- a/lib/os_mon/test/os_sup_SUITE.erl
+++ b/lib/os_mon/test/os_sup_SUITE.erl
@@ -90,7 +90,7 @@ message(Config) when is_list(Config) ->
{result, true} ->
ok;
{result, Rec} ->
- ?t:fail({no_message, Rec})
+ ct:fail({no_message, Rec})
end,
ok.
@@ -131,10 +131,10 @@ port(Config) when is_list(Config) ->
{'DOWN', MonRef, _, _, {port_died, _Reason}} ->
ok;
{'DOWN', MonRef, _, _, Reason} ->
- ?t:fail({unexpected_exit_reason, Reason})
+ ct:fail({unexpected_exit_reason, Reason})
after
3000 ->
- ?t:fail(still_alive)
+ ct:fail(still_alive)
end,
%% Give os_mon_sup time to restart os_sup