Add additional locations to the gc tests
This commit is contained in:
parent
178c5a7ac0
commit
6e47ec2ef1
2 changed files with 12 additions and 1 deletions
|
@ -34,6 +34,17 @@ class TestGarbageColection(unittest.TestCase):
|
||||||
for i in range(0, 2):
|
for i in range(0, 2):
|
||||||
model.find_or_create_derived_storage(image.storage, 'squash', preferred)
|
model.find_or_create_derived_storage(image.storage, 'squash', preferred)
|
||||||
|
|
||||||
|
# Add some additional placements to the image.
|
||||||
|
for location_name in ['local_eu']:
|
||||||
|
location = database.ImageStorageLocation.get(name=location_name)
|
||||||
|
|
||||||
|
try:
|
||||||
|
database.ImageStoragePlacement.get(location=location, storage=image.storage)
|
||||||
|
except:
|
||||||
|
continue
|
||||||
|
|
||||||
|
database.ImageStoragePlacement.create(location=location, storage=image.storage)
|
||||||
|
|
||||||
return image.storage
|
return image.storage
|
||||||
|
|
||||||
def createRepository(self, namespace=ADMIN_ACCESS_USER, name=REPO, **kwargs):
|
def createRepository(self, namespace=ADMIN_ACCESS_USER, name=REPO, **kwargs):
|
||||||
|
|
|
@ -28,7 +28,7 @@ class TestConfig(DefaultConfig):
|
||||||
|
|
||||||
DB_TRANSACTION_FACTORY = create_transaction
|
DB_TRANSACTION_FACTORY = create_transaction
|
||||||
|
|
||||||
DISTRIBUTED_STORAGE_CONFIG = {'local_us': ['FakeStorage', {}]}
|
DISTRIBUTED_STORAGE_CONFIG = {'local_us': ['FakeStorage', {}], 'local_eu': ['FakeStorage', {}]}
|
||||||
DISTRIBUTED_STORAGE_PREFERENCE = ['local_us']
|
DISTRIBUTED_STORAGE_PREFERENCE = ['local_us']
|
||||||
|
|
||||||
BUILDLOGS_MODULE_AND_CLASS = ('test.testlogs', 'testlogs.TestBuildLogs')
|
BUILDLOGS_MODULE_AND_CLASS = ('test.testlogs', 'testlogs.TestBuildLogs')
|
||||||
|
|
Reference in a new issue