Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
0120-kernel-gen-udp-test-Tweaking.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0120-kernel-gen-udp-test-Tweaking.patch of Package erlang
From 5862d6fd7e01500ae392371248a4a1a1aa7f686c Mon Sep 17 00:00:00 2001 From: Micael Karlberg <bmk@erlang.org> Date: Thu, 25 Mar 2021 17:22:39 +0100 Subject: [PATCH] [kernel|gen-udp|test] Tweaking Remove a compiler warning (unused variable). Also added some printouts in [init|end]_per_[suite|testcase]. Also use of system monitoring. --- lib/kernel/test/gen_udp_SUITE.erl | 59 +++++++++++++++++++++++++++---- 1 file changed, 53 insertions(+), 6 deletions(-) diff --git a/lib/kernel/test/gen_udp_SUITE.erl b/lib/kernel/test/gen_udp_SUITE.erl index a52f70933e..5e78ab6f58 100644 --- a/lib/kernel/test/gen_udp_SUITE.erl +++ b/lib/kernel/test/gen_udp_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2020. All Rights Reserved. +%% Copyright Ericsson AB 1998-2021. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -100,6 +100,9 @@ init_per_suite(Config0) -> ?P("init_per_suite -> end when " "~n Config: ~p", [Config1]), + %% We need a monitor on this node also + kernel_test_sys_monitor:start(), + Config1 end. @@ -109,10 +112,13 @@ end_per_suite(Config0) -> "~n Config: ~p" "~n Nodes: ~p", [Config0, erlang:nodes()]), + %% Stop the local monitor + kernel_test_sys_monitor:stop(), + Config1 = ?LIB:end_per_suite(Config0), ?P("end_per_suite -> " - "~n Nodes: ~p", [erlang:nodes()]), + "~n Nodes: ~p", [erlang:nodes()]), Config1. @@ -133,15 +139,49 @@ end_per_group(_GroupName, Config) -> Config. -init_per_testcase(read_packets, Config) -> +init_per_testcase(Case, Config0) -> + ?P("init_per_testcase -> entry with" + "~n Config: ~p" + "~n Nodes: ~p" + "~n Links: ~p" + "~n Monitors: ~p", + [Config0, erlang:nodes(), pi(links), pi(monitors)]), + + kernel_test_global_sys_monitor:reset_events(), + + Config1 = init_per_testcase2(Case, Config0), + + ?P("init_per_testcase -> done when" + "~n Nodes: ~p" + "~n Links: ~p" + "~n Monitors: ~p", [erlang:nodes(), pi(links), pi(monitors)]), + Config1. + +init_per_testcase2(read_packets, Config) -> ct:timetrap({minutes, 2}), Config; -init_per_testcase(_Case, Config) -> +init_per_testcase2(_Case, Config) -> Config. -end_per_testcase(_Case, _Config) -> + +end_per_testcase(_Case, Config) -> + ?P("end_per_testcase -> entry with" + "~n Config: ~p" + "~n Nodes: ~p" + "~n Links: ~p" + "~n Monitors: ~p", + [Config, erlang:nodes(), pi(links), pi(monitors)]), + + ?P("system events during test: " + "~n ~p", [kernel_test_global_sys_monitor:events()]), + + ?P("end_per_testcase -> done with" + "~n Nodes: ~p" + "~n Links: ~p" + "~n Monitors: ~p", [erlang:nodes(), pi(links), pi(monitors)]), ok. + %%------------------------------------------------------------- %% Send two packets to a closed port (on some systems this causes the socket %% to be closed). @@ -793,7 +833,7 @@ sendtos_ok({unix,_}, _) -> true; sendtos_ok(_, _) -> false. %% Using the option returns einval, so it is not implemented. -sendttl_ok({unix,darwin}, OSVer) -> false; % not semver_lt(OSVer, {19,6,0}); +sendttl_ok({unix,darwin}, _OSVer) -> false; % not semver_lt(OSVer, {19,6,0}); sendttl_ok({unix,linux}, OSVer) -> not semver_lt(OSVer, {4,0,0}); %% Using the option returns enoprotoopt, so it is not implemented. sendttl_ok({unix,freebsd}, OSVer) -> not semver_lt(OSVer, {12,2,0}); @@ -1277,6 +1317,13 @@ get_localaddr([Localhost|Ls]) -> end. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +pi(Item) -> + {Item, Val} = process_info(self(), Item), + Val. + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% -- 2.26.2
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