02_Misc.py 1021 B

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/python
  2. import os, sys, mmap
  3. from regression import Regression
  4. loader = os.environ['PAL_LOADER']
  5. regression = Regression(loader, "Misc", timeout=5000)
  6. regression.add_check(name="Query System Time",
  7. check=lambda res: "Query System Time OK" in res[0].log)
  8. regression.add_check(name="Delay Execution for 10000 Microseconds",
  9. check=lambda res: "Delay Execution for 10000 Microseconds OK" in res[0].log)
  10. regression.add_check(name="Delay Execution for 3 Seconds",
  11. check=lambda res: "Delay Execution for 3 Seconds OK" in res[0].log)
  12. regression.add_check(name="Generate Random Bits",
  13. check=lambda res: "Generate Random Bits OK" in res[0].log)
  14. rv = regression.run_checks()
  15. if rv: sys.exit(rv)
  16. regression = Regression(loader, "Hex")
  17. regression.add_check(name="Hex 2 String Helper Function",
  18. check=lambda res: "Hex test 1 is deadbeef" in res[0].log and \
  19. "Hex test 2 is cdcdcdcdcdcdcdcd" in res[0].log)
  20. rv = regression.run_checks()
  21. if rv: sys.exit(rv)