Add additional locations to the gc tests

This commit is contained in:
Joseph Schorr 2014-11-13 13:20:21 -05:00
parent 178c5a7ac0
commit 6e47ec2ef1
2 changed files with 12 additions and 1 deletions

View file

@ -34,6 +34,17 @@ class TestGarbageColection(unittest.TestCase):
for i in range(0, 2):
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
def createRepository(self, namespace=ADMIN_ACCESS_USER, name=REPO, **kwargs):

View file

@ -28,7 +28,7 @@ class TestConfig(DefaultConfig):
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']
BUILDLOGS_MODULE_AND_CLASS = ('test.testlogs', 'testlogs.TestBuildLogs')