]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: mark test that depend on external servers and or are unreliable 14935/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 5 Dec 2024 13:54:13 +0000 (14:54 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 5 Dec 2024 14:09:15 +0000 (15:09 +0100)
While there get rid of the special status of test_WellKnown.py and
correct the way args are passed to pytest

regression-tests.recursor-dnssec/pytest.ini [new file with mode: 0644]
regression-tests.recursor-dnssec/runtests
regression-tests.recursor-dnssec/test_Chain.py
regression-tests.recursor-dnssec/test_ExtendedErrors.py
regression-tests.recursor-dnssec/test_SimpleDoT.py
regression-tests.recursor-dnssec/test_SimpleForwardOverDoT.py
regression-tests.recursor-dnssec/test_WellKnown.py

diff --git a/regression-tests.recursor-dnssec/pytest.ini b/regression-tests.recursor-dnssec/pytest.ini
new file mode 100644 (file)
index 0000000..261099a
--- /dev/null
@@ -0,0 +1,4 @@
+[pytest]
+markers = 
+    external: uses external web servers
+    unreliable_on_gh: test is fine when run locally, but shows issues on GitHub
index adee05c4617320de7d1bdc9b02b8fb9315c9446b..3543dd2b79c52b1d1548b64e77440adcaeda4804 100755 (executable)
@@ -61,9 +61,13 @@ if ! "$PDNSRECURSOR" --version 2>&1 | grep Features | grep -q dnstap-framestream
   export NODNSTAPTESTS=1
 fi
 
+# Run with -m 'not external' to skip test that require external connectivity
+# Run with -m 'not unreliable_on_gh' to skip tests that are unreliable on GitHUb
+# Run with -m 'not (external or unreliable_on_gh)' to skip both categories
+
 # LIBFAKETIME is only added to LD_PRELOAD by the pyton code when needed
 if [ "${LIBASAN}" != "" -o "${LIBAUTHBIND}" != "" ]; then
-LD_PRELOAD="${LIBASAN} ${LIBAUTHBIND}" pytest --ignore=test_WellKnown.py --junitxml=pytest.xml $@
+LD_PRELOAD="${LIBASAN} ${LIBAUTHBIND}" pytest --junitxml=pytest.xml "$@"
 else
-pytest --ignore=test_WellKnown.py  --junitxml=pytest.xml $@
+pytest --junitxml=pytest.xml "$@"
 fi
index 6c20937b31e32a1691d47d5f093717a3bf523cd4..3c20da0fc75897b55fbd68cd6671d389b923c454 100644 (file)
@@ -1,3 +1,4 @@
+import pytest
 import dns
 import os
 import time
@@ -23,6 +24,7 @@ class ChainTest(RecursorTest):
     api-key=%s
 """ % (_wsPort, _wsPassword, _apiKey)
 
+    @pytest.mark.unreliable_on_gh
     def testBasic(self):
         """
         Tests the case of #14624. Sending many equal requests could lead to ServFail because of clashing
index 635c2c579c4c4e5c53a54da5b6d7946ac3c7697a..a684665a7935d15048b797f3fdb2bb59d55054f7 100644 (file)
@@ -83,6 +83,7 @@ extended-resolution-errors=yes
 
         super(ExtendedErrorsTest, cls).generateRecursorConfig(confdir)
 
+    @pytest.mark.external
     def testNotIncepted(self):
         qname = 'signotincepted.bad-dnssec.wb.sidnlabs.nl.'
         query = dns.message.make_query(qname, 'A', want_dnssec=True)
@@ -96,6 +97,7 @@ extended-resolution-errors=yes
             self.assertEqual(res.options[0].otype, 15)
             self.assertEqual(res.options[0], extendederrors.ExtendedErrorOption(8, b''))
 
+    @pytest.mark.external
     def testExpired(self):
         qname = 'sigexpired.bad-dnssec.wb.sidnlabs.nl.'
         query = dns.message.make_query(qname, 'A', want_dnssec=True)
@@ -109,6 +111,7 @@ extended-resolution-errors=yes
             self.assertEqual(res.options[0].otype, 15)
             self.assertEqual(res.options[0], extendederrors.ExtendedErrorOption(7, b''))
 
+    @pytest.mark.external
     def testAllExpired(self):
         qname = 'servfail.nl.'
         query = dns.message.make_query(qname, 'AAAA', want_dnssec=True)
@@ -122,6 +125,7 @@ extended-resolution-errors=yes
             self.assertEqual(res.options[0].otype, 15)
             self.assertEqual(res.options[0], extendederrors.ExtendedErrorOption(6, b''))
 
+    @pytest.mark.external
     def testBogus(self):
         qname = 'bogussig.ok.bad-dnssec.wb.sidnlabs.nl.'
         query = dns.message.make_query(qname, 'A', want_dnssec=True)
@@ -135,6 +139,7 @@ extended-resolution-errors=yes
             self.assertEqual(res.options[0].otype, 15)
             self.assertEqual(res.options[0], extendederrors.ExtendedErrorOption(6, b''))
 
+    @pytest.mark.external
     def testMissingRRSIG(self):
         qname = 'brokendnssec.net.'
         query = dns.message.make_query(qname, 'A', want_dnssec=True)
@@ -236,6 +241,7 @@ extended-resolution-errors=no
     def generateRecursorConfig(cls, confdir):
         super(NoExtendedErrorsTest, cls).generateRecursorConfig(confdir)
 
+    @pytest.mark.external
     def testNotIncepted(self):
         qname = 'signotincepted.bad-dnssec.wb.sidnlabs.nl.'
         query = dns.message.make_query(qname, 'A', want_dnssec=True)
index 4802e4ef4c5c3abfc0be776d069350c9605c5759..20eaea132d295d09dcd904d69dc5a981a9e14c86 100644 (file)
@@ -1,3 +1,4 @@
+import pytest
 import dns
 import os
 import subprocess
@@ -30,6 +31,7 @@ devonly-regression-test-mode
         cls.generateRecursorConfig(confdir)
         cls.startRecursor(confdir, cls._recursorPort)
 
+    @pytest.mark.external
     def testTXT(self):
         expected = dns.rrset.from_text('dot-test-target.powerdns.org.', 0, dns.rdataclass.IN, 'TXT', 'https://github.com/PowerDNS/pdns/pull/12825')
         query = dns.message.make_query('dot-test-target.powerdns.org', 'TXT', want_dnssec=True)
index d7b85e648c21e295bd76b2c123ed9837cbfeb50b..8de66060b5d8a6d97fa09de644680688133ae322 100644 (file)
@@ -1,3 +1,4 @@
+import pytest
 import dns
 import os
 import subprocess
@@ -27,6 +28,7 @@ devonly-regression-test-mode
         cls.generateRecursorConfig(confdir)
         cls.startRecursor(confdir, cls._recursorPort)
 
+    @pytest.mark.external
     def testA(self):
         expected = dns.rrset.from_text('dns.google.', 0, dns.rdataclass.IN, 'A', '8.8.8.8', '8.8.4.4')
         query = dns.message.make_query('dns.google', 'A', want_dnssec=True)
index feaaa6f29d0e5f90db7ce2e2d009f1e87d3108cb..fa04a9692c92485bb3f1b83ef1fd6c73eab5e31d 100644 (file)
@@ -1,7 +1,9 @@
+import pytest
 import dns
 from recursortests import RecursorTest
 
-class TestWellKnown(RecursorTest):
+@pytest.mark.external
+class WellKnownTest(RecursorTest):
     _auths_zones = None
     _confdir = 'WellKnown'
     _roothints = None