#!/usr/share/ucs-test/runner python3
## desc: Set nameserver during dns/forward_zone creation
## tags: [udm]
## roles: [domaincontroller_master]
## bugs: [15654]
## exposure: careful
## packages:
##   - univention-config
##   - univention-directory-manager-tools
## versions:
##  3.1-1: skip
##  3.2-0: fixed

import univention.testing.utils as utils
import univention.testing.udm as udm_test
import univention.testing.strings as uts

if __name__ == '__main__':
	with udm_test.UCSTestUDM() as udm:
		ns_record = uts.random_dns_record()

		forward_zone = udm.create_object('dns/forward_zone', zone='%s.%s' % (uts.random_name(), uts.random_name()), nameserver=ns_record)
		utils.verify_ldap_object(forward_zone, {'nSRecord': ['%s' % ns_record]})
