# License for the specific language governing permissions and limitations
# under the License.
from oslo_log import log as logging
+from oslo_utils import versionutils
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
@decorators.idempotent_id('8e7ecedb-5c35-46f8-ae0e-39e4aaabc97d')
def test_create_recordset_type_TXT(self):
self._test_create_recordset_type(
- "www", "TXT", ["\"Any Old Text Goes Here\""])
+ "sample", "TXT", ["\"Any Old Text Goes Here\""])
+
+ @decorators.idempotent_id('521ae1b0-f115-4d3c-8bcd-e54ef53bb2b9')
+ def test_create_recordset_type_SVCB(self):
+ if not versionutils.is_compatible('2.2', self.api_version,
+ same_major=False):
+ raise self.skipException(
+ 'SVCB record tests require Designate API version 2.2 or '
+ 'newer. Skipping test_create_recordset_type_SVCB test.')
+
+ ipv61 = '2001:db8:3333:4444:5555:6666:7777:8888'
+ ipv6hint = f'{ipv61},2001:db8:3333:4444:cccc:dddd:eeee:ffff'
+ ipv4hint = "1.2.3.4,9.8.7.6"
+ alpn = "h3,h2,http/1.1"
+ port = "888"
+ target = "sample.example.org."
+ doh = '/dns-query{?dns}'
+ self._test_create_recordset_type(
+ None,
+ "SVCB",
+ [f"1 {target} alpn={alpn} ipv4hint={ipv4hint}"
+ f" ipv6hint={ipv6hint} port={port} dohpath={doh}"]
+ )
+
+ @decorators.idempotent_id('ebb3c1e2-fa33-4520-bba5-2888886d84f5')
+ def test_create_recordset_type_HTTPS(self):
+ if not versionutils.is_compatible('2.2', self.api_version,
+ same_major=False):
+ raise self.skipException(
+ 'HTTPS record tests require Designate API version 2.2 or '
+ 'newer. Skipping test_create_recordset_type_HTTPS test.')
+
+ ipv61 = '2001:db8:3333:4444:5555:6666:7777:8888'
+ ipv6hint = f'{ipv61},2001:db8:3333:4444:cccc:dddd:eeee:ffff'
+ ipv4hint = "1.2.3.4,9.8.7.6"
+ alpn = "h3,h2,http/1.1"
+ port = "888"
+ target = "sample.example.org."
+ self._test_create_recordset_type(
+ "sample",
+ "HTTPS",
+ [f"1 {target} alpn={alpn} ipv4hint={ipv4hint}"
+ f" ipv6hint={ipv6hint} port={port}"]
+ )
+
+ @decorators.idempotent_id('64f3a41b-065c-47f8-8a73-2a0cd62ed196')
+ def test_create_recordset_type_HTTPS_no_default_alpn(self):
+ if not versionutils.is_compatible('2.2', self.api_version,
+ same_major=False):
+ raise self.skipException(
+ 'HTTPS record tests require Designate API version 2.2 or '
+ 'newer. Skipping '
+ 'test_create_recordset_type_HTTPS_no_default_alpntest.')
+
+ self._test_create_recordset_type(
+ "sample", "HTTPS", ['1 sample.example.org. alpn=http/1.1 '
+ 'no-default-alpn port=8000']
+ )
+
+ @decorators.idempotent_id('4d399592-5d37-43ba-99ac-e7665c2c1f8f')
+ def test_create_recordset_type_HTTPS_mandatory(self):
+ if not versionutils.is_compatible('2.2', self.api_version,
+ same_major=False):
+ raise self.skipException(
+ 'HTTPS record tests require Designate API version 2.2 or '
+ 'newer. Skipping test_create_recordset_type_HTTPS_mandatory '
+ 'test.')
+
+ ipv6 = "2001:db8:3333:4444:5555:6666:7777:8888"
+ self._test_create_recordset_type(
+ "sample",
+ "HTTPS",
+ [f'1 sample.example.org. ipv4hint=192.168.1.2 ipv6hint={ipv6}'
+ f' alpn=h2 mandatory=alpn'
+ ]
+ )
def _test_create_wildcard_recordset(self, name, type, records):
if name is not None:
lib_exc.NotFound, lambda: self.alt_client.create_recordset(
self.zone['id'], recordset_data))
+ @decorators.idempotent_id('f236a24a-a3c6-4a0c-a54c-ebf8a312b908')
+ def test_create_recordset_invalid_HTTPS_alpn(self):
+ if not versionutils.is_compatible('2.2', self.api_version,
+ same_major=False):
+ raise self.skipException(
+ 'HTTPS record tests require Designate API version 2.2 or '
+ 'newer. Skipping test_create_recordset_invalid_HTTPS_alpn '
+ 'test.')
+
+ self._test_create_recordset_invalid(
+ None, 'HTTPS', ["1 sample.example.org. alpn=foo"])
+
+ @decorators.idempotent_id('d680ef3a-4406-47c5-a994-483138c5e975')
+ def test_create_recordset_invalid_HTTPS_port(self):
+ if not versionutils.is_compatible('2.2', self.api_version,
+ same_major=False):
+ raise self.skipException(
+ 'HTTPS record tests require Designate API version 2.2 or '
+ 'newer. Skipping test_create_recordset_invalid_HTTPS_port '
+ 'test.')
+
+ self._test_create_recordset_invalid(
+ None, 'HTTPS', ["1 sample.example.org. port=foo"])
+
+ @decorators.idempotent_id('a33fc327-8d37-4582-9d2b-be83f6ee38d3')
+ def test_create_recordset_invalid_HTTPS_ech(self):
+ if not versionutils.is_compatible('2.2', self.api_version,
+ same_major=False):
+ raise self.skipException(
+ 'HTTPS record tests require Designate API version 2.2 or '
+ 'newer. Skipping test_create_recordset_invalid_HTTPS_ech '
+ 'test.')
+
+ self._test_create_recordset_invalid(
+ None, 'HTTPS', ["1 sample.example.org. port=8888 ech=foo//"])
+
+ @decorators.idempotent_id('1869737f-1a1b-4712-93da-2d680cd45cd8')
+ def test_create_recordset_invalid_SVCB_mandatory(self):
+ if not versionutils.is_compatible('2.2', self.api_version,
+ same_major=False):
+ raise self.skipException(
+ 'SVCB record tests require Designate API version 2.2 or '
+ 'newer. Skipping test_create_recordset_invalid_SVCB_mandatory '
+ 'test.')
+
+ ipv6hint = "2001:db8:3333:4444:5555:6666:7777:8888"
+ self._test_create_recordset_invalid(
+ None, 'SVCB', [
+ f"1 sample.example.org."
+ f" ipv6hint={ipv6hint} mandatory=alpn,ipv4hint"
+ ]
+ )
+
+ @decorators.idempotent_id('5bae6c22-7a37-48a5-b6b3-089d83a8f2ce')
+ def test_create_recordset_invalid_SVCB_ipv4hint(self):
+ if not versionutils.is_compatible('2.2', self.api_version,
+ same_major=False):
+ raise self.skipException(
+ 'SVCB record tests require Designate API version 2.2 or '
+ 'newer. Skipping test_create_recordset_invalid_SVCB_ipv4hint '
+ 'test.')
+
+ self._test_create_recordset_invalid(
+ None, 'SVCB',
+ ['1 sample.example.org. ipv4hint=foo,192.168.1.2'])
+
+ @decorators.idempotent_id('72dce8ca-f2fa-4054-b2b7-7bccfe3a02c1')
+ def test_create_recordset_invalid_SVCB_ipv6hint(self):
+ if not versionutils.is_compatible('2.2', self.api_version,
+ same_major=False):
+ raise self.skipException(
+ 'SVCB record tests require Designate API version 2.2 or '
+ 'newer. Skipping test_create_recordset_invalid_SVCB_ipv6hint'
+ 'test.')
+
+ self._test_create_recordset_invalid(
+ None, 'SVCB', ['1 sample.example.org. ipv6hint=foo']
+ )
+
class RootRecordsetsTests(BaseRecordsetsTest):
credentials = ["admin", "primary", "alt"]
limitations under the License.
"""
from oslo_log import log as logging
+from oslo_utils import versionutils
from tempest import config
from tempest.lib import decorators
self.recordset_client.create_recordset,
self.zone['id'], post_model,
)
+
+ @decorators.idempotent_id('193be0fb-ac25-44a3-ae12-f7776048c31a')
+ def test_create_SVCB_with(self):
+ if not versionutils.is_compatible('2.2', self.api_version,
+ same_major=False):
+ raise self.skipException(
+ 'SVCB record tests require Designate API version 2.2 or '
+ 'newer. Skipping test_create_SVCB_with test.')
+
+ ipv4hint = "1.2.3.4,9.8.7.6"
+ alpn = "h3,h2,http/1.1"
+ port = "888"
+ target = f"sample.{self.zone['name']}"
+ doh = '/dns-query{?dns}'
+ svcb_data_records = [f"1 {target} alpn={alpn} ipv4hint={ipv4hint}"
+ f" port={port} dohpath={doh}"]
+ recordset_data = {
+ 'name': "svcb" + "." + self.zone['name'],
+ 'type': "SVCB",
+ 'records': svcb_data_records,
+ }
+ recordset = self.create_recordset(recordset_data)
+ waiters.wait_for_recordset_status(
+ self.recordset_client, self.zone['id'],
+ recordset['id'], 'ACTIVE')
+
+ @decorators.idempotent_id('758c4367-88a6-4657-908e-4c0785428cf9')
+ def test_create_HTTPS_with(self):
+ if not versionutils.is_compatible('2.2', self.api_version,
+ same_major=False):
+ raise self.skipException(
+ 'HTTPS record tests require Designate API version 2.2 or '
+ 'newer. Skipping test_create_HTTPS_with test.')
+
+ ipv4hint = "1.2.3.4,9.8.7.6"
+ alpn = "h3,h2,http/1.1"
+ port = "4443"
+ target = f"sample.{self.zone['name']}"
+ https_data_records = [f"1 {target} alpn={alpn} ipv4hint={ipv4hint}"
+ f" port={port}"]
+ recordset_data = {
+ 'name': "https" + "." + self.zone['name'],
+ 'type': "HTTPS",
+ 'records': https_data_records,
+ }
+ recordset = self.create_recordset(recordset_data)
+ waiters.wait_for_recordset_status(
+ self.recordset_client, self.zone['id'],
+ recordset['id'], 'ACTIVE')