aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2010-10-12 10:52:14 +0200
committerLukas Larsson <[email protected]>2011-02-17 17:28:28 +0100
commit60c006def535e129f73d3834dba9f8b2bfa74813 (patch)
tree14ef095fed4b18c59a0a9c05e32b6d818d967ca1 /lib
parenta7cf522a129b3d707141bb681fc5c074bdca5e69 (diff)
downloadotp-60c006def535e129f73d3834dba9f8b2bfa74813.tar.gz
otp-60c006def535e129f73d3834dba9f8b2bfa74813.tar.bz2
otp-60c006def535e129f73d3834dba9f8b2bfa74813.zip
Update os_mon tests to conform with common_test standard
Diffstat (limited to 'lib')
-rw-r--r--lib/os_mon/test/cpu_sup_SUITE.erl36
-rw-r--r--lib/os_mon/test/disksup_SUITE.erl36
-rw-r--r--lib/os_mon/test/memsup_SUITE.erl37
-rw-r--r--lib/os_mon/test/os_mon.spec2
-rw-r--r--lib/os_mon/test/os_mon_SUITE.erl24
-rw-r--r--lib/os_mon/test/os_mon_mib_SUITE.erl61
-rw-r--r--lib/os_mon/test/os_sup_SUITE.erl33
7 files changed, 131 insertions, 98 deletions
diff --git a/lib/os_mon/test/cpu_sup_SUITE.erl b/lib/os_mon/test/cpu_sup_SUITE.erl
index 45f9d981d1..7c51b9b54b 100644
--- a/lib/os_mon/test/cpu_sup_SUITE.erl
+++ b/lib/os_mon/test/cpu_sup_SUITE.erl
@@ -17,10 +17,10 @@
%% %CopyrightEnd%
%%
-module(cpu_sup_SUITE).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
%% Test server specific exports
--export([all/1]).
+-export([all/0,groups/0,init_per_group/2,end_per_group/2]).
-export([init_per_suite/1, end_per_suite/1]).
-export([init_per_testcase/2, end_per_testcase/2]).
@@ -50,19 +50,25 @@ end_per_testcase(_Case, Config) ->
?t:timetrap_cancel(Dog),
ok.
-all(suite) ->
- case ?t:os_type() of
- {unix, sunos} ->
- [load_api, util_api, util_values, port,
- {conf, terminate, [unavailable], restart}];
- {unix, linux} ->
- [load_api, util_api, util_values, port,
- {conf, terminate, [unavailable], restart}];
- {unix, _OSname} ->
- [load_api];
- _OS ->
- [unavailable]
- end.
+all() ->
+case test_server:os_type() of
+ {unix, sunos} ->
+ [load_api, util_api, util_values, port, unavailable];
+ {unix, linux} ->
+ [load_api, util_api, util_values, port, unavailable];
+ {unix, _OSname} -> [load_api];
+ _OS -> [unavailable]
+end.
+
+groups() ->
+ [].
+
+init_per_group(_GroupName, Config) ->
+ Config.
+
+end_per_group(_GroupName, Config) ->
+ Config.
+
load_api(suite) ->
[];
diff --git a/lib/os_mon/test/disksup_SUITE.erl b/lib/os_mon/test/disksup_SUITE.erl
index 987d631c36..f21b8db2ae 100644
--- a/lib/os_mon/test/disksup_SUITE.erl
+++ b/lib/os_mon/test/disksup_SUITE.erl
@@ -17,10 +17,10 @@
%% %CopyrightEnd%
%%
-module(disksup_SUITE).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
%% Test server specific exports
--export([all/1]).
+-export([all/0,groups/0,init_per_group/2,end_per_group/2]).
-export([init_per_suite/1, end_per_suite/1]).
-export([init_per_testcase/2, end_per_testcase/2]).
@@ -50,19 +50,25 @@ end_per_testcase(_Case, Config) ->
?t:timetrap_cancel(Dog),
ok.
-all(suite) ->
- Bugs = [otp_5910],
- case ?t:os_type() of
- {unix, sunos} ->
- [api, config, alarm, port,
- {conf, terminate, [unavailable], restart}] ++ Bugs;
- {unix, _OSname} ->
- [api, alarm] ++ Bugs;
- {win32, _OSname} ->
- [api, alarm] ++ Bugs;
- _OS ->
- [unavailable]
- end.
+all() ->
+Bugs = [otp_5910],
+ case test_server:os_type() of
+ {unix, sunos} ->
+ [api, config, alarm, port, unavailable] ++ Bugs;
+ {unix, _OSname} -> [api, alarm] ++ Bugs;
+ {win32, _OSname} -> [api, alarm] ++ Bugs;
+ _OS -> [unavailable]
+end.
+
+groups() ->
+ [].
+
+init_per_group(_GroupName, Config) ->
+ Config.
+
+end_per_group(_GroupName, Config) ->
+ Config.
+
api(suite) ->
[];
diff --git a/lib/os_mon/test/memsup_SUITE.erl b/lib/os_mon/test/memsup_SUITE.erl
index 01a7f6c7f2..dc7af32746 100644
--- a/lib/os_mon/test/memsup_SUITE.erl
+++ b/lib/os_mon/test/memsup_SUITE.erl
@@ -17,10 +17,10 @@
%% %CopyrightEnd%
%%
-module(memsup_SUITE).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
%% Test server specific exports
--export([all/1]).
+-export([all/0,groups/0,init_per_group/2,end_per_group/2]).
-export([init_per_suite/1, end_per_suite/1]).
-export([init_per_testcase/2, end_per_testcase/2]).
@@ -49,18 +49,27 @@ end_per_testcase(_Case, Config) ->
?t:timetrap_cancel(Dog),
Config.
-all(suite) ->
- All = case ?t:os_type() of
- {unix, sunos} ->
- [api, alarm1, alarm2, process,
- config, timeout, unavailable, port];
- {unix, linux} ->
- [api, alarm1, alarm2, process, timeout];
- _OS ->
- [api, alarm1, alarm2, process]
- end,
- Bugs = [otp_5910],
- All ++ Bugs.
+all() ->
+All = case test_server:os_type() of
+ {unix, sunos} ->
+ [api, alarm1, alarm2, process, config, timeout,
+ unavailable, port];
+ {unix, linux} ->
+ [api, alarm1, alarm2, process, timeout];
+ _OS -> [api, alarm1, alarm2, process]
+ end,
+ Bugs = [otp_5910],
+ All ++ Bugs.
+
+groups() ->
+ [].
+
+init_per_group(_GroupName, Config) ->
+ Config.
+
+end_per_group(_GroupName, Config) ->
+ Config.
+
api(suite) ->
[];
diff --git a/lib/os_mon/test/os_mon.spec b/lib/os_mon/test/os_mon.spec
index bdae523795..859859c587 100644
--- a/lib/os_mon/test/os_mon.spec
+++ b/lib/os_mon/test/os_mon.spec
@@ -1 +1 @@
-{topcase, {dir, "../os_mon_test"}}.
+{suites,"os_mon_test",all}.
diff --git a/lib/os_mon/test/os_mon_SUITE.erl b/lib/os_mon/test/os_mon_SUITE.erl
index 033c61e3c8..f5dea6a92d 100644
--- a/lib/os_mon/test/os_mon_SUITE.erl
+++ b/lib/os_mon/test/os_mon_SUITE.erl
@@ -17,10 +17,10 @@
%% %CopyrightEnd%
%%
-module(os_mon_SUITE).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
%% Test server specific exports
--export([all/1]).
+-export([all/0,groups/0,init_per_group/2,end_per_group/2]).
-export([init_per_testcase/2, end_per_testcase/2]).
%% Test cases
@@ -38,11 +38,21 @@ end_per_testcase(_Case, Config) ->
test_server:timetrap_cancel(Dog),
ok.
-all(suite) ->
- case ?t:os_type() of
- {unix, sunos} -> [app_file, config];
- _OS -> [app_file]
- end.
+all() ->
+case test_server:os_type() of
+ {unix, sunos} -> [app_file, config];
+ _OS -> [app_file]
+end.
+
+groups() ->
+ [].
+
+init_per_group(_GroupName, Config) ->
+ Config.
+
+end_per_group(_GroupName, Config) ->
+ Config.
+
app_file(suite) ->
[];
diff --git a/lib/os_mon/test/os_mon_mib_SUITE.erl b/lib/os_mon/test/os_mon_mib_SUITE.erl
index a1d463030a..d784b636ff 100644
--- a/lib/os_mon/test/os_mon_mib_SUITE.erl
+++ b/lib/os_mon/test/os_mon_mib_SUITE.erl
@@ -24,13 +24,13 @@
-define(line,erlang:display({line,?LINE}),).
-define(config(A,B), config(A,B)).
-else.
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-include_lib("os_mon/include/OTP-OS-MON-MIB.hrl").
-include_lib("snmp/include/snmp_types.hrl").
-endif.
% Test server specific exports
--export([all/1, init_per_suite/1, end_per_suite/1,
+-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1,
init_per_testcase/2, end_per_testcase/2]).
@@ -38,8 +38,8 @@
-export([update_load_table/1]).
-export([get_mem_sys_mark/1, get_mem_proc_mark/1, get_disk_threshold/1,
- get_load_table/1, get_next_load_table/1, get_disk_table/1,
- get_next_disk_table/1, real_snmp_request/1, load_unload/1]).
+ get_load_table/1, get_disk_table/1,
+ real_snmp_request/1, load_unload/1]).
-export([sys_tot_mem/1, sys_used_mem/1, large_erl_process/1,
large_erl_process_mem/1, cpu_load/1, cpu_load5/1, cpu_load15/1,
@@ -47,7 +47,7 @@
large_erl_process_mem64/1, disk_descr/1, disk_kbytes/1,
disk_capacity/1]).
--export([tickets/1]).
+-export([]).
-export([otp_6351/1, otp_7441/1]).
-define(TRAP_UDP, 5000).
@@ -77,17 +77,30 @@ end_per_testcase(_Case, Config) when is_list(Config) ->
test_server:timetrap_cancel(Dog),
Config.
-all(doc) ->
- ["Test os_mon mibs and provided instrumentation functions."];
+all() ->
+[load_unload, get_mem_sys_mark, get_mem_proc_mark,
+ get_disk_threshold, get_load_table,
+ {group, get_next_load_table}, get_disk_table,
+ {group, get_next_disk_table}, real_snmp_request,
+ update_load_table, {group, tickets}].
+
+groups() ->
+ [{tickets, [], [otp_6351, otp_7441]},
+ {get_next_load_table, [],
+ [sys_tot_mem, sys_used_mem, large_erl_process,
+ large_erl_process_mem, cpu_load, cpu_load5, cpu_load15,
+ os_wordsize, sys_tot_mem64, sys_used_mem64,
+ large_erl_process_mem64]},
+ {get_next_disk_table, [],
+ [disk_descr, disk_kbytes, disk_capacity]}].
+
+init_per_group(_GroupName, Config) ->
+ Config.
+
+end_per_group(_GroupName, Config) ->
+ Config.
-all(suite) ->
- [load_unload, get_mem_sys_mark, get_mem_proc_mark,
- get_disk_threshold, get_load_table, get_next_load_table,
- get_disk_table, get_next_disk_table, real_snmp_request,
- update_load_table, tickets].
-tickets(suite) ->
- [otp_6351, otp_7441].
-endif.
%%---------------------------------------------------------------------
@@ -338,21 +351,6 @@ get_load_table(Config) when is_list(Config) ->
ok.
%%---------------------------------------------------------------------
-get_next_load_table(doc) ->
- ["Simulates get_next calls to test the instrumentation function "
- "for the loadTable"];
-get_next_load_table(suite) ->
- [ sys_tot_mem,
- sys_used_mem,
- large_erl_process,
- large_erl_process_mem,
- cpu_load,
- cpu_load5,
- cpu_load15,
- os_wordsize,
- sys_tot_mem64,
- sys_used_mem64,
- large_erl_process_mem64].
sys_tot_mem(doc) ->
[];
@@ -592,11 +590,6 @@ get_disk_table(Config) when is_list(Config) ->
ok.
%%---------------------------------------------------------------------
-get_next_disk_table(doc) ->
- ["Simulates get_next calls to test the instrumentation function "
- "for the diskTable."];
-get_next_disk_table(suite) ->
- [disk_descr, disk_kbytes, disk_capacity].
disk_descr(doc) ->
[];
diff --git a/lib/os_mon/test/os_sup_SUITE.erl b/lib/os_mon/test/os_sup_SUITE.erl
index 25041f968d..02e1acf1b7 100644
--- a/lib/os_mon/test/os_sup_SUITE.erl
+++ b/lib/os_mon/test/os_sup_SUITE.erl
@@ -17,10 +17,10 @@
%% %CopyrightEnd%
%%
-module(os_sup_SUITE).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
%% Test server specific exports
--export([all/1]).
+-export([all/0,groups/0,init_per_group/2,end_per_group/2]).
-export([init_per_suite/1, end_per_suite/1]).
-export([init_per_testcase/2, end_per_testcase/2]).
@@ -63,16 +63,25 @@ end_per_testcase(_Case, Config) ->
?t:timetrap_cancel(Dog),
ok.
-all(suite) ->
- case ?t:os_type() of
- {unix, sunos} ->
- [message, config, port];
- {win32, _OSname} ->
- [message];
- OS ->
- Str = io_lib:format("os_sup not available for ~p", [OS]),
- {skip, lists:flatten(Str)}
- end.
+all() ->
+case test_server:os_type() of
+ {unix, sunos} -> [message, config, port];
+ {win32, _OSname} -> [message];
+ OS ->
+ Str = io_lib:format("os_sup not available for ~p",
+ [OS]),
+ {skip, lists:flatten(Str)}
+end.
+
+groups() ->
+ [].
+
+init_per_group(_GroupName, Config) ->
+ Config.
+
+end_per_group(_GroupName, Config) ->
+ Config.
+
message(suite) ->
[];