Skip to content

Commit

Permalink
tests: Add HIL test for writting bins
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioGasquez committed Feb 26, 2025
1 parent 661ed32 commit c6ec31d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions espflash/tests/scripts/write-bin.sh
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

0 comments on commit c6ec31d

Please sign in to comment.