Gentoo Archives: gentoo-commits

From: Kent Fredric <kentnl@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-perl/Plack/, dev-perl/Plack/files/
Date: Tue, 02 Aug 2016 14:05:19
Message-Id: 1470146692.8146f7e4bb0353f76767e8a8bab0a403e3e3233c.kentnl@gentoo
1 commit: 8146f7e4bb0353f76767e8a8bab0a403e3e3233c
2 Author: Kent Fredric <kentnl <AT> gentoo <DOT> org>
3 AuthorDate: Tue Aug 2 14:04:40 2016 +0000
4 Commit: Kent Fredric <kentnl <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 2 14:04:52 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8146f7e4
7
8 dev-perl/Plack: Fence out network IO re bug #527362
9
10 Under EAPI6, NO_NETWORK_TESTING is exported by default
11 and these tests will be skipped regardless.
12
13 They can be turned back on, but you'll have to read the eclass source.
14
15 Thanks to Diego Elio Pettenò for reporting.
16
17 Bug: https://bugs.gentoo.org/527362
18
19 Package-Manager: portage-2.3.0
20 RepoMan-Options: --include-arches="alpha amd64 amd64-fbsd arm arm64 hppa ia64 m68k mips nios2 ppc ppc64 riscv s390 sh sparc sparc-fbsd x86 x86-fbsd"
21
22 dev-perl/Plack/Plack-1.3.900.ebuild | 1 +
23 .../files/Plack-1.3.900-network-testing.patch | 196 +++++++++++++++++++++
24 2 files changed, 197 insertions(+)
25
26 diff --git a/dev-perl/Plack/Plack-1.3.900.ebuild b/dev-perl/Plack/Plack-1.3.900.ebuild
27 index 1acafb0..6ab5f7a 100644
28 --- a/dev-perl/Plack/Plack-1.3.900.ebuild
29 +++ b/dev-perl/Plack/Plack-1.3.900.ebuild
30 @@ -15,6 +15,7 @@ KEYWORDS="~amd64 ~x86"
31 IUSE="test minimal examples"
32 PATCHES=(
33 "${FILESDIR}/${P}-issue-545.patch"
34 + "${FILESDIR}/${P}-network-testing.patch"
35 )
36 RDEPEND="
37 !minimal? (
38
39 diff --git a/dev-perl/Plack/files/Plack-1.3.900-network-testing.patch b/dev-perl/Plack/files/Plack-1.3.900-network-testing.patch
40 new file mode 100644
41 index 0000000..6d703a9
42 --- /dev/null
43 +++ b/dev-perl/Plack/files/Plack-1.3.900-network-testing.patch
44 @@ -0,0 +1,196 @@
45 +From 5f5a0a34556d0ae739f79d7c148d24fcf3ff8557 Mon Sep 17 00:00:00 2001
46 +From: Kent Fredric <kentfredric@×××××.com>
47 +Date: Wed, 3 Aug 2016 01:26:17 +1200
48 +Subject: [PATCH] Fence of Network IO with NO_NETWORK_TESTING
49 +
50 +This is a workaround for #477 but doesn't actually fix the underlying
51 +issue, merely recognises that some vendors are smart enough to
52 +anticipate Network IO will fail and integrate this ENV var to quickly
53 +avoid it.
54 +
55 +This precedent was established by Test::RequiresInternet as a result of
56 +a CPANworkers discussion, and Gentoo is known to export this variable
57 +within its tooling by default as a result.
58 +
59 +This doesn't actually test that binding a socket/IP will work, but this
60 +fence should be tested anyway, because security measures could result in
61 +attempted socket/IP binds getting SIGKILLed ( Sandbox )
62 +
63 +This commit hence addresses/fences only the problem cases listed in bug
64 +in depth.
65 +
66 +However, this commit targets to simply solve the known parts of the
67 +problem in the simplest way possible without any extra dependencies.
68 +
69 +The application of a BEGIN { } block and `print` was a design decision
70 +instead of using `Test::More` and `skip`, because the overhead of
71 +loading Test::More is quite high when you have lots of .t files, and
72 +Test2 further increases the load time.
73 +
74 +This load time is generally acceptable if you're actually running a
75 +dozen tests, but spinning up a full suite of Test::More to only then
76 +immediately exit with a skip is a lot of CPU load for relatively little
77 +benefit.
78 +---
79 + t/Plack-Handler/standalone.t | 6 ++++++
80 + t/Plack-Loader/shotgun.t | 6 ++++++
81 + t/Plack-Middleware/component-leak.t | 7 +++++++
82 + t/Plack-Middleware/error_document_streaming_app.t | 7 +++++++
83 + t/Plack-Middleware/stacktrace/sigdie.t | 7 +++++++
84 + t/Plack-Middleware/stacktrace/utf8.t | 7 +++++++
85 + t/Plack-Middleware/urlmap_ports.t | 6 ++++++
86 + t/Plack-Test/2args.t | 7 +++++++
87 + t/Plack-Test/hello_server.t | 7 +++++++
88 + t/Plack-Util/response_cb.t | 7 +++++++
89 + 10 files changed, 67 insertions(+)
90 +
91 +diff --git a/t/Plack-Handler/standalone.t b/t/Plack-Handler/standalone.t
92 +index f5fcf26..b42de16 100644
93 +--- a/t/Plack-Handler/standalone.t
94 ++++ b/t/Plack-Handler/standalone.t
95 +@@ -1,3 +1,9 @@
96 ++BEGIN {
97 ++ if ( $ENV{NO_NETWORK_TESTING} ) {
98 ++ print '1..0 # SKIP Network connections required for this test';
99 ++ exit;
100 ++ }
101 ++}
102 + use strict;
103 + use warnings;
104 + use Test::More;
105 +diff --git a/t/Plack-Loader/shotgun.t b/t/Plack-Loader/shotgun.t
106 +index cb7b95a..d9fe148 100644
107 +--- a/t/Plack-Loader/shotgun.t
108 ++++ b/t/Plack-Loader/shotgun.t
109 +@@ -1,3 +1,9 @@
110 ++BEGIN {
111 ++ if ( $ENV{NO_NETWORK_TESTING} ) {
112 ++ print '1..0 # SKIP Network connections required for this test';
113 ++ exit;
114 ++ }
115 ++}
116 + use strict;
117 + use warnings;
118 + use Test::More;
119 +diff --git a/t/Plack-Middleware/component-leak.t b/t/Plack-Middleware/component-leak.t
120 +index 7cdab99..2acedd0 100644
121 +--- a/t/Plack-Middleware/component-leak.t
122 ++++ b/t/Plack-Middleware/component-leak.t
123 +@@ -1,3 +1,10 @@
124 ++BEGIN {
125 ++ if ( $ENV{NO_NETWORK_TESTING} ) {
126 ++ print '1..0 # SKIP Network connections required for this test';
127 ++ exit;
128 ++ }
129 ++}
130 ++
131 + package MyComponent;
132 + use strict;
133 + use warnings;
134 +diff --git a/t/Plack-Middleware/error_document_streaming_app.t b/t/Plack-Middleware/error_document_streaming_app.t
135 +index b177c53..c893e7b 100644
136 +--- a/t/Plack-Middleware/error_document_streaming_app.t
137 ++++ b/t/Plack-Middleware/error_document_streaming_app.t
138 +@@ -1,3 +1,10 @@
139 ++BEGIN {
140 ++ if ( $ENV{NO_NETWORK_TESTING} ) {
141 ++ print '1..0 # SKIP Network connections required for this test';
142 ++ exit;
143 ++ }
144 ++}
145 ++
146 + use strict;
147 + use warnings;
148 + use FindBin;
149 +diff --git a/t/Plack-Middleware/stacktrace/sigdie.t b/t/Plack-Middleware/stacktrace/sigdie.t
150 +index dc82b2c..28747cf 100644
151 +--- a/t/Plack-Middleware/stacktrace/sigdie.t
152 ++++ b/t/Plack-Middleware/stacktrace/sigdie.t
153 +@@ -1,3 +1,10 @@
154 ++BEGIN {
155 ++ if ( $ENV{NO_NETWORK_TESTING} ) {
156 ++ print '1..0 # SKIP Network connections required for this test';
157 ++ exit;
158 ++ }
159 ++}
160 ++
161 + use strict;
162 + use warnings;
163 + use Test::More;
164 +diff --git a/t/Plack-Middleware/stacktrace/utf8.t b/t/Plack-Middleware/stacktrace/utf8.t
165 +index 6d2f51f..77849dc 100644
166 +--- a/t/Plack-Middleware/stacktrace/utf8.t
167 ++++ b/t/Plack-Middleware/stacktrace/utf8.t
168 +@@ -1,3 +1,10 @@
169 ++BEGIN {
170 ++ if ( $ENV{NO_NETWORK_TESTING} ) {
171 ++ print '1..0 # SKIP Network connections required for this test';
172 ++ exit;
173 ++ }
174 ++}
175 ++
176 + use strict;
177 + use warnings;
178 + use Test::More;
179 +diff --git a/t/Plack-Middleware/urlmap_ports.t b/t/Plack-Middleware/urlmap_ports.t
180 +index 9a0a9c0..4ff4ba5 100644
181 +--- a/t/Plack-Middleware/urlmap_ports.t
182 ++++ b/t/Plack-Middleware/urlmap_ports.t
183 +@@ -1,3 +1,9 @@
184 ++BEGIN {
185 ++ if ( $ENV{NO_NETWORK_TESTING} ) {
186 ++ print '1..0 # SKIP Network connections required for this test';
187 ++ exit;
188 ++ }
189 ++}
190 + use strict;
191 + use Test::More;
192 + use Plack::App::URLMap;
193 +diff --git a/t/Plack-Test/2args.t b/t/Plack-Test/2args.t
194 +index 2942f93..a68481d 100644
195 +--- a/t/Plack-Test/2args.t
196 ++++ b/t/Plack-Test/2args.t
197 +@@ -1,3 +1,10 @@
198 ++BEGIN {
199 ++ if ( $ENV{NO_NETWORK_TESTING} ) {
200 ++ print '1..0 # SKIP Network connections required for this test';
201 ++ exit;
202 ++ }
203 ++}
204 ++
205 + use Plack::Test;
206 + use Test::More;
207 + use HTTP::Request::Common;
208 +diff --git a/t/Plack-Test/hello_server.t b/t/Plack-Test/hello_server.t
209 +index 47ffb75..dc9f4bd 100644
210 +--- a/t/Plack-Test/hello_server.t
211 ++++ b/t/Plack-Test/hello_server.t
212 +@@ -1,3 +1,10 @@
213 ++BEGIN {
214 ++ if ( $ENV{NO_NETWORK_TESTING} ) {
215 ++ print '1..0 # SKIP Network connections required for this test';
216 ++ exit;
217 ++ }
218 ++}
219 ++
220 + use Test::More;
221 + use Plack::Test;
222 +
223 +diff --git a/t/Plack-Util/response_cb.t b/t/Plack-Util/response_cb.t
224 +index 813dc87..5cb31ba 100644
225 +--- a/t/Plack-Util/response_cb.t
226 ++++ b/t/Plack-Util/response_cb.t
227 +@@ -1,3 +1,10 @@
228 ++BEGIN {
229 ++ if ( $ENV{NO_NETWORK_TESTING} ) {
230 ++ print '1..0 # SKIP Network connections required for this test';
231 ++ exit;
232 ++ }
233 ++}
234 ++
235 + use strict;
236 + use warnings;
237 + use Plack::Util;
238 +--
239 +2.9.2
240 +