Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for md5 checksums if remote uses that #248

Merged
merged 6 commits into from
Aug 21, 2024
Merged

Check for md5 checksums if remote uses that #248

merged 6 commits into from
Aug 21, 2024

Conversation

qubixes
Copy link
Collaborator

@qubixes qubixes commented Aug 16, 2024

Fixes #245

Copy link
Member

@chStaiger chStaiger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add unit tests for the checksum calculation, have a new option in the config for the tests checksum_type?

ibridges/util.py Outdated
memv=memoryview(bytearray(128*1024))
with open(filepath, 'rb', buffering=0) as file:
for item in iter(lambda : file.readinto(memv), 0):
f_hash.update(memv[:item])
if checksum_type == "md5":
return f"md5:{f_hash.hexdigest()}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The native iRODS checksum in the iCAT not use the prefix md5: but just returns the md5sum. So will this work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, no then it's not going to work. Can we test md5 checksums on both YoDa and the native iRODS integration test?

ibridges/util.py Outdated

"""
remote_check = calc_checksum(remote_path)
local_check = calc_checksum(local_path, checksum_type=remote_check.split(":")[0])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, now I see. You are introducing the md5: prefix to unify the code for the two checksum types.

@qubixes qubixes merged commit 350118b into develop Aug 21, 2024
9 checks passed
@chStaiger chStaiger deleted the fix-check-md5 branch August 22, 2024 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

overwrite does wrong checksum validation
2 participants