]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
serve_stale: add test with NS timeout test-serve-stale 1227/head
authorTomas Krizek <tomas.krizek@nic.cz>
Mon, 15 Nov 2021 15:01:21 +0000 (16:01 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Mon, 15 Nov 2021 15:54:23 +0000 (16:54 +0100)
Modify the test to simulate a non-responsive auth as well. As of v5.4.2,
this test should fail, because serve_stale doesn't work with the current
server selection algorithm.

Related #687

modules/meson.build
modules/serve_stale/test.integr/module_serve_stale.rpl

index b2e68a6ebb3aeafff3c5b1c458e70706070fcf9c..6c7366cf22f7c3c23e00c76de38e98b536f4fd82 100644 (file)
@@ -29,7 +29,7 @@ config_tests += [
 
 integr_tests += [
   ['rebinding', meson.current_source_dir() / 'rebinding' / 'test.integr'],
-  ['serve_stale', meson.current_source_dir() / 'serve_stale' / 'test.integr'],
+  ['serve_stale', meson.current_source_dir() / 'serve_stale' / 'test.integr', [], true],
 ]
 
 
index 3ab3a8475ca31f575be80be7a357643aaa323f57..f64af866648768bdb20a5568a49a87caa5da8df5 100644 (file)
@@ -208,6 +208,23 @@ SECTION ADDITIONAL
 ENTRY_END
 RANGE_END
 
+; K.ROOT-SERVERS.NET.
+; do_not_answer any queries
+RANGE_BEGIN 201 300
+       ADDRESS 193.0.14.129
+       ADDRESS 192.5.6.30
+       ADDRESS 1.2.3.4
+ENTRY_BEGIN
+MATCH opcode subdomain
+ADJUST copy_id copy_query do_not_answer
+REPLY QR SERVFAIL
+SECTION QUESTION
+. IN A
+SECTION AUTHORITY
+SECTION ADDITIONAL
+ENTRY_END
+RANGE_END
+
 STEP 1 QUERY
 ENTRY_BEGIN
 REPLY RD
@@ -277,4 +294,26 @@ www.example.com. IN A      10.20.30.40
 ;ns.example.com.               IN      A       1.2.3.4
 ENTRY_END
 
+STEP 210 QUERY
+ENTRY_BEGIN
+REPLY RD
+SECTION QUESTION
+www.example.com. IN A
+ENTRY_END
+
+; Must be resolved from expired cache by serve_stale module
+STEP 220 CHECK_ANSWER
+ENTRY_BEGIN
+MATCH all
+REPLY QR RD RA NOERROR
+SECTION QUESTION
+www.example.com. IN A
+SECTION ANSWER
+www.example.com. IN A  10.20.30.40
+;SECTION AUTHORITY
+;example.com.  IN NS   ns.example.com.
+;SECTION ADDITIONAL
+;ns.example.com.               IN      A       1.2.3.4
+ENTRY_END
+
 SCENARIO_END