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:
parent
cbdda3c990
commit
decd73129c
@ -14,6 +14,16 @@ def testfunc(child):
|
|||||||
child.sendline('test')
|
child.sendline('test')
|
||||||
child.expect('SUCCESS')
|
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__":
|
if __name__ == "__main__":
|
||||||
sys.exit(run(testfunc))
|
sys.exit(run(testfunc))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user