From: Remi Gacogne Date: Thu, 26 Jan 2023 14:45:14 +0000 (+0100) Subject: dnsdist: Add a test for an invalid name in the cache API X-Git-Tag: dnsdist-1.8.0-rc1~74^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F12473%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Add a test for an invalid name in the cache API --- diff --git a/regression-tests.dnsdist/test_Caching.py b/regression-tests.dnsdist/test_Caching.py index 77c1d72af8..0db60a1d08 100644 --- a/regression-tests.dnsdist/test_Caching.py +++ b/regression-tests.dnsdist/test_Caching.py @@ -2845,6 +2845,10 @@ class TestAPICache(DNSDistTest): r = requests.delete(url + '?pool=pool-without-cache&type=AAAA', headers=headers, timeout=self._webTimeout) self.assertEqual(r.status_code, 400) + # invalid name (label is too long) + r = requests.delete(url + '?pool=&name=' + 'a'*65, headers=headers, timeout=self._webTimeout) + self.assertEqual(r.status_code, 400) + # different name r = requests.delete(url + '?pool=&name=not-cache-api.cache.tests.powerdns.com.', headers=headers, timeout=self._webTimeout) self.assertTrue(r)