]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pytest: dns_aging sibling test fails on windows
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Sat, 19 Jun 2021 03:54:11 +0000 (15:54 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 22 Jun 2021 01:14:37 +0000 (01:14 +0000)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/dns_aging.py

index 17ce1c0518dd5b9a23f1975302fc3a309993691f..b9efb694447523d5a8ad36e4d3909113e7e9f182 100644 (file)
@@ -2663,8 +2663,19 @@ class TestDNSAging(DNSTest):
         self.dns_update_record(name, B)
         a_rec = self.get_unique_txt_record(name, A)
         if not aging and touch:
-            # this resets the timestamp even if it is a static record.
-            self.assert_soon_after(a_rec, now)
+            # On Windows, this resets the timestamp even if it is a
+            # static record, though in that case it may be a
+            # transitory effect of the DNS cache. We will insist on
+            # the Samba behaviour of not changing (that is
+            # un-static-ing) a zero timestamp, because that is the
+            # sensible thing.
+            if a_days_ago == 0:
+                self.windows_variation(
+                    self.assert_soon_after, a_rec, now,
+                    msg="Windows resets static siblings (cache effect?)")
+                self.assert_timestamps_equal(a_rec, 0)
+            else:
+                self.assert_soon_after(a_rec, now)
         else:
             self.assert_timestamps_equal(a_rec, atime)