summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorMark Washenberger <mark.washenberger@rackspace.com>2011-03-21 17:10:34 -0400
committerMark Washenberger <mark.washenberger@rackspace.com>2011-03-21 17:10:34 -0400
commitd3b8df422e58a5489c4e4462f372a6b06b2a08c9 (patch)
tree07808dbdbfe8dcd4653b5c0b4f8b7bfdd1422847 /nova/tests
parent39783f386a473ed28c786bb72a29e8403503c40c (diff)
parentd3242b17036a78c66959918b5db0d77ee8b720bf (diff)
merge lp:nova
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/api/openstack/test_images.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/nova/tests/api/openstack/test_images.py b/nova/tests/api/openstack/test_images.py
index a866c764d..feb32ed9f 100644
--- a/nova/tests/api/openstack/test_images.py
+++ b/nova/tests/api/openstack/test_images.py
@@ -22,6 +22,7 @@ and as a WSGI layer
import json
import datetime
+import os
import shutil
import tempfile
@@ -151,6 +152,17 @@ class LocalImageServiceTest(test.TestCase,
self.stubs.UnsetAll()
super(LocalImageServiceTest, self).tearDown()
+ def test_get_all_ids_with_incorrect_directory_formats(self):
+ # create some old-style image directories (starting with 'ami-')
+ for x in [1, 2, 3]:
+ tempfile.mkstemp(prefix='ami-', dir=self.tempdir)
+ # create some valid image directories names
+ for x in ["1485baed", "1a60f0ee", "3123a73d"]:
+ os.makedirs(os.path.join(self.tempdir, x))
+ found_image_ids = self.service._ids()
+ self.assertEqual(True, isinstance(found_image_ids, list))
+ self.assertEqual(3, len(found_image_ids), len(found_image_ids))
+
class GlanceImageServiceTest(test.TestCase,
BaseImageServiceTests):