#51226 Issue 51102 - RFE - ds-replcheck - make online timeout configurable
Closed 2 years ago by spichugi. Opened 2 years ago by bsmejkal.
bsmejkal/389-ds-base replcheck_timeout  into  master

@@ -496,6 +496,48 @@ 

      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

Description:
Created a sanity test to check if the newly introduced -t option
for ds-replcheck does not break anything when used with various connections.

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

Reviewed by: ???

Probably, it'll sound more precise if you'll write:
'Check that ds-replcheck timeout option works with various connections mechanisms'

Also, the test case name should reflect that it focuses on the connection mechanisms part.

The rest looks good! Ack

rebased onto b1e4f5f

2 years ago

@spichugi
Modified, please review. Thanks!

Pull-Request has been merged by spichugi

2 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/4279

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

2 years ago
Metadata