[PATCH] Ensure that nsswitch.conf for nss/tst-reload[12] are really synced.
Stefan Liebler
stli@linux.ibm.com
Wed Mar 10 15:22:50 GMT 2021
Both tests, nss/tst-reload1 and nss/tst-reload2 are test-container
tests and both provide a root directory for the container.
Unfortunately on a fresh git clone, all the nsswitch files have
the same size of 40bytes and timestamp:
nss/tst-reload1.root/etc/nsswitch.conf2
nss/tst-reload2.root/etc/nsswitch.conf
nss/tst-reload2.root/subdir/etc/nsswitch.conf
nss/tst-reload1.root/etc/nsswitch.conf
After running tst-reload1, the <objpfx>/testroot.root/etc/nsswitch.conf
file has the content of nss/tst-reload1.root/etc/nsswitch.conf2.
Rerunning with "make t=nss/tst-reload1 test" leads to fails
as nsswitch.conf is not synced by test-container.c.
Therefore this patch just adds different comments to those files
to ensure that test-container.c is always syncing them.
---
nss/tst-reload1.root/etc/nsswitch.conf | 4 ++++
nss/tst-reload1.root/etc/nsswitch.conf2 | 3 +++
nss/tst-reload2.root/etc/nsswitch.conf | 2 ++
3 files changed, 9 insertions(+)
diff --git a/nss/tst-reload1.root/etc/nsswitch.conf b/nss/tst-reload1.root/etc/nsswitch.conf
index 606d8f51d6..56248fc8a3 100644
--- a/nss/tst-reload1.root/etc/nsswitch.conf
+++ b/nss/tst-reload1.root/etc/nsswitch.conf
@@ -1,3 +1,7 @@
+# This nsswitch.conf file should be synced by test-container.c while starting
+# tst-reload1. Ensure that the size differs compared to the other
+# nsswitch.conf[2] files of tst-reload1 or tst-reload2. Otherwise
+# test-container.c won't sync it.
passwd: test1
group: test1
hosts: test1
diff --git a/nss/tst-reload1.root/etc/nsswitch.conf2 b/nss/tst-reload1.root/etc/nsswitch.conf2
index 2e93977efb..762dcc3f36 100644
--- a/nss/tst-reload1.root/etc/nsswitch.conf2
+++ b/nss/tst-reload1.root/etc/nsswitch.conf2
@@ -1,3 +1,6 @@
+# This nsswitch.conf will be used while running tst-reload2.
+# Ensure that the size differs compared to the other nsswitch.conf[2] files of
+# tst-reload1 or tst-reload2. Otherwise test-container.c won't sync it.
passwd: test2
group: test2
hosts: test2
diff --git a/nss/tst-reload2.root/etc/nsswitch.conf b/nss/tst-reload2.root/etc/nsswitch.conf
index 688a589519..fbe057480f 100644
--- a/nss/tst-reload2.root/etc/nsswitch.conf
+++ b/nss/tst-reload2.root/etc/nsswitch.conf
@@ -1,3 +1,5 @@
+# Ensure that the size differs compared to the other nsswitch.conf[2] files of
+# tst-reload1 or tst-reload2. Otherwise test-container.c won't sync it.
passwd: test1
group: test2
hosts: files
--
2.28.0
More information about the Libc-alpha
mailing list