From decd73129ce2e493ce50b2220df4a01b9789ecd7 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Wed, 13 Nov 2019 09:10:31 +0100 Subject: [PATCH] tests/periph_eeprom: improve automatic test script Reboot the application and verify data previously written on EEPROM by the test command are still there --- tests/periph_eeprom/tests/01-run.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/periph_eeprom/tests/01-run.py b/tests/periph_eeprom/tests/01-run.py index 26c16c36d6..febee43fd3 100755 --- a/tests/periph_eeprom/tests/01-run.py +++ b/tests/periph_eeprom/tests/01-run.py @@ -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))