Files
Don Porter fe7a6e6934 Fix a bug introduced by commit 3a40af399d (#94)
* Fix a PAL unit test

* Make the PAL unit tests fail properly if one that should work doesn't.

* Get consistent indexes with and without graphene ipc module

* A little debugging output for ltp flakiness.  Seems to make things a little more stable.

* A bugfix for issue #80. The migration is not complete when a file-backed VMA is larger than
the file size, but the file size is not page-aligned. In Linux, if the file size is smaller
than the mapped memory, accessing the remaining memory that is not backed by the file will
trigger a SIGBUS. However, it is fine to access the remaining memory within the last page that
still overlaps with file, and won't trigger a SIGBUS. This area is commonly used in ELF binary
to store uninitialized, static variables. To improve fork latency, Graphene chooses to
truncate the migration size as the file size, but missed the memory which belongs to the last
file-backed page. The migration size should be aligned up to the page size.

* Fix assertion lines in PAL and LibOS

* Make sure the return code is correct for the LTP script, bump up some timeouts

* Only run gipc tests when the module is loaded, for the purposes of getting CI to work.

* Build fix
2018-08-13 10:19:44 -04:00

40 lines
1.2 KiB
Python

#!/usr/bin/python
import os, sys, mmap
from regression import Regression
loader = os.environ['PAL_LOADER']
try:
sgx = os.environ['SGX_RUN']
except KeyError:
sgx = 0
regression = Regression(loader, "Memory")
regression.add_check(name="Memory Allocation",
check=lambda res: "Memory Allocation OK" in res[0].log)
regression.add_check(name="Memory Allocation with Address",
check=lambda res: "Memory Allocation with Address OK" in res[0].log)
regression.add_check(name="Memory Protection", flaky = sgx,
check=lambda res: "Memory Allocation Protection (RW) OK" in res[0].log and
"Memory Protection (R) OK" in res[0].log)
regression.add_check(name="Memory Deallocation", flaky = sgx,
check=lambda res: "Memory Deallocation OK" in res[0].log)
def check_quota(res):
for line in res[0].log:
if line.startswith("Total Memory:"):
return line != "Total Memory: 0"
return False
regression.add_check(name="Get Memory Total Quota", check=check_quota)
regression.add_check(name="Get Memory Available Quota",
check=lambda res: "Get Memory Available Quota OK" in res[0].log)
rv = regression.run_checks()
if rv: sys.exit(rv)