Skip to content

Commit

Permalink
qwe
Browse files Browse the repository at this point in the history
  • Loading branch information
droideck committed Jan 31, 2024
1 parent 587e621 commit 45b2990
Showing 1 changed file with 5 additions and 29 deletions.
34 changes: 5 additions & 29 deletions dirsrvtests/tests/suites/schema/schema_standard_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand All @@ -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()
Expand Down

0 comments on commit 45b2990

Please sign in to comment.