calliope-edu / CalliopEO_AstroPi

MIT License
1 stars 2 forks source link

md5sum verification goes wrong sometimes #38

Closed rzbrk closed 3 years ago

rzbrk commented 3 years ago

In a couple of testcases md5sum is used to verify the correct output of the Calliope Mini after flashing with a dedicated hex.

Sometimes, the verification goes wrong with md5sum claiming, the files to verify are not in place:

-=# CalliopEO #=-
Unpacked /home/calliope/src/CalliopEO_AstroPi/30sec-counter.zip

programming: /home/calliope/src/CalliopEO_AstroPi/run_20210721-230028/30sec-counter.hex
done
open serial port
Calliope Mini found on /dev/ttyACM0  ..........
done
reading data

Start @ 2021/07/21-23:00:44; Will stop @ 2021/07/22-02:05:44

Send @START@

Received @START@
*****************
17 lines read
done
############################################################################################################

Check: Return code in all cases is 0 ... PASSED
Check: ZIP archive renamed to .done ... PASSED
Check: Folder run_* created ... PASSED
Check: Created two .data files ... PASSED
Check: Verify content of .data file ... md5sum: 30sec-counter.hex: No such file or directory
md5sum: 30sec-counter.hex.data: No such file or directory
md5sum: WARNING: 2 listed files could not be read
NOT PASSED

Reason currently unknown ...

The sync and sleep 1 in all testcases after executing the Python script seems not to be sufficient.

rzbrk commented 3 years ago

Inserting a ls -al before executing md5sum in testcase 07 reveals that the heuristic approach in this line to decide where to put the md5sum file and where to perform the md5sum verification can go wrong. This way, sometimes simply the wrong run_* folder is selected.

The following testcases are affected:

rzbrk commented 3 years ago

04transmission-30s.sh not affected, because different code. There, we do not have to deal with different run* folders.

rzbrk commented 3 years ago

Fixed in edbda36.

Can be closed if #39 is merged.