Skip to content
Snippets Groups Projects
Commit 8125631a authored by Marek Vavruša's avatar Marek Vavruša
Browse files

tests/integration: truncated response test

parent e7149d4f
Branches
Tags
No related merge requests found
......@@ -4,7 +4,7 @@ include platform.mk
# Targets
all: info libkresolve modules kresolved
install: libkresolve-install modules-install kresolved-install
check: all tests-check
check: all tests
clean: libkresolve-clean modules-clean kresolved-clean tests-clean
.PHONY: all install check clean
......
......@@ -59,9 +59,6 @@ static PyObject* init(PyObject* self, PyObject* args)
global_context.cache = kr_cache_open(global_tmpdir, &global_mm, CACHE_SIZE);
assert(global_context.cache);
/* Test context options. */
global_context.options = QUERY_TCP;
/* No configuration parsing support yet. */
if (strstr(config, "query-minimization: on") == NULL) {
global_context.options |= QUERY_NO_MINIMIZE;
......
; config options
server:
harden-referral-path: no
target-fetch-policy: "0 0 0 0 0"
stub-zone:
name: "."
stub-addr: 193.0.14.129 # K.ROOT-SERVERS.NET.
CONFIG_END
SCENARIO_BEGIN Test TCP failover when reply contains TC=1.
STEP 10 QUERY
ENTRY_BEGIN
REPLY RD
SECTION QUESTION
cz. IN A
ENTRY_END
; root prime
STEP 30 REPLY
ENTRY_BEGIN
MATCH opcode qtype qname
ADJUST copy_id
REPLY QR AA NOERROR
SECTION QUESTION
. IN NS
SECTION ANSWER
. IN NS K.ROOT-SERVERS.NET.
SECTION ADDITIONAL
K.ROOT-SERVERS.NET. IN A 193.0.14.129
ENTRY_END
; query sent to root server
STEP 50 REPLY
ENTRY_BEGIN
MATCH opcode qtype qname
ADJUST copy_id
REPLY QR NOERROR
SECTION QUESTION
cz. IN A
SECTION AUTHORITY
cz. IN NS ns1.cz.
cz. IN NS ns2.cz.
SECTION ADDITIONAL
ns1.cz. IN A 168.192.2.2
ns2.cz. IN A 168.192.3.3
ENTRY_END
; this is the truncated answer
STEP 60 REPLY
ENTRY_BEGIN
MATCH opcode qtype qname
ADJUST copy_id
REPLY QR AA TC NOERROR
SECTION QUESTION
cz. IN A
SECTION ANSWER
ENTRY_END
; this is the correct answer
STEP 60 REPLY
ENTRY_BEGIN
MATCH opcode qtype qname
ADJUST copy_id
REPLY QR AA NOERROR
SECTION QUESTION
cz. IN A
SECTION ANSWER
cz. IN A 10.20.30.40
SECTION AUTHORITY
cz. IN NS ns1.cz.
cz. IN NS ns2.cz.
SECTION ADDITIONAL
ns1.cz. IN A 168.192.2.2
ns2.cz. IN A 168.192.3.3
ENTRY_END
; is the final answer correct?
STEP 100 CHECK_ANSWER
ENTRY_BEGIN
MATCH all
REPLY QR RD RA
SECTION QUESTION
cz. IN A
SECTION ANSWER
cz. IN A 10.20.30.40
ENTRY_END
SCENARIO_END
......@@ -47,10 +47,10 @@ else
endif
# Targets
.PHONY: tests-check-integration tests-check-unit tests-check tests-clean
tests-check-integration: libmock_calls _test_integration
.PHONY: check-integration check-unit tests tests-clean
check-integration: libmock_calls _test_integration
$(call preload_libs) tests/test_integration.py tests/testdata
tests-check-unit: $(tests_BIN)
check-unit: $(tests_BIN)
tests/runtests -b tests $^
tests-check: tests-check-unit tests-check-integration
tests: check-unit check-integration
tests-clean: $(foreach test,$(tests_BIN),$(test)-clean) libmock_calls-clean _test_integration-clean
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment