The RBD large_write test cases was taking multiple minutes to
run under a Fedora 21 VM. Replaced the million+ random number
generator calls with a single call to os.urandom. The test
now completes within seconds.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
# vim: expandtab smarttab shiftwidth=4 softtabstop=4
import functools
-import random
import socket
import struct
import os
eq([image_name], rbd.list(ioctx))
def rand_data(size):
- l = [random.Random().getrandbits(64) for _ in xrange(size/8)]
- return struct.pack((size/8)*'Q', *l)
+ return os.urandom(size)
def check_stat(info, size, order):
assert 'block_name_prefix' in info