]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
support: Reinitialize containers if /etc is present
authorFlorian Weimer <fweimer@redhat.com>
Sat, 24 Jan 2026 09:29:39 +0000 (10:29 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Sat, 24 Jan 2026 09:29:39 +0000 (10:29 +0100)
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.

Reviewed-by: DJ Delorie <dj@redhat.com>
support/test-container.c

index acadb7952bc669e5c374040efe4cdc31abf168ce..8954dd2767a11bdc2b927d1d4e99054e33da1c1a 100644 (file)
@@ -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, the testroot is cleaned,
+     too.  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)))