#5772 Failures in topology tests produce unclear error messages
Closed: Fixed Opened by mkubik.

The message doesn't say anything useful about the failure. Specifying the error message for the assertion should make the error more obvious and easier to parse.

________________________ TestTopologyOptions.test_add_remove_segment ________________________
self = <ipatests.test_integration.test_topology.TestTopologyOptions object at 0x7f5bac35fc90>
    def test_add_remove_segment(self):
        """
            Make sure a topology segment can be manually created and deleted
            with the influence on the real topology
            Testcase http://www.freeipa.org/page/V4/Manage_replication_topology/
            Test_plan#Test_case:_Basic_CRUD_test
            """
        tasks.kinit_admin(self.master)
        # Install the second replica
        tasks.install_replica(self.master, self.replicas[1], setup_ca=False,
                              setup_dns=False)
        # turn a star into a ring
        segment, err = tasks.create_segment(self.master,
                                            self.replicas[0],
                                            self.replicas[1])
        assert err == "", err
        # Make sure the new segment is shown by `ipa topologysegment-find`
        result1 = self.master.run_command(['ipa', 'topologysegment-find',
                                           DOMAIN_SUFFIX_NAME])
        assert(result1.stdout_text.find(segment['name']) > 0)
        # Remove master <-> replica2 segment and make sure that the changes get
        # there through replica1
        deleteme = "%s-to-%s" % (self.master.hostname,
                                 self.replicas[1].hostname)
        returncode, error = tasks.destroy_segment(self.master, deleteme)
        assert returncode == 0, error
        # make sure replica1 does not have segment that was deleted on master
        result3 = self.replicas[0].run_command(['ipa', 'topologysegment-find',
                                               DOMAIN_SUFFIX_NAME])
>       assert(result3.stdout_text.find(deleteme) < 0)
E       assert 193 < 0
E        +  where 193 = <built-in method find of str object at 0x17d5e60>('ipatest1.lxc-to-ipatest4.lxc')
E        +    where <built-in method find of str object at 0x17d5e60> = '------------------\n3 segments matched\n------------------\n  Segment name: ipatest1.lxc-to-ipatest2.lxc\n  Left node....lxc\n  Connectivity: both\n----------------------------\nNumber of entries returned 3\n----------------------------\n'.find
E        +      where '------------------\n3 segments matched\n------------------\n  Segment name: ipatest1.lxc-to-ipatest2.lxc\n  Left node....lxc\n  Connectivity: both\n----------------------------\nNumber of entries returned 3\n----------------------------\n' = <pytest_multihost.transport.SSHCommand object at 0x7f5bac353090>.stdout_text
test_integration/test_topology.py:124: AssertionError

master:

  • 1974f20aec8de61d0e8d5a550df6a5fabd4b383a Improve reporting of failed tests in topology test suite
  • 1c79c1ea2d077d8699c7e3190526a45e627a7a18 Bugfixes in managed topology tests

ipa-4-3:

  • b41164f237341ccf2546b73585e804aac4cffc8e Improve reporting of failed tests in topology test suite
  • 10e9e33ac057d5ad4e42cd7207b7203ce1d100d1 Bugfixes in managed topology tests

Metadata Update from @mkubik:
- Issue assigned to ofayans
- Issue set to the milestone: FreeIPA 4.3.2

Metadata