Merge "Fix cinder test cases when cinder extensions are in use"
diff --git a/tempest/api/volume/test_volumes_list.py b/tempest/api/volume/test_volumes_list.py
index def330e..3c66eb8 100644
--- a/tempest/api/volume/test_volumes_list.py
+++ b/tempest/api/volume/test_volumes_list.py
@@ -15,6 +15,7 @@
 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 #    License for the specific language governing permissions and limitations
 #    under the License.
+import operator
 
 from tempest.api.volume import base
 from tempest.common.utils import data_utils
@@ -23,6 +24,8 @@
 
 LOG = logging.getLogger(__name__)
 
+VOLUME_FIELDS = ('id', 'display_name')
+
 
 class VolumesListTest(base.BaseVolumeTest):
 
@@ -36,7 +39,11 @@
 
     _interface = 'json'
 
-    def assertVolumesIn(self, fetched_list, expected_list):
+    def assertVolumesIn(self, fetched_list, expected_list, fields=None):
+        if fields:
+            expected_list = map(operator.itemgetter(*fields), expected_list)
+            fetched_list = map(operator.itemgetter(*fields), fetched_list)
+
         missing_vols = [v for v in expected_list if v not in fetched_list]
         if len(missing_vols) == 0:
             return
@@ -113,7 +120,8 @@
         # Fetch all volumes
         resp, fetched_list = self.client.list_volumes()
         self.assertEqual(200, resp.status)
-        self.assertVolumesIn(fetched_list, self.volume_list)
+        self.assertVolumesIn(fetched_list, self.volume_list,
+                             fields=VOLUME_FIELDS)
 
     @attr(type='gate')
     def test_volume_list_with_details(self):
@@ -150,7 +158,8 @@
         self.assertEqual(200, resp.status)
         for volume in fetched_list:
             self.assertEqual('available', volume['status'])
-        self.assertVolumesIn(fetched_list, self.volume_list)
+        self.assertVolumesIn(fetched_list, self.volume_list,
+                             fields=VOLUME_FIELDS)
 
     @attr(type='gate')
     def test_volumes_list_details_by_status(self):
@@ -170,7 +179,8 @@
         self.assertEqual(200, resp.status)
         for volume in fetched_list:
             self.assertEqual(zone, volume['availability_zone'])
-        self.assertVolumesIn(fetched_list, self.volume_list)
+        self.assertVolumesIn(fetched_list, self.volume_list,
+                             fields=VOLUME_FIELDS)
 
     @attr(type='gate')
     def test_volumes_list_details_by_availability_zone(self):