]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pytest: dns_aging: fix two tests (bad arithmetic)
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Sat, 19 Jun 2021 02:52:47 +0000 (14:52 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 22 Jun 2021 01:14:37 +0000 (01:14 +0000)
oops.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/dns_aging.py
selftest/knownfail.d/dns-aging

index 67bc836c70e05b65a424452dfb750f1bafa7598e..cad2c8743dcdd1f1d897d19b82198f9db8c27e5f 100644 (file)
@@ -1631,8 +1631,8 @@ class TestDNSAging(DNSTest):
 
     def test_aging_refresh(self):
         name, txt = 'agingtest', ['test txt']
-        no_refresh = 100
-        refresh = 80
+        no_refresh = 200
+        refresh = 160
         self.set_zone_int_params(NoRefreshInterval=no_refresh,
                                  RefreshInterval=refresh,
                                  Aging=1)
@@ -1640,22 +1640,22 @@ class TestDNSAging(DNSTest):
         start_time = before_mod.dwTimeStamp
 
         # go back 86 hours, which is in the no-refresh time (but
-        # wouldn't be if we had stuck to the default of 84).
-        self.ldap_modify_timestamps(name, -86)
+        # wouldn't be if we had stuck to the default of 168).
+        self.ldap_modify_timestamps(name, -170)
         rec = self.dns_update_record(name, txt)
         self.assert_timestamps_equal(rec.dwTimeStamp,
-                                     start_time - 86)
+                                     start_time - 170)
 
-        # back to -102 hours, into the refresh zone
+        # back to -202 hours, into the refresh zone
         # the update should reset the timestamp to now.
-        self.ldap_modify_timestamps(name, -16)
+        self.ldap_modify_timestamps(name, -32)
         rec = self.dns_update_record(name, txt)
         self.assert_soon_after(rec.dwTimeStamp, start_time)
 
-        # back to -182 hours, beyond the end of the refresh period.
+        # back to -362 hours, beyond the end of the refresh period.
         # Actually nothing changes at this time -- we can still
         # refresh, but the record is liable for scavenging.
-        self.ldap_modify_timestamps(name, -182)
+        self.ldap_modify_timestamps(name, -160)
         rec = self.dns_update_record(name, txt)
         self.assert_soon_after(rec.dwTimeStamp, start_time)
 
@@ -2030,8 +2030,8 @@ class TestDNSAging(DNSTest):
         # the database directly.
 
         # just to be sure we have the right limits.
-        self.set_zone_int_params(NoRefreshInterval=84,
-                                 RefreshInterval=84,
+        self.set_zone_int_params(NoRefreshInterval=168,
+                                 RefreshInterval=168,
                                  Aging=1)
 
         ts1, ts2, ts3, ts4, ts5, ts6 = ('1', '2', '3', '4', '5', '6')
index ea1f0771c7c8bcccb1b09ecfc611cbad96ffe10e..31c381efee1ce01f0c0ea55634c06a49b56e649b 100644 (file)
@@ -3,6 +3,7 @@
 # These all pass on Windows, apart from test_basic_scavenging, which
 # fails due to technical issues.
 
+samba.tests.dns_aging.__main__.TestDNSAging.test_aging_refresh
 samba.tests.dns_aging.+test_dns_add_sibling_0_0_days_aging
 samba.tests.dns_aging.+test_dns_add_sibling_0_0_days_aging_touch
 samba.tests.dns_aging.+test_dns_add_sibling_0_0_days_no_aging
@@ -37,7 +38,6 @@ samba.tests.dns_aging.+test_add_update_many
 samba.tests.dns_aging.+test_add_update_timestamp
 samba.tests.dns_aging.+test_add_update_ttl
 samba.tests.dns_aging.+test_add_update_ttl_serial
-samba.tests.dns_aging.+test_basic_scavenging
 samba.tests.dns_aging.+test_dns_delete_simple_0_0_days_no_aging_touch
 samba.tests.dns_aging.+test_dns_delete_simple_0_113_days_no_aging_touch
 samba.tests.dns_aging.+test_dns_delete_simple_10_0_days_aging