Example #1
0
    def test_list(self):
        """Test that images can be listed."""

        # See if we can retrieve the list of images
        images = self.os.images.list()

        # Do we have a list?
        adaptor.assert_not_equal(len(images), 0)

        # Let's see if our test image is in the list
        foundimg = False
        for img in images:
            if img.id == self._image_id:
                adaptor.assert_equal(img.name, self._image_name)
                adaptor.assert_equal(img.status, 'ACTIVE')
                foundimg = True

        # Did we actually find the image we were looking for?
        adaptor.assert_true(foundimg)
Example #2
0
    def test_list(self):
        """Test that flavors can be listed."""

        # See if we can retrieve the list of flavors
        flavors = self.os.flavors.list()

        # Do we have a list?
        adaptor.assert_not_equal(len(flavors), 0)

        # Let's see if some of our base-line flavors are present
        foundflav = 0
        for flav in flavors:
            if flav.name in self.recognized_flavors:
                exemplar = self.recognized_flavors[flav.name]
                adaptor.assert_equal(flav.id, exemplar['id'])
                adaptor.assert_equal(flav.ram, exemplar['ram'])
                adaptor.assert_equal(flav.disk, exemplar['disk'])
                foundflav += 1

        # Make sure we found our flavors
        adaptor.assert_equal(len(self.recognized_flavors), foundflav)