Fixes lp#940532

* Changes image filter by server_ref tests since
  the location of the property was modified

Change-Id: I3dc55323402b766d6b12df8660e35b8bf2b16112
diff --git a/tempest/tests/test_list_images.py b/tempest/tests/test_list_images.py
index 65cbe00..b81ee27 100644
--- a/tempest/tests/test_list_images.py
+++ b/tempest/tests/test_list_images.py
@@ -110,7 +110,6 @@
         self.assertFalse(any([i for i in images if i['id'] == self.image2_id]))
         self.assertFalse(any([i for i in images if i['id'] == self.image3_id]))
 
-    @unittest.skip('Skipping until Nova Bug 912837 is fixed')
     @attr(type='positive')
     def test_list_images_filter_by_server_id(self):
         """The images should contain images filtered by server id"""
@@ -126,12 +125,19 @@
     @attr(type='positive')
     def test_list_images_filter_by_server_ref(self):
         """The list of servers should be filtered by server ref"""
-        params = {'server': self.image3['metadata']['instance_ref']}
-        resp, images = self.client.list_images(params)
+        server_links = self.server2['links']
 
-        self.assertFalse(any([i for i in images if i['id'] == self.image1_id]))
-        self.assertFalse(any([i for i in images if i['id'] == self.image2_id]))
-        self.assertTrue(any([i for i in images if i['id'] == self.image3_id]))
+        # Try all server link types
+        for link in server_links:
+            params = {'server': link['href']}
+            resp, images = self.client.list_images(params)
+
+            self.assertFalse(any([i for i in images
+                            if i['id'] == self.image1_id]))
+            self.assertFalse(any([i for i in images
+                            if i['id'] == self.image2_id]))
+            self.assertTrue(any([i for i in images
+                            if i['id'] == self.image3_id]))
 
     @attr(type='positive')
     def test_list_images_filter_by_type(self):
@@ -210,12 +216,19 @@
     @attr(type='positive')
     def test_list_images_with_detail_filter_by_server_ref(self):
         """Detailed list of servers should be filtered by server ref"""
-        params = {'server': self.image3['metadata']['instance_ref']}
-        resp, images = self.client.list_images_with_detail(params)
+        server_links = self.server2['links']
 
-        self.assertFalse(any([i for i in images if i['id'] == self.image1_id]))
-        self.assertFalse(any([i for i in images if i['id'] == self.image2_id]))
-        self.assertTrue(any([i for i in images if i['id'] == self.image3_id]))
+        # Try all server link types
+        for link in server_links:
+            params = {'server': link['href']}
+            resp, images = self.client.list_images_with_detail(params)
+
+            self.assertFalse(any([i for i in images
+                            if i['id'] == self.image1_id]))
+            self.assertFalse(any([i for i in images
+                            if i['id'] == self.image2_id]))
+            self.assertTrue(any([i for i in images
+                            if i['id'] == self.image3_id]))
 
     @attr(type='positive')
     def test_list_images_with_detail_filter_by_type(self):