提交 68c1a02a 编写于 作者: X Xu Han

Fixup function hash_file

Correct the parameter name.
Signed-off-by: NXu Han <xuhan@redhat.com>
上级 921b65f8
...@@ -100,7 +100,7 @@ def run(test, params, env): ...@@ -100,7 +100,7 @@ def run(test, params, env):
def compare_md5sum(name): def compare_md5sum(name):
txt = "Comparing md5sum of the files on guest and host" txt = "Comparing md5sum of the files on guest and host"
error_context.context(txt, logging.info) error_context.context(txt, logging.info)
host_result = crypto.hash_file(name, method="md5") host_result = crypto.hash_file(name, algorithm="md5")
try: try:
o = session.cmd_output("md5sum %s" % name) o = session.cmd_output("md5sum %s" % name)
guest_result = re.findall(r"\w+", o)[0] guest_result = re.findall(r"\w+", o)[0]
......
...@@ -94,7 +94,7 @@ def run(test, params, env): ...@@ -94,7 +94,7 @@ def run(test, params, env):
utils_misc.generate_random_string(8)) utils_misc.generate_random_string(8))
cmd = "dd if=/dev/zero of=%s bs=1M count=%d" % (host_path, filesize) cmd = "dd if=/dev/zero of=%s bs=1M count=%d" % (host_path, filesize)
process.run(cmd) 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 " error_context.context("Guest test file prepare, Copy file %s from host to "
"guest" % host_path, logging.info) "guest" % host_path, logging.info)
......
...@@ -45,7 +45,7 @@ def run(test, params, env): ...@@ -45,7 +45,7 @@ def run(test, params, env):
logging.info) logging.info)
cmd = params.get("dd_cmd") % src cmd = params.get("dd_cmd") % src
process.system(cmd, timeout=dd_timeout, shell=True) 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) vm.copy_files_to(src, dst, timeout=copy_timeout)
process.system("rm -f %s" % src) process.system("rm -f %s" % src)
error_context.context("create live snapshot", logging.info) error_context.context("create live snapshot", logging.info)
...@@ -60,7 +60,7 @@ def run(test, params, env): ...@@ -60,7 +60,7 @@ def run(test, params, env):
error_context.context("copy file to host, check content not changed", error_context.context("copy file to host, check content not changed",
logging.info) logging.info)
vm.copy_files_from(dst, src, timeout=copy_timeout) 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") test.fail("diff md5 before/after create snapshot")
session.cmd(params.get("alive_check_cmd", "dir")) session.cmd(params.get("alive_check_cmd", "dir"))
finally: finally:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册