'tahoe mv' doesn't report errors from the DELETE operation #1255

Closed
opened 2010-11-10 01:32:36 +00:00 by davidsarah · 6 comments
davidsarah commented 2010-11-10 01:32:36 +00:00
Owner

While fixing #1253, I found another bug. source:src/allmydata/scripts/tahoe_mv.py@4811#L65 intends to check the status code from the DELETE operation, but actually checks the status code that is left in the status variable from the previous PUT operation. That would cause it to print 'OK' even though the DELETE has failed (in which case the source link might be left in place).

While fixing #1253, I found another bug. source:src/allmydata/scripts/tahoe_mv.py@4811#L65 intends to check the status code from the DELETE operation, but actually checks the status code that is left in the `status` variable from the previous PUT operation. That would cause it to print 'OK' even though the DELETE has failed (in which case the source link might be left in place).
tahoe-lafs added the
code-frontend-cli
major
defect
1.8.0
labels 2010-11-10 01:32:36 +00:00
tahoe-lafs added this to the 1.8.1 milestone 2010-11-10 01:32:36 +00:00
davidsarah commented 2010-11-10 01:37:28 +00:00
Author
Owner

Attachment look-at-the-right-status-code.darcs.patch (16666 bytes) added

tahoe_mv.py: when checking success of the DELETE operation, look at the status code from DELETE rather than from the previous PUT. fixes #1255

**Attachment** look-at-the-right-status-code.darcs.patch (16666 bytes) added tahoe_mv.py: when checking success of the DELETE operation, look at the status code from DELETE rather than from the previous PUT. fixes #1255
davidsarah commented 2010-11-10 04:16:43 +00:00
Author
Owner

In order to test this, we need to arrange for the DELETE to fail, but for the preceding GET and PUT to succeed. Tricky. Can anyone see how to do that reliably?

In order to test this, we need to arrange for the DELETE to fail, but for the preceding GET and PUT to succeed. Tricky. Can anyone see how to do that reliably?
zooko commented 2010-11-10 06:59:24 +00:00
Author
Owner

Replying to davidsarah:

In order to test this, we need to arrange for the DELETE to fail, but for the preceding GET and PUT to succeed. Tricky. Can anyone see how to do that reliably?

How about put a fake do_http(). The fake one could check whether its first arg is "DELETE" and if so return a non-200 status code.

Replying to [davidsarah](/tahoe-lafs/trac-2024-07-25/issues/1255#issuecomment-122719): > In order to test this, we need to arrange for the DELETE to fail, but for the preceding GET and PUT to succeed. Tricky. Can anyone see how to do that reliably? How about put a fake `do_http()`. The fake one could check whether its first arg is `"DELETE"` and if so return a non-200 status code.
davidsarah commented 2010-11-12 02:15:00 +00:00
Author
Owner

Attachment test-1255.darcs.patch (19578 bytes) added

test_cli.py: test that 'tahoe mv' reports errors from the DELETE operation. refs #1255

**Attachment** test-1255.darcs.patch (19578 bytes) added test_cli.py: test that 'tahoe mv' reports errors from the DELETE operation. refs #1255
david-sarah@jacaranda.org commented 2010-11-20 07:40:43 +00:00
Author
Owner

In changeset:fdf69466699f0b2b:

test_cli.py: test that 'tahoe mv' reports errors from the DELETE operation. refs #1255
In changeset:fdf69466699f0b2b: ``` test_cli.py: test that 'tahoe mv' reports errors from the DELETE operation. refs #1255 ```
david-sarah@jacaranda.org commented 2010-11-20 07:40:44 +00:00
Author
Owner

In changeset:38a0d3f5fa5a4d60:

tahoe_mv.py: when checking success of the DELETE operation, look at the status code from DELETE rather than from the previous PUT. fixes #1255
In changeset:38a0d3f5fa5a4d60: ``` tahoe_mv.py: when checking success of the DELETE operation, look at the status code from DELETE rather than from the previous PUT. fixes #1255 ```
tahoe-lafs added the
fixed
label 2010-11-20 07:40:44 +00:00
david-sarah@jacaranda.org closed this issue 2010-11-20 07:40:44 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: tahoe-lafs/trac-2024-07-25#1255
No description provided.