tests/periph_eeprom: improve automatic test script

Reboot the application and verify data previously written on EEPROM by the test command are still there
This commit is contained in:
Alexandre Abadie 2019-11-13 09:10:31 +01:00
parent cbdda3c990
commit decd73129c
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405

View File

@ -14,6 +14,16 @@ def testfunc(child):
child.sendline('test')
child.expect('SUCCESS')
# reboot the device to ensure data are still available on EEPROM
child.sendline('reboot')
child.expect(r'EEPROM size: (\d+)')
eeprom_size = int(child.match.group(1))
child.expect_exact('>')
child.sendline('read 0 4')
child.expect_exact('Data read from EEPROM (4 bytes): AAAA')
child.sendline('read {} 4'.format(eeprom_size - 4))
child.expect_exact('Data read from EEPROM (4 bytes): AAAA')
if __name__ == "__main__":
sys.exit(run(testfunc))