diff --git a/tempest/README.rst b/tempest/README.rst
index 892b0f8..8f07a07 100644
--- a/tempest/README.rst
+++ b/tempest/README.rst
@@ -12,13 +12,13 @@
 and guidelines. Below is the proposed Havana restructuring for Tempest
 to make this clear.
 
-tempest/
-   api/ - API tests
-   cli/ - CLI tests
-   scenario/ - complex scenario tests
-   stress/ - stress tests
-   thirdparty/ - 3rd party api tests
-   whitebox/ - white box testing
+| tempest/
+|    api/ - API tests
+|    cli/ - CLI tests
+|    scenario/ - complex scenario tests
+|    stress/ - stress tests
+|    thirdparty/ - 3rd party api tests
+|    whitebox/ - white box testing
 
 Each of these directories contains different types of tests. What
 belongs in each directory, the rules and examples for good tests, are
diff --git a/tempest/api/compute/images/test_images.py b/tempest/api/compute/images/test_images.py
index 1ef30d4..a74bb68 100644
--- a/tempest/api/compute/images/test_images.py
+++ b/tempest/api/compute/images/test_images.py
@@ -15,8 +15,6 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import testtools
-
 from tempest.api import compute
 from tempest.api.compute import base
 from tempest import clients
@@ -100,11 +98,10 @@
         self.assertRaises(exceptions.Duplicate, self.client.create_image,
                           server['id'], snapshot_name)
 
-    @testtools.skip("Until Bug #1039739 is fixed")
     @attr(type=['negative', 'gate'])
     def test_create_image_when_server_is_rebooting(self):
         # Return error when creating an image of server that is rebooting
-        resp, server = self.create_server()
+        resp, server = self.create_server(wait_until='ACTIVE')
         self.servers_client.reboot(server['id'], 'HARD')
 
         snapshot_name = rand_name('test-snap-')
diff --git a/tempest/api/network/base.py b/tempest/api/network/base.py
index e0e40cb..8068284 100644
--- a/tempest/api/network/base.py
+++ b/tempest/api/network/base.py
@@ -73,6 +73,7 @@
         cidr = netaddr.IPNetwork(cls.network_cfg.tenant_network_cidr)
         mask_bits = cls.network_cfg.tenant_network_mask_bits
         # Find a cidr that is not in use yet and create a subnet with it
+        failure = None
         for subnet_cidr in cidr.subnet(mask_bits):
             try:
                 resp, body = cls.client.create_subnet(network['id'],
@@ -82,6 +83,12 @@
                 is_overlapping_cidr = 'overlaps with another subnet' in str(e)
                 if not is_overlapping_cidr:
                     raise
+                # save the failure in case all of the CIDRs are overlapping
+                failure = e
+
+        if not body and failure:
+            raise failure
+
         subnet = body['subnet']
         cls.subnets.append(subnet)
         return subnet
diff --git a/tempest/api/volume/base.py b/tempest/api/volume/base.py
index 2839da4..fc510cb 100644
--- a/tempest/api/volume/base.py
+++ b/tempest/api/volume/base.py
@@ -128,9 +128,9 @@
         resp, snapshot = cls.snapshots_client.create_snapshot(volume_id,
                                                               **kwargs)
         assert 200 == resp.status
+        cls.snapshots.append(snapshot)
         cls.snapshots_client.wait_for_snapshot_status(snapshot['id'],
                                                       'available')
-        cls.snapshots.append(snapshot)
         return snapshot
 
     #NOTE(afazekas): these create_* and clean_* could be defined
@@ -141,8 +141,8 @@
         """Wrapper utility that returns a test volume."""
         resp, volume = cls.volumes_client.create_volume(size, **kwargs)
         assert 200 == resp.status
-        cls.volumes_client.wait_for_volume_status(volume['id'], 'available')
         cls.volumes.append(volume)
+        cls.volumes_client.wait_for_volume_status(volume['id'], 'available')
         return volume
 
     @classmethod
diff --git a/tempest/api/volume/test_volumes_get.py b/tempest/api/volume/test_volumes_get.py
index 68ab745..eda7153 100644
--- a/tempest/api/volume/test_volumes_get.py
+++ b/tempest/api/volume/test_volumes_get.py
@@ -21,7 +21,6 @@
 
 
 class VolumesGetTest(base.BaseVolumeTest):
-
     _interface = "json"
 
     @classmethod
@@ -29,22 +28,17 @@
         super(VolumesGetTest, cls).setUpClass()
         cls.client = cls.volumes_client
 
-    def _volume_create_get_delete(self, image_ref=None):
+    def _volume_create_get_delete(self, **kwargs):
         # Create a volume, Get it's details and Delete the volume
         try:
             volume = {}
-            v_name = rand_name('Volume-')
-            metadata = {'Type': 'work'}
+            v_name = rand_name('Volume')
+            metadata = {'Type': 'Test'}
             #Create a volume
-            if not image_ref:
-                resp, volume = self.client.create_volume(size=1,
-                                                         display_name=v_name,
-                                                         metadata=metadata)
-            else:
-                resp, volume = self.client.create_volume(size=1,
-                                                         display_name=v_name,
-                                                         metadata=metadata,
-                                                         imageRef=image_ref)
+            resp, volume = self.client.create_volume(size=1,
+                                                     display_name=v_name,
+                                                     metadata=metadata,
+                                                     **kwargs)
             self.assertEqual(200, resp.status)
             self.assertTrue('id' in volume)
             self.assertTrue('display_name' in volume)
@@ -107,11 +101,17 @@
 
     @attr(type='smoke')
     def test_volume_create_get_delete(self):
-        self._volume_create_get_delete(image_ref=None)
+        self._volume_create_get_delete()
 
     @attr(type='smoke')
-    def test_volume_from_image(self):
-        self._volume_create_get_delete(image_ref=self.config.compute.image_ref)
+    def test_volume_create_get_delete_from_image(self):
+        self._volume_create_get_delete(imageRef=self.config.compute.image_ref)
+
+    @attr(type='gate')
+    def test_volume_create_get_delete_as_clone(self):
+        origin = self.create_volume(size=1,
+                                    display_name="Volume Origin")
+        self._volume_create_get_delete(source_volid=origin['id'])
 
 
 class VolumesGetTestXML(VolumesGetTest):
diff --git a/tempest/hacking/checks.py b/tempest/hacking/checks.py
index 93cf89d..5e941da 100644
--- a/tempest/hacking/checks.py
+++ b/tempest/hacking/checks.py
@@ -66,3 +66,4 @@
 def factory(register):
     register(skip_bugs)
     register(import_no_clients_in_api)
+    register(import_no_files_in_tests)
diff --git a/tempest/whitebox/test_servers_whitebox.py b/tempest/whitebox/test_servers_whitebox.py
index cd3c026..2694b95 100644
--- a/tempest/whitebox/test_servers_whitebox.py
+++ b/tempest/whitebox/test_servers_whitebox.py
@@ -50,70 +50,6 @@
             except exceptions.NotFound:
                 continue
 
-    def test_create_server_vcpu_quota_full(self):
-        # Disallow server creation when tenant's vcpu quota is full
-        quotas = self.meta.tables['quotas']
-        stmt = (quotas.select().
-                where(quotas.c.project_id == self.tenant_id).
-                where(quotas.c.resource == 'cores'))
-        result = self.connection.execute(stmt).first()
-
-        # Set vcpu quota for tenant if not already set
-        if not result:
-            cores_hard_limit = 2
-            stmt = quotas.insert().values(deleted=0,
-                                          project_id=self.tenant_id,
-                                          resource='cores',
-                                          hard_limit=cores_hard_limit)
-
-            self.connection.execute(stmt, autocommit=True)
-        else:
-            cores_hard_limit = result.hard_limit
-
-        # Create servers assuming 1 VCPU per instance i.e flavor_id=1
-        try:
-            for count in range(cores_hard_limit + 1):
-                self.create_server()
-        except exceptions.OverLimit:
-            pass
-        else:
-            self.fail("Could create servers over the VCPU quota limit")
-        finally:
-            stmt = quotas.delete()
-            self.connection.execute(stmt, autocommit=True)
-
-    def test_create_server_memory_quota_full(self):
-        # Disallow server creation when tenant's memory quota is full
-        quotas = self.meta.tables['quotas']
-        stmt = (quotas.select().
-                where(quotas.c.project_id == self.tenant_id).
-                where(quotas.c.resource == 'ram'))
-        result = self.connection.execute(stmt).first()
-
-        # Set memory quota for tenant if not already set
-        if not result:
-            ram_hard_limit = 1024
-            stmt = quotas.insert().values(deleted=0,
-                                          project_id=self.tenant_id,
-                                          resource='ram',
-                                          hard_limit=ram_hard_limit)
-
-            self.connection.execute(stmt, autocommit=True)
-        else:
-            ram_hard_limit = result.hard_limit
-
-        try:
-            # Set a hard range of 3 servers for reaching the RAM quota
-            for count in range(3):
-                self.create_server()
-        except exceptions.OverLimit:
-            pass
-        else:
-            self.fail("Could create servers over the RAM quota limit")
-        finally:
-            stmt = quotas.delete()
-            self.connection.execute(stmt, autocommit=True)
-
     def update_state(self, server_id, vm_state, task_state, deleted=0):
         """Update states of an instance in database for validation."""
         if not task_state:
