[PATCH] support: Reinitialize containers if /etc is present
Florian Weimer
fweimer@redhat.com
Wed Jan 21 16:17:52 GMT 2026
This prevents test failures because configuration file leftovers
unexpectedly change glibc for future tests. Whether this
triggers depends on test execution order.
Adding postclean.req files manually (before this change) appears
too error-prone.
---
support/test-container.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/support/test-container.c b/support/test-container.c
index acadb7952b..8da8d2169a 100644
--- a/support/test-container.c
+++ b/support/test-container.c
@@ -134,7 +134,9 @@ int verbose = 0;
- 'mkdirp': A minimal "mkdir -p FILE" command.
* mytest.root/postclean.req causes fresh rsync (with delete) after
- test if present
+ test if present. If /etc is present, it is also cleaned. This
+ prevents further tests from using special configurations in /etc
+ from previous tests.
* mytest.root/ldconfig.run causes ldconfig to be issued prior
test execution (to setup the initial ld.so.cache).
@@ -870,7 +872,8 @@ main (int argc, char **argv)
if (strrchr (so_base, '/') != NULL)
strrchr (so_base, '/')[1] = 0;
- if (file_exists (concat (command_root, "/postclean.req", NULL)))
+ if (file_exists (concat (command_root, "/postclean.req", NULL))
+ || file_exists (concat (command_root, "/etc", NULL)))
do_postclean = 1;
if (file_exists (concat (command_root, "/ldconfig.run", NULL)))
base-commit: 04e750e75b73957cf1c791535a3f4319534a52fc
More information about the Libc-alpha
mailing list