meta-openembedded/meta-python/recipes-devtools/python/python3-gunicorn/run-ptest
Trevor Gamblin e8247f6b28 python3-gunicorn: tweak run-ptest, add RDEPENDS
gunicorn relies on eventlet and gevent for its ptests, and it also
requires a non-empty /etc/resolv.conf for one of those tests. Add those
two modules to RDEPENDS for the recipe, and add an echo in run-ptest to
make sure that there is something basic in /etc/resolv.conf before the
test actually runs.

Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
2021-08-26 09:57:25 -07:00

585 B

#!/bin/sh

there needs to be something in /etc/resolv.conf for the gunicorn

ptests to work, so make sure there's at least one nameserver line

echo "nameserver 8.8.8.8" >> /etc/resolv.conf

pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/[...%]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'