Revision 4d72f9ab snf-tools/synnefo_tools/burnin.py
b/snf-tools/synnefo_tools/burnin.py | ||
---|---|---|
235 | 235 |
cls.temp_image_name = \ |
236 | 236 |
SNF_TEST_PREFIX + cls.imageid + ".diskdump" |
237 | 237 |
|
238 |
@classmethod |
|
239 |
def tearDownClass(cls): |
|
240 |
"""Remove local files""" |
|
241 |
try: |
|
242 |
temp_file = os.path.join(cls.temp_dir, cls.temp_image_name) |
|
243 |
os.unlink(temp_file) |
|
244 |
except: |
|
245 |
pass |
|
246 |
try: |
|
247 |
os.rmdir(cls.temp_dir) |
|
248 |
except: |
|
249 |
pass |
|
250 |
|
|
238 | 251 |
def test_001_list_images(self): |
239 | 252 |
"""Test image list actually returns images""" |
240 | 253 |
self.assertGreater(len(self.images), 0) |
... | ... | |
295 | 308 |
properties = {'OSFAMILY': "linux", 'ROOT_PARTITION': 1} |
296 | 309 |
self.plankton.register(self.temp_image_name, location, |
297 | 310 |
params, properties) |
311 |
# Get image id |
|
312 |
details = self.plankton.list_public(detail=True) |
|
313 |
detail = filter( |
|
314 |
lambda x: x['owner'] == PITHOS_USER and |
|
315 |
x['name'] == self.temp_image_name, |
|
316 |
details) |
|
317 |
self.assertEqual(len(detail), 1) |
|
318 |
cls = type(self) |
|
319 |
cls.temp_image_id = detail[0]['id'] |
|
320 |
log.info("Image registered with id %s" % detail[0]['id']) |
|
321 |
|
|
322 |
def test_008_cleanup_image(self): |
|
323 |
"""Cleanup image test""" |
|
324 |
log.info("Cleanup image test") |
|
325 |
# Remove image from pithos+ |
|
326 |
pithos_client = PithosClient(PITHOS, TOKEN, PITHOS_USER) |
|
327 |
pithos_client.container = "images" |
|
328 |
pithos_client.del_object(self.temp_image_name) |
|
298 | 329 |
|
299 | 330 |
|
300 | 331 |
# -------------------------------------------------------------------- |
... | ... | |
2109 | 2140 |
'network_spawn': NetworkTestCase} |
2110 | 2141 |
seq_cases = [] |
2111 | 2142 |
if 'all' in opts.tests: |
2112 |
seq_cases = [UnauthorizedTestCase, ImagesTestCase, |
|
2143 |
seq_cases = [UnauthorizedTestCase, CImagesTestCase,
|
|
2113 | 2144 |
FlavorsTestCase, ServersTestCase, |
2114 | 2145 |
PithosTestCase, ServerTestCase, |
2115 | 2146 |
NetworkTestCase] |
Also available in: Unified diff