summaryrefslogtreecommitdiff
path: root/upstream-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-dnspython/run-ptest
diff options
context:
space:
mode:
Diffstat (limited to 'upstream-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-dnspython/run-ptest')
-rw-r--r--upstream-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-dnspython/run-ptest9
1 files changed, 9 insertions, 0 deletions
diff --git a/upstream-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-dnspython/run-ptest b/upstream-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-dnspython/run-ptest
index 8d2017d39c..cb674db8a0 100644
--- a/upstream-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-dnspython/run-ptest
+++ b/upstream-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-dnspython/run-ptest
@@ -1,3 +1,12 @@
#!/bin/sh
+# The live resolver tests use the system resolver configuration. When the
+# network is set up by the kernel's ip= parameter and nothing in userspace
+# (e.g. systemd-resolved) writes /etc/resolv.conf from it, the nameserver is
+# only available in /proc/net/pnp, so the tests fail with "no nameservers"
+# even though the Internet is reachable. Seed resolv.conf from it in that case.
+if ! grep -qs '^nameserver' /etc/resolv.conf && grep -qs '^nameserver' /proc/net/pnp; then
+ grep '^nameserver' /proc/net/pnp >> /etc/resolv.conf
+fi
+
pytest --automake