diff --git a/tempest/test.py b/tempest/test.py
index b0038e0..4db9827 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -120,7 +120,7 @@
     return False
 
 
-def status_timeout(things, thing_id, expected_status):
+def status_timeout(testcase, things, thing_id, expected_status):
     """
     Given a thing and an expected status, do a loop, sleeping
     for a configurable amount of time, checking for the
@@ -134,9 +134,9 @@
         thing = things.get(thing_id)
         new_status = thing.status
         if new_status == 'ERROR':
-            self.fail("%s failed to get to expected status."
-                      "In ERROR state."
-                      % thing)
+            testcase.fail("%s failed to get to expected status."
+                          "In ERROR state."
+                          % thing)
         elif new_status == expected_status:
             return True  # All good.
         LOG.debug("Waiting for %s to get to %s status. "
@@ -146,8 +146,8 @@
     if not call_until_true(check_status,
                            conf.compute.build_timeout,
                            conf.compute.build_interval):
-        self.fail("Timed out waiting for thing %s to become %s"
-                  % (thing_id, expected_status))
+        testcase.fail("Timed out waiting for thing %s to become %s"
+                      % (thing_id, expected_status))
 
 
 class DefaultClientSmokeTest(TestCase):
diff --git a/tempest/tests/compute/servers/test_server_advanced_ops.py b/tempest/tests/compute/servers/test_server_advanced_ops.py
index 56222f9..8be9c54 100644
--- a/tempest/tests/compute/servers/test_server_advanced_ops.py
+++ b/tempest/tests/compute/servers/test_server_advanced_ops.py
@@ -66,16 +66,18 @@
 
         self.assertEqual(self.instance.status, 'BUILD')
         instance_id = self.get_resource('instance').id
-        test.status_timeout(self.compute_client.servers, instance_id, 'ACTIVE')
+        test.status_timeout(
+            self, self.compute_client.servers, instance_id, 'ACTIVE')
         instance = self.get_resource('instance')
         instance_id = instance.id
         resize_flavor = self.config.compute.flavor_ref_alt
         LOG.debug("Resizing instance %s from flavor %s to flavor %s",
                   instance.id, instance.flavor, resize_flavor)
         instance.resize(resize_flavor)
-        test.status_timeout(self.compute_client.servers, instance_id,
+        test.status_timeout(self, self.compute_client.servers, instance_id,
                             'VERIFY_RESIZE')
 
         LOG.debug("Confirming resize of instance %s", instance_id)
         instance.confirm_resize()
-        test.status_timeout(self.compute_client.servers, instance_id, 'ACTIVE')
+        test.status_timeout(
+            self, self.compute_client.servers, instance_id, 'ACTIVE')
diff --git a/tempest/tests/compute/servers/test_server_basic_ops.py b/tempest/tests/compute/servers/test_server_basic_ops.py
index 05cb39e..e4e246a 100644
--- a/tempest/tests/compute/servers/test_server_basic_ops.py
+++ b/tempest/tests/compute/servers/test_server_basic_ops.py
@@ -101,7 +101,8 @@
 
     def wait_on_active(self):
         instance_id = self.get_resource('instance').id
-        test.status_timeout(self.compute_client.servers, instance_id, 'ACTIVE')
+        test.status_timeout(
+            self, self.compute_client.servers, instance_id, 'ACTIVE')
 
     def pause_server(self):
         instance = self.get_resource('instance')
@@ -109,7 +110,8 @@
         LOG.debug("Pausing instance %s. Current status: %s",
                   instance_id, instance.status)
         instance.pause()
-        test.status_timeout(self.compute_client.servers, instance_id, 'PAUSED')
+        test.status_timeout(
+            self, self.compute_client.servers, instance_id, 'PAUSED')
 
     def unpause_server(self):
         instance = self.get_resource('instance')
@@ -117,7 +119,8 @@
         LOG.debug("Unpausing instance %s. Current status: %s",
                   instance_id, instance.status)
         instance.unpause()
-        test.status_timeout(self.compute_client.servers, instance_id, 'ACTIVE')
+        test.status_timeout(
+            self, self.compute_client.servers, instance_id, 'ACTIVE')
 
     def suspend_server(self):
         instance = self.get_resource('instance')
@@ -125,7 +128,7 @@
         LOG.debug("Suspending instance %s. Current status: %s",
                   instance_id, instance.status)
         instance.suspend()
-        test.status_timeout(self.compute_client.servers,
+        test.status_timeout(self, self.compute_client.servers,
                             instance_id, 'SUSPENDED')
 
     def resume_server(self):
@@ -134,7 +137,8 @@
         LOG.debug("Resuming instance %s. Current status: %s",
                   instance_id, instance.status)
         instance.resume()
-        test.status_timeout(self.compute_client.servers, instance_id, 'ACTIVE')
+        test.status_timeout(
+            self, self.compute_client.servers, instance_id, 'ACTIVE')
 
     def terminate_instance(self):
         instance = self.get_resource('instance')
diff --git a/tempest/tests/network/common.py b/tempest/tests/network/common.py
index 1cff2c4..8c8d518 100644
--- a/tempest/tests/network/common.py
+++ b/tempest/tests/network/common.py
@@ -273,7 +273,7 @@
             self.set_resource(name, server)
         except AttributeError:
             self.fail("Server not successfully created.")
-        test.status_timeout(client.servers, server.id, 'ACTIVE')
+        test.status_timeout(self, client.servers, server.id, 'ACTIVE')
         # The instance retrieved on creation is missing network
         # details, necessitating retrieval after it becomes active to
         # ensure correct details.
