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

53 lines
1.8 KiB
Python

#!/usr/bin/python
import os, sys, mmap
from regression import Regression
loader = os.environ['PAL_LOADER']
regression = Regression(loader, "Process")
def check_times(target, lines, times):
count = 0
for line in lines:
if target == line:
count += 1
return count == times
regression.add_check(name="Process Creation",
check=lambda res: check_times("Child Process Created", res[0].log, 3))
regression.add_check(name="Process Creation Arguments",
check=lambda res: check_times("argv[0] = Process", res[0].log, 3) and
check_times("argv[1] = Child", res[0].log, 3))
regression.add_check(name="Process Channel Transmission",
check=lambda res: check_times("Process Write 1 OK", res[0].log, 3) and
check_times("Process Read 1: Hello World 1", res[0].log, 3) and
check_times("Process Write 2 OK", res[0].log, 3) and
check_times("Process Read 2: Hello World 2", res[0].log, 3))
regression.add_check(name="Multi-Process Broadcast Channel Transmission",
check=lambda res: check_times("Broadcast Write OK", res[0].log, 1) and
check_times("Broadcast Read: Hello World 1", res[0].log, 3))
rv = regression.run_checks()
if rv: sys.exit(rv)
regression = Regression(loader, "Process2")
regression.add_check(name="Process Creation with a Different Binary",
check=lambda res: check_times("User Program Started", res[0].log, 1))
rv = regression.run_checks()
if rv: sys.exit(rv)
regression = Regression(loader, "Process3")
regression.add_check(name="Process Creation without Executable",
check=lambda res: check_times("Binary 1 Preloaded", res[0].log, 2) and
check_times("Binary 2 Preloaded", res[0].log, 2))
rv = regression.run_checks()
if rv: sys.exit(rv)