From: Mark Andrews Date: Thu, 9 Jul 2026 04:47:28 +0000 (+1000) Subject: cdnxdomain test is failing on some platforms X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=d2fbb36eeae6bf00b54791f5119998f3130ea2b8;p=thirdparty%2Fbind9.git cdnxdomain test is failing on some platforms Ensure the modification time is newer (second granuality) when the zone file is rewritten as named uses the file modification time to determine if it needs to reload a file. --- diff --git a/bin/tests/system/cdnxdomain/tests_cdnxdomain.py b/bin/tests/system/cdnxdomain/tests_cdnxdomain.py index 4f211f0be51..6448dd7b515 100644 --- a/bin/tests/system/cdnxdomain/tests_cdnxdomain.py +++ b/bin/tests/system/cdnxdomain/tests_cdnxdomain.py @@ -76,7 +76,20 @@ ns2 A 10.53.0.2 def _serve(ns2, system_test_dir, variant): """Make ns2 serve the 'full' or 'empty' (a.example-less) signed zone.""" src = system_test_dir / "ns2" / f"example-{variant}.db.signed" - shutil.copyfile(src, system_test_dir / "ns2" / "example.db.signed") + dst = system_test_dir / "ns2" / "example.db.signed" + # Ensure that the modification time of 'dst' increases on + # file systems with seconds granuality. + st_ok = False + try: + st = os.stat(dst) + st_ok = True + except FileNotFoundError: + pass + shutil.copyfile(src, dst) + if st_ok: + st2 = os.stat(dst) + if int(st2.st_mtime) <= int(st.st_mtime): + os.utime(dst, (st2.st_atime, st.st_mtime + 1)) ns2.reload()