From 3e4740f788aee00ae03a61d39238f605779fcece Mon Sep 17 00:00:00 2001 From: Oleg Fayans Date: Wed, 24 Aug 2016 13:53:17 +0200 Subject: [PATCH] Xfailed a test that fails due to 6250 Also created a decorator that removes the segment that the next test does not expect. https://fedorahosted.org/freeipa/ticket/6250 Reviewed-By: Martin Basti --- ipatests/test_integration/test_topology.py | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/ipatests/test_integration/test_topology.py b/ipatests/test_integration/test_topology.py index a3e0488ea..4cdcd46a1 100644 --- a/ipatests/test_integration/test_topology.py +++ b/ipatests/test_integration/test_topology.py @@ -27,6 +27,26 @@ def find_segment(master, replica): return '-to-'.join(segment) +def remove_segment(master, host1, host2): + """ + This removes a segment between host1 and host2 on master. The function is + needed because test_add_remove_segment expects only one segment, but due to + track tickete N 6250, the test_topology_updated_on_replica_install_remove + leaves 2 topology segments + """ + def wrapper(func): + def wrapped(*args, **kwargs): + try: + func(*args, **kwargs) + finally: + segment = find_segment(host1, host2) + master.run_command(['ipa', 'topologysegment-del', + DOMAIN_SUFFIX_NAME, segment], + raiseonerr=False) + return wrapped + return wrapper + + @pytest.mark.skipif(config.domain_level == 0, reason=reasoning) class TestTopologyOptions(IntegrationTest): num_replicas = 2 @@ -64,6 +84,10 @@ class TestTopologyOptions(IntegrationTest): ) return result + @pytest.mark.xfail(reason="Trac 6250", strict=True) + @remove_segment(config.domains[0].master, + config.domains[0].master, + config.domains[0].replicas[1]) def test_topology_updated_on_replica_install_remove(self): """ Install and remove a replica and make sure topology information is