From 45b2990e70ed543e660549348907c4adcc911573 Mon Sep 17 00:00:00 2001 From: Simon Pichugin Date: Wed, 31 Jan 2024 13:17:49 -0800 Subject: [PATCH] qwe --- .../suites/schema/schema_standard_update.py | 34 +++---------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/dirsrvtests/tests/suites/schema/schema_standard_update.py b/dirsrvtests/tests/suites/schema/schema_standard_update.py index 3808cf00f..99b7ff0fd 100644 --- a/dirsrvtests/tests/suites/schema/schema_standard_update.py +++ b/dirsrvtests/tests/suites/schema/schema_standard_update.py @@ -10,7 +10,7 @@ import time import ldap import pytest -from lib389._constants import SUFFIX, DEFAULT_SUFFIX +from lib389._constants import DEFAULT_SUFFIX from lib389.replica import ReplicationManager from lib389.topologies import topology_m2 as topology from lib389.schema import Schema @@ -45,38 +45,14 @@ def trigger_update(topology, user_rdn, num): time.sleep(1) -def trigger_schema_push(topology, user_rdn, num): +def test_custom_schema_rewrites_standard_schema(topology, schema_replication_init): + repl = ReplicationManager(DEFAULT_SUFFIX) m1 = topology.ms["supplier1"] m2 = topology.ms["supplier2"] - agreements = m1.agreement.list(suffix=SUFFIX, - consumer_host=m2.host, - consumer_port=m2.port) - assert (len(agreements) == 1) - ra = agreements[0] - trigger_update(topology, user_rdn, num) - #m1.agreement.pause(ra.dn) - #m1.agreement.resume(ra.dn) - #trigger_update(topology, user_rdn, num) - - -@pytest.fixture(scope="function") -def schema_replication_init(topology): - """Initialize the test environment """ - - supplier = topology.ms["supplier1"] - users = UserAccounts(supplier, DEFAULT_SUFFIX) + users = UserAccounts(m1, DEFAULT_SUFFIX) user = users.create_test_user() - user.replace('telephonenumber', '0') - - return user - -def test_custom_schema_rewrites_standard_schema(topology, schema_replication_init): - repl = ReplicationManager(DEFAULT_SUFFIX) - user = schema_replication_init - m1 = topology.ms["supplier1"] - m2 = topology.ms["supplier2"] schema_m1 = Schema(m1) schema_m2 = Schema(m2) attr_type = schema_m1.query_attributetype('surname')[0] @@ -87,7 +63,7 @@ def test_custom_schema_rewrites_standard_schema(topology, schema_replication_ini schema_m1.add('attributetypes', attr_type) - trigger_schema_push(topology, user.rdn, 1) + trigger_update(topology, user.rdn, 1) repl.wait_for_replication(m1, m2) schema_csn_m1 = m1.schema.get_schema_csn() schema_csn_m2 = m2.schema.get_schema_csn()