Skip to content

Command autotest (Autotest for hidden errors after compiling from source)

Franco Corbelli edited this page Sep 2, 2023 · 2 revisions

zpaqfranz can run on different systems, sometimes "weird" one, like non-Intel, ARM, or even BIG ENDIAN one
A good way to be sure that the newly compiled executable works correctly, at least in the main commands, is to run a self-test

CMD autotest (autotest) <>: Operational self-test on this system <>: -all Heavy test (all hashes) <>: -n X On heavy test (-all) use X size (min: 200.000,default 1.000.000) <>: -n X On light test (not -all) use X ASCII chars <>: -verbose Verbose output <>: -to d0 Create (into folder d0) a dotest.sh/bat script) Examples:

The very first test are the hashers

Hashing internal test 'ABCD'

zpaqfranz autotest
(...)
Quick check chunsize 5: ABCDE
This seems a LITTLE ENDIAN CPU (aka:'normal')
-----------------------------------------------------------------------------------------------------
CALC          BLAKE3: 61274278289E9F6233DF34ABB392AAFE03EE7CE9D77167F3A8D9CDE1AD9861C0
CALC          CRC-32: 72D31AD5
CALC         CRC-32C: B6AFE183
CALC      HIGHWAY128: C4C97D024A5DDDC7609B799BDBC46492
CALC      HIGHWAY256: 13F23C2D5C49147DB7B10C8D8923CB052C2B3E1FF3EED5681E4FD69F05FFA6FE
CALC       HIGHWAY64: 4755E237BAD15B4C
CALC             MD5: 2ECDDE3959051D913F61B14579EA136D
CALC     SHA-256-PUT: F0393FEBE8BAAA55E32F7BE2A7CC180BF34E52137D99E056C817A9C07B8F239A
CALC   SHA-256-WRITE: F0393FEBE8BAAA55E32F7BE2A7CC180BF34E52137D99E056C817A9C07B8F239A
CALC           SHA-3: 034AF02F68F8874B6668CCBEE49143A64BE435610E1282D93BF35FD80ACCE1FB
CALC        SHA1-PUT: 7BE07AAF460D593A323D0DB33DA05B64BFDCB3A5
CALC      SHA1-WRITE: 7BE07AAF460D593A323D0DB33DA05B64BFDCB3A5
CALC       WHIRLPOOL: C73D8F890F181CE6EB9FF431E08828D6BADA50AC2427546BA10A8F8226F527850FB61E638F798CE86028248262DF17D77D9D00FA5FE5E6CE6C94267E1DC2E99C
CALC            XXH3: 1C8288B6013152D97B4A5D7E6C7893D4
CALC        XXHASH64: E47599E7C7CEF609
CALC       XXHASH64Y: E47599E7C7CEF609
-----------------------------------------------------------------------------------------------------

Beware: ABCD is a small string, for "strange endian" a bigger one is better

Hashing internal test 'ABCDEFGHIJ' (10 bytes, more than 8)

zpaqfranz autotest -n 10
zpaqfranz v58.9d-JIT-GUI-L,HW SHA1/2,SFX64 v55.1,(2023-08-23)
franz:-n                                       10
franz:-hw
Self-test for correct internal functioning
Quick check chunsize 10: ABCDEFGHIJ
This seems a LITTLE ENDIAN CPU (aka:'normal')
-----------------------------------------------------------------------------------------------------
CALC          BLAKE3: A83D6456601B32E4302F696532AE882044F7EDED2B00F74159A0DDFD6A0A9DAA
CALC          CRC-32: 321E6D05
CALC         CRC-32C: D599AEFD
CALC      HIGHWAY128: E1BBF9D05BFB99EBD0336A9906F3CCE4
CALC      HIGHWAY256: B0EBEBDAF4ED2043B968F0D094325F475CD2F478D0DE57B97CCB10294AC99942
CALC       HIGHWAY64: 9579048C07CC2514
CALC             MD5: E86410FA2D6E2634FD8AC5F4B3AFE7F3
CALC     SHA-256-PUT: 261305762671A58CAE5B74990BCFC236C2336FB04A0FBAC626166D9491D2884C
CALC   SHA-256-WRITE: 261305762671A58CAE5B74990BCFC236C2336FB04A0FBAC626166D9491D2884C
CALC           SHA-3: 5B124C1AC15BBD082620143FFDC3BC84EED02BE0D0A84CAA276B6A4A8C565CB0
CALC        SHA1-PUT: 9F67EFC6AFA95F1AEF9B3351D6B01D7E0591B748
CALC      SHA1-WRITE: 9F67EFC6AFA95F1AEF9B3351D6B01D7E0591B748
CALC       WHIRLPOOL: B11F2BC6D12A027AF10E2B12BE5EB385FD6B94F94A8CB3BE260304C02D007D4D58BC3F369C30C455FDAF0C7CF1FFDB209AAEA893FDC81F6FB90F88356438B7EA
CALC            XXH3: 3FC2ABFB4543DAA0C1B965201991D9DB
CALC        XXHASH64: D6B92ADC10DC7FFE
CALC       XXHASH64Y: D6B92ADC10DC7FFE
-----------------------------------------------------------------------------------------------------

The second test is the -all

Heavier processing is done here, again in order to intercept any hashing problems with strange CPUs
For slow machines it can take a long time

Z:\>zpaqfranz autotest -all
zpaqfranz v58.9d-JIT-GUI-L,HW SHA1/2,SFX64 v55.1,(2023-08-23)
franz:-all                                      4
franz:-hw
Self-test for correct internal functioning
Iteration 0/9 chunksize    1.000.000
Iteration 1/9 chunksize      333.333
Iteration 2/9 chunksize      111.111
Iteration 3/9 chunksize       37.037
Iteration 4/9 chunksize       12.345
Iteration 5/9 chunksize        4.115
Iteration 6/9 chunksize        1.371
Iteration 7/9 chunksize          457
Iteration 8/9 chunksize          152
Iteration 9/9 chunksize           50
This seems a LITTLE ENDIAN CPU (aka:'normal')
         BLAKE3 : OK
         CRC-32 : OK
        CRC-32C : OK
     HIGHWAY128 : OK
     HIGHWAY256 : OK
      HIGHWAY64 : OK
            MD5 : OK
    SHA-256-PUT : OK
  SHA-256-WRITE : OK
          SHA-3 : OK
       SHA1-PUT : OK
     SHA1-WRITE : OK
      WHIRLPOOL : OK
           XXH3 : OK
       XXHASH64 : OK
      XXHASH64Y : OK
Time 127.89 seconds for bytes 1.748.003.691

127.906 seconds (000:02:07) (all OK)

The -verbose (or -debug) will show a lot of BTS (just in case of something wrong)

The final one require some (~4GB) temporary disk space. Be sure NO full drives!

This will create, inside the -to folder, a lot of data, AND a script to be launched "by hand". The script will be .BAT or .sh (Win/*nix) For slow machines it can take a long time

Z:\>zpaqfranz autotest -all -to z:\pippo
zpaqfranz v58.9d-JIT-GUI-L,HW SHA1/2,SFX64 v55.1,(2023-08-23)
franz:-all                                      4
franz:-hw
Self-test for correct internal functioning
Creating autotest folder in <<z:/pippo/>>
Iteration 0/9 chunksize    1.000.000
Iteration 1/9 chunksize      333.333
Iteration 2/9 chunksize      111.111
Iteration 3/9 chunksize       37.037
Iteration 4/9 chunksize       12.345
Iteration 5/9 chunksize        4.115
Iteration 6/9 chunksize        1.371
Iteration 7/9 chunksize          457
Iteration 8/9 chunksize          152
Iteration 9/9 chunksize           50
This seems a LITTLE ENDIAN CPU (aka:'normal')
         BLAKE3 : OK
         CRC-32 : OK
        CRC-32C : OK
     HIGHWAY128 : OK
     HIGHWAY256 : OK
      HIGHWAY64 : OK
            MD5 : OK
    SHA-256-PUT : OK
  SHA-256-WRITE : OK
          SHA-3 : OK
       SHA1-PUT : OK
     SHA1-WRITE : OK
      WHIRLPOOL : OK
           XXH3 : OK
       XXHASH64 : OK
      XXHASH64Y : OK
Time 134.78 seconds for bytes 1.748.003.691


The test batchfile is: z:\pippo\dotest.bat

134.796 seconds (000:02:14) (all OK)

And now launch the batch/script file

Please be patient, you will get 4 "stop points"

Z:\>z:\pippo\dotest.bat
Impossibile trovare z:\pippo\testme.zpaq
zpaqfranz v58.9d-JIT-GUI-L,HW SHA1/2,SFX64 v55.1,(2023-08-23)
franz:-hw
z:/pippo/sha256.zpaq:
1 versions, 256 files, 158.239 bytes (154.53 KB)
Extract 9.472.000 bytes (9.03 MB) in 256 files (0 folders) / 32 T
        94.14% 00:00:00  (   8.50 MB)=>(   9.03 MB)  580.53 KB/sec

15.563 seconds (000:00:15) (all OK)
zpaqfranz v58.9d-JIT-GUI-L,HW SHA1/2,SFX64 v55.1,(2023-08-23)
franz:sum                                       1 - command
franz:-sha256 -force -hw -rename
Getting SHA-256 ignoring .zfs and :$DATA

No multithread: Found (9.03 MB) => 9.472.000 bytes (9.03 MB) / 256 files in 0.000000
Renamed     files  0
NOT renamed files  256

0.062 seconds (00:00:00) (all OK)
(1) You should read NOT renamed files  256


**** Hit a key to continue ****

Look at (1)

(...)
zpaqfranz v58.9d-JIT-GUI-L,HW SHA1/2,SFX64 v55.1,(2023-08-23)
franz:sum                                       1 - command
franz:-sha256 -hw
Getting SHA-256 ignoring .zfs and :$DATA

No multithread: Found (976.56 KB) => 1.000.000 bytes (976.56 KB) / 1 files in 0.016000
|SHA-256: 67708591460BCE3BC45AE086A342F9F390AD2913A22639EC7AF3646B7D2AEA78 [          1.000.000]     |z:/pippo/verifica

0.047 seconds (00:00:00) (all OK)
(2) You should read SHA-256: 67708591460BCE3BC45AE086A342F9F390AD2913A22639EC7AF3646B7D2AEA78


**** Hit a key to continue ****

Look at (2)

(...)
SUMMARY :        40.92 (total time)
Virtual :           10 (skipped, does not exists in 7.15)
Total   :       42.727
GOOD    :       42.727 of       42.727 (stored=decompressed)
SURE    :       42.727 of       42.727 (stored=decompressed=file on disk)
All OK (paranoid test with check against filesystem)

41.000 seconds (000:00:41) (all OK)
(3) You should read SURE    :       42.727 of       42.727 (stored=decompressed=file on disk)

Look at (3)

(...)
No multithread: Found (926.02 MB) => 971.003.691 bytes (926.02 MB) / 41.958 files in 1.063000
Scanning filesystem time            1.063 s
Data transfer+CPU   time            2.251 s
Data output         time            0.062 s
Total size                        971.003.691 ( 926.02 MB)
Tested size                       971.003.691 ( 926.02 MB)
Duplicated size                   843.011.115 ( 803.96 MB)
Duplicated files                       39.654
Worked on 971.003.691 bytes avg speed (hashtime) 431.365.478 B/s
GLOBAL SHA256: 7B32DB3F6F0180062773C5A046A2C99D17BE7668202379BA136E7A4D134FFC26

3.438 seconds (000:00:03) (all OK)
(4) You should read GLOBAL SHA256: 7B32DB3F6F0180062773C5A046A2C99D17BE7668202379BA136E7A4D134FFC26

Finally look at (4)

Now you can safely delete the temporary folder

Almost everything should be "OK", errors=0 etc

Is this autotest 100% reliable? Of course NO. There are way too functions, inside zpaqfranz, for extensive testing. but it is a good method for a preliminary evaluation

Clone this wiki locally