Commit Graph

8 Commits

Author SHA1 Message Date
Stephen Finucane 9679ffc463 Remove six.moves.http_client usage
This is a rather beefy change due to the number of usages of this
import. The changes are trivial though.

Change-Id: I7badeeaca438b0291f4ed86670e7f217e6372c61
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-01-27 14:54:05 +00:00
Stephen Finucane 6bd7c188ee Remove six.text_type, six.binary_type usage
Change-Id: I2ed464202f8b645aed11490e111c61d3c7423c11
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-01-27 14:54:00 +00:00
Dan Smith c290c4af5a Make image stage set image.size
When we stage an image, we know the image size, so we should set it.
Since the user may be streaming an image and did not declare the
expected size, this lets them confirm before they import. It also
provides us a value to count for the staging quota coming in a later
patch.

The bulk of this change is adjusting existing tests to validate the
size for all of our stage/import tests.

This follows the change to set the image size during conversion,
ensuring that we can set it during stage for non-conversion jobs,
and that the conversion code that re-sets it after changing the
image data and size continues to work.

Related to blueprint glance-unified-quotas

Change-Id: I93a9145df27594a0cc59828619a7d0573e58d4fc
2021-06-21 07:19:01 -07:00
Dan Smith 80b84d4e97 Fix erroneous exit from copy wait loop
The wait_for_copying() helper will exit the loop if the *last*
store is found in the list, instead of *all* of them. This technically
works if the stores are processed in the same order we are checking,
but it's fragile and likely to fail in confusing ways.

This makes us only exit if all of them are present.

Change-Id: I8d9ba50f46e22b6740fdbdec6f8ef7c61dddbcf1
2021-03-08 13:30:34 -08:00
Dan Smith 6c96319eeb Poll for final state on test_copy_image_revert_lifecycle()
This test currently simulates failure by pre-deleting the store
directory for 'file3' which is the second of a two-store import
operation. The goal is to assert that the later failure reverts
the import of the earlier 'file2' store. However, the way the
polling loop works is that we break out once 'file2' has completed,
and then assume that 'file3' has already failed and reverted.
This is a race, and one we're losing consistently in CI.

This patch waits for the failure of 'file3' to be reported, as
well as the revert of 'file2' to occur before exiting the polling
loop and checking the final state of things to ensure that the
revert has actually happened. This addresses the non-determinism
inherent in the original test.

Change-Id: I11c7edaefc96236d2757acfb70d9c338c0f51348
2020-08-18 16:57:25 +00:00
Abhishek Kekane 1754c9e2b0 Copy existing image in multiple stores
Added new import method 'copy-image' which will copy existing image into
specified list of stores. Introduced additional task which will serve
as internal plugin which will allow copying existing image into staging
area and then this data will be uploaded to specified stores via regula
import flow.

NOTE: This new import method 'copy-image' is only supported if multiple
stores are enabled in deployment.

APIImpact
Implements: blueprint copy-existing-image
Change-Id: I13eaab7ab013f44ce18465bdbdbe8052942570ff
2020-02-12 05:32:46 +00:00
Brian Rosmaita 432b9f6c24 Add multihash checks to functional tests
Refactor the image functional tests to pull common code into a
utility function and add multihash checks to those functional tests
that are only checking that the legacy checksum is set correctly.

Change-Id: If4e2dbb6db2bee0b8d8e307ce2f7f7bd15cddea8
2018-08-14 21:01:22 -04:00
Brian Rosmaita b2179479db Add time-bounded wait-for-status to func tests
Replace strategy of time.sleep(s_value) waiting for an image to
reach 'active' with a time-bounded wait-for-status loop function.
That way we can have a more generous s_value, which seems to
sometimes be needed in the gates, without having to use that much
time on every run.

I picked the initial s_value as 4x what was in the current code,
though given that some of the other gate tests run >1 hour, we could
easily make it 600 sec without lengthening the current minimum
time-to-verification of a patch.

Closes-bug: #1767142
Change-Id: Ib771079348d22212c7b6d90fa89e7fd4161422d3
2018-05-03 15:28:01 +00:00