def test_glance_diskformat(self): glance.glance_delete_all(utils.test_name(), quiet=True) ret = glance.glance_import(os.devnull, name=utils.test_name(), diskformat='notgood') self.assertFalse(ret) ret = glance.glance_import(os.devnull, name=utils.test_name()) self.assertFalse(ret) glance.glance_delete_all(utils.test_name(), quiet=True)
def test_glance_ids_uuid(self): glance.glance_delete_all(utils.test_name(), quiet=True) ret = glance.glance_import(os.devnull, name=utils.test_name(), diskformat='raw') self.assertTrue(ret) img_uuids_name = list(glance.glance_ids(utils.test_name())) self.assertEqual(len(img_uuids_name), 1) img_uuid = img_uuids_name[0] img_uuids_uuid = list(glance.glance_ids(img_uuid)) self.assertEqual(img_uuids_uuid, img_uuids_name) glance.glance_delete_all(utils.test_name(), quiet=True)
def test_glance_delete_all(self): self.common_start() self.assertTrue(glance.glance_import(os.devnull, name=self._IMG_NAME, diskformat='raw')) self.assertTrue(glance.glance_import(os.devnull, name=self._IMG_NAME, diskformat='raw')) self.assertTrue(glance.glance_exists(self._IMG_NAME)) self.assertTrue(glance.glance_delete_all(self._IMG_NAME)) self.assertFalse(glance.glance_exists(self._IMG_NAME))
def test_glance_delete_all(self): self.common_start() self.assertTrue( glance.glance_import(os.devnull, name=self._IMG_NAME, diskformat='raw')) self.assertTrue( glance.glance_import(os.devnull, name=self._IMG_NAME, diskformat='raw')) self.assertTrue(glance.glance_exists(self._IMG_NAME)) self.assertTrue(glance.glance_delete_all(self._IMG_NAME)) self.assertFalse(glance.glance_exists(self._IMG_NAME))
def setUp(self): if self._IMG_ID: glance.glance_delete_all(self._IMG_ID, quiet=True) if self._IMG_NAME: glance.glance_delete_all(self._IMG_NAME, quiet=True)