Blame SOURCES/0011-Issue-4243-Fix-test-SyncRepl-plugin-provides-a-wrong.patch

3280a9
From e540effa692976c2eef766f1f735702ba5dc0950 Mon Sep 17 00:00:00 2001
3280a9
From: tbordaz <tbordaz@redhat.com>
3280a9
Date: Mon, 30 Nov 2020 09:03:33 +0100
3280a9
Subject: [PATCH] Issue 4243 - Fix test: SyncRepl plugin provides a wrong
3280a9
 cookie (#4467)
3280a9
3280a9
Bug description:
3280a9
	This test case was incorrect.
3280a9
	During a refreshPersistent search, a cookie is sent
3280a9
	with the intermediate message that indicates the end of the refresh phase.
3280a9
	Then a second cookie is sent on the updated entry (group10)
3280a9
	I believed this test was successful some time ago but neither python-ldap
3280a9
	nor sync_repl changed (intermediate sent in post refresh).
3280a9
	So the testcase was never successful :(
3280a9
3280a9
Fix description:
3280a9
	The fix is just to take into account the two expected cookies
3280a9
3280a9
relates: https://github.com/389ds/389-ds-base/issues/4243
3280a9
3280a9
Reviewed by: Mark Reynolds
3280a9
3280a9
Platforms tested: F31
3280a9
---
3280a9
 .../tests/suites/syncrepl_plugin/basic_test.py       | 12 +++++++-----
3280a9
 1 file changed, 7 insertions(+), 5 deletions(-)
3280a9
3280a9
diff --git a/dirsrvtests/tests/suites/syncrepl_plugin/basic_test.py b/dirsrvtests/tests/suites/syncrepl_plugin/basic_test.py
3280a9
index 79ec374bc..7b35537d5 100644
3280a9
--- a/dirsrvtests/tests/suites/syncrepl_plugin/basic_test.py
3280a9
+++ b/dirsrvtests/tests/suites/syncrepl_plugin/basic_test.py
3280a9
@@ -589,7 +589,7 @@ def test_sync_repl_cookie_with_failure(topology, request):
3280a9
     sync_repl.start()
3280a9
     time.sleep(5)
3280a9
 
3280a9
-    # Add a test group just to check that sync_repl receives only one update
3280a9
+    # Add a test group just to check that sync_repl receives that SyncControlInfo cookie
3280a9
     group.append(groups.create(properties={'cn': 'group%d' % 10}))
3280a9
 
3280a9
     # create users, that automember/memberof will generate nested updates
3280a9
@@ -610,13 +610,15 @@ def test_sync_repl_cookie_with_failure(topology, request):
3280a9
     time.sleep(10)
3280a9
     cookies = sync_repl.get_result()
3280a9
 
3280a9
-    # checking that the cookie list contains only one entry
3280a9
-    assert len(cookies) == 1
3280a9
-    prev = 0
3280a9
+    # checking that the cookie list contains only two entries
3280a9
+    # the one from the SyncInfo/RefreshDelete that indicates the end of the refresh
3280a9
+    # the the one from SyncStateControl related to the only updated entry (group10)
3280a9
+    assert len(cookies) == 2
3280a9
+    prev = -1
3280a9
     for cookie in cookies:
3280a9
         log.info('Check cookie %s' % cookie)
3280a9
 
3280a9
-        assert int(cookie) > 0
3280a9
+        assert int(cookie) >= 0
3280a9
         assert int(cookie) < 1000
3280a9
         assert int(cookie) > prev
3280a9
         prev = int(cookie)
3280a9
-- 
3280a9
2.26.2
3280a9