From 70ba6e385482f160ce6e3e47258ad5a4712977bf Mon Sep 17 00:00:00 2001 From: Akshay Adhikari Date: Jul 03 2019 15:01:38 +0000 Subject: Issue 49997 - Add a new CI test case Bug Description: If the suffix provided in the command line does not exist or it's not replicated, we have an error message that it's regarding the RUV Fix Description: Added a test case that will validate if a wrong suffix is passed then a proper error message is displayed or not. Relates: https://pagure.io/389-ds-base/issue/49997 Review by: vashirov (Thanks!) --- diff --git a/dirsrvtests/tests/suites/ds_tools/replcheck_test.py b/dirsrvtests/tests/suites/ds_tools/replcheck_test.py index 5773586..11f713e 100644 --- a/dirsrvtests/tests/suites/ds_tools/replcheck_test.py +++ b/dirsrvtests/tests/suites/ds_tools/replcheck_test.py @@ -403,6 +403,35 @@ def test_inconsistencies(topo_tls_ldapi): user_m1.delete() +def test_suffix_exists(topo_tls_ldapi): + """Check if wrong suffix is provided, server is giving Error: Failed + to validate suffix. + + :id: ce75debc-c07f-4e72-8787-8f99cbfaf1e2 + :setup: Two master replication + :steps: + 1. Run ds-replcheck with wrong suffix (Non Existing) + :expectedresults: + 1. It should be unsuccessful + """ + 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') + + if ds_is_newer("1.4.1.2"): + tool_cmd = [ds_replcheck_path, 'online', '-b', 'dc=test,dc=com', '-D', DN_DM, '-w', PW_DM, + '-m', 'ldaps://{}:{}'.format(m1.host, m1.sslport), + '-r', 'ldaps://{}:{}'.format(m2.host, m2.sslport)] + else: + tool_cmd = [ds_replcheck_path, '-b', 'dc=test,dc=com', '-D', DN_DM, '-w', PW_DM, + '-m', 'ldaps://{}:{}'.format(m1.host, m1.sslport), + '-r', 'ldaps://{}:{}'.format(m2.host, m2.sslport)] + + result1 = subprocess.Popen(tool_cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, encoding='utf-8') + result = result1.communicate() + assert "Failed to validate suffix" in result[0] + + if __name__ == '__main__': # Run isolated # -s for DEBUG mode