Skip to content

Commit

Permalink
Issue 51102 - RFE - ds-replcheck - make online timeout configurable
Browse files Browse the repository at this point in the history
Description:
Created a sanity test to check if the newly introduced -t option
for ds-replcheck does not break anything when used with various connection mechanisms.

Relates: https://pagure.io/389-ds-base/issue/51102

Reviewed by: spichugi (Thanks!)
  • Loading branch information
bsimonova committed Aug 3, 2020
1 parent 594bf91 commit b1e4f5f
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions dirsrvtests/tests/suites/ds_tools/replcheck_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,48 @@ def test_dsreplcheck_with_password_file(topo_tls_ldapi, tmpdir):
subprocess.Popen(tool_cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, encoding='utf-8')


@pytest.mark.ds51102
@pytest.mark.bz1836428
@pytest.mark.skipif(ds_is_older('1.4.1'), reason='Not implemented')
def test_dsreplcheck_timeout_connection_mechanisms(topo_tls_ldapi):
"""Check that ds-replcheck timeout option works with various connection mechanisms
:id: aeeb99c9-09e2-45dc-bd75-9f95409babe7
:setup: Two master replication
:steps:
1. Create two masters with various connection mechanisms configured
2. Run ds-replcheck with -t option
:expectedresults:
1. Success
2. Success
"""

OUTPUT = 'Master and Replica are in perfect synchronization'

m1 = topo_tls_ldapi.ms["master1"]
m2 = topo_tls_ldapi.ms["master2"]

ds_replcheck_path = os.path.join(m1.ds_paths.bin_dir, 'ds-replcheck')

replcheck_cmd = [[ds_replcheck_path, 'online', '-b', DEFAULT_SUFFIX, '-D', DN_DM, '-w', PW_DM, '-l', '1',
'-m', 'ldap://{}:{}'.format(m1.host, m1.port), '--conflicts',
'-r', 'ldap://{}:{}'.format(m2.host, m2.port), '-t', '120'],
[ds_replcheck_path, 'online', '-b', DEFAULT_SUFFIX, '-D', DN_DM, '-w', PW_DM, '-l', '1',
'-m', 'ldaps://{}:{}'.format(m1.host, m1.sslport), '--conflicts',
'-r', 'ldaps://{}:{}'.format(m2.host, m2.sslport), '-t', '120'],
[ds_replcheck_path, 'online', '-b', DEFAULT_SUFFIX, '-D', DN_DM, '-w', PW_DM, '-l', '1',
'-m', 'ldap://{}:{}'.format(m1.host, m1.port), '-Z', m1.get_ssca_dir(),
'-r', 'ldap://{}:{}'.format(m2.host, m2.port), '--conflicts', '-t', '120'],
[ds_replcheck_path, 'online', '-b', DEFAULT_SUFFIX, '-D', DN_DM, '-w', PW_DM, '-l', '1',
'-m', 'ldapi://%2fvar%2frun%2fslapd-{}.socket'.format(m1.serverid), '--conflict',
'-r', 'ldapi://%2fvar%2frun%2fslapd-{}.socket'.format(m2.serverid), '-t', '120']]

log.info('Run ds-replcheck with -t option')
for connection in replcheck_cmd:
result = subprocess.check_output(connection)
assert OUTPUT in ensure_str(result)


if __name__ == '__main__':
# Run isolated
# -s for DEBUG mode
Expand Down

0 comments on commit b1e4f5f

Please sign in to comment.