* [PATCH] Fix failing nss/tst-nss-files-hosts-long.
@ 2021-07-09 9:04 Stefan Liebler
2021-07-09 9:21 ` Florian Weimer
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Liebler @ 2021-07-09 9:04 UTC (permalink / raw)
To: libc-alpha; +Cc: Stefan Liebler
Sometimes the test nss/tst-nss-files-hosts-long is failing as getent
fails with exit-code 2.
This happens e.g. if tst-reload1 was run just before this test:
make t=nss/tst-reload1 test
make t=nss/tst-nss-files-hosts-long test
Then the test fails as /etc/nsswitch.conf contains "hosts: test2".
If /etc/nsswitch.conf is not present or there is no hosts line,
then it defaults to "hosts: dns [!UNAVAIL=return] files".
I've also observed a case, where dns returns with NSS_STATUS_NOTFOUND
and thus getent also fails with exit-code 2 without searching in
/etc/hosts.
Thus, this patch just uses "hosts: files" in nsswitch.conf.
---
nss/tst-nss-files-hosts-long.root/etc/nsswitch.conf | 1 +
1 file changed, 1 insertion(+)
create mode 100644 nss/tst-nss-files-hosts-long.root/etc/nsswitch.conf
diff --git a/nss/tst-nss-files-hosts-long.root/etc/nsswitch.conf b/nss/tst-nss-files-hosts-long.root/etc/nsswitch.conf
new file mode 100644
index 0000000000..5b0c6a4199
--- /dev/null
+++ b/nss/tst-nss-files-hosts-long.root/etc/nsswitch.conf
@@ -0,0 +1 @@
+hosts: files
--
2.31.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix failing nss/tst-nss-files-hosts-long.
2021-07-09 9:04 [PATCH] Fix failing nss/tst-nss-files-hosts-long Stefan Liebler
@ 2021-07-09 9:21 ` Florian Weimer
2021-07-12 8:47 ` Stefan Liebler
0 siblings, 1 reply; 3+ messages in thread
From: Florian Weimer @ 2021-07-09 9:21 UTC (permalink / raw)
To: Stefan Liebler via Libc-alpha; +Cc: Stefan Liebler
* Stefan Liebler via Libc-alpha:
> Sometimes the test nss/tst-nss-files-hosts-long is failing as getent
> fails with exit-code 2.
>
> This happens e.g. if tst-reload1 was run just before this test:
> make t=nss/tst-reload1 test
> make t=nss/tst-nss-files-hosts-long test
> Then the test fails as /etc/nsswitch.conf contains "hosts: test2".
>
> If /etc/nsswitch.conf is not present or there is no hosts line,
> then it defaults to "hosts: dns [!UNAVAIL=return] files".
> I've also observed a case, where dns returns with NSS_STATUS_NOTFOUND
> and thus getent also fails with exit-code 2 without searching in
> /etc/hosts.
>
> Thus, this patch just uses "hosts: files" in nsswitch.conf.
> ---
> nss/tst-nss-files-hosts-long.root/etc/nsswitch.conf | 1 +
> 1 file changed, 1 insertion(+)
> create mode 100644 nss/tst-nss-files-hosts-long.root/etc/nsswitch.conf
>
> diff --git a/nss/tst-nss-files-hosts-long.root/etc/nsswitch.conf b/nss/tst-nss-files-hosts-long.root/etc/nsswitch.conf
> new file mode 100644
> index 0000000000..5b0c6a4199
> --- /dev/null
> +++ b/nss/tst-nss-files-hosts-long.root/etc/nsswitch.conf
> @@ -0,0 +1 @@
> +hosts: files
I think the issue is that nss/tst-reload1 clobbers the test chroot
without indicating so. A file nss/tst-reload1.root/postclean.req
appears to be missing.
Thanks,
Florian
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix failing nss/tst-nss-files-hosts-long.
2021-07-09 9:21 ` Florian Weimer
@ 2021-07-12 8:47 ` Stefan Liebler
0 siblings, 0 replies; 3+ messages in thread
From: Stefan Liebler @ 2021-07-12 8:47 UTC (permalink / raw)
To: Florian Weimer, Stefan Liebler via Libc-alpha
On 09/07/2021 11:21, Florian Weimer wrote:
> * Stefan Liebler via Libc-alpha:
>
>> Sometimes the test nss/tst-nss-files-hosts-long is failing as getent
>> fails with exit-code 2.
>>
>> This happens e.g. if tst-reload1 was run just before this test:
>> make t=nss/tst-reload1 test
>> make t=nss/tst-nss-files-hosts-long test
>> Then the test fails as /etc/nsswitch.conf contains "hosts: test2".
>>
>> If /etc/nsswitch.conf is not present or there is no hosts line,
>> then it defaults to "hosts: dns [!UNAVAIL=return] files".
>> I've also observed a case, where dns returns with NSS_STATUS_NOTFOUND
>> and thus getent also fails with exit-code 2 without searching in
>> /etc/hosts.
>>
>> Thus, this patch just uses "hosts: files" in nsswitch.conf.
>> ---
>> nss/tst-nss-files-hosts-long.root/etc/nsswitch.conf | 1 +
>> 1 file changed, 1 insertion(+)
>> create mode 100644 nss/tst-nss-files-hosts-long.root/etc/nsswitch.conf
>>
>> diff --git a/nss/tst-nss-files-hosts-long.root/etc/nsswitch.conf b/nss/tst-nss-files-hosts-long.root/etc/nsswitch.conf
>> new file mode 100644
>> index 0000000000..5b0c6a4199
>> --- /dev/null
>> +++ b/nss/tst-nss-files-hosts-long.root/etc/nsswitch.conf
>> @@ -0,0 +1 @@
>> +hosts: files
>
> I think the issue is that nss/tst-reload1 clobbers the test chroot
> without indicating so. A file nss/tst-reload1.root/postclean.req
> appears to be missing.
>
> Thanks,
> Florian
>
I've just send a v2 patch with the postclean.req:
https://sourceware.org/pipermail/libc-alpha/2021-July/128919.html
Thanks,
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-07-12 8:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-09 9:04 [PATCH] Fix failing nss/tst-nss-files-hosts-long Stefan Liebler
2021-07-09 9:21 ` Florian Weimer
2021-07-12 8:47 ` Stefan Liebler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).