From 1230d56e011a5825f64daf5820fdead90b329b4d Mon Sep 17 00:00:00 2001 From: Gyorgy Sarvari Date: Fri, 31 Oct 2025 16:44:11 +0100 Subject: [PATCH] libnet-dns-perl: fix ptests Enable network connection to get a test unstuck that was trying to access the network. Signed-off-by: Gyorgy Sarvari --- meta-perl/recipes-perl/libnet/files/run-ptest | 6 ++++++ meta-perl/recipes-perl/libnet/libnet-dns-perl_1.33.bb | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/meta-perl/recipes-perl/libnet/files/run-ptest b/meta-perl/recipes-perl/libnet/files/run-ptest index c9f9ca94d0..48d72a78fa 100644 --- a/meta-perl/recipes-perl/libnet/files/run-ptest +++ b/meta-perl/recipes-perl/libnet/files/run-ptest @@ -1,5 +1,11 @@ #!/bin/sh +if ! nslookup example.com; then + mv /etc/resolv.conf /etc/resolv.conf.bak + echo "nameserver 8.8.8.8" > /etc/resolv.conf + trap "mv /etc/resolv.conf.bak /etc/resolv.conf" INT EXIT +fi + for case in `find t -type f -name '*.t'`; do perl $case >$case.output 2>&1 ret=$? diff --git a/meta-perl/recipes-perl/libnet/libnet-dns-perl_1.33.bb b/meta-perl/recipes-perl/libnet/libnet-dns-perl_1.33.bb index c768d64e32..3432076ade 100644 --- a/meta-perl/recipes-perl/libnet/libnet-dns-perl_1.33.bb +++ b/meta-perl/recipes-perl/libnet/libnet-dns-perl_1.33.bb @@ -7,7 +7,8 @@ LIC_FILES_CHKSUM = "file://README;beginline=252;endline=269;md5=de95b6a896d5f861 DEPENDS += "perl" -SRC_URI = "http://search.cpan.org/CPAN/authors/id/N/NL/NLNETLABS/Net-DNS-${PV}.tar.gz" +SRC_URI = "http://search.cpan.org/CPAN/authors/id/N/NL/NLNETLABS/Net-DNS-${PV}.tar.gz \ + file://run-ptest" SRC_URI[sha256sum] = "5a40e7cf524e4bd2c33cf03b82b47d5308b712083aa5ee180b0b5af54c71fbd2" @@ -49,6 +50,14 @@ RDEPENDS:${PN}-ptest += " \ perl-module-overload \ " +do_install_ptest_perl:append(){ + # This test tries to reconcile the MANIFEST file content with the actual + # package content. While this might be useful for package integrity + # verification, it is not much for runtime testing. It also requires the + # whole source package to be installed. Rather just drop this test. + rm ${D}${PTEST_PATH}/t/00-install.t +} + python __anonymous () { # rather than use "find" to determine libc-*.so, # statically export the known paths for glibc and musl