Files
graphene/Pal/regression/02_Socket.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

40 lines
1.5 KiB
Python

import os, sys, mmap
from regression import Regression
loader = os.environ['PAL_LOADER']
regression = Regression(loader, "Socket")
regression.add_check(name="TCP Socket Creation",
check=lambda res: "TCP Creation 1 OK" in res[0].log)
regression.add_check(name="TCP Socket Connection",
check=lambda res: "TCP Connection 1 OK" in res[0].log)
regression.add_check(name="TCP Socket Transmission",
check=lambda res: "TCP Write 1 OK" in res[0].log and
"TCP Read 1: Hello World 1" in res[0].log and
"TCP Write 2 OK" in res[0].log and
"TCP Read 2: Hello World 2" in res[0].log)
regression.add_check(name="UDP Socket Creation",
check=lambda res: "UDP Creation 1 OK" in res[0].log)
regression.add_check(name="UDP Socket Connection",
check=lambda res: "UDP Connection 1 OK" in res[0].log)
regression.add_check(name="UDP Socket Transmission",
check=lambda res: "UDP Write 1 OK" in res[0].log and
"UDP Read 1: Hello World 1" in res[0].log and
"UDP Write 2 OK" in res[0].log and
"UDP Read 2: Hello World 2" in res[0].log)
regression.add_check(name="Bound UDP Socket Transmission",
check=lambda res: "UDP Write 3 OK" in res[0].log and
"UDP Read 3: Hello World 1" in res[0].log and
"UDP Write 4 OK" in res[0].log and
"UDP Read 4: Hello World 2" in res[0].log)
rv = regression.run_checks()
if rv: sys.exit(rv)