Skip to content

scs-0128: remove ListUserImagesTest due to Glance format enforcement - #1300

Open
shresth-kumar-lal wants to merge 3 commits into
SovereignCloudStack:mainfrom
shresth-kumar-lal:fix-1299-glance-format-enforcement
Open

shresth-kumar-lal wants to merge 3 commits into
SovereignCloudStack:mainfrom
shresth-kumar-lal:fix-1299-glance-format-enforcement

Conversation

@shresth-kumar-lal

Copy link
Copy Markdown

Description

Glance now enforces image format validation by default to mitigate security vulnerabilities (OSSA-2024-001). Under strict format validation, Tempest tests under ListUserImagesTest fail because bogus/synthetic test payloads uploaded during test setup are rejected by Glance.

Following the discussion in #1299, these tests are incompatible with upstream Glance security defaults and should be removed from the non-admin test suite.

Changes

  • Removed tempest.api.image.v2.test_images.ListUserImagesTest.* from Tests/iaas/scs_0128_e2e_testing/tempest-tests-non-admin.lst.

Fixes #1299.

OpenStack Glance enables image format enforcement by default following
OSSA-2024-001. Under format enforcement, Tempest's ListUserImagesTest
fails because dummy/synthetic image data uploaded during test setup is
rejected by Glance.

Remove these tests from tempest-tests-non-admin.lst to prevent false
failures against compliant Glance deployments.

Fixes SovereignCloudStack#1299

Signed-off-by: Shresth Kumar Lal <shresthkumarlal@gmail.com>
- Implement compute_scs_0104_custom_image_upload validating Glance image
  upload mandated by SCS-0104 with a valid minimal raw payload.
- Validate image schemas (get_images_schema, get_image_schema), image details,
  and parameter filtering (visibility, status, disk/container format, limit)
  to retain baseline SCS-0128 test coverage.
- Add cleanup_images to Janitor in cleanup.py to ensure test images prefixed
  with '_scs-' are safely removed.
- Register scs_0104_custom_image_upload in openstack_test.py.

Signed-off-by: Shresth Kumar Lal <shresthkumarlal@gmail.com>
@shresth-kumar-lal

Copy link
Copy Markdown
Author

Per @toothstone's feedback on #1299, I have added a companion commit to this PR:

  • Native Image Upload Testing (scs-0104): Implements compute_scs_0104_custom_image_upload in Tests/iaas/scs_0104_standard_images/standard_images.py using a minimal valid raw payload that complies with Glance image format enforcement (OSSA-2024-001).
  • Baseline Coverage Retention (scs-0128): Validates image schemas (get_images_schema, get_image_schema), image detail retrieval, pagination, and listing filters (visibility, status, disk_format, container_format), recovering the full functional test assertions from the removed Tempest cases.
  • Teardown & Janitor Safety: Adds cleanup_images to Janitor in Tests/iaas/cleanup.py (scoped strictly to private images matching prefix _scs-) and registers the test in openstack_test.py.

@depressiveRobot depressiveRobot added the IaaS Issues or pull requests relevant for Team1: IaaS label Nov 10, 2026
@mbuechse

Copy link
Copy Markdown
Contributor

Hi @shresth-kumar-lal, thanks for this contribution! I had a quick look, and at first glance, it looks very good! This change here supplies the new testcase, but it doesn't incorporate the new testcase into the overall tests.

I think I shall check whether all current partners pass this test, and then we (meaning us SCS folks, including you if you like!) can talk in the SIG Std/Cert on November 26th, 2026 whether and how best to include this new testcase.

Thanks again! 🚀


image_id = test_image.id
logger.info(f"Uploading image payload for ID: {image_id}...")
conn.image.set_image_data(image_id, payload)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm afraid I'm getting an error message here:

ERROR: Error during SCS-0104 custom image upload test: 'Proxy' object has no attribute 'set_image_data'
Traceback (most recent call last):
  File "/home/mbue/opensrc/standards-shresth-kumar-lal/Tests/iaas/scs_0104_standard_images/standard_images.py", line 201, in compute_scs_0104_custom_image_upload
    conn.image.set_image_data(image_id, payload)
    ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Proxy' object has no attribute 'set_image_data'. Did you mean: 'get_image_cache'?

Replace non-existent conn.image.set_image_data() call with openstacksdk's
native conn.image.create_image(..., data=io.BytesIO(payload), wait=True).

Signed-off-by: Shresth Kumar Lal <shresthkumarlal@gmail.com>
@shresth-kumar-lal

Copy link
Copy Markdown
Author

Thanks for catching that @mbuechse! I've pushed a fix replacing conn.image.set_image_data() with conn.image.create_image(..., data=io.BytesIO(payload), wait=True) so openstacksdk handles the binary upload stream natively.

Looking forward to the partner test results and discussing inclusion at the SIG Std/Cert meeting on Nov 26!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

IaaS Issues or pull requests relevant for Team1: IaaS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

glance image_format_enforcement breaks test - bogus image data not allowed

3 participants