Project

Profile

Help

Test #4216

test_crud_content_unit should test that content units cannot be deleted manually

Added by dalley 11 months ago. Updated 6 months ago.

Status:
CLOSED - COMPLETE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Version:
Platform Release:
Tags:
Plugin Template
Sprint:

Description

The tests that currently exist were based off of Pulp Issue 3418 [0], which said that content units that are present in a repository version should not be able to be deleted.

Shortly after that issue, another issue was created [1] which removed the ability to delete content units at all. After that issue was resolved, the proper (and only) way to do so from outside of a plugin is orphan cleanup.

In the following plugins, the test for 3418 [2] should be removed and replaced with a simpler test for 3445 that ensures that content units cannot be deleted, and that they raise an HTTP 405 "method not allowed" exception.

  • Plugin Template
  • File Plugin
  • Python Plugin
  • RPM Plugin
  • Docker Plugin
  • Ansible Plugin

Tangentially, it would be good to make all tests for unsupported HTTP methods (such as [3]) check for the specific HTTP 405 error code.

[0] https://pulp.plan.io/issues/3418
[1] https://pulp.plan.io/issues/3445
[2] https://github.com/pulp/plugin_template/blob/master/pulp_plugin_template/tests/functional/api/test_crud_content_unit.py#L108-L144
[3] https://github.com/pulp/plugin_template/blob/master/pulp_plugin_template/tests/functional/api/test_crud_content_unit.py#L85-L103


Checklist


Related issues

Related to Pulp - Issue #3445: Remove the ability for users to delete a single content unit. MODIFIED Actions

Associated revisions

Revision 631ffe95 View on GitHub
Added by dalley 11 months ago

Simplify content unit deletion test

For a brief period Pulp would allow you to delete a content unit as long
as it wasn't used by a repository version. That is no longer the case -
content unit deletion should be disallowed in all circumstances. Fix the
tests likewise, and test that the response is HTTP 405 'method not allowed', specifically.

re #4216
https://pulp.plan.io/issues/4216

Revision 4e136cc7 View on GitHub
Added by dalley 11 months ago

Simplify content unit deletion test

For a brief period Pulp would allow you to delete a content unit as long
as it wasn't used by a repository version. That is no longer the case -
content unit deletion should be disallowed in all circumstances. Fix the
tests likewise, and test that the response is HTTP 405 'method not allowed', specifically.

re #4216
https://pulp.plan.io/issues/4216

Revision 4322c927 View on GitHub
Added by dalley 11 months ago

Simplify content unit deletion test

For a brief period Pulp would allow you to delete a content unit as long
as it wasn't used by a repository version. That is no longer the case -
content unit deletion should be disallowed in all circumstances. Fix the
tests likewise, and test that the response is HTTP 405 'method not allowed', specifically.

re #4216
https://pulp.plan.io/issues/4216

Revision 1d84e96a View on GitHub
Added by dalley 11 months ago

Simplify content unit deletion test

For a brief period Pulp would allow you to delete a content unit as long
as it wasn't used by a repository version. That is no longer the case -
content unit deletion should be disallowed in all circumstances. Fix the
tests likewise, and test that the response is HTTP 405 'method not allowed', specifically.

re #4216
https://pulp.plan.io/issues/4216

Revision f592f249 View on GitHub
Added by dalley 11 months ago

Simplify content unit deletion test

For a brief period Pulp would allow you to delete a content unit as long
as it wasn't used by a repository version. That is no longer the case -
content unit deletion should be disallowed in all circumstances. Fix the
tests likewise, and test that the response is HTTP 405 'method not allowed', specifically.

re #4216
https://pulp.plan.io/issues/4216

Revision f592f249 View on GitHub
Added by dalley 11 months ago

Simplify content unit deletion test

For a brief period Pulp would allow you to delete a content unit as long
as it wasn't used by a repository version. That is no longer the case -
content unit deletion should be disallowed in all circumstances. Fix the
tests likewise, and test that the response is HTTP 405 'method not allowed', specifically.

re #4216
https://pulp.plan.io/issues/4216

Revision b712be75 View on GitHub
Added by dalley 10 months ago

Simplify content unit deletion test

For a brief period Pulp would allow you to delete a content unit as long
as it wasn't used by a repository version. That is no longer the case -
content unit deletion should be disallowed in all circumstances. Fix the
tests likewise, and test that the response is HTTP 405 'method not allowed', specifically.

re #4216
https://pulp.plan.io/issues/4216

History

#1 Updated by dalley 11 months ago

  • Related to Issue #3445: Remove the ability for users to delete a single content unit. added

#2 Updated by dalley 11 months ago

  • Checklist item Fix in plugin template added
  • Checklist item Fix in pulp_file added
  • Checklist item Fix in pulp_rpm added
  • Checklist item Fix in pulp_docker added
  • Checklist item Fix in pulp_ansible added
  • Checklist item Fix in pulp_python added

#3 Updated by dalley 11 months ago

  • Checklist item Fix in plugin template set to Done
  • Checklist item Fix in pulp_file set to Done

#4 Updated by dalley 11 months ago

  • Status changed from NEW to POST
  • Assignee set to dalley

#6 Updated by dalley 11 months ago

  • Checklist item Fix in pulp_rpm set to Done

#7 Updated by dalley 11 months ago

  • Checklist item Fix in pulp_python set to Done

#9 Updated by dalley 11 months ago

  • Checklist item Fix in pulp_ansible set to Done

#10 Updated by dalley 11 months ago

  • Checklist item Fix in pulp_docker set to Done

#11 Updated by dalley 11 months ago

  • Status changed from POST to CLOSED - COMPLETE

#12 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3)

#13 Updated by bmbouter 6 months ago

  • Tags Plugin Template added

#14 Updated by bmbouter 6 months ago

  • Project changed from 27 to Pulp

The plugin template Redmine project is being consolidated into the Pulp Redmine project so all issues are being moved over.

#15 Updated by bmbouter 6 months ago

  • Sprint/Milestone set to 3.0

Please register to edit this issue

Also available in: Atom PDF