aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2014-08-06 15:07:23 +0200
committerLukas Larsson <[email protected]>2014-08-06 15:07:23 +0200
commitbf4d615f04002aebca4e340f9fa0aaf3888e84e2 (patch)
tree7c402e1810ed576cf305ff3f244a0aa88565d8e1
parentf3220cea004a277b477b0f53cc35ab8122a53792 (diff)
parent85635f0d0e47ca4db56a88681c15f73f1727298a (diff)
downloadotp-bf4d615f04002aebca4e340f9fa0aaf3888e84e2.tar.gz
otp-bf4d615f04002aebca4e340f9fa0aaf3888e84e2.tar.bz2
otp-bf4d615f04002aebca4e340f9fa0aaf3888e84e2.zip
Merge branch 'lukas/os_mon/testfixes/OTP-12053' into maint
* lukas/os_mon/testfixes/OTP-12053: os_mon: Fix so that all testcases are run os_mon: Ignore posix_only on windows and solaris
-rw-r--r--lib/os_mon/doc/src/disksup.xml3
-rw-r--r--lib/os_mon/src/disksup.erl8
-rw-r--r--lib/os_mon/test/disksup_SUITE.erl19
3 files changed, 13 insertions, 17 deletions
diff --git a/lib/os_mon/doc/src/disksup.xml b/lib/os_mon/doc/src/disksup.xml
index c8566d0126..0e76178edb 100644
--- a/lib/os_mon/doc/src/disksup.xml
+++ b/lib/os_mon/doc/src/disksup.xml
@@ -81,7 +81,8 @@
necessary on embedded systems with stripped-down versions
of Unix tools like <c>df</c>. The returned disk data and alarms
can be different when using this option.</p>
- <p>The parameter is ignored on Windows.</p>
+ <p>The parameter is ignored on platforms that are known to not be
+ posix compatible (Windows and SunOS).</p>
</item>
</taglist>
<p>See <seealso marker="kernel:config">config(4)</seealso> for
diff --git a/lib/os_mon/src/disksup.erl b/lib/os_mon/src/disksup.erl
index 3fd80f2365..af5bcc6fe8 100644
--- a/lib/os_mon/src/disksup.erl
+++ b/lib/os_mon/src/disksup.erl
@@ -211,14 +211,14 @@ format_status(_Opt, [_PDict, #state{os = OS, threshold = Threshold,
get_os(PosixOnly) ->
case os:type() of
- {unix, _} when PosixOnly ->
- {unix, posix};
{unix, sunos} ->
- case os:version() of
+ case os:version() of
{5,_,_} -> {unix, solaris};
{4,_,_} -> {unix, sunos4};
V -> exit({unknown_os_version, V})
- end;
+ end;
+ {unix, _} when PosixOnly ->
+ {unix, posix};
{unix, irix64} -> {unix, irix};
OS ->
OS
diff --git a/lib/os_mon/test/disksup_SUITE.erl b/lib/os_mon/test/disksup_SUITE.erl
index 2f62564959..f9addd96cf 100644
--- a/lib/os_mon/test/disksup_SUITE.erl
+++ b/lib/os_mon/test/disksup_SUITE.erl
@@ -49,7 +49,8 @@ init_per_testcase(_Case, Config) ->
Dog = ?t:timetrap(?default_timeout),
[{watchdog,Dog} | Config].
-end_per_testcase(unavailable, Config) ->
+end_per_testcase(TC, Config) when TC =:= unavailable;
+ TC =:= posix_only ->
restart(Config),
end_per_testcase(dummy, Config);
end_per_testcase(_Case, Config) ->
@@ -61,11 +62,10 @@ suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
Bugs = [otp_5910],
+ Always = [api, config, alarm, port, posix_only, unavailable] ++ Bugs,
case test_server:os_type() of
- {unix, sunos} ->
- [api, config, alarm, port, unavailable, posix_only] ++ Bugs;
- {unix, _OSname} -> [api, alarm, posix_only] ++ Bugs;
- {win32, _OSname} -> [api, alarm, posix_only] ++ Bugs;
+ {unix, _OSname} -> Always;
+ {win32, _OSname} -> Always;
_OS -> [unavailable]
end.
@@ -336,6 +336,7 @@ 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.
@@ -409,13 +410,7 @@ posix_only(Config) when is_list(Config) ->
ok = supervisor:terminate_child(os_mon_sup, disksup),
{ok, _Child1} = supervisor:restart_child(os_mon_sup, disksup),
- ok = check_get_disk_data(),
-
- %% Reset option and restart disksup
- ok = application:set_env(os_mon, disksup_posix_only, false),
- ok = supervisor:terminate_child(os_mon_sup, disksup),
- {ok, _Child2} = supervisor:restart_child(os_mon_sup, disksup),
- ok.
+ ok = check_get_disk_data().
dump_info() ->
io:format("Status: ~p~n", [sys:get_status(disksup)]).