0b26f7
commit ae925404a10bf0ea63d6e8d41e3821f68b4d776c
0b26f7
Author: Aurelien Jarno <aurelien@aurel32.net>
0b26f7
Date:   Fri Sep 3 00:28:14 2021 +0200
0b26f7
0b26f7
    Fix failing nss/tst-nss-files-hosts-long with local resolver
0b26f7
    
0b26f7
    When a local resolver like unbound is listening on the IPv4 loopback
0b26f7
    address 127.0.0.1, the nss/tst-nss-files-hosts-long test fails. This is
0b26f7
    due to:
0b26f7
    - the default resolver in the absence of resolv.conf being 127.0.0.1
0b26f7
    - the default DNS NSS database configuration in the absence of
0b26f7
      nsswitch.conf being 'hosts: dns [!UNAVAIL=return] file'
0b26f7
    
0b26f7
    This causes the requests for 'test4' and 'test6' to first be sent to the
0b26f7
    local resolver, which responds with NXDOMAIN in the likely case those
0b26f7
    records do no exist. In turn that causes the access to /etc/hosts to be
0b26f7
    skipped, which is the purpose of that test.
0b26f7
    
0b26f7
    Fix that by providing a simple nsswitch.conf file forcing access to
0b26f7
    /etc/hosts for that test. I have tested that the only changed result in
0b26f7
    the testsuite is that test.
0b26f7
    
0b26f7
    (cherry picked from commit 2738480a4b0866723fb8c633f36bdd34a8767581)
0b26f7
0b26f7
diff --git a/nss/tst-nss-files-hosts-long.root/etc/nsswitch.conf b/nss/tst-nss-files-hosts-long.root/etc/nsswitch.conf
0b26f7
new file mode 100644
0b26f7
index 0000000000000000..5b0c6a419937a013
0b26f7
--- /dev/null
0b26f7
+++ b/nss/tst-nss-files-hosts-long.root/etc/nsswitch.conf
0b26f7
@@ -0,0 +1 @@
0b26f7
+hosts: files