From ebfa200bfd9e63588d59c97232ade2ca4d0ae996 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Sat, 19 Jun 2021 14:52:47 +1200 Subject: [PATCH] pytest: dns_aging: fix two tests (bad arithmetic) oops. Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- python/samba/tests/dns_aging.py | 22 +++++++++++----------- selftest/knownfail.d/dns-aging | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/python/samba/tests/dns_aging.py b/python/samba/tests/dns_aging.py index 67bc836c70e..cad2c8743dc 100644 --- a/python/samba/tests/dns_aging.py +++ b/python/samba/tests/dns_aging.py @@ -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') diff --git a/selftest/knownfail.d/dns-aging b/selftest/knownfail.d/dns-aging index ea1f0771c7c..31c381efee1 100644 --- a/selftest/knownfail.d/dns-aging +++ b/selftest/knownfail.d/dns-aging @@ -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 -- 2.47.2