Autotest: Porting all hash operations to use utils.hash
Replace all functions that evaluate md5 and sha1 hexdigests
with the function utils.hash().
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@4204 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/tko/parsers/version_1_unittest.py b/tko/parsers/version_1_unittest.py
index 5110fe8..72444c5 100755
--- a/tko/parsers/version_1_unittest.py
+++ b/tko/parsers/version_1_unittest.py
@@ -1,8 +1,9 @@
#!/usr/bin/python
-import unittest, datetime, time, md5
+import unittest, datetime, time
import common
+from autotest_lib.client.common_lib import utils
from autotest_lib.tko.parsers import version_1
@@ -163,7 +164,7 @@
"patch0": "first_patch 0 0",
"patch1": "another_patch 0 0"})
kern = line.get_kernel()
- kernel_hash = md5.new("2.6.24-rc40,0,0").hexdigest()
+ kernel_hash = utils.hash("md5", "2.6.24-rc40,0,0").hexdigest()
self.assertEquals(kern.base, "2.6.24-rc40")
self.assertEquals(kern.patches[0].spec, "first_patch")
self.assertEquals(kern.patches[1].spec, "another_patch")
@@ -178,7 +179,7 @@
"patch0": "first_patch 0 0",
"patch2": "another_patch 0 0"})
kern = line.get_kernel()
- kernel_hash = md5.new("2.6.24-rc40,0").hexdigest()
+ kernel_hash = utils.hash("md5", "2.6.24-rc40,0").hexdigest()
self.assertEquals(kern.base, "2.6.24-rc40")
self.assertEquals(kern.patches[0].spec, "first_patch")
self.assertEquals(len(kern.patches), 1)