Merge ~paelzer/ubuntu/+source/libiscsi:fix-FTBFS-1894129-GROOVY into ubuntu/+source/libiscsi:ubuntu/groovy-devel
- Git
- lp:~paelzer/ubuntu/+source/libiscsi
- fix-FTBFS-1894129-GROOVY
- Merge into ubuntu/groovy-devel
Proposed by
Christian Ehrhardt
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Christian Ehrhardt | ||||
Approved revision: | d2755eb1d7db1a44da9a35b5c71c87bf06c2eaac | ||||
Merged at revision: | d2755eb1d7db1a44da9a35b5c71c87bf06c2eaac | ||||
Proposed branch: | ~paelzer/ubuntu/+source/libiscsi:fix-FTBFS-1894129-GROOVY | ||||
Merge into: | ubuntu/+source/libiscsi:ubuntu/groovy-devel | ||||
Diff against target: |
989 lines (+889/-1) 15 files modified
debian/changelog (+6/-0) debian/control (+2/-1) debian/patches/lp-1894129-test-tool-BlockEraseReserved-override-driver-queue_p.patch (+74/-0) debian/patches/lp-1894129-test-tool-BlockEraseReserved-skip-unless-iSCSI.patch (+39/-0) debian/patches/lp-1894129-test-tool-Compare-Write-override-driver-queue_pdu-ca.patch (+71/-0) debian/patches/lp-1894129-test-tool-Compare-Write-skip-InvalidDataOutSize-unle.patch (+39/-0) debian/patches/lp-1894129-test-tool-CryptoEraseReserved-override-driver-queue_.patch (+74/-0) debian/patches/lp-1894129-test-tool-CryptoEraseReserved-skip-unless-iSCSI.patch (+39/-0) debian/patches/lp-1894129-test-tool-OverwriteReserved-override-driver-queue_pd.patch (+68/-0) debian/patches/lp-1894129-test-tool-Use-extern-int-in-headers.patch (+58/-0) debian/patches/lp-1894129-test-tool-iSCSICmdSnTooHigh-override-driver-queue_pd.patch (+68/-0) debian/patches/lp-1894129-test-tool-iSCSICmdSnTooLow-override-driver-queue_pdu.patch (+69/-0) debian/patches/lp-1894129-test-tool-iSCSIDataSnInvalid-override-driver-queue_p.patch (+166/-0) debian/patches/lp-1894129-test-tool-remove-unused-iscsi_queue_pdu-symbol-overl.patch (+104/-0) debian/patches/series (+12/-0) |
||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Lucas Kanashiro (community) | Approve | ||
Canonical Server | Pending | ||
Canonical Server packageset reviewers | Pending | ||
Review via email: mp+390397@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Christian Ehrhardt (paelzer) wrote : | # |
Revision history for this message
Christian Ehrhardt (paelzer) wrote : | # |
Also submitted to https:/
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote : | # |
LGTM, +1.
review:
Approve
Revision history for this message
Christian Ehrhardt (paelzer) wrote : | # |
Thanks!
* [new tag] upload/
Uploading to ubuntu (via ftp to upload.ubuntu.com):
Uploading libiscsi_
Uploading libiscsi_
Uploading libiscsi_
Uploading libiscsi_
Successfully uploaded packages.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/debian/changelog b/debian/changelog |
2 | index 096d70b..bf25cdc 100644 |
3 | --- a/debian/changelog |
4 | +++ b/debian/changelog |
5 | @@ -1,3 +1,9 @@ |
6 | +libiscsi (1.19.0-2ubuntu1) groovy; urgency=medium |
7 | + |
8 | + * d/p/lp-1894129-*: fix FTBFS (LP: #1894129) |
9 | + |
10 | + -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Tue, 08 Sep 2020 14:31:03 +0200 |
11 | + |
12 | libiscsi (1.19.0-2) unstable; urgency=medium |
13 | |
14 | * attribute_packed.patch (Closes: #966864) |
15 | diff --git a/debian/control b/debian/control |
16 | index 9310439..50f39ed 100644 |
17 | --- a/debian/control |
18 | +++ b/debian/control |
19 | @@ -1,7 +1,8 @@ |
20 | Source: libiscsi |
21 | Section: net |
22 | Priority: optional |
23 | -Maintainer: Michael Tokarev <mjt@tls.msk.ru> |
24 | +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> |
25 | +XSBC-Original-Maintainer: Michael Tokarev <mjt@tls.msk.ru> |
26 | Build-Depends: debhelper-compat (= 12), libcunit1-dev, librdmacm-dev |
27 | Rules-Requires-Root: no |
28 | Standards-Version: 4.5.0 |
29 | diff --git a/debian/patches/lp-1894129-test-tool-BlockEraseReserved-override-driver-queue_p.patch b/debian/patches/lp-1894129-test-tool-BlockEraseReserved-override-driver-queue_p.patch |
30 | new file mode 100644 |
31 | index 0000000..68def73 |
32 | --- /dev/null |
33 | +++ b/debian/patches/lp-1894129-test-tool-BlockEraseReserved-override-driver-queue_p.patch |
34 | @@ -0,0 +1,74 @@ |
35 | +From b705f9e5240583fb862f16d603e5cf2120e5d54c Mon Sep 17 00:00:00 2001 |
36 | +From: David Disseldorp <ddiss@suse.de> |
37 | +Date: Mon, 16 Sep 2019 14:46:28 +0200 |
38 | +Subject: [PATCH] test-tool/BlockEraseReserved: override driver queue_pdu() |
39 | + callback |
40 | + |
41 | +In preparation for removing the test-tool iscsi_queue_pdu() dlsym |
42 | +overload hack, convert this test to use the regular transport driver |
43 | +callback for this purpose. |
44 | + |
45 | +Signed-off-by: David Disseldorp <ddiss@suse.de> |
46 | + |
47 | +Origin: upstream, https://github.com/sahlberg/libiscsi/commit/b705f9e5 |
48 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1894129 |
49 | +Last-Update: 2020-09-08 |
50 | + |
51 | +--- |
52 | + test-tool/test_sanitize_block_erase_reserved.c | 17 +++++++++++------ |
53 | + 1 file changed, 11 insertions(+), 6 deletions(-) |
54 | + |
55 | +diff --git a/test-tool/test_sanitize_block_erase_reserved.c b/test-tool/test_sanitize_block_erase_reserved.c |
56 | +index fcb862e..4a0d2cb 100644 |
57 | +--- a/test-tool/test_sanitize_block_erase_reserved.c |
58 | ++++ b/test-tool/test_sanitize_block_erase_reserved.c |
59 | +@@ -25,8 +25,9 @@ |
60 | + #include "iscsi-test-cu.h" |
61 | + |
62 | + static int change_num; |
63 | ++static struct iscsi_transport iscsi_drv_orig; |
64 | + |
65 | +-static int my_iscsi_queue_pdu(struct iscsi_context *iscsi _U_, struct iscsi_pdu *pdu) |
66 | ++static int my_iscsi_queue_pdu(struct iscsi_context *iscsi, struct iscsi_pdu *pdu) |
67 | + { |
68 | + switch (change_num) { |
69 | + case 1: |
70 | +@@ -43,12 +44,12 @@ static int my_iscsi_queue_pdu(struct iscsi_context *iscsi _U_, struct iscsi_pdu |
71 | + break; |
72 | + } |
73 | + |
74 | +- change_num = 0; |
75 | +- return 0; |
76 | ++ change_num = 0; |
77 | ++ return iscsi_drv_orig.queue_pdu(iscsi, pdu); |
78 | + } |
79 | + |
80 | + void test_sanitize_block_erase_reserved(void) |
81 | +-{ |
82 | ++{ |
83 | + int i; |
84 | + |
85 | + logging(LOG_VERBOSE, LOG_BLANK_LINE); |
86 | +@@ -64,8 +65,9 @@ void test_sanitize_block_erase_reserved(void) |
87 | + return; |
88 | + } |
89 | + |
90 | +- local_iscsi_queue_pdu = my_iscsi_queue_pdu; |
91 | +- |
92 | ++ /* override transport queue_pdu callback for PDU manipulation */ |
93 | ++ iscsi_drv_orig = *sd->iscsi_ctx->drv; |
94 | ++ sd->iscsi_ctx->drv->queue_pdu = my_iscsi_queue_pdu; |
95 | + |
96 | + logging(LOG_VERBOSE, "Send SANITIZE command with the reserved " |
97 | + "bit in byte 1 set to 1"); |
98 | +@@ -81,4 +83,7 @@ void test_sanitize_block_erase_reserved(void) |
99 | + SANITIZE(sd, 0, 0, SCSI_SANITIZE_BLOCK_ERASE, 0, NULL, |
100 | + EXPECT_INVALID_FIELD_IN_CDB); |
101 | + } |
102 | ++ |
103 | ++ /* restore transport callbacks */ |
104 | ++ *(sd->iscsi_ctx->drv) = iscsi_drv_orig; |
105 | + } |
106 | +-- |
107 | +2.28.0 |
108 | + |
109 | diff --git a/debian/patches/lp-1894129-test-tool-BlockEraseReserved-skip-unless-iSCSI.patch b/debian/patches/lp-1894129-test-tool-BlockEraseReserved-skip-unless-iSCSI.patch |
110 | new file mode 100644 |
111 | index 0000000..43ae51b |
112 | --- /dev/null |
113 | +++ b/debian/patches/lp-1894129-test-tool-BlockEraseReserved-skip-unless-iSCSI.patch |
114 | @@ -0,0 +1,39 @@ |
115 | +From fdc45fadfa06f2543a12abe8eefe7f87d5dab0c2 Mon Sep 17 00:00:00 2001 |
116 | +From: David Disseldorp <ddiss@suse.de> |
117 | +Date: Mon, 16 Sep 2019 15:40:00 +0200 |
118 | +Subject: [PATCH] test-tool/BlockEraseReserved: skip unless iSCSI |
119 | + |
120 | +This test performs PDU manipulation so should only be run against iSCSI |
121 | +devices. |
122 | + |
123 | +Signed-off-by: David Disseldorp <ddiss@suse.de> |
124 | + |
125 | +Origin: upstream, https://github.com/sahlberg/libiscsi/commit/fdc45fad |
126 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1894129 |
127 | +Last-Update: 2020-09-08 |
128 | + |
129 | +--- |
130 | + test-tool/test_sanitize_block_erase_reserved.c | 7 +++++++ |
131 | + 1 file changed, 7 insertions(+) |
132 | + |
133 | +diff --git a/test-tool/test_sanitize_block_erase_reserved.c b/test-tool/test_sanitize_block_erase_reserved.c |
134 | +index 55c85d9..fcb862e 100644 |
135 | +--- a/test-tool/test_sanitize_block_erase_reserved.c |
136 | ++++ b/test-tool/test_sanitize_block_erase_reserved.c |
137 | +@@ -56,6 +56,13 @@ void test_sanitize_block_erase_reserved(void) |
138 | + |
139 | + CHECK_FOR_SANITIZE; |
140 | + CHECK_FOR_DATALOSS; |
141 | ++ if (sd->iscsi_ctx == NULL) { |
142 | ++ const char *err = "[SKIPPED] This test is " |
143 | ++ "only supported for iSCSI backends"; |
144 | ++ logging(LOG_NORMAL, "%s", err); |
145 | ++ CU_PASS(err); |
146 | ++ return; |
147 | ++ } |
148 | + |
149 | + local_iscsi_queue_pdu = my_iscsi_queue_pdu; |
150 | + |
151 | +-- |
152 | +2.28.0 |
153 | + |
154 | diff --git a/debian/patches/lp-1894129-test-tool-Compare-Write-override-driver-queue_pdu-ca.patch b/debian/patches/lp-1894129-test-tool-Compare-Write-override-driver-queue_pdu-ca.patch |
155 | new file mode 100644 |
156 | index 0000000..d0433a2 |
157 | --- /dev/null |
158 | +++ b/debian/patches/lp-1894129-test-tool-Compare-Write-override-driver-queue_pdu-ca.patch |
159 | @@ -0,0 +1,71 @@ |
160 | +From 310e9ace02bafb78d69bfe20e5c9befe7ed24a10 Mon Sep 17 00:00:00 2001 |
161 | +From: David Disseldorp <ddiss@suse.de> |
162 | +Date: Mon, 16 Sep 2019 14:46:28 +0200 |
163 | +Subject: [PATCH] test-tool/Compare&Write: override driver queue_pdu() callback |
164 | + |
165 | +In preparation for removing the test-tool iscsi_queue_pdu() dlsym |
166 | +overload hack, convert the Compare&Write InvalidDataOutSize test to use |
167 | +the regular transport driver callback for this purpose. |
168 | + |
169 | +Signed-off-by: David Disseldorp <ddiss@suse.de> |
170 | + |
171 | +Origin: upstream, https://github.com/sahlberg/libiscsi/commit/310e9ace |
172 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1894129 |
173 | +Last-Update: 2020-09-08 |
174 | + |
175 | +--- |
176 | + .../test_compareandwrite_invalid_dataout_size.c | 16 +++++++++++----- |
177 | + 1 file changed, 11 insertions(+), 5 deletions(-) |
178 | + |
179 | +diff --git a/test-tool/test_compareandwrite_invalid_dataout_size.c b/test-tool/test_compareandwrite_invalid_dataout_size.c |
180 | +index eb6a6dd..9fcd739 100644 |
181 | +--- a/test-tool/test_compareandwrite_invalid_dataout_size.c |
182 | ++++ b/test-tool/test_compareandwrite_invalid_dataout_size.c |
183 | +@@ -27,11 +27,12 @@ |
184 | + |
185 | + |
186 | + static int new_tl; |
187 | ++static struct iscsi_transport iscsi_drv_orig; |
188 | + |
189 | +-static int my_iscsi_queue_pdu(struct iscsi_context *iscsi _U_, struct iscsi_pdu *pdu _U_) |
190 | ++static int my_iscsi_queue_pdu(struct iscsi_context *iscsi, struct iscsi_pdu *pdu) |
191 | + { |
192 | + if (pdu->outdata.data[0] != ISCSI_PDU_SCSI_REQUEST) { |
193 | +- return 0; |
194 | ++ goto out; |
195 | + } |
196 | + switch (new_tl) { |
197 | + case 1: |
198 | +@@ -43,7 +44,8 @@ static int my_iscsi_queue_pdu(struct iscsi_context *iscsi _U_, struct iscsi_pdu |
199 | + pdu->outdata.data[32 + 13] = 3; |
200 | + break; |
201 | + } |
202 | +- return 0; |
203 | ++out: |
204 | ++ return iscsi_drv_orig.queue_pdu(iscsi, pdu); |
205 | + } |
206 | + |
207 | + void |
208 | +@@ -61,8 +63,10 @@ test_compareandwrite_invalid_dataout_size(void) |
209 | + return; |
210 | + } |
211 | + |
212 | +- local_iscsi_queue_pdu = my_iscsi_queue_pdu; |
213 | +- |
214 | ++ /* override transport queue_pdu callback for PDU manipulation */ |
215 | ++ iscsi_drv_orig = *sd->iscsi_ctx->drv; |
216 | ++ sd->iscsi_ctx->drv->queue_pdu = my_iscsi_queue_pdu; |
217 | ++ |
218 | + logging(LOG_VERBOSE, LOG_BLANK_LINE); |
219 | + logging(LOG_VERBOSE, "Test that COMPAREANDWRITE fails for invalid " |
220 | + "(too small/too large) DataOut sizes."); |
221 | +@@ -89,4 +93,6 @@ test_compareandwrite_invalid_dataout_size(void) |
222 | + block_size, 0, 0, 0, 0, |
223 | + EXPECT_STATUS_GENERIC_BAD); |
224 | + |
225 | ++ /* restore transport callbacks */ |
226 | ++ *(sd->iscsi_ctx->drv) = iscsi_drv_orig; |
227 | + } |
228 | +-- |
229 | +2.28.0 |
230 | + |
231 | diff --git a/debian/patches/lp-1894129-test-tool-Compare-Write-skip-InvalidDataOutSize-unle.patch b/debian/patches/lp-1894129-test-tool-Compare-Write-skip-InvalidDataOutSize-unle.patch |
232 | new file mode 100644 |
233 | index 0000000..179a622 |
234 | --- /dev/null |
235 | +++ b/debian/patches/lp-1894129-test-tool-Compare-Write-skip-InvalidDataOutSize-unle.patch |
236 | @@ -0,0 +1,39 @@ |
237 | +From 60a5856f00731be578a57bfbf68b2e9858680f07 Mon Sep 17 00:00:00 2001 |
238 | +From: David Disseldorp <ddiss@suse.de> |
239 | +Date: Mon, 16 Sep 2019 14:33:50 +0200 |
240 | +Subject: [PATCH] test-tool/Compare&Write: skip InvalidDataOutSize unless iSCSI |
241 | + |
242 | +This test performs PDU manipulation so should only be run against iSCSI |
243 | +devices. |
244 | + |
245 | +Signed-off-by: David Disseldorp <ddiss@suse.de> |
246 | + |
247 | +Origin: upstream, https://github.com/sahlberg/libiscsi/commit/60a5856f |
248 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1894129 |
249 | +Last-Update: 2020-09-08 |
250 | + |
251 | +--- |
252 | + test-tool/test_compareandwrite_invalid_dataout_size.c | 7 +++++++ |
253 | + 1 file changed, 7 insertions(+) |
254 | + |
255 | +diff --git a/test-tool/test_compareandwrite_invalid_dataout_size.c b/test-tool/test_compareandwrite_invalid_dataout_size.c |
256 | +index 4abd501..eb6a6dd 100644 |
257 | +--- a/test-tool/test_compareandwrite_invalid_dataout_size.c |
258 | ++++ b/test-tool/test_compareandwrite_invalid_dataout_size.c |
259 | +@@ -53,6 +53,13 @@ test_compareandwrite_invalid_dataout_size(void) |
260 | + CHECK_FOR_THIN_PROVISIONING; |
261 | + CHECK_FOR_LBPPB_GT_1; |
262 | + CHECK_FOR_SBC; |
263 | ++ if (sd->iscsi_ctx == NULL) { |
264 | ++ const char *err = "[SKIPPED] This test is " |
265 | ++ "only supported for iSCSI backends"; |
266 | ++ logging(LOG_NORMAL, "%s", err); |
267 | ++ CU_PASS(err); |
268 | ++ return; |
269 | ++ } |
270 | + |
271 | + local_iscsi_queue_pdu = my_iscsi_queue_pdu; |
272 | + |
273 | +-- |
274 | +2.28.0 |
275 | + |
276 | diff --git a/debian/patches/lp-1894129-test-tool-CryptoEraseReserved-override-driver-queue_.patch b/debian/patches/lp-1894129-test-tool-CryptoEraseReserved-override-driver-queue_.patch |
277 | new file mode 100644 |
278 | index 0000000..0c4a300 |
279 | --- /dev/null |
280 | +++ b/debian/patches/lp-1894129-test-tool-CryptoEraseReserved-override-driver-queue_.patch |
281 | @@ -0,0 +1,74 @@ |
282 | +From 77279dd44fd19167c22cfada2eec377058e1bde9 Mon Sep 17 00:00:00 2001 |
283 | +From: David Disseldorp <ddiss@suse.de> |
284 | +Date: Mon, 16 Sep 2019 14:46:28 +0200 |
285 | +Subject: [PATCH] test-tool/CryptoEraseReserved: override driver queue_pdu() |
286 | + callback |
287 | + |
288 | +In preparation for removing the test-tool iscsi_queue_pdu() dlsym |
289 | +overload hack, convert this test to use the regular transport driver |
290 | +callback for this purpose. |
291 | + |
292 | +Signed-off-by: David Disseldorp <ddiss@suse.de> |
293 | + |
294 | +Origin: upstream, https://github.com/sahlberg/libiscsi/commit/77279dd4 |
295 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1894129 |
296 | +Last-Update: 2020-09-08 |
297 | + |
298 | +--- |
299 | + test-tool/test_sanitize_crypto_erase_reserved.c | 17 +++++++++++------ |
300 | + 1 file changed, 11 insertions(+), 6 deletions(-) |
301 | + |
302 | +diff --git a/test-tool/test_sanitize_crypto_erase_reserved.c b/test-tool/test_sanitize_crypto_erase_reserved.c |
303 | +index 00bbf34..646cbea 100644 |
304 | +--- a/test-tool/test_sanitize_crypto_erase_reserved.c |
305 | ++++ b/test-tool/test_sanitize_crypto_erase_reserved.c |
306 | +@@ -25,8 +25,9 @@ |
307 | + #include "iscsi-test-cu.h" |
308 | + |
309 | + static int change_num; |
310 | ++static struct iscsi_transport iscsi_drv_orig; |
311 | + |
312 | +-static int my_iscsi_queue_pdu(struct iscsi_context *iscsi _U_, struct iscsi_pdu *pdu) |
313 | ++static int my_iscsi_queue_pdu(struct iscsi_context *iscsi, struct iscsi_pdu *pdu) |
314 | + { |
315 | + switch (change_num) { |
316 | + case 1: |
317 | +@@ -43,12 +44,12 @@ static int my_iscsi_queue_pdu(struct iscsi_context *iscsi _U_, struct iscsi_pdu |
318 | + break; |
319 | + } |
320 | + |
321 | +- change_num = 0; |
322 | +- return 0; |
323 | ++ change_num = 0; |
324 | ++ return iscsi_drv_orig.queue_pdu(iscsi, pdu); |
325 | + } |
326 | + |
327 | + void test_sanitize_crypto_erase_reserved(void) |
328 | +-{ |
329 | ++{ |
330 | + int i; |
331 | + |
332 | + logging(LOG_VERBOSE, LOG_BLANK_LINE); |
333 | +@@ -64,8 +65,9 @@ void test_sanitize_crypto_erase_reserved(void) |
334 | + return; |
335 | + } |
336 | + |
337 | +- local_iscsi_queue_pdu = my_iscsi_queue_pdu; |
338 | +- |
339 | ++ /* override transport queue_pdu callback for PDU manipulation */ |
340 | ++ iscsi_drv_orig = *sd->iscsi_ctx->drv; |
341 | ++ sd->iscsi_ctx->drv->queue_pdu = my_iscsi_queue_pdu; |
342 | + |
343 | + logging(LOG_VERBOSE, "Send SANITIZE command with the reserved " |
344 | + "bit in byte 1 set to 1"); |
345 | +@@ -81,4 +83,7 @@ void test_sanitize_crypto_erase_reserved(void) |
346 | + SANITIZE(sd, 0, 0, SCSI_SANITIZE_CRYPTO_ERASE, 0, NULL, |
347 | + EXPECT_INVALID_FIELD_IN_CDB); |
348 | + } |
349 | ++ |
350 | ++ /* restore transport callbacks */ |
351 | ++ *(sd->iscsi_ctx->drv) = iscsi_drv_orig; |
352 | + } |
353 | +-- |
354 | +2.28.0 |
355 | + |
356 | diff --git a/debian/patches/lp-1894129-test-tool-CryptoEraseReserved-skip-unless-iSCSI.patch b/debian/patches/lp-1894129-test-tool-CryptoEraseReserved-skip-unless-iSCSI.patch |
357 | new file mode 100644 |
358 | index 0000000..95ca3a3 |
359 | --- /dev/null |
360 | +++ b/debian/patches/lp-1894129-test-tool-CryptoEraseReserved-skip-unless-iSCSI.patch |
361 | @@ -0,0 +1,39 @@ |
362 | +From c830a3b55e91fe8b1cb97e6899ef872691c8804e Mon Sep 17 00:00:00 2001 |
363 | +From: David Disseldorp <ddiss@suse.de> |
364 | +Date: Mon, 16 Sep 2019 15:40:00 +0200 |
365 | +Subject: [PATCH] test-tool/CryptoEraseReserved: skip unless iSCSI |
366 | + |
367 | +This test performs PDU manipulation so should only be run against iSCSI |
368 | +devices. |
369 | + |
370 | +Signed-off-by: David Disseldorp <ddiss@suse.de> |
371 | + |
372 | +Origin: upstream, https://github.com/sahlberg/libiscsi/commit/c830a3b5 |
373 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1894129 |
374 | +Last-Update: 2020-09-08 |
375 | + |
376 | +--- |
377 | + test-tool/test_sanitize_crypto_erase_reserved.c | 7 +++++++ |
378 | + 1 file changed, 7 insertions(+) |
379 | + |
380 | +diff --git a/test-tool/test_sanitize_crypto_erase_reserved.c b/test-tool/test_sanitize_crypto_erase_reserved.c |
381 | +index c713ab5..00bbf34 100644 |
382 | +--- a/test-tool/test_sanitize_crypto_erase_reserved.c |
383 | ++++ b/test-tool/test_sanitize_crypto_erase_reserved.c |
384 | +@@ -56,6 +56,13 @@ void test_sanitize_crypto_erase_reserved(void) |
385 | + |
386 | + CHECK_FOR_SANITIZE; |
387 | + CHECK_FOR_DATALOSS; |
388 | ++ if (sd->iscsi_ctx == NULL) { |
389 | ++ const char *err = "[SKIPPED] This test is " |
390 | ++ "only supported for iSCSI backends"; |
391 | ++ logging(LOG_NORMAL, "%s", err); |
392 | ++ CU_PASS(err); |
393 | ++ return; |
394 | ++ } |
395 | + |
396 | + local_iscsi_queue_pdu = my_iscsi_queue_pdu; |
397 | + |
398 | +-- |
399 | +2.28.0 |
400 | + |
401 | diff --git a/debian/patches/lp-1894129-test-tool-OverwriteReserved-override-driver-queue_pd.patch b/debian/patches/lp-1894129-test-tool-OverwriteReserved-override-driver-queue_pd.patch |
402 | new file mode 100644 |
403 | index 0000000..0b6e27b |
404 | --- /dev/null |
405 | +++ b/debian/patches/lp-1894129-test-tool-OverwriteReserved-override-driver-queue_pd.patch |
406 | @@ -0,0 +1,68 @@ |
407 | +From 2ae45ac15d8c1d4a4f68a085dadb7f43e2f2e280 Mon Sep 17 00:00:00 2001 |
408 | +From: David Disseldorp <ddiss@suse.de> |
409 | +Date: Mon, 16 Sep 2019 14:46:28 +0200 |
410 | +Subject: [PATCH] test-tool/OverwriteReserved: override driver queue_pdu() |
411 | + callback |
412 | + |
413 | +In preparation for removing the test-tool iscsi_queue_pdu() dlsym |
414 | +overload hack, convert this test to use the regular transport driver |
415 | +callback for this purpose. |
416 | + |
417 | +Signed-off-by: David Disseldorp <ddiss@suse.de> |
418 | + |
419 | +Origin: backport, https://github.com/sahlberg/libiscsi/commit/2ae45ac1 |
420 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1894129 |
421 | +Last-Update: 2020-09-08 |
422 | + |
423 | +--- |
424 | + test-tool/test_sanitize_overwrite_reserved.c | 16 +++++++++++----- |
425 | + 1 file changed, 11 insertions(+), 5 deletions(-) |
426 | + |
427 | +--- a/test-tool/test_sanitize_overwrite_reserved.c |
428 | ++++ b/test-tool/test_sanitize_overwrite_reserved.c |
429 | +@@ -26,8 +26,9 @@ |
430 | + #include "iscsi-test-cu.h" |
431 | + |
432 | + static int change_num; |
433 | ++static struct iscsi_transport iscsi_drv_orig; |
434 | + |
435 | +-static int my_iscsi_queue_pdu(struct iscsi_context *iscsi _U_, struct iscsi_pdu *pdu) |
436 | ++static int my_iscsi_queue_pdu(struct iscsi_context *iscsi, struct iscsi_pdu *pdu) |
437 | + { |
438 | + switch (change_num) { |
439 | + case 1: |
440 | +@@ -44,12 +45,12 @@ static int my_iscsi_queue_pdu(struct isc |
441 | + break; |
442 | + } |
443 | + |
444 | +- change_num = 0; |
445 | +- return 0; |
446 | ++ change_num = 0; |
447 | ++ return iscsi_drv_orig.queue_pdu(iscsi, pdu); |
448 | + } |
449 | + |
450 | + void test_sanitize_overwrite_reserved(void) |
451 | +-{ |
452 | ++{ |
453 | + int i; |
454 | + struct iscsi_data data; |
455 | + |
456 | +@@ -68,7 +69,9 @@ void test_sanitize_overwrite_reserved(vo |
457 | + CHECK_FOR_SANITIZE; |
458 | + CHECK_FOR_DATALOSS; |
459 | + |
460 | +- local_iscsi_queue_pdu = my_iscsi_queue_pdu; |
461 | ++ /* override transport queue_pdu callback for PDU manipulation */ |
462 | ++ iscsi_drv_orig = *sd->iscsi_ctx->drv; |
463 | ++ sd->iscsi_ctx->drv->queue_pdu = my_iscsi_queue_pdu; |
464 | + |
465 | + logging(LOG_VERBOSE, "Send SANITIZE command with the reserved " |
466 | + "bit in byte 1 set to 1"); |
467 | +@@ -84,4 +87,7 @@ void test_sanitize_overwrite_reserved(vo |
468 | + SANITIZE(sd, 0, 0, SCSI_SANITIZE_OVERWRITE, data.size, &data, |
469 | + EXPECT_INVALID_FIELD_IN_CDB); |
470 | + } |
471 | ++ |
472 | ++ /* restore transport callbacks */ |
473 | ++ *(sd->iscsi_ctx->drv) = iscsi_drv_orig; |
474 | + } |
475 | diff --git a/debian/patches/lp-1894129-test-tool-Use-extern-int-in-headers.patch b/debian/patches/lp-1894129-test-tool-Use-extern-int-in-headers.patch |
476 | new file mode 100644 |
477 | index 0000000..f10a7a4 |
478 | --- /dev/null |
479 | +++ b/debian/patches/lp-1894129-test-tool-Use-extern-int-in-headers.patch |
480 | @@ -0,0 +1,58 @@ |
481 | +From ea89dcdbf167acd634300296172926c2e8d85804 Mon Sep 17 00:00:00 2001 |
482 | +From: Cole Robinson <crobinso@redhat.com> |
483 | +Date: Sat, 15 Feb 2020 18:03:11 -0500 |
484 | +Subject: [PATCH] test-tool: Use 'extern int' in headers |
485 | + |
486 | +Without this, linking fails on Fedora rawhide. Example: |
487 | + |
488 | +... |
489 | +/usr/bin/ld: test_async_lu_reset_simple.o:/root/libiscsi/libiscsi.git/test-tool/iscsi-support.h:59: multiple definition of `param_list_len_err_ascqs'; iscsi-test-cu.o:/root/libiscsi/libiscsi.git/test-tool/iscsi-support.h:59: first defined here |
490 | +/usr/bin/ld: test_async_lu_reset_simple.o:/root/libiscsi/libiscsi.git/test-tool/iscsi-support.h:58: multiple definition of `invalid_cdb_ascqs'; iscsi-test-cu.o:/root/libiscsi/libiscsi.git/test-tool/iscsi-support.h:58: first defined here |
491 | +... |
492 | + |
493 | +Signed-off-by: Cole Robinson <crobinso@redhat.com> |
494 | + |
495 | +Origin: upstream, https://github.com/sahlberg/libiscsi/commit/ea89dcdb |
496 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1894129 |
497 | +Last-Update: 2020-09-08 |
498 | + |
499 | +--- |
500 | + test-tool/iscsi-support.h | 22 +++++++++++----------- |
501 | + 1 file changed, 11 insertions(+), 11 deletions(-) |
502 | + |
503 | +diff --git a/test-tool/iscsi-support.h b/test-tool/iscsi-support.h |
504 | +index 7aa9e45..9c3a461 100644 |
505 | +--- a/test-tool/iscsi-support.h |
506 | ++++ b/test-tool/iscsi-support.h |
507 | +@@ -53,17 +53,17 @@ extern const char *initiatorname2; |
508 | + #define EXPECT_RESERVATION_CONFLICT SCSI_STATUS_RESERVATION_CONFLICT, 0, NULL, 0 |
509 | + #define EXPECT_COPY_ABORTED SCSI_STATUS_CHECK_CONDITION, SCSI_SENSE_COPY_ABORTED, copy_aborted_ascqs, 3 |
510 | + |
511 | +-int no_medium_ascqs[3]; |
512 | +-int lba_oob_ascqs[1]; |
513 | +-int invalid_cdb_ascqs[2]; |
514 | +-int param_list_len_err_ascqs[1]; |
515 | +-int too_many_desc_ascqs[2]; |
516 | +-int unsupp_desc_code_ascqs[2]; |
517 | +-int write_protect_ascqs[3]; |
518 | +-int sanitize_ascqs[1]; |
519 | +-int removal_ascqs[1]; |
520 | +-int miscompare_ascqs[1]; |
521 | +-int copy_aborted_ascqs[3]; |
522 | ++extern int no_medium_ascqs[3]; |
523 | ++extern int lba_oob_ascqs[1]; |
524 | ++extern int invalid_cdb_ascqs[2]; |
525 | ++extern int param_list_len_err_ascqs[1]; |
526 | ++extern int too_many_desc_ascqs[2]; |
527 | ++extern int unsupp_desc_code_ascqs[2]; |
528 | ++extern int write_protect_ascqs[3]; |
529 | ++extern int sanitize_ascqs[1]; |
530 | ++extern int removal_ascqs[1]; |
531 | ++extern int miscompare_ascqs[1]; |
532 | ++extern int copy_aborted_ascqs[3]; |
533 | + |
534 | + extern int loglevel; |
535 | + #define LOG_SILENT 0 |
536 | +-- |
537 | +2.28.0 |
538 | + |
539 | diff --git a/debian/patches/lp-1894129-test-tool-iSCSICmdSnTooHigh-override-driver-queue_pd.patch b/debian/patches/lp-1894129-test-tool-iSCSICmdSnTooHigh-override-driver-queue_pd.patch |
540 | new file mode 100644 |
541 | index 0000000..5df90d9 |
542 | --- /dev/null |
543 | +++ b/debian/patches/lp-1894129-test-tool-iSCSICmdSnTooHigh-override-driver-queue_pd.patch |
544 | @@ -0,0 +1,68 @@ |
545 | +From 575ba2244c5db240bc29fa493404eee39f693a2d Mon Sep 17 00:00:00 2001 |
546 | +From: David Disseldorp <ddiss@suse.de> |
547 | +Date: Mon, 16 Sep 2019 14:46:28 +0200 |
548 | +Subject: [PATCH] test-tool/iSCSICmdSnTooHigh: override driver queue_pdu() |
549 | + callback |
550 | + |
551 | +In preparation for removing the test-tool iscsi_queue_pdu() dlsym |
552 | +overload hack, convert this test to use the regular transport driver |
553 | +callback for this purpose. |
554 | + |
555 | +Signed-off-by: David Disseldorp <ddiss@suse.de> |
556 | + |
557 | +Origin: upstream, https://github.com/sahlberg/libiscsi/commit/575ba224 |
558 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1894129 |
559 | +Last-Update: 2020-09-08 |
560 | + |
561 | +--- |
562 | + test-tool/test_iscsi_cmdsn_toohigh.c | 11 ++++++++--- |
563 | + 1 file changed, 8 insertions(+), 3 deletions(-) |
564 | + |
565 | +diff --git a/test-tool/test_iscsi_cmdsn_toohigh.c b/test-tool/test_iscsi_cmdsn_toohigh.c |
566 | +index 59ce0ab..19c8b91 100644 |
567 | +--- a/test-tool/test_iscsi_cmdsn_toohigh.c |
568 | ++++ b/test-tool/test_iscsi_cmdsn_toohigh.c |
569 | +@@ -25,6 +25,7 @@ |
570 | + #include "iscsi-test-cu.h" |
571 | + |
572 | + static int change_cmdsn; |
573 | ++static struct iscsi_transport iscsi_drv_orig; |
574 | + |
575 | + static int my_iscsi_queue_pdu(struct iscsi_context *iscsi, struct iscsi_pdu *pdu) |
576 | + { |
577 | +@@ -40,7 +41,7 @@ static int my_iscsi_queue_pdu(struct iscsi_context *iscsi, struct iscsi_pdu *pdu |
578 | + } |
579 | + |
580 | + change_cmdsn = 0; |
581 | +- return 0; |
582 | ++ return iscsi_drv_orig.queue_pdu(iscsi, pdu); |
583 | + } |
584 | + |
585 | + void test_iscsi_cmdsn_toohigh(void) |
586 | +@@ -64,7 +65,9 @@ void test_iscsi_cmdsn_toohigh(void) |
587 | + |
588 | + sd->iscsi_ctx->use_immediate_data = ISCSI_IMMEDIATE_DATA_NO; |
589 | + sd->iscsi_ctx->target_max_recv_data_segment_length = block_size; |
590 | +- local_iscsi_queue_pdu = my_iscsi_queue_pdu; |
591 | ++ /* override transport queue_pdu callback for PDU manipulation */ |
592 | ++ iscsi_drv_orig = *sd->iscsi_ctx->drv; |
593 | ++ sd->iscsi_ctx->drv->queue_pdu = my_iscsi_queue_pdu; |
594 | + change_cmdsn = 1; |
595 | + /* we don't want autoreconnect since some targets will incorrectly |
596 | + * drop the connection on this condition. |
597 | +@@ -81,9 +84,11 @@ void test_iscsi_cmdsn_toohigh(void) |
598 | + logging(LOG_VERBOSE, "[FAILURE] We got a response from the target but SMDSN was outside of the window."); |
599 | + } |
600 | + |
601 | +- |
602 | + iscsi_set_noautoreconnect(sd->iscsi_ctx, 0); |
603 | + logging(LOG_VERBOSE, "Send a TESTUNITREADY with CMDSN == EXPCMDSN. should work again"); |
604 | + TESTUNITREADY(sd, |
605 | + EXPECT_STATUS_GOOD); |
606 | ++ |
607 | ++ /* restore transport callbacks */ |
608 | ++ *(sd->iscsi_ctx->drv) = iscsi_drv_orig; |
609 | + } |
610 | +-- |
611 | +2.28.0 |
612 | + |
613 | diff --git a/debian/patches/lp-1894129-test-tool-iSCSICmdSnTooLow-override-driver-queue_pdu.patch b/debian/patches/lp-1894129-test-tool-iSCSICmdSnTooLow-override-driver-queue_pdu.patch |
614 | new file mode 100644 |
615 | index 0000000..4dcd73d |
616 | --- /dev/null |
617 | +++ b/debian/patches/lp-1894129-test-tool-iSCSICmdSnTooLow-override-driver-queue_pdu.patch |
618 | @@ -0,0 +1,69 @@ |
619 | +From c067eef9c10c17b8a9be83ee4f71d4c8d0d238e4 Mon Sep 17 00:00:00 2001 |
620 | +From: David Disseldorp <ddiss@suse.de> |
621 | +Date: Mon, 16 Sep 2019 14:46:28 +0200 |
622 | +Subject: [PATCH] test-tool/iSCSICmdSnTooLow: override driver queue_pdu() |
623 | + callback |
624 | + |
625 | +In preparation for removing the test-tool iscsi_queue_pdu() dlsym |
626 | +overload hack, convert this test to use the regular transport driver |
627 | +callback for this purpose. |
628 | + |
629 | +Signed-off-by: David Disseldorp <ddiss@suse.de> |
630 | + |
631 | +Origin: upstream, https://github.com/sahlberg/libiscsi/commit/c067eef9 |
632 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1894129 |
633 | +Last-Update: 2020-09-08 |
634 | + |
635 | +--- |
636 | + test-tool/test_iscsi_cmdsn_toolow.c | 12 ++++++++---- |
637 | + 1 file changed, 8 insertions(+), 4 deletions(-) |
638 | + |
639 | +diff --git a/test-tool/test_iscsi_cmdsn_toolow.c b/test-tool/test_iscsi_cmdsn_toolow.c |
640 | +index 0b980b3..23b93c3 100644 |
641 | +--- a/test-tool/test_iscsi_cmdsn_toolow.c |
642 | ++++ b/test-tool/test_iscsi_cmdsn_toolow.c |
643 | +@@ -25,6 +25,7 @@ |
644 | + #include "iscsi-test-cu.h" |
645 | + |
646 | + static int change_cmdsn; |
647 | ++static struct iscsi_transport iscsi_drv_orig; |
648 | + |
649 | + static int my_iscsi_queue_pdu(struct iscsi_context *iscsi, struct iscsi_pdu *pdu) |
650 | + { |
651 | +@@ -40,7 +41,7 @@ static int my_iscsi_queue_pdu(struct iscsi_context *iscsi, struct iscsi_pdu *pdu |
652 | + } |
653 | + |
654 | + change_cmdsn = 0; |
655 | +- return 0; |
656 | ++ return iscsi_drv_orig.queue_pdu(iscsi, pdu); |
657 | + } |
658 | + |
659 | + void test_iscsi_cmdsn_toolow(void) |
660 | +@@ -64,7 +65,9 @@ void test_iscsi_cmdsn_toolow(void) |
661 | + |
662 | + sd->iscsi_ctx->use_immediate_data = ISCSI_IMMEDIATE_DATA_NO; |
663 | + sd->iscsi_ctx->target_max_recv_data_segment_length = block_size; |
664 | +- local_iscsi_queue_pdu = my_iscsi_queue_pdu; |
665 | ++ /* override transport queue_pdu callback for PDU manipulation */ |
666 | ++ iscsi_drv_orig = *sd->iscsi_ctx->drv; |
667 | ++ sd->iscsi_ctx->drv->queue_pdu = my_iscsi_queue_pdu; |
668 | + change_cmdsn = 1; |
669 | + /* we don't want autoreconnect since some targets will incorrectly |
670 | + * drop the connection on this condition. |
671 | +@@ -81,10 +84,11 @@ void test_iscsi_cmdsn_toolow(void) |
672 | + logging(LOG_VERBOSE, "[FAILURE] We got a response from the target but SMDSN was outside of the window."); |
673 | + } |
674 | + |
675 | +- |
676 | +- |
677 | + iscsi_set_noautoreconnect(sd->iscsi_ctx, 0); |
678 | + logging(LOG_VERBOSE, "Send a TESTUNITREADY with CMDSN == EXPCMDSN. should work again"); |
679 | + TESTUNITREADY(sd, |
680 | + EXPECT_STATUS_GOOD); |
681 | ++ |
682 | ++ /* restore transport callbacks */ |
683 | ++ *(sd->iscsi_ctx->drv) = iscsi_drv_orig; |
684 | + } |
685 | +-- |
686 | +2.28.0 |
687 | + |
688 | diff --git a/debian/patches/lp-1894129-test-tool-iSCSIDataSnInvalid-override-driver-queue_p.patch b/debian/patches/lp-1894129-test-tool-iSCSIDataSnInvalid-override-driver-queue_p.patch |
689 | new file mode 100644 |
690 | index 0000000..4a253a1 |
691 | --- /dev/null |
692 | +++ b/debian/patches/lp-1894129-test-tool-iSCSIDataSnInvalid-override-driver-queue_p.patch |
693 | @@ -0,0 +1,166 @@ |
694 | +From 153ca193fa61be8c2c26d8736119e7dc873d1242 Mon Sep 17 00:00:00 2001 |
695 | +From: David Disseldorp <ddiss@suse.de> |
696 | +Date: Mon, 16 Sep 2019 14:46:28 +0200 |
697 | +Subject: [PATCH] test-tool/iSCSIDataSnInvalid: override driver queue_pdu() |
698 | + callback |
699 | + |
700 | +In preparation for removing the test-tool iscsi_queue_pdu() dlsym |
701 | +overload hack, convert this test to use the regular transport driver |
702 | +callback for this purpose. |
703 | +This commit also removes a number of unnecessary "WRITE10 is not |
704 | +implemented" checks, which should all be caught by the first check. |
705 | + |
706 | +Signed-off-by: David Disseldorp <ddiss@suse.de> |
707 | + |
708 | +Origin: upstream, https://github.com/sahlberg/libiscsi/commit/153ca193 |
709 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1894129 |
710 | +Last-Update: 2020-09-08 |
711 | + |
712 | +--- |
713 | + test-tool/test_iscsi_datasn_invalid.c | 56 ++++++++++----------------- |
714 | + 1 file changed, 21 insertions(+), 35 deletions(-) |
715 | + |
716 | +diff --git a/test-tool/test_iscsi_datasn_invalid.c b/test-tool/test_iscsi_datasn_invalid.c |
717 | +index 14deb7a..c25631a 100644 |
718 | +--- a/test-tool/test_iscsi_datasn_invalid.c |
719 | ++++ b/test-tool/test_iscsi_datasn_invalid.c |
720 | +@@ -25,13 +25,14 @@ |
721 | + #include "iscsi-test-cu.h" |
722 | + |
723 | + static int change_datasn; |
724 | ++static struct iscsi_transport iscsi_drv_orig; |
725 | + |
726 | +-static int my_iscsi_queue_pdu(struct iscsi_context *iscsi _U_, struct iscsi_pdu *pdu _U_) |
727 | ++static int my_iscsi_queue_pdu(struct iscsi_context *iscsi, struct iscsi_pdu *pdu) |
728 | + { |
729 | + uint32_t datasn; |
730 | + |
731 | + if (pdu->outdata.data[0] != ISCSI_PDU_DATA_OUT) { |
732 | +- return 0; |
733 | ++ goto out; |
734 | + } |
735 | + switch (change_datasn) { |
736 | + case 1: |
737 | +@@ -52,11 +53,12 @@ static int my_iscsi_queue_pdu(struct iscsi_context *iscsi _U_, struct iscsi_pdu |
738 | + scsi_set_uint32(&pdu->outdata.data[36], 1 - datasn); |
739 | + break; |
740 | + } |
741 | +- return 0; |
742 | ++out: |
743 | ++ return iscsi_drv_orig.queue_pdu(iscsi, pdu); |
744 | + } |
745 | + |
746 | + void test_iscsi_datasn_invalid(void) |
747 | +-{ |
748 | ++{ |
749 | + int ret; |
750 | + |
751 | + CHECK_FOR_DATALOSS; |
752 | +@@ -77,7 +79,9 @@ void test_iscsi_datasn_invalid(void) |
753 | + |
754 | + sd->iscsi_ctx->use_immediate_data = ISCSI_IMMEDIATE_DATA_NO; |
755 | + sd->iscsi_ctx->target_max_recv_data_segment_length = block_size; |
756 | +- local_iscsi_queue_pdu = my_iscsi_queue_pdu; |
757 | ++ /* override transport queue_pdu callback for PDU manipulation */ |
758 | ++ iscsi_drv_orig = *sd->iscsi_ctx->drv; |
759 | ++ sd->iscsi_ctx->drv->queue_pdu = my_iscsi_queue_pdu; |
760 | + iscsi_set_noautoreconnect(sd->iscsi_ctx, 1); |
761 | + iscsi_set_timeout(sd->iscsi_ctx, 3); |
762 | + |
763 | +@@ -89,81 +93,63 @@ void test_iscsi_datasn_invalid(void) |
764 | + if (ret == -2) { |
765 | + logging(LOG_NORMAL, "[SKIPPED] WRITE10 is not implemented."); |
766 | + CU_PASS("WRITE10 is not implemented."); |
767 | +- local_iscsi_queue_pdu = NULL; |
768 | +- return; |
769 | +- } |
770 | ++ goto out_ctx_restore; |
771 | ++ } |
772 | + CU_ASSERT_NOT_EQUAL(ret, 0); |
773 | + |
774 | ++ /* avoid changing DataSN during reconnect */ |
775 | ++ *(sd->iscsi_ctx->drv) = iscsi_drv_orig; |
776 | + iscsi_set_noautoreconnect(sd->iscsi_ctx, 0); |
777 | + |
778 | +- |
779 | + logging(LOG_VERBOSE, "Send Data-Out PDU with DataSN==27. Should fail"); |
780 | + change_datasn = 2; |
781 | + |
782 | + sd->iscsi_ctx->use_immediate_data = ISCSI_IMMEDIATE_DATA_NO; |
783 | + sd->iscsi_ctx->target_max_recv_data_segment_length = block_size; |
784 | +- local_iscsi_queue_pdu = my_iscsi_queue_pdu; |
785 | ++ sd->iscsi_ctx->drv->queue_pdu = my_iscsi_queue_pdu; |
786 | + iscsi_set_noautoreconnect(sd->iscsi_ctx, 1); |
787 | + iscsi_set_timeout(sd->iscsi_ctx, 3); |
788 | + |
789 | + ret = write10(sd, 100, block_size, |
790 | + block_size, 0, 0, 0, 0, 0, scratch, |
791 | + EXPECT_STATUS_GOOD); |
792 | +- if (ret == -2) { |
793 | +- logging(LOG_NORMAL, "[SKIPPED] WRITE10 is not implemented."); |
794 | +- CU_PASS("WRITE10 is not implemented."); |
795 | +- local_iscsi_queue_pdu = NULL; |
796 | +- return; |
797 | +- } |
798 | + CU_ASSERT_NOT_EQUAL(ret, 0); |
799 | + |
800 | ++ *(sd->iscsi_ctx->drv) = iscsi_drv_orig; |
801 | + iscsi_set_noautoreconnect(sd->iscsi_ctx, 0); |
802 | + |
803 | +- |
804 | + logging(LOG_VERBOSE, "Send Data-Out PDU with DataSN==-1. Should fail"); |
805 | + change_datasn = 3; |
806 | + |
807 | + sd->iscsi_ctx->use_immediate_data = ISCSI_IMMEDIATE_DATA_NO; |
808 | + sd->iscsi_ctx->target_max_recv_data_segment_length = block_size; |
809 | +- local_iscsi_queue_pdu = my_iscsi_queue_pdu; |
810 | ++ sd->iscsi_ctx->drv->queue_pdu = my_iscsi_queue_pdu; |
811 | + iscsi_set_noautoreconnect(sd->iscsi_ctx, 1); |
812 | + iscsi_set_timeout(sd->iscsi_ctx, 3); |
813 | + |
814 | + ret = write10(sd, 100, block_size, |
815 | + block_size, 0, 0, 0, 0, 0, scratch, |
816 | + EXPECT_STATUS_GOOD); |
817 | +- if (ret == -2) { |
818 | +- logging(LOG_NORMAL, "[SKIPPED] WRITE10 is not implemented."); |
819 | +- CU_PASS("WRITE10 is not implemented."); |
820 | +- local_iscsi_queue_pdu = NULL; |
821 | +- return; |
822 | +- } |
823 | + CU_ASSERT_NOT_EQUAL(ret, 0); |
824 | + |
825 | ++ *(sd->iscsi_ctx->drv) = iscsi_drv_orig; |
826 | + iscsi_set_noautoreconnect(sd->iscsi_ctx, 0); |
827 | + |
828 | +- |
829 | +- |
830 | + logging(LOG_VERBOSE, "Send Data-Out PDU's in reverse order (DataSN == 1,0). Should fail"); |
831 | + change_datasn = 4; |
832 | + |
833 | + sd->iscsi_ctx->use_immediate_data = ISCSI_IMMEDIATE_DATA_NO; |
834 | + sd->iscsi_ctx->target_max_recv_data_segment_length = block_size; |
835 | +- local_iscsi_queue_pdu = my_iscsi_queue_pdu; |
836 | ++ sd->iscsi_ctx->drv->queue_pdu = my_iscsi_queue_pdu; |
837 | + iscsi_set_noautoreconnect(sd->iscsi_ctx, 1); |
838 | + iscsi_set_timeout(sd->iscsi_ctx, 3); |
839 | + |
840 | + ret = write10(sd, 100, 2 * block_size, |
841 | + block_size, 0, 0, 0, 0, 0, scratch, |
842 | + EXPECT_STATUS_GOOD); |
843 | +- if (ret == -2) { |
844 | +- logging(LOG_NORMAL, "[SKIPPED] WRITE10 is not implemented."); |
845 | +- CU_PASS("WRITE10 is not implemented."); |
846 | +- local_iscsi_queue_pdu = NULL; |
847 | +- return; |
848 | +- } |
849 | + CU_ASSERT_NOT_EQUAL(ret, 0); |
850 | +- |
851 | +- local_iscsi_queue_pdu = NULL; |
852 | ++out_ctx_restore: |
853 | ++ /* restore transport callbacks and autoreconnect */ |
854 | ++ *(sd->iscsi_ctx->drv) = iscsi_drv_orig; |
855 | + iscsi_set_noautoreconnect(sd->iscsi_ctx, 0); |
856 | + } |
857 | +-- |
858 | +2.28.0 |
859 | + |
860 | diff --git a/debian/patches/lp-1894129-test-tool-remove-unused-iscsi_queue_pdu-symbol-overl.patch b/debian/patches/lp-1894129-test-tool-remove-unused-iscsi_queue_pdu-symbol-overl.patch |
861 | new file mode 100644 |
862 | index 0000000..6cd1a9f |
863 | --- /dev/null |
864 | +++ b/debian/patches/lp-1894129-test-tool-remove-unused-iscsi_queue_pdu-symbol-overl.patch |
865 | @@ -0,0 +1,104 @@ |
866 | +From dd17293bcc188dbefc420ee23b77bc9bb7c5e9a2 Mon Sep 17 00:00:00 2001 |
867 | +From: David Disseldorp <ddiss@suse.de> |
868 | +Date: Mon, 16 Sep 2019 16:02:36 +0200 |
869 | +Subject: [PATCH] test-tool: remove unused iscsi_queue_pdu() symbol overload |
870 | + |
871 | +All users have now been changed to overload via the iscsi_ctx transport |
872 | +callback, so the dlsym based overloading can now be dropped. |
873 | + |
874 | +Signed-off-by: David Disseldorp <ddiss@suse.de> |
875 | + |
876 | +Origin: upstream, https://github.com/sahlberg/libiscsi/commit/dd17293b |
877 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1894129 |
878 | +Last-Update: 2020-09-08 |
879 | + |
880 | +--- |
881 | + test-tool/iscsi-support.c | 11 ----------- |
882 | + test-tool/iscsi-support.h | 1 - |
883 | + test-tool/iscsi-test-cu.c | 15 --------------- |
884 | + 3 files changed, 27 deletions(-) |
885 | + |
886 | +diff --git a/test-tool/iscsi-support.c b/test-tool/iscsi-support.c |
887 | +index 4b49478..169d2b0 100644 |
888 | +--- a/test-tool/iscsi-support.c |
889 | ++++ b/test-tool/iscsi-support.c |
890 | +@@ -119,8 +119,6 @@ int readonly; |
891 | + int sbc3_support; |
892 | + int maximum_transfer_length; |
893 | + |
894 | +-int (*real_iscsi_queue_pdu)(struct iscsi_context *iscsi, struct iscsi_pdu *pdu); |
895 | +- |
896 | + static const unsigned char zeroBlock[4096]; |
897 | + |
898 | + /** |
899 | +@@ -569,15 +567,6 @@ wait_until_test_finished(struct iscsi_context *iscsi, struct iscsi_async_state * |
900 | + } |
901 | + } |
902 | + |
903 | +-int |
904 | +-iscsi_queue_pdu(struct iscsi_context *iscsi, struct iscsi_pdu *pdu) |
905 | +-{ |
906 | +- if (local_iscsi_queue_pdu != NULL) { |
907 | +- local_iscsi_queue_pdu(iscsi, pdu); |
908 | +- } |
909 | +- return real_iscsi_queue_pdu(iscsi, pdu); |
910 | +-} |
911 | +- |
912 | + int |
913 | + orwrite(struct scsi_device *sdev, uint64_t lba, |
914 | + uint32_t datalen, int blocksize, int wrprotect, |
915 | +diff --git a/test-tool/iscsi-support.h b/test-tool/iscsi-support.h |
916 | +index aee00ca..2b20a1f 100644 |
917 | +--- a/test-tool/iscsi-support.h |
918 | ++++ b/test-tool/iscsi-support.h |
919 | +@@ -782,7 +782,6 @@ struct iscsi_async_state { |
920 | + void wait_until_test_finished(struct iscsi_context *iscsi, struct iscsi_async_state *test_state); |
921 | + |
922 | + struct iscsi_pdu; |
923 | +-int (*local_iscsi_queue_pdu)(struct iscsi_context *iscsi, struct iscsi_pdu *pdu); |
924 | + |
925 | + struct scsi_command_descriptor *get_command_descriptor(int opcode, int sa); |
926 | + |
927 | +diff --git a/test-tool/iscsi-test-cu.c b/test-tool/iscsi-test-cu.c |
928 | +index eafda39..26e1b05 100644 |
929 | +--- a/test-tool/iscsi-test-cu.c |
930 | ++++ b/test-tool/iscsi-test-cu.c |
931 | +@@ -59,12 +59,6 @@ int loglevel = LOG_NORMAL; |
932 | + struct scsi_device *sd = NULL; /* mp_sds[0] alias */ |
933 | + static unsigned int maxsectors; |
934 | + |
935 | +-/* |
936 | +- * this allows us to redefine how PDU are queued, at times, for |
937 | +- * testing purposes |
938 | +- */ |
939 | +-int (*real_iscsi_queue_pdu)(struct iscsi_context *iscsi, struct iscsi_pdu *pdu); |
940 | +- |
941 | + /***************************************************************** |
942 | + * |
943 | + * list of tests and test suites |
944 | +@@ -805,7 +799,6 @@ test_setup(void) |
945 | + { |
946 | + task = NULL; |
947 | + read_write_buf = NULL; |
948 | +- local_iscsi_queue_pdu = NULL; |
949 | + } |
950 | + |
951 | + void |
952 | +@@ -1214,14 +1207,6 @@ main(int argc, char *argv[]) |
953 | + mp_num_sds++; |
954 | + } |
955 | + |
956 | +- /* So that we can override iscsi_queue_pdu in tests |
957 | +- * and replace or mutate the blob that we are about to write to the |
958 | +- * wire. |
959 | +- * This allows such tests to do their mutates and then call out |
960 | +- * to the real queueing function once they have modified the data. |
961 | +- */ |
962 | +- real_iscsi_queue_pdu = dlsym(RTLD_NEXT, "iscsi_queue_pdu"); |
963 | +- |
964 | + if ((mp_num_sds == 0) || (mp_sds[0]->iscsi_url == NULL |
965 | + && mp_sds[0]->sgio_dev == NULL)) { |
966 | + #ifdef HAVE_SG_IO |
967 | +-- |
968 | +2.28.0 |
969 | + |
970 | diff --git a/debian/patches/series b/debian/patches/series |
971 | index de65f63..36e1d44 100644 |
972 | --- a/debian/patches/series |
973 | +++ b/debian/patches/series |
974 | @@ -3,3 +3,15 @@ soversion.diff |
975 | libpthread.diff |
976 | attribute_packed.patch |
977 | spelling.patch |
978 | +lp-1894129-test-tool-Compare-Write-skip-InvalidDataOutSize-unle.patch |
979 | +lp-1894129-test-tool-Compare-Write-override-driver-queue_pdu-ca.patch |
980 | +lp-1894129-test-tool-iSCSICmdSnTooLow-override-driver-queue_pdu.patch |
981 | +lp-1894129-test-tool-iSCSICmdSnTooHigh-override-driver-queue_pd.patch |
982 | +lp-1894129-test-tool-iSCSIDataSnInvalid-override-driver-queue_p.patch |
983 | +lp-1894129-test-tool-BlockEraseReserved-skip-unless-iSCSI.patch |
984 | +lp-1894129-test-tool-CryptoEraseReserved-skip-unless-iSCSI.patch |
985 | +lp-1894129-test-tool-CryptoEraseReserved-override-driver-queue_.patch |
986 | +lp-1894129-test-tool-OverwriteReserved-override-driver-queue_pd.patch |
987 | +lp-1894129-test-tool-remove-unused-iscsi_queue_pdu-symbol-overl.patch |
988 | +lp-1894129-test-tool-BlockEraseReserved-override-driver-queue_p.patch |
989 | +lp-1894129-test-tool-Use-extern-int-in-headers.patch |
PPA: https:/ /launchpad. net/~ci- train-ppa- service/ +archive/ ubuntu/ 4256/+packages