Example #1
0
    def test_load_new_drivers(self):
        for cls, driver in self.new_drivers.iteritems():
            self.flags(compute_driver=cls)
            # NOTE(sdague) the try block is to make it easier to debug a
            # failure by knowing which driver broke
            try:
                cm = ComputeManager()
            except Exception as e:
                self.fail("Couldn't load driver %s - %s" % (cls, e))

            self.assertEqual(cm.driver.__class__.__name__, driver,
                             "Could't load driver %s" % cls)
Example #2
0
    def test_load_old_drivers(self):
        # we explicitly use the old default
        self.flags(compute_driver='nova.virt.connection.get_connection')
        for cls, driver in self.old_drivers.iteritems():
            self.flags(connection_type=cls)
            # NOTE(sdague) the try block is to make it easier to debug a
            # failure by knowing which driver broke
            try:
                cm = ComputeManager()
            except Exception as e:
                self.fail("Couldn't load connection %s - %s" % (cls, e))

            self.assertEqual(cm.driver.__class__.__name__, driver,
                             "Could't load connection %s" % cls)