From b476f98381af7e7b369e788fffee817d4e4ebb45 Mon Sep 17 00:00:00 2001 From: Gyorgy Sarvari Date: Sun, 19 Oct 2025 17:59:26 +0200 Subject: python3-betamax: fix ptests 1. Some tests require internet access. Set a DNS for that, if it is not available at the start of the test. 2. Added a backported patch that fixes some failing tests, due to a variable header value contained in a response. (fix-failing-ptest.patch) 3. Added a backported patch that avoids calling pytest fixtures directly. If not applied, tests calling them are marked as failing by pytest. (fix-direct-calls-to-test-fixtures.patch) Signed-off-by: Gyorgy Sarvari --- meta-python/recipes-devtools/python/python3-betamax/run-ptest | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'meta-python/recipes-devtools/python/python3-betamax/run-ptest') diff --git a/meta-python/recipes-devtools/python/python3-betamax/run-ptest b/meta-python/recipes-devtools/python/python3-betamax/run-ptest index b63c4de0d9..7553a6d4bc 100644 --- a/meta-python/recipes-devtools/python/python3-betamax/run-ptest +++ b/meta-python/recipes-devtools/python/python3-betamax/run-ptest @@ -1,3 +1,9 @@ #!/bin/sh +if ! nslookup httpbin.org >/dev/null 2>&1 ; then + trap 'mv /etc/resolv.conf.bak /etc/resolv.conf' INT EXIT + mv /etc/resolv.conf /etc/resolv.conf.bak + echo "nameserver 8.8.8.8" > /etc/resolv.conf +fi + 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}}' -- cgit v1.2.3-54-g00ecf