Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
0927-cleanup-Replace-test_server-os_type-with-o...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0927-cleanup-Replace-test_server-os_type-with-os-type.patch of Package erlang
From aa06ea1f05641c3dd5c90e5b8baccde38dd29e47 Mon Sep 17 00:00:00 2001 From: Maxim Fedorov <maximfca@gmail.com> Date: Tue, 1 Feb 2022 08:31:29 -0800 Subject: [PATCH] [cleanup] Replace test_server:os_type() with os:type() Codemod, drops undocumented function in favour of a documented one. --- erts/test/erlc_SUITE.erl | 2 +- lib/common_test/src/test_server.erl | 10 ---------- lib/inets/test/httpc_SUITE.erl | 10 +++++----- lib/inets/test/httpd_1_1.erl | 2 +- lib/inets/test/httpd_SUITE.erl | 6 +++--- lib/inets/test/httpd_all.erl | 2 +- lib/inets/test/httpd_basic_SUITE.erl | 2 +- lib/inets/test/httpd_mod.erl | 2 +- lib/kernel/test/global_SUITE.erl | 4 ++-- lib/kernel/test/heart_SUITE.erl | 2 +- lib/kernel/test/ignore_cores.erl | 2 +- lib/odbc/test/mysql.erl | 2 +- lib/odbc/test/postgres.erl | 2 +- lib/os_mon/test/cpu_sup_SUITE.erl | 2 +- lib/os_mon/test/disksup_SUITE.erl | 2 +- lib/os_mon/test/memsup_SUITE.erl | 4 ++-- lib/os_mon/test/os_mon_SUITE.erl | 2 +- lib/os_mon/test/os_sup_SUITE.erl | 4 ++-- lib/snmp/test/snmp_test_lib.erl | 12 +----------- 19 files changed, 27 insertions(+), 47 deletions(-) diff --git a/erts/test/erlc_SUITE.erl b/erts/test/erlc_SUITE.erl index f5a5f8bf5c..c350abf57b 100644 --- a/erts/test/erlc_SUITE.erl +++ b/erts/test/erlc_SUITE.erl @@ -150,7 +150,7 @@ compile_mib(Config) when is_list(Config) -> %% Try -W option and more verbose. ok = file:delete(Output), - case test_server:os_type() of + case os:type() of {unix,_} -> run(Config, Cmd, FileName, "-W +'{verbosity,info}'", ["\\[GOOD-MIB[.]mib\\]\\[INF\\]: No accessfunction for 'sysDescr' => using default", diff --git a/lib/common_test/src/test_server.erl b/lib/common_test/src/test_server.erl index 63955f83aa..367a7dc711 100644 --- a/lib/common_test/src/test_server.erl +++ b/lib/common_test/src/test_server.erl @@ -43,7 +43,6 @@ -export([app_test/1, app_test/2, appup_test/1]). -export([is_native/1]). -export([comment/1, make_priv_dir/0]). --export([os_type/0]). -export([run_on_shielded_node/2]). -export([is_cover/0,is_debug/0,is_commercial/0]). @@ -3028,15 +3027,6 @@ read_comment() -> make_priv_dir() -> tc_supervisor_req(make_priv_dir). -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% os_type() -> OsType -%% -%% Returns the OsType of the target node. OsType is -%% the same as returned from os:type() -os_type() -> - os:type(). - - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% is_cover() -> boolean() %% diff --git a/lib/inets/test/httpc_SUITE.erl b/lib/inets/test/httpc_SUITE.erl index 32b49f0fd6..2f6df150b1 100644 --- a/lib/inets/test/httpc_SUITE.erl +++ b/lib/inets/test/httpc_SUITE.erl @@ -428,7 +428,7 @@ post() -> "only care about the client side of the the post. The server " "script will not actually use the post data."}]. post(Config) when is_list(Config) -> - CGI = case test_server:os_type() of + CGI = case os:type() of {win32, _} -> "/cgi-bin/cgi_echo.exe"; _ -> @@ -453,7 +453,7 @@ delete() -> "only care about the client side of the the delete. The server " "script will not actually use the delete data."}]. delete(Config) when is_list(Config) -> - CGI = case test_server:os_type() of + CGI = case os:type() of {win32, _} -> "/cgi-bin/cgi_echo.exe"; _ -> @@ -477,7 +477,7 @@ patch() -> "only care about the client side of the the patch. The server " "script will not actually use the patch data."}]. patch(Config) when is_list(Config) -> - CGI = case test_server:os_type() of + CGI = case os:type() of {win32, _} -> "/cgi-bin/cgi_echo.exe"; _ -> @@ -499,7 +499,7 @@ post_stream() -> "We only care about the client side of the the post. " "The server script will not actually use the post data."}]. post_stream(Config) when is_list(Config) -> - CGI = case test_server:os_type() of + CGI = case os:type() of {win32, _} -> "/cgi-bin/cgi_echo.exe"; _ -> @@ -2053,7 +2053,7 @@ setup_server_dirs(ServerRoot, DocRoot, DataDir) -> end end, Files), - Cgi = case test_server:os_type() of + Cgi = case os:type() of {win32, _} -> "cgi_echo.exe"; _ -> diff --git a/lib/inets/test/httpd_1_1.erl b/lib/inets/test/httpd_1_1.erl index 298c7150fd..bda45bafa6 100644 --- a/lib/inets/test/httpd_1_1.erl +++ b/lib/inets/test/httpd_1_1.erl @@ -244,7 +244,7 @@ head(Type, Port, Host, Node)-> [{statuscode, 200}]), %% mod_cgi Script = - case test_server:os_type() of + case os:type() of {win32, _} -> "printenv.bat"; _ -> diff --git a/lib/inets/test/httpd_SUITE.erl b/lib/inets/test/httpd_SUITE.erl index b39ae6425a..0eedfae6f3 100644 --- a/lib/inets/test/httpd_SUITE.erl +++ b/lib/inets/test/httpd_SUITE.erl @@ -1042,7 +1042,7 @@ cgi() -> cgi(Config) when is_list(Config) -> {Script, Script2, Script3} = - case test_server:os_type() of + case os:type() of {win32, _} -> {"printenv.bat", "printenv.sh", "cgi_echo.exe"}; _ -> @@ -1117,7 +1117,7 @@ cgi_chunked_encoding_test() -> cgi_chunked_encoding_test(Config) when is_list(Config) -> Host = proplists:get_value(host, Config), Script = - case test_server:os_type() of + case os:type() of {win32, _} -> "/cgi-bin/printenv.bat"; _ -> @@ -1947,7 +1947,7 @@ setup_server_dirs(ServerRoot, DocRoot, DataDir) -> inets_test_lib:copy_dirs(PicsSrc, PicsDir), inets_test_lib:copy_dirs(ConfigSrc, ConfigDir), - Cgi = case test_server:os_type() of + Cgi = case os:type() of {win32, _} -> "cgi_echo.exe"; _ -> diff --git a/lib/inets/test/httpd_all.erl b/lib/inets/test/httpd_all.erl index 9be02e3fd8..b4845e4cf0 100644 --- a/lib/inets/test/httpd_all.erl +++ b/lib/inets/test/httpd_all.erl @@ -128,7 +128,7 @@ esi(Version, Type, Port, Host, Node) -> cgi(Version, Type, Port, Host, Node) -> {Script, Script2, Script3} = - case test_server:os_type() of + case os:type() of {win32, _} -> {"printenv.bat", "printenv.sh", "cgi_echo.exe"}; _ -> diff --git a/lib/inets/test/httpd_basic_SUITE.erl b/lib/inets/test/httpd_basic_SUITE.erl index c6b35eb756..f43a5c9d31 100644 --- a/lib/inets/test/httpd_basic_SUITE.erl +++ b/lib/inets/test/httpd_basic_SUITE.erl @@ -85,7 +85,7 @@ DUMMY DummyFile = filename:join([PrivDir,"dummy.html"]), CgiDir = filename:join(PrivDir, "cgi-bin"), ok = file:make_dir(CgiDir), - {CgiPrintEnv, CgiSleep} = case test_server:os_type() of + {CgiPrintEnv, CgiSleep} = case os:type() of {win32, _} -> {"printenv.bat", "cgi_sleep.exe"}; _ -> diff --git a/lib/inets/test/httpd_mod.erl b/lib/inets/test/httpd_mod.erl index 3daeb4f889..2e656d1680 100644 --- a/lib/inets/test/httpd_mod.erl +++ b/lib/inets/test/httpd_mod.erl @@ -611,7 +611,7 @@ htaccess(Type, Port, Host, Node) -> %%-------------------------------------------------------------------- cgi(Type, Port, Host, Node) -> {Script, Script2, Script3} = - case test_server:os_type() of + case os:type() of {win32, _} -> {"printenv.bat", "printenv.sh", "cgi_echo.exe"}; _ -> diff --git a/lib/kernel/test/global_SUITE.erl b/lib/kernel/test/global_SUITE.erl index 8eaeb525e9..60e27c9da7 100644 --- a/lib/kernel/test/global_SUITE.erl +++ b/lib/kernel/test/global_SUITE.erl @@ -2902,7 +2902,7 @@ many_nodes(Config) when is_list(Config) -> OrigNames = global:registered_names(), {Rels, N_cps} = - case test_server:os_type() of + case os:type() of {unix, Osname} when Osname =:= linux; Osname =:= openbsd; Osname =:= darwin -> @@ -3051,7 +3051,7 @@ sync_0(Config) when is_list(Config) -> init_condition(Config), N_cps = - case test_server:os_type() of + case os:type() of {unix, Osname} when Osname =:= linux; Osname =:= openbsd; Osname =:= darwin -> diff --git a/lib/kernel/test/heart_SUITE.erl b/lib/kernel/test/heart_SUITE.erl index 1488517d30..1595e76e6d 100644 --- a/lib/kernel/test/heart_SUITE.erl +++ b/lib/kernel/test/heart_SUITE.erl @@ -102,7 +102,7 @@ end_per_suite(Config) when is_list(Config) -> start_check(Type, Name) -> start_check(Type, Name, []). start_check(Type, Name, Envs) -> - Args = case test_server:os_type() of + Args = case os:type() of {win32,_} -> "+t50000 -heart " ++ env_encode([{"HEART_COMMAND", no_reboot}|Envs]); _ -> diff --git a/lib/kernel/test/ignore_cores.erl b/lib/kernel/test/ignore_cores.erl index fde65bf5c4..25dce346b9 100644 --- a/lib/kernel/test/ignore_cores.erl +++ b/lib/kernel/test/ignore_cores.erl @@ -94,7 +94,7 @@ setup(Suite, Testcase, Config, SetCwd) when is_atom(Suite), end, ok = file:write_file(filename:join([IgnDir, "ignore_core_files"]), <<>>), %% cores are dumped in /cores on MacOS X - CoresDir = case {test_server:os_type(), filelib:is_dir("/cores")} of + CoresDir = case {os:type(), filelib:is_dir("/cores")} of {{unix,darwin}, true} -> filelib:fold_files("/cores", "^core.*$", diff --git a/lib/odbc/test/mysql.erl b/lib/odbc/test/mysql.erl index 69b136e743..144d381596 100644 --- a/lib/odbc/test/mysql.erl +++ b/lib/odbc/test/mysql.erl @@ -27,7 +27,7 @@ %------------------------------------------------------------------------- connection_string() -> - case test_server:os_type() of + case os:type() of {unix, linux} -> "DSN=MySQL;Database=odbctest;Uid=odbctest;Pwd=gurka;CHARSET=utf8;SSTMT=SET NAMES 'utf8';"; {unix, sunos} -> diff --git a/lib/odbc/test/postgres.erl b/lib/odbc/test/postgres.erl index 7c45e48899..c4ea7f2751 100644 --- a/lib/odbc/test/postgres.erl +++ b/lib/odbc/test/postgres.erl @@ -27,7 +27,7 @@ %------------------------------------------------------------------------- connection_string() -> - case test_server:os_type() of + case os:type() of {unix, sunos} -> "DSN=Postgres;UID=odbctest"; {unix, linux} -> diff --git a/lib/os_mon/test/cpu_sup_SUITE.erl b/lib/os_mon/test/cpu_sup_SUITE.erl index 03aa6cd355..fd808d049e 100644 --- a/lib/os_mon/test/cpu_sup_SUITE.erl +++ b/lib/os_mon/test/cpu_sup_SUITE.erl @@ -56,7 +56,7 @@ suite() -> {timetrap,{minutes,1}}]. all() -> - case test_server:os_type() of + case os:type() of {unix, sunos} -> [load_api, util_api, util_values, port, unavailable]; {unix, linux} -> diff --git a/lib/os_mon/test/disksup_SUITE.erl b/lib/os_mon/test/disksup_SUITE.erl index 34726581cf..537e9b8d53 100644 --- a/lib/os_mon/test/disksup_SUITE.erl +++ b/lib/os_mon/test/disksup_SUITE.erl @@ -61,7 +61,7 @@ all() -> Bugs = [otp_5910], Always = [api, config, alarm, port, posix_only, unavailable, parse_df_output_posix, parse_df_output_susv3] ++ Bugs, - case test_server:os_type() of + case os:type() of {unix, _OSname} -> Always; {win32, _OSname} -> Always; _OS -> [unavailable] diff --git a/lib/os_mon/test/memsup_SUITE.erl b/lib/os_mon/test/memsup_SUITE.erl index 0232e55885..5acad6aad2 100644 --- a/lib/os_mon/test/memsup_SUITE.erl +++ b/lib/os_mon/test/memsup_SUITE.erl @@ -63,7 +63,7 @@ suite() -> {timetrap,{minutes,1}}]. all() -> - All = case test_server:os_type() of + All = case os:type() of {unix, sunos} -> [api, alarm1, alarm2, process, config, timeout, unavailable, port]; @@ -551,7 +551,7 @@ timeout(Config) when is_list(Config) -> %% Linux should be handled the same way as solaris. - % TimeoutMsg = case ?t:os_type() of + % TimeoutMsg = case os:type() of % {unix, sunos} -> ext_collection_timeout; % {unix, linux} -> reg_collection_timeout % end, diff --git a/lib/os_mon/test/os_mon_SUITE.erl b/lib/os_mon/test/os_mon_SUITE.erl index c373b5d851..be7d44f8cb 100644 --- a/lib/os_mon/test/os_mon_SUITE.erl +++ b/lib/os_mon/test/os_mon_SUITE.erl @@ -31,7 +31,7 @@ suite() -> {timetrap,{minutes,1}}]. all() -> - case test_server:os_type() of + case os:type() of {unix, sunos} -> [app_file, appup_file, config]; _OS -> [app_file, appup_file] end. diff --git a/lib/os_mon/test/os_sup_SUITE.erl b/lib/os_mon/test/os_sup_SUITE.erl index febd3b5f12..55c9386454 100644 --- a/lib/os_mon/test/os_sup_SUITE.erl +++ b/lib/os_mon/test/os_sup_SUITE.erl @@ -56,7 +56,7 @@ suite() -> {timetrap,{minutes,1}}]. all() -> - case test_server:os_type() of + case os:type() of {unix, sunos} -> [message, config, port]; {win32, _OSname} -> [message]; OS -> @@ -76,7 +76,7 @@ message(Config) when is_list(Config) -> %% Check with message_receptor that it has been received ct:sleep({seconds,1}), Msg = - case ?t:os_type() of + case os:type() of {unix, sunos} -> {?TAG, Data}; {win32, _} -> diff --git a/lib/snmp/test/snmp_test_lib.erl b/lib/snmp/test/snmp_test_lib.erl index 52355b9a19..f0999d948f 100644 --- a/lib/snmp/test/snmp_test_lib.erl +++ b/lib/snmp/test/snmp_test_lib.erl @@ -26,7 +26,7 @@ -export([tc_try/2, tc_try/3, tc_try/4, tc_try/5]). -export([proxy_call/3]). --export([hostname/0, hostname/1, localhost/0, localhost/1, os_type/0, sz/1, +-export([hostname/0, hostname/1, localhost/0, localhost/1, sz/1, display_suite_info/1]). -export([non_pc_tc_maybe_skip/4, os_based_skip/1, @@ -412,16 +412,6 @@ sz(B) when is_binary(B) -> sz(O) -> {unknown_size,O}. - -os_type() -> - case (catch test_server:os_type()) of - {'EXIT', _} -> - %% Pre-R10 test server does not have this function - os:type(); - OsType -> - OsType - end. - display_suite_info(SUITE) when is_atom(SUITE) -> (catch do_display_suite_info(SUITE)). -- 2.34.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor