02_Misc.py 1.1 KB

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