pulp / Pulp-2-Tests

:warning: ⛔️ Pulp2 is EOL as of November 30 2022, for more info visit this link https://pulpproject.org/2022/09/19/pulp-2-eol/. ⛔️ Functional tests for Pulp 2.
https://pulp-2-tests.readthedocs.io/
1 stars 11 forks source link

Test for duplicated file copy in PULP_MANIFEST on updated iso copy #204

Closed bherrin3 closed 5 years ago

bherrin3 commented 5 years ago

Problem

ISO repo copy can lead to a duplicates in a target repo and corrupted manifest.

Test

Note

The actual parsing of the PULP_MANIFEST was not added to this test. I researched it and didn't see the value to the complexity.

If the updated ISO was copied the second time and the repo only contained 1 ISO, the logic for the fix appears to be covered.

If not, parsing the PULP_MANIFEST using parse_pulp_manifest as well as refactoring that function to a util can be completed.

Test Logic

Upload an ISO into a source iso-repo and copy the ISO to the target. Update the ISO on the source to have different content and copy the updated ISO to the target iso-repo.

Verify that the target repo only has one entry for the ISO in the PULP_MANIFEST

Command Line Test

count=1; while [ $count -le 10 ]; do echo -e "Iteration: $count\n"; time pytest -svvv  --disable-warnings pulp_2_tests/tests/rpm/api_v2/test_duplicate_uploads.py::DuplicateUploadAndCopyTestCase --disable-warnings; ((count++)); done

References

See https://pulp.plan.io/issues/4943