Use random binary data for test images

There have been some complaints that the image api testing does nothing
to verify the actual path of uploading binary image data. Since binary
data is the norm rather than the exception, this patch modifies most
usage of image data to be randomly selected binary data.

Change-Id: I54457ed3aea14b540820b5e451c529831074a7bf
diff --git a/tempest/api/image/v1/test_images.py b/tempest/api/image/v1/test_images.py
index 8528e42..bf55b89 100644
--- a/tempest/api/image/v1/test_images.py
+++ b/tempest/api/image/v1/test_images.py
@@ -44,7 +44,7 @@
             self.assertEqual(val, body.get('properties')[key])
 
         # Now try uploading an image file
-        image_file = StringIO.StringIO(('*' * 1024))
+        image_file = StringIO.StringIO(data_utils.random_bytes())
         _, body = self.client.update_image(image_id, data=image_file)
         self.assertIn('size', body)
         self.assertEqual(1024, body.get('size'))
@@ -157,7 +157,7 @@
         image. Note that the size of the new image is a random number between
         1024 and 4096
         """
-        image_file = StringIO.StringIO('*' * size)
+        image_file = StringIO.StringIO(data_utils.random_bytes(size))
         name = 'New Standard Image %s' % name
         _, image = cls.create_image(name=name,
                                     container_format=container_format,
@@ -338,10 +338,9 @@
                                disk_format, size):
         """
         Create a new standard image and return the ID of the newly-registered
-        image. Note that the size of the new image is a random number between
-        1024 and 4096
+        image.
         """
-        image_file = StringIO.StringIO('*' * size)
+        image_file = StringIO.StringIO(data_utils.random_bytes(size))
         name = 'New Standard Image %s' % name
         _, image = cls.create_image(name=name,
                                     container_format=container_format,