From 68c1a02ad1b7958ad6343d376805e379b4f62f3e Mon Sep 17 00:00:00 2001 From: Xu Han Date: Wed, 11 Apr 2018 18:33:42 +0800 Subject: [PATCH] Fixup function hash_file Correct the parameter name. Signed-off-by: Xu Han --- generic/tests/ethtool.py | 2 +- generic/tests/nicdriver_unload.py | 2 +- qemu/tests/live_snapshot_base.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/generic/tests/ethtool.py b/generic/tests/ethtool.py index 419a4567..3bea39f4 100644 --- a/generic/tests/ethtool.py +++ b/generic/tests/ethtool.py @@ -100,7 +100,7 @@ def run(test, params, env): def compare_md5sum(name): txt = "Comparing md5sum of the files on guest and host" error_context.context(txt, logging.info) - host_result = crypto.hash_file(name, method="md5") + host_result = crypto.hash_file(name, algorithm="md5") try: o = session.cmd_output("md5sum %s" % name) guest_result = re.findall(r"\w+", o)[0] diff --git a/generic/tests/nicdriver_unload.py b/generic/tests/nicdriver_unload.py index f2afad28..192ae255 100644 --- a/generic/tests/nicdriver_unload.py +++ b/generic/tests/nicdriver_unload.py @@ -94,7 +94,7 @@ def run(test, params, env): utils_misc.generate_random_string(8)) cmd = "dd if=/dev/zero of=%s bs=1M count=%d" % (host_path, filesize) process.run(cmd) - file_checksum = crypto.hash_file(host_path, "md5") + file_checksum = crypto.hash_file(host_path, algorithm="md5") error_context.context("Guest test file prepare, Copy file %s from host to " "guest" % host_path, logging.info) diff --git a/qemu/tests/live_snapshot_base.py b/qemu/tests/live_snapshot_base.py index 79d2a5f1..8e5beab2 100644 --- a/qemu/tests/live_snapshot_base.py +++ b/qemu/tests/live_snapshot_base.py @@ -45,7 +45,7 @@ def run(test, params, env): logging.info) cmd = params.get("dd_cmd") % src process.system(cmd, timeout=dd_timeout, shell=True) - md5 = crypto.hash_file(src, method="md5") + md5 = crypto.hash_file(src, algorithm="md5") vm.copy_files_to(src, dst, timeout=copy_timeout) process.system("rm -f %s" % src) error_context.context("create live snapshot", logging.info) @@ -60,7 +60,7 @@ def run(test, params, env): error_context.context("copy file to host, check content not changed", logging.info) vm.copy_files_from(dst, src, timeout=copy_timeout) - if md5 and (md5 != crypto.hash_file(src, method="md5")): + if md5 and (md5 != crypto.hash_file(src, algorithm="md5")): test.fail("diff md5 before/after create snapshot") session.cmd(params.get("alive_check_cmd", "dir")) finally: -- GitLab