Files
graphene/Pal/regression/04_SendHandle.py
Simon Gaiser 3d60004a8c [*/regression] Drop unused shebang
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.
2019-04-15 17:24:27 +02:00

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)