test data

This commit is contained in:
Edwin Eefting
2022-02-20 13:04:49 +01:00
parent 4d27b3b6ea
commit 626c84fe47
7 changed files with 35 additions and 0 deletions

0
tests/data/empty Normal file
View File

1
tests/data/partial Normal file
View File

@ -0,0 +1 @@
xC<78><43>ʟ<EFBFBD>ZG<5A><47>М<EFBFBD><D09C><EFBFBD>?<3F><><1D>ZG<>#<0F><>,<>ƻ<>Q=<3D>><3E>ك1<D983>NU<4E><15>u<>{Zj;<3B>`<60><19><19><>Dv<44><76>Q<EFBFBD>j<EFBFBD>voQFN<46><4E><EFBFBD><EFBFBD><EFBFBD>;3Sa<53>R<EFBFBD>^2Z<32><5A>

BIN
tests/data/whole Normal file

Binary file not shown.

BIN
tests/data/whole2 Normal file

Binary file not shown.

BIN
tests/data/whole_whole2 Normal file

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,34 @@
import hashlib
from .util import block_hash
from .CliBase import CliBase
class ZfsCheck(CliBase):
def __init__(self, argv, print_arguments=True):
# NOTE: common options and parameters are in ZfsAuto
super(ZfsCheck, self).__init__(argv, print_arguments)
def run(self):
# print(sha1sum("/home/psy/Downloads/carimage.zip"))
for (block, h ) in block_hash("/home/psy/Downloads/carimage.zip" , count=10000):
print(block)
print (h)
pass
def cli():
import sys
sys.exit(ZfsCheck(sys.argv[1:], False).run())
if __name__ == "__main__":
cli()