From 96e359ed11de0ae6e5279e38d947e59b1af782ba Mon Sep 17 00:00:00 2001 From: Akshay Adhikari Date: Thu, 11 Jan 2018 20:16:23 +0530 Subject: [PATCH] Issue 48006 - Issue 48006 - Add a new CI test case Bug Description: Missing warning for invalid replica backoff configuration Fix Description: Add a test case that will check the invalid replica backoff configuration (the case when nsds5ReplicaBackoffMin is set to the bigger value than nsds5ReplicaBackoffMax) https://pagure.io/389-ds-base/issue/48006 Reviewed by: ? --- .../tests/suites/replication/acceptance_test.py | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/dirsrvtests/tests/suites/replication/acceptance_test.py b/dirsrvtests/tests/suites/replication/acceptance_test.py index 824a627..afa4ba7 100644 --- a/dirsrvtests/tests/suites/replication/acceptance_test.py +++ b/dirsrvtests/tests/suites/replication/acceptance_test.py @@ -7,6 +7,7 @@ # --- END COPYRIGHT BLOCK --- # import pytest +from lib389.replica import Replicas from lib389.tasks import * from lib389.utils import * from lib389.topologies import topology_m4 as topo_m4 @@ -497,6 +498,28 @@ def test_invalid_agmt(topo_m4): m1.log.fatal('Failed to bind: ' + str(e)) assert False +def test_warining_for_invalid_replica(topo_m4): + """Testing logs to indicate the inconsistency when configuration is performed. + + :id: dd689d03-69b8-4bf9-a06e-2acd19d5e2c8 + :setup: MMR with four masters + :steps: + 1. Setup nsds5ReplicaBackoffMin to 20 + 2. Setup nsds5ReplicaBackoffMax to 10 + :expectedresults: + 1. nsds5ReplicaBackoffMin should set to 20 + 2. An error should be generated and also logged in the error logs. + """ + replicas = Replicas(topo_m4.ms["master1"]) + replica = replicas.list()[0] + log.info('Set nsds5ReplicaBackoffMin to 20') + replica.set('nsds5ReplicaBackoffMin', '20') + with pytest.raises(ldap.UNWILLING_TO_PERFORM): + log.info('Set nsds5ReplicaBackoffMax to 10') + replica.set('nsds5ReplicaBackoffMax', '10') + log.info('Check the error log for the error') + assert topo_m4.ms["master1"].ds_error_log.match('.*nsds5ReplicaBackoffMax.*10.*invalid.*') + if __name__ == '__main__': # Run isolated -- 1.8.3.1