Merge "Fix base unit test class location"
diff --git a/README.rst b/README.rst
index 7da83cd..650a1ed 100644
--- a/README.rst
+++ b/README.rst
@@ -58,7 +58,7 @@
 #. You first need to install Tempest. This is done with pip after you check out
    the Tempest repo::
 
-    $ git clone https://github.com/openstack/tempest/
+    $ git clone http://git.openstack.org/openstack/tempest
     $ pip install tempest/
 
    This can be done within a venv, but the assumption for this guide is that
@@ -71,14 +71,14 @@
    it's recommended that you copy or rename tempest.conf.sample to tempest.conf
    and make those changes to that file in /etc/tempest
 
-#. Setup a local working Tempest dir. This is done using the tempest init
+#. Setup a local working Tempest dir. This is done by using the tempest init
    command::
 
-    tempest init cloud-01
+    $ tempest init cloud-01
 
    works the same as::
 
-    mkdir cloud-01 && cd cloud-01 && tempest init
+    $ mkdir cloud-01 && cd cloud-01 && tempest init
 
    This will create a new directory for running a single Tempest configuration.
    If you'd like to run Tempest against multiple OpenStack deployments the idea
diff --git a/tempest/api/compute/admin/test_migrations.py b/tempest/api/compute/admin/test_migrations.py
index f81d665..6113c04 100644
--- a/tempest/api/compute/admin/test_migrations.py
+++ b/tempest/api/compute/admin/test_migrations.py
@@ -15,8 +15,10 @@
 import testtools
 
 from tempest.api.compute import base
+from tempest.common.utils import data_utils
 from tempest.common import waiters
 from tempest import config
+from tempest.lib import exceptions
 from tempest import test
 
 CONF = config.CONF
@@ -28,6 +30,7 @@
     def setup_clients(cls):
         super(MigrationsAdminTest, cls).setup_clients()
         cls.client = cls.os_adm.migrations_client
+        cls.flavors_admin_client = cls.os_adm.flavors_client
 
     @test.idempotent_id('75c0b83d-72a0-4cf8-a153-631e83e7d53f')
     def test_list_migrations(self):
@@ -53,3 +56,50 @@
 
         instance_uuids = [x['instance_uuid'] for x in body]
         self.assertIn(server_id, instance_uuids)
+
+    def _flavor_clean_up(self, flavor_id):
+        try:
+            self.flavors_admin_client.delete_flavor(flavor_id)
+            self.flavors_admin_client.wait_for_resource_deletion(flavor_id)
+        except exceptions.NotFound:
+            pass
+
+    @test.idempotent_id('33f1fec3-ba18-4470-8e4e-1d888e7c3593')
+    @testtools.skipUnless(CONF.compute_feature_enabled.resize,
+                          'Resize not available.')
+    def test_resize_server_revert_deleted_flavor(self):
+        # Tests that we can revert the resize on an instance whose original
+        # flavor has been deleted.
+
+        # First we have to create a flavor that we can delete so make a copy
+        # of the normal flavor from which we'd create a server.
+        flavor = self.flavors_admin_client.show_flavor(
+            self.flavor_ref)['flavor']
+        flavor = self.flavors_admin_client.create_flavor(
+            name=data_utils.rand_name('test_resize_flavor_'),
+            ram=flavor['ram'],
+            disk=flavor['disk'],
+            vcpus=flavor['vcpus']
+        )['flavor']
+        self.addCleanup(self._flavor_clean_up, flavor['id'])
+
+        # Now boot a server with the copied flavor.
+        server = self.create_test_server(
+            wait_until='ACTIVE', flavor=flavor['id'])
+
+        # Delete the flavor we used to boot the instance.
+        self._flavor_clean_up(flavor['id'])
+
+        # Now resize the server and wait for it to go into verify state.
+        self.servers_client.resize_server(server['id'], self.flavor_ref_alt)
+        waiters.wait_for_server_status(self.servers_client, server['id'],
+                                       'VERIFY_RESIZE')
+
+        # Now revert the resize, it should be OK even though the original
+        # flavor used to boot the server was deleted.
+        self.servers_client.revert_resize_server(server['id'])
+        waiters.wait_for_server_status(self.servers_client, server['id'],
+                                       'ACTIVE')
+
+        server = self.servers_client.show_server(server['id'])['server']
+        self.assertEqual(flavor['id'], server['flavor']['id'])
diff --git a/tempest/common/credentials_factory.py b/tempest/common/credentials_factory.py
index 58157ef..3923aec 100644
--- a/tempest/common/credentials_factory.py
+++ b/tempest/common/credentials_factory.py
@@ -133,7 +133,7 @@
     def get_creds_by_roles(self, roles, force_new=False):
         msg = "Credentials being specified through the config file can not be"\
               " used with tests that specify using credentials by roles. "\
-              "Either exclude/skip the tests doing this or use either an "\
+              "Either exclude/skip the tests doing this or use either a "\
               "test_accounts_file or dynamic credentials."
         raise exceptions.InvalidConfiguration(msg)
 
diff --git a/tempest/config.py b/tempest/config.py
index b787b19..0292462 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -91,7 +91,7 @@
                     "create users and projects",
                deprecated_group='identity'),
     cfg.StrOpt('admin_project_name',
-               help="Project name to use for an  administrative user. This is "
+               help="Project name to use for an administrative user. This is "
                     "needed for authenticating requests made by project "
                     "isolation to create users and projects",
                deprecated_opts=[cfg.DeprecatedOpt('admin_tenant_name',
@@ -99,7 +99,7 @@
                                 cfg.DeprecatedOpt('admin_tenant_name',
                                                   group='identity')]),
     cfg.StrOpt('admin_password',
-               help="Password to use for an  administrative user. This is "
+               help="Password to use for an administrative user. This is "
                     "needed for authenticating requests made by project "
                     "isolation to create users and projects",
                secret=True,