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

added in tests for bad checksums on ubuntu images, and added in some … #1481

Merged

Conversation

noahgildersleeve
Copy link
Contributor

…pydoc docs in the images and volumes sections

added in opensuse checksum and added associated config data

fixed pep8 errors

Which issue(s) this PR fixes:

Issue #1121

What this PR does / why we need it:

This adds image checksum testing to the automation

Special notes for your reviewer:

I added in some docs on other tests in the images and volumes scenarios. Also this will allow command line adding of the checksum for the images. This will also work if you just remove the text in the checksum and leave it blank, and the negative test case will still run correctly as well.

Additional documentation or context

I checked that the other tests weren't being affected and I don't think any of them should be.

@noahgildersleeve noahgildersleeve requested a review from a team August 27, 2024 18:07
Copy link
Collaborator

@khushboo-rancher khushboo-rancher left a comment

Choose a reason for hiding this comment

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

In general, LGTM. Couple of minor comments.

Can we edit the image created with bad checksum and provide the right one? If so, can we have that test to ensure volume can be crated with edited image. (Need not be in the same PR, you can create a separate ticket too. Either ways will work)

Have you run the impacted test cases to ensure they are running fine with the changes?

config.yml Outdated Show resolved Hide resolved
config.yml Outdated Show resolved Hide resolved
harvester_e2e_tests/fixtures/images.py Outdated Show resolved Hide resolved
harvester_e2e_tests/integrations/test_1_volumes.py Outdated Show resolved Hide resolved
harvester_e2e_tests/integrations/test_1_volumes.py Outdated Show resolved Hide resolved
Copy link
Member

@lanfon72 lanfon72 left a comment

Choose a reason for hiding this comment

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

Please help to check the new field checksum is backward compatible or not, if old Harvester version will not support the field spec.checksum, we would need create another ImageManager to prevent break the API.

harvester_e2e_tests/fixtures/api_client.py Show resolved Hide resolved
harvester_e2e_tests/integrations/test_1_volumes.py Outdated Show resolved Hide resolved
harvester_e2e_tests/integrations/test_1_volumes.py Outdated Show resolved Hide resolved
apiclient/harvester_api/managers/images.py Outdated Show resolved Hide resolved
harvester_e2e_tests/fixtures/images.py Outdated Show resolved Hide resolved
apiclient/harvester_api/managers/images.py Outdated Show resolved Hide resolved
apiclient/harvester_api/managers/images.py Outdated Show resolved Hide resolved
harvester_e2e_tests/integrations/test_1_volumes.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@khushboo-rancher khushboo-rancher left a comment

Choose a reason for hiding this comment

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

LGTM

…pydoc docs in the images and volumes sections

added in opensuse checksum and added associated config data

fixed pep8 errors

made some requested changes from PR review

PR review changes

removed old status check

fixed an improper assertion, added a default for image_checksum, and added a setter for opensuse_checksum

changed assertion message to be more clear

changed checksum default type

removed default checksums from default

fixed some pep8 errors

fixed some errors and made some adjustments based on PR review comments

added default value for image_checksum
Copy link
Member

@lanfon72 lanfon72 left a comment

Choose a reason for hiding this comment

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

In general LGTM,

IMO, refactor should be done in another PR, when adding new test case, we should not do any refactor.
and I saw that we add fixture ubuntu_checksum and opensuse_checksum but they will not be used in anywhere, if it is not used, we should not add them.

Copy link
Contributor

@albinsun albinsun left a comment

Choose a reason for hiding this comment

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

LGTM

@khushboo-rancher khushboo-rancher merged commit f347d44 into harvester:main Oct 11, 2024
4 checks passed
@noahgildersleeve noahgildersleeve deleted the image-url-checksum branch October 14, 2024 17:58
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.

4 participants