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 glance functional test for image-conversion config #582

Merged
merged 1 commit into from Jun 1, 2021
Merged

added glance functional test for image-conversion config #582

merged 1 commit into from Jun 1, 2021

Conversation

hernandanielg
Copy link
Contributor

Functional test for image-conversion feature added in https://review.opendev.org/c/openstack/charm-glance/+/792065

Test does:

  • Validates that test runs only on supported versions
  • Enables config image-conversion
  • Wait for unit to settle
  • Creates, stages and imports an image and waits until it's imported
  • Assert that image format is raw

@codecov-commenter
Copy link

codecov-commenter commented May 28, 2021

Codecov Report

Merging #582 (fb41ca7) into master (90a61f6) will decrease coverage by 0.04%.
The diff coverage is 6.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #582      +/-   ##
==========================================
- Coverage   18.13%   18.08%   -0.05%     
==========================================
  Files         163      163              
  Lines       10313    10349      +36     
==========================================
+ Hits         1870     1872       +2     
- Misses       8443     8477      +34     
Impacted Files Coverage Δ
zaza/openstack/charm_tests/glance/tests.py 0.00% <0.00%> (ø)
zaza/openstack/utilities/openstack.py 60.19% <11.11%> (-0.97%) ⬇️
zaza/openstack/charm_tests/trilio/tests.py 0.00% <0.00%> (ø)
...ack/charm_tests/glance_simplestreams_sync/setup.py 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 90a61f6...fb41ca7. Read the comment docs.

Copy link
Contributor

@lourot lourot left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! See my comments

zaza/openstack/charm_tests/glance/tests.py Show resolved Hide resolved
zaza/openstack/utilities/openstack.py Show resolved Hide resolved
def import_image_to_glance(glance, local_path, image_name,
disk_format='qcow2', visibility='public',
container_format='bare'):
"""Creates, stages and import an image.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not an Glance expert: can you explain in the docstring a bit the difference with upload_image_to_glance()? What's the difference between "uploading" and "staging/importing" an image?

logging.info('Downloading {} ...'.format(image_url))
download_image(image_url, local_path)
else:
logging.info('Cached image found at {} - Skipping download'.format(
Copy link
Contributor

Choose a reason for hiding this comment

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

you're duplicating code from create_image(). Can we refactor in order not to duplicate code?

@hernandanielg hernandanielg requested a review from lourot May 30, 2021 17:36
@lourot
Copy link
Contributor

lourot commented Jun 1, 2021

This needs to be merged at the same time as https://review.opendev.org/c/openstack/charm-glance/+/792065 , when ready

@lourot lourot merged commit 2dd5b96 into openstack-charmers:master Jun 1, 2021
openstack-mirroring pushed a commit to openstack/charm-glance that referenced this pull request Jun 1, 2021
image-convertion config enables image convertion to raw format
this optimizes back-end capabilities while not putting the burden
of converting images to their end users

func-test-pr: openstack-charmers/zaza-openstack-tests#582
Closes-Bug: 1899767
Change-Id: Id3791721f9e38899c87b88591cdc42e46ffea5c1
openstack-mirroring pushed a commit to openstack/openstack that referenced this pull request Jun 1, 2021
* Update charm-glance from branch 'master'
  to 4aaa2ce5a34679a753e261f90f16c7e5bc0c05f9
  - add config to enable convertion to raw format
    
    image-convertion config enables image convertion to raw format
    this optimizes back-end capabilities while not putting the burden
    of converting images to their end users
    
    func-test-pr: openstack-charmers/zaza-openstack-tests#582
    Closes-Bug: 1899767
    Change-Id: Id3791721f9e38899c87b88591cdc42e46ffea5c1
@hernandanielg hernandanielg deleted the test-image-conversion-config branch June 1, 2021 23:27
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

3 participants