diff --git a/tempest/lib/common/rest_client.py b/tempest/lib/common/rest_client.py
index fc86914..a11b7c1 100644
--- a/tempest/lib/common/rest_client.py
+++ b/tempest/lib/common/rest_client.py
@@ -492,7 +492,7 @@
             self._log_request_full(resp, req_headers, req_body,
                                    resp_body, extra)
 
-    def _parse_resp(self, body):
+    def _parse_resp(self, body, top_key_to_verify=None):
         try:
             body = json.loads(body)
         except ValueError:
@@ -516,8 +516,17 @@
             if not hasattr(body, "keys") or len(body.keys()) != 1:
                 return body
             # Just return the "wrapped" element
-            _, first_item = tuple(body.items())[0]
+            first_key, first_item = tuple(body.items())[0]
             if isinstance(first_item, (dict, list)):
+                if top_key_to_verify is not None:
+                    msg_args = {
+                        'top_key': top_key_to_verify,
+                        'actual_key': first_key,
+                    }
+                    assert_msg = ("The expected top level key is "
+                                  "'%(top_key)s' but we found "
+                                  "'%(actual_key)s'." % msg_args)
+                    assert top_key_to_verify == first_key, assert_msg
                 return first_item
         except (ValueError, IndexError):
             pass
diff --git a/tempest/tests/lib/common/test_rest_client.py b/tempest/tests/lib/common/test_rest_client.py
index 1dea5f5..910756f 100644
--- a/tempest/tests/lib/common/test_rest_client.py
+++ b/tempest/tests/lib/common/test_rest_client.py
@@ -280,6 +280,26 @@
         body = self.rest_client._parse_resp(json.dumps(empty_list))
         self.assertEqual(empty_list, body)
 
+    def test_parse_top_key_match(self):
+        body = self.rest_client._parse_resp(json.dumps(self.dict_expected),
+                                            top_key_to_verify="body_dict")
+        self.assertEqual(self.dict_expected["body_dict"], body)
+
+
+class TestRestClientParseErrorRespJSON(BaseRestClientTestClass):
+
+    dict_expected = {"body_dict": {"fake_key": "fake_value"}}
+
+    def setUp(self):
+        self.fake_http = fake_http.fake_httplib2()
+        super(TestRestClientParseErrorRespJSON, self).setUp()
+
+    def test_parse_top_key_no_match(self):
+        self.assertRaises(AssertionError,
+                          self.rest_client._parse_resp,
+                          json.dumps(self.dict_expected),
+                          top_key_to_verify="body_key")
+
 
 class TestRestClientErrorCheckerJSON(base.TestCase):
     c_type = "application/json"
