From c6b4476f6e87057fdfa97fceed5a401a189fcd28 Mon Sep 17 00:00:00 2001 From: Libor Peltan Date: Tue, 7 Mar 2017 10:57:52 +0100 Subject: [PATCH] tests: events/soa: retry query after SERVFAIL to avoid hitting AXFR --- tests-extra/tests/events/soa/test.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests-extra/tests/events/soa/test.py b/tests-extra/tests/events/soa/test.py index 198cd429c..e5fb5324a 100644 --- a/tests-extra/tests/events/soa/test.py +++ b/tests-extra/tests/events/soa/test.py @@ -4,15 +4,21 @@ from dnstest.utils import * from dnstest.test import Test +import dns.rcode import random EXPIRE_SLEEP = 15 +RECHECK_SLEEP = 0.5 def test_ok(slave): resp = slave.dig("example.", "SOA") resp.check(rcode="NOERROR") t.sleep(EXPIRE_SLEEP) resp = slave.dig("example.", "SOA") + if resp.resp.rcode() == dns.rcode.SERVFAIL: + t.sleep(RECHECK_SLEEP) + # retry if we hit the query just in the middle of AXFR + resp = slave.dig("example.", "SOA") resp.check(rcode="NOERROR") def test_expired(slave): -- GitLab