py3 hashlib error

In python3 str isn't a valid type to pass to hashlib functions.

Change-Id: I64d214088bf89a81ae1eff2ce5f9b81785f82546
diff --git a/tests/base.py b/tests/base.py
index 2568ec8..c680389 100755
--- a/tests/base.py
+++ b/tests/base.py
@@ -90,7 +90,7 @@
 
 
 def random_sha1():
-    return hashlib.sha1(str(random.random())).hexdigest()
+    return hashlib.sha1(str(random.random()).encode('ascii')).hexdigest()
 
 
 def iterate_timeout(max_seconds, purpose):