app_test.py 984 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/usr/bin/env python
  2. import ttfw_idf
  3. from tiny_test_fw import Utility
  4. mem_test = [
  5. ['IRAM0_SRAM', 'WRX'],
  6. ['IRAM0_RTCFAST', 'WRX'],
  7. ['DRAM0_SRAM', 'WR'],
  8. ['DRAM0_RTCFAST', 'WR'],
  9. ['PERI1_RTCSLOW', 'WR'],
  10. ['PERI2_RTCSLOW_0', 'WRX'],
  11. ['PERI2_RTCSLOW_1', 'WRX']
  12. ]
  13. @ttfw_idf.idf_custom_test(env_tag='Example_GENERIC', target='esp32s2', group='test-apps')
  14. def test_memprot(env, extra_data):
  15. dut = env.get_dut('memprot', 'tools/test_apps/system/memprot')
  16. dut.start_app()
  17. for i in mem_test:
  18. if 'R' in i[1]:
  19. dut.expect(i[0] + ' read low: OK')
  20. dut.expect(i[0] + ' read high: OK')
  21. if 'W' in i[1]:
  22. dut.expect(i[0] + ' write low: OK')
  23. dut.expect(i[0] + ' write high: OK')
  24. if 'X' in i[1]:
  25. dut.expect(i[0] + ' exec low: OK')
  26. dut.expect(i[0] + ' exec high: OK')
  27. Utility.console_log('Memprot test done')
  28. if __name__ == '__main__':
  29. test_memprot()