summaryrefslogtreecommitdiff
path: root/tko
diff options
context:
space:
mode:
authorlmr <lmr@592f7852-d20e-0410-864c-8624ca9c26a4>2010-02-04 03:18:28 +0000
committerlmr <lmr@592f7852-d20e-0410-864c-8624ca9c26a4>2010-02-04 03:18:28 +0000
commitf23ac1df044d07895d186613e1792c7ae3bd7e72 (patch)
tree0d5b594ea5f87dc2ea4de44b3a3b51879c5f4ca8 /tko
parentbf1a33f4cc96cd07035042d0eb99354d5e1d96f7 (diff)
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: svn://test.kernel.org/autotest/trunk@4204 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'tko')
-rw-r--r--tko/models.py4
-rwxr-xr-xtko/parsers/version_1_unittest.py7
2 files changed, 6 insertions, 5 deletions
diff --git a/tko/models.py b/tko/models.py
index bc70074b..8f060498 100644
--- a/tko/models.py
+++ b/tko/models.py
@@ -1,4 +1,4 @@
-import os, md5
+import os
from autotest_lib.client.common_lib import utils
from autotest_lib.tko import utils as tko_utils
@@ -63,7 +63,7 @@ class kernel(object):
@staticmethod
def compute_hash(base, hashes):
key_string = ','.join([base] + hashes)
- return md5.new(key_string).hexdigest()
+ return utils.hash('md5', key_string).hexdigest()
class test(object):
diff --git a/tko/parsers/version_1_unittest.py b/tko/parsers/version_1_unittest.py
index 5110fe80..72444c5e 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 @@ class test_status_line(unittest.TestCase):
"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 @@ class test_status_line(unittest.TestCase):
"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)