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

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