Skip to content

Commit

Permalink
Merge pull request #3794 from xiagao/bz2230244_case_insense_md5sum
Browse files Browse the repository at this point in the history
virtio_fs: use md5sum cmd to check case insensitive
  • Loading branch information
YongxueHong authored Sep 6, 2023
2 parents ddceb16 + 8e7cfff commit 9f5b381
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions qemu/tests/virtio_fs_share_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,8 @@ def start_multifs_instance():

if case_insensitive_test:
# only for windows guest, testing case insensitive
def file_check(guest_file_win):
cmd_check_file = "dir %s" % guest_file_win
s, o = session.cmd_status_output(cmd_check_file, io_timeout)
def file_check(cmd):
s, o = session.cmd_status_output(cmd, io_timeout)
if s:
test.fail("Case insensitive failed,"
" the output is %s" % o)
Expand All @@ -506,18 +505,24 @@ def file_check(guest_file_win):

error_context.context("check the file with"
" uppercase letter name.", test.log.info)
guest_file = os.path.join(fs_dest, test_file_guest.upper())
guest_file_win = guest_file.replace("/", "\\")
file_check(guest_file_win)
guest_file_full_path = volume_letter + ":\\" + test_file_guest.upper()
cmd_check_file = "dir %s" % guest_file_full_path
file_check(cmd_check_file)
cmd_check_md5sum = cmd_md5 % (volume_letter, test_file_guest.upper())
file_check(cmd_check_md5sum)

error_context.context("Create file on host.", test.log.info)
test_file_host = test_file + "_Host"
host_data = os.path.join(fs_source, test_file_host)
process.system('touch %s' % host_data, io_timeout)
time.sleep(2)
error_context.context("check the file with"
" lowercase letter name.", test.log.info)
guest_file_win = os.path.join(fs_dest, test_file_host.lower()).replace("/", "\\")
file_check(guest_file_win)
guest_file_full_path = volume_letter + ":\\" + test_file_host.lower()
cmd_check_file = "dir %s" % guest_file_full_path
file_check(cmd_check_file)
cmd_check_md5sum = cmd_md5 % (volume_letter, test_file_host.lower())
file_check(cmd_check_md5sum)

if cmd_symblic_file:
error_context.context("Symbolic test under %s inside "
Expand Down

0 comments on commit 9f5b381

Please sign in to comment.