zrhoffman / rpms / 389-ds-base

Forked from rpms/389-ds-base 3 years ago
Clone

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

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