Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for CRD artifacts. #885

Merged
merged 1 commit into from Mar 1, 2018
Merged

Conversation

nixocio
Copy link

@nixocio nixocio commented Feb 27, 2018

As of this writing, pulp3 does not handle upload of duplicate files.
Due that, there is a need to clean the artifacts present in pulp3, before
attempt to upload a new file to pulp3.
However, if a file exists as content unit and as artifact, the file has
to be deleted first as a content unit then as an artifact.
To solve this issue, 2 new functions were added to pulp3/utils.

  • clean_content_units()
  • clean_artifacts()

Add tests to CRD artifacts.

  1. Create an artifact by uploading a file to pulp3.
  2. Reads an artifact by its href.
  3. Delete an artifact.

Closes: #726

@nixocio
Copy link
Author

nixocio commented Feb 27, 2018

Tested against F27, with the following versions of Pulp3 packages.

pulp-file==0.0.1a15
pulpcore==3.0.0a23
pulpcore-common==3.0.0a14
pulpcore-plugin==0.0.1a18

# To avoid duplicates in pulp. This function call may be removed after
# pulp3 is able to handle duplicates, and how to delete artifacts that
# are content units as well.
clean_artifacts()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass self.cfg.

"""
if cfg is None:
cfg = config.get_config()
clean_content_units()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass cfg.

@nixocio nixocio force-pushed the p3_test_issue_726 branch 3 times, most recently from 1b94c2c to 2218e5c Compare February 28, 2018 14:27
@Ichimonji10
Copy link
Contributor

Please rebase onto master and resolve the merge conflicts.

As of this writing, pulp3 does not handle upload of duplicate files.
Due that, there is a need to clean the artifacts present in pulp3, before
attempt to upload a new file to pulp3.
However, if a file exists as content unit and as artifact, the file has
to be deleted first as a content unit then as an artifact.
To solve this issue, 2 new functions were added to pulp3/utils.

- `clean_content_units()`
- `clean_artifacts()`

Add tests to CRD artifacts.

1. Create an artifact by uploading a file to pulp3.
2. Reads an artifact by its href.
3. Delete an artifact.

Closes: pulp#726
@Ichimonji10 Ichimonji10 merged commit e8f0fda into pulp:master Mar 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants