-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Add HIL test for writting bins
- Loading branch information
1 parent
661ed32
commit c6ec31d
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
# https://github.com/esp-rs/espflash/issues/622 reproducer | ||
echo -ne "\x01\xa0" >binary_file.bin | ||
result=$(espflash write-bin 0x0 binary_file.bin 2>&1) | ||
echo "$result" | ||
if [[ ! $result =~ "Binary successfully written to flash!" ]]; then | ||
echo "Failed to write binary" | ||
exit 1 | ||
fi | ||
|
||
result=$(espflash read-flash 0 64 flash_content.bin 2>&1) | ||
echo "$result" | ||
if [[ ! $result =~ "Flash content successfully read and written to" ]]; then | ||
echo "Failed to read flash content" | ||
exit 1 | ||
fi | ||
# Check that the flash_content.bin contains the '01 a0' bytes | ||
if ! grep -q -a -F $'\x01\xa0' flash_content.bin; then | ||
echo "Failed verifying content" | ||
exit 1 | ||
fi |