Univention Bugzilla – Bug 39269
Create basic DNS tests
Last modified: 2017-04-04 18:29:09 CEST
We should add basic DNS tests, creating DNS entries via UDM and checking if the new created objects are resolvable via DNS. Theses tests should include all parts, forward / reverse zones, a records, alias records, SRV records and so forth. ucs-test/tests/67_udm-dns is a good starting point.
*** Bug 27651 has been marked as a duplicate of this bug. ***
-test for forward-zone finished
Committed changes for 100_dns_forward_zone_check_resolve. Test creates a SOA-Record and trys to resolve the name of the zone. It also compares the zone-name of the dns-response with the created one to check if the response-object is the same. Test is tagged with WIP.
Revision 65772 Version 5.0.171-4.1205.201509161449 Added tests for resolving different dns records. Tests work with openldap and also with samba4. Tests are in section 67, no. 100-106. In case of samba4-backend, resolving TXT-Records is aborted. Refer to Bug #37346. Tests are tagged as WIP at the moment.
It looks like essential.dns_helper is missing: *** BEGIN *** ['/usr/bin/python', '100_dns_forward_zone_check_resolve'] *** *** 67_udm-dns/100_dns_forward_zone_check_resolve *** Creates dns forward zone entry and trys to resolve it *** *** START TIME: 2016-09-13 08:55:47 *** Traceback (most recent call last): File "100_dns_forward_zone_check_resolve", line 18, in <module> from essential.dns_helper import resolveDnsEntry ImportError: No module named essential.dns_helper *** END TIME: 2016-09-13 08:55:47 *** *** TEST DURATION (H:MM:SS.ms): 0:00:00.213270 *** *** END *** 1 ***
Hinzufügen 67_udm-dns/essential Hinzufügen 67_udm-dns/essential/__init__.py Hinzufügen 67_udm-dns/essential/dns_helper.py Übertrage Daten .. Revision 73144 übertragen. Added missing modules to ucs-4.1/ucs-4.1-3/test/ucs-test/tests/67_udm-dns
Thanks, that looks better. Can you remove the WIP tag so that we get test results from our daily Jenkins tests. Please also merge the commits to the UCS 4.2 branch.
Sende 67_udm-dns/100_dns_forward_zone_check_resolve Sende 67_udm-dns/101_dns_reverse_zone_check_resolve Sende 67_udm-dns/102_dns_host_record_check_resolve Sende 67_udm-dns/103_dns_alias_record_check_resolve Sende 67_udm-dns/104_dns_srv_record_check_resolve Sende 67_udm-dns/105_dns_pointer_record_check_resolve Sende 67_udm-dns/106_dns_txt_record_check_resolve Übertrage Daten ....... Revision 73202 übertragen. Committed changes to ucs-4.1/ucs-4.1-3/test/ucs-test/tests/67_udm-dns
Sende 67_udm-dns/100_dns_forward_zone_check_resolve Sende 67_udm-dns/101_dns_reverse_zone_check_resolve Sende 67_udm-dns/102_dns_host_record_check_resolve Sende 67_udm-dns/103_dns_alias_record_check_resolve Sende 67_udm-dns/104_dns_srv_record_check_resolve Sende 67_udm-dns/105_dns_pointer_record_check_resolve Sende 67_udm-dns/106_dns_txt_record_check_resolve Übertrage Daten ....... Revision 73203 übertragen. Also added to ucs-4.2/ucs-4.2-0/test/ucs-test/tests/67_udm-dns
The following condition will never become True because e is not the class but the instance of the class: + except Exception as e: + if e is dns.resolver.YXDOMAIN: Please use "except dns.resolver.YXDOMAIN:" A better variable name for "e" would be "exc". To check for instances use "isinstance(exc, dns.resolver.YXDOMAIN)". Catching Exception should be prevented as it hides details when there are errors in the script. You could catch dns.exception.DNSException instead which is the base class of all pyhton-dnspython exceptions.
The changes haven't been merged to UCS 4.2 causes some tests to fail. ucs-test (7.0.6-44): r75724 | Bug #39269: merge r73144 to UCS 4.2
I will review the tests ... Code-quality is very bad
r75797 | Bug #39269 test/dns: Fix DNS query tests Fix busy loop. Remove exception wrapping, which only added debug info. Use ldap/base directly. Remove broken hand-rolled UDP-only resolver. Simplify iterative and redundant assignment of zoneName.
Test failed on S3,master, because BIND9 refused to start up with a wrong zone NS: <http://jenkins.knut.univention.de:8080/job/UCS-4.2/job/UCS-4.2-0/job/AutotestJoin/lastCompletedBuild/SambaVersion=s3,Systemrolle=master/testReport/67_udm-dns/> r75961 | Bug #39269 test/dns: Fix DNS query tests
UCS 4.2 has been released: https://docs.software-univention.de/release-notes-4.2-0-en.html https://docs.software-univention.de/release-notes-4.2-0-de.html If this error occurs again, please use "Clone This Bug".