From eca8e776e82e0a6838066aadc5811e41cd889204 Mon Sep 17 00:00:00 2001 From: Simon Pichugin Date: Wed, 9 Aug 2017 17:17:34 +0200 Subject: [PATCH] Issue 83 - lib389 - Replace topology agmt objects Bug description: In the lib389 commit that improves topology object, we remove "masterX_agmts" key from TopologyMain. We use it in our dirsrvtests. Fix description: Replace the "masterX_agmts" objects with inst.agreement functions. We really should stick to one method only. https://pagure.io/lib389/issue/83 Reviewed by: ? --- dirsrvtests/tests/suites/replication/acceptance_test.py | 7 ++++--- dirsrvtests/tests/suites/replication/cleanallruv_test.py | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dirsrvtests/tests/suites/replication/acceptance_test.py b/dirsrvtests/tests/suites/replication/acceptance_test.py index f92e8744c..086cf9c73 100644 --- a/dirsrvtests/tests/suites/replication/acceptance_test.py +++ b/dirsrvtests/tests/suites/replication/acceptance_test.py @@ -305,14 +305,15 @@ def test_modify_stripattrs(topo_m4): :expectedresults: It should be contain the value """ - agreement = topo_m4.ms["master1_agmts"]["m1_m2"] + m1 = topo_m4.ms["master1"] + agreement = m1.agreement.list(suffix=DEFAULT_SUFFIX)[0].dn attr_value = 'modifiersname modifytimestamp' log.info('Modify nsds5replicastripattrs with {}'.format(attr_value)) - topo_m4.ms["master1"].modify_s(agreement, [(ldap.MOD_REPLACE, 'nsds5replicastripattrs', attr_value)]) + m1.modify_s(agreement, [(ldap.MOD_REPLACE, 'nsds5replicastripattrs', attr_value)]) log.info('Check nsds5replicastripattrs for {}'.format(attr_value)) - entries = topo_m4.ms['master1'].search_s(agreement, ldap.SCOPE_BASE, "objectclass=*", ['nsds5replicastripattrs']) + entries = m1.search_s(agreement, ldap.SCOPE_BASE, "objectclass=*", ['nsds5replicastripattrs']) assert attr_value in entries[0].data['nsds5replicastripattrs'] diff --git a/dirsrvtests/tests/suites/replication/cleanallruv_test.py b/dirsrvtests/tests/suites/replication/cleanallruv_test.py index a5a367305..f6cfb650e 100644 --- a/dirsrvtests/tests/suites/replication/cleanallruv_test.py +++ b/dirsrvtests/tests/suites/replication/cleanallruv_test.py @@ -194,7 +194,10 @@ def restore_master4(topology_m4): topology_m4.ms["master{}".format(num)].start(timeout=30) time.sleep(5) topology_m4.ms["master1"].agreement.init(SUFFIX, host_to, port_to) - topology_m4.ms["master1"].waitForReplInit(topology_m4.ms["master1_agmts"]["m1_m{}".format(num)]) + agreement = topology_m4.ms["master1"].agreement.list(suffix=SUFFIX, + consumer_host=host_to, + consumer_port=port_to)[0].dn + topology_m4.ms["master1"].waitForReplInit(agreement) time.sleep(5) -- 2.13.3