06_AvxDisable.py 551 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env python2
  2. import os, sys, mmap
  3. from regression import Regression
  4. loader = os.environ['PAL_LOADER']
  5. sgx = os.environ.get('SGX_RUN', False)
  6. def manifest_file(file):
  7. if sgx:
  8. return file + '.manifest.sgx'
  9. else:
  10. return file + '.manifest'
  11. if not sgx:
  12. sys.exit(0)
  13. # Running AvxDisable
  14. regression = Regression(loader, "AvxDisable")
  15. regression.add_check(name="Disable AVX bit in XFRM",
  16. check=lambda res: "Illegal instruction executed in enclave" in res[0].log)
  17. rv = regression.run_checks()
  18. if rv: sys.exit(rv)