mirror of
https://github.com/clearlinux/graphene.git
synced 2026-09-06 13:51:28 +00:00
The regression python scripts are not marked executable. Also they expect that the Makefile has setup the environment correctly so just marking them executable would not be useful. So drop the unused shebang to avoid encoding the interpreter in multiple places. Script/regression.py is a library so it also doesn't need a shebang.
30 lines
969 B
Python
30 lines
969 B
Python
import os, sys, mmap
|
|
from regression import Regression
|
|
|
|
loader = os.environ['PAL_LOADER']
|
|
|
|
regression = Regression(loader, "SendHandle")
|
|
|
|
def check_times(target, lines, times):
|
|
count = 0
|
|
for line in lines:
|
|
if target == line:
|
|
count += 1
|
|
return count == times
|
|
|
|
regression.add_check(name="Send and Receive Handles across Processes",
|
|
check=lambda res: check_times("Send Handle OK", res[0].log, 3) and
|
|
check_times("Receive Handle OK", res[0].log, 3))
|
|
|
|
regression.add_check(name="Send Pipe Handle",
|
|
check=lambda res: check_times("Receive Pipe Handle: Hello World", res[0].log, 1))
|
|
|
|
regression.add_check(name="Send Socket Handle",
|
|
check=lambda res: check_times("Receive Socket Handle: Hello World", res[0].log, 1))
|
|
|
|
regression.add_check(name="Send File Handle",
|
|
check=lambda res: check_times("Receive File Handle: Hello World", res[0].log, 1))
|
|
|
|
rv = regression.run_checks()
|
|
if rv: sys.exit(rv)
|