]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Adjusted serve-stale test
authorDiego Fronza <diego@isc.org>
Fri, 11 Dec 2020 19:12:48 +0000 (16:12 -0300)
committerDiego Fronza <diego@isc.org>
Mon, 25 Jan 2021 13:47:14 +0000 (10:47 -0300)
After the addition of stale-answer-client-timeout a test was broken due
to the following behavior expected by the test.

1. Prime cache data.example txt.
2. Disable authoritative server.
3. Send a query for data.example txt.
4. Recursive server will timeout and answer from cache with stale RRset.
5. Recursive server will activate stale-refresh-time due to the previous
   failure in attempting to refresh the RRset.
6. Send a query for data.example txt.
7. Expect stale answer from cache due to stale-refresh-time
window being active, even if authoritative server is up.

Problem is that in step 4, due to the new option
stale-answer-client-timeout, recursive server will answer with stale
data before the actual fetch completes.

Since the original fetch is still running in background, if we re-enable
the authoritative server during that time, the RRset will actually be
successfully refreshed, and stale-refresh-window will not be activated.

The next queries will fail because they expect the TTL of the RRset to
match the one in the stale cache, not the one just refreshed.

To solve this, we explicitly disable stale-answer-client-timeout for
this test, as it's not the feature we are interested in testing here
anyways.

bin/tests/system/serve-stale/clean.sh
bin/tests/system/serve-stale/ns1/named1.conf.in
bin/tests/system/serve-stale/ns1/named2.conf.in
bin/tests/system/serve-stale/ns1/named3.conf.in

index 5f3c90f540b067d52c0393f67da107630fcdc3f2..2784ba25a079d7b47d6e8ebb5c4b9c0c7b93ee74 100644 (file)
@@ -15,3 +15,4 @@ rm -f */named.run */named.memstats
 rm -f ns*/managed-keys.bind*
 rm -f ns*/named_dump*
 rm -f ns*/named.stats*
+rm -f ns1/named.run.prev
index 41347871cdec0dacfc66ec3a843f12d2475fa498..a8410a0e448166116531fef8569bb6035da38878 100644 (file)
@@ -30,6 +30,7 @@ options {
        max-stale-ttl 3600;
        stale-answer-ttl 4;
        stale-answer-enable yes;
+       stale-answer-client-timeout disabled;
        stale-cache-enable yes;
        stale-refresh-time 30;
        servfail-ttl 0;
index 06fae5369c2c61d90e62e41d66d80fc1ecacb746..c8a8daeee1a22e8593aba536bb3a90bccb6c1456 100644 (file)
@@ -30,6 +30,7 @@ options {
        max-stale-ttl 20;
        stale-answer-ttl 3;
        stale-answer-enable yes;
+       stale-answer-client-timeout disabled;
        stale-cache-enable yes;
        servfail-ttl 0;
 };
index f97dea958de86c5242ee4c684ee055d29341db25..6fed86ae4052230a18a8c70b0c7d40106ff51c61 100644 (file)
@@ -30,6 +30,7 @@ options {
        max-stale-ttl 20;
        stale-answer-ttl 3;
        stale-answer-enable yes;
+       stale-answer-client-timeout disabled;
        stale-cache-enable yes;
        stale-refresh-time 0;
        servfail-ttl 0;