#7447 test_create_host_with_ip is not fully covering possible return errors
Closed: fixed 6 years ago Opened 6 years ago by abbra.

Test test_create_host_with_ip() does not expect all kinds of valid responses and fails in travic-ci.

Test runner output:
=================================== FAILURES ===================================
___________ TestHostNoNameserversForRevZone.test_create_host_with_ip ___________
self = <ipatests.test_xmlrpc.test_host_plugin.TestHostNoNameserversForRevZone object at 0x7f28ba34e630>
dns_setup_nonameserver = None
host4 = <ipatests.test_xmlrpc.tracker.host_plugin.HostTracker object at 0x7f28ba34ee48>
    def test_create_host_with_ip(self, dns_setup_nonameserver, host4):
        """
            Regression test for ticket 7397

            Configure the master with forward-policy = none to make sure
            that no DNS server will answer for the reverse zone
            Try to add a new host with an IP address in the missing reverse
            zone.
            With issue 7397, a NoNameserver exception generates a Traceback in
            httpd error_log, and the command returns an InternalError.
            """
        try:
            command = host4.make_create_command()
            result = command(ip_address=ipv4_in_missingrevzone_ip)
            msg = result['messages'][0]
            assert msg['code'] == messages.FailedToAddHostDNSRecords.errno
            expected_msg = ("The host was added but the DNS update failed "
                            "with: All nameservers failed to answer the query "
                            "for DNS reverse zone {}").format(missingrevzone)
>           assert msg['message'] == expected_msg
E           AssertionError: assert 'The host was...y this server' == 'The host was ...in-addr.arpa.'
E             - The host was added but the DNS update failed with: DNS reverse zone 16.172.in-addr.arpa. for IP address 172.16.30.22 is not managed by this server
E             + The host was added but the DNS update failed with: All nameservers failed to answer the query for DNS reverse zone 22.30.16.172.in-addr.arpa.
/usr/lib/python3.6/site-packages/ipatests/test_xmlrpc/test_host_plugin.py:655: AssertionError

Since we expect a failure of a DNS update, we should allow both types of responses.


Metadata Update from @pvoborni:
- Issue tagged with: test-failure

6 years ago

The test case is flaky and keeps breaking builds.

Metadata Update from @cheimes:
- Issue assigned to cheimes

6 years ago

Metadata Update from @cheimes:
- Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/1697

6 years ago

Metadata Update from @cheimes:
- Issue priority set to: low
- Issue set to the milestone: FreeIPA 4.6.4

6 years ago

master:

  • 6959956 Relax message check in test_create_host_with_ip

ipa-4-6:

  • b6f6e85 Relax message check in test_create_host_with_ip

Metadata Update from @cheimes:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

6 years ago

Login to comment on this ticket.

Metadata