From b9fc951ea47c29b18a0bffa0941ee27d8afcd6c9 Mon Sep 17 00:00:00 2001
From: Mark Reynolds <mreynolds@redhat.com>
Date: Mon, 26 Sep 2016 10:25:44 -0400
Subject: [PATCH] Ticket 48978 - Fix CI test to account for new logging format

Description:  There are some tests that check for error log messages,
              but those messages have slightly changed in the new format.
              Updated the tests to account for the new log messages.

https://fedorahosted.org/389/ticket/48978

Reviewed by: ?
---
 dirsrvtests/tests/tickets/ticket47431_test.py |  2 +-
 dirsrvtests/tests/tickets/ticket47823_test.py | 14 +++++++-------
 dirsrvtests/tests/tickets/ticket48784_test.py |  2 +-
 ldap/servers/plugins/uiduniq/uid.c            |  2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/dirsrvtests/tests/tickets/ticket47431_test.py b/dirsrvtests/tests/tickets/ticket47431_test.py
index 00d3f98..27a52b9 100644
--- a/dirsrvtests/tests/tickets/ticket47431_test.py
+++ b/dirsrvtests/tests/tickets/ticket47431_test.py
@@ -81,7 +81,7 @@ def test_ticket47431_1(topology):
     '''
 
     log.info("Ticket 47431 - 1: Check 26 duplicate values are treated as one...")
-    expected = "str2entry_dupcheck: .* duplicate values for attribute type nsslapd-pluginarg2 detected in entry cn=7-bit check,cn=plugins,cn=config."
+    expected = "str2entry_dupcheck - .* duplicate values for attribute type nsslapd-pluginarg2 detected in entry cn=7-bit check,cn=plugins,cn=config."
 
     log.debug('modify_s %s' % DN_7BITPLUGIN)
     try:
diff --git a/dirsrvtests/tests/tickets/ticket47823_test.py b/dirsrvtests/tests/tickets/ticket47823_test.py
index ba5d110..4d6058a 100644
--- a/dirsrvtests/tests/tickets/ticket47823_test.py
+++ b/dirsrvtests/tests/tickets/ticket47823_test.py
@@ -643,7 +643,7 @@ def test_ticket47823_invalid_config_1(topology):
             pass
 
     # Check the expected error message
-    regex = re.compile("Config fail: unable to parse old style")
+    regex = re.compile("Unable to parse old style")
     res = _pattern_errorlog(topology.standalone.errorlog_file, regex)
     if not res:
         # be sure to restore a valid config before assert
@@ -694,7 +694,7 @@ def test_ticket47823_invalid_config_2(topology):
             pass
 
     # Check the expected error message
-    regex = re.compile("Config info: No valid subtree is defined")
+    regex = re.compile("No valid subtree is defined")
     res = _pattern_errorlog(topology.standalone.errorlog_file, regex)
     if not res:
         # be sure to restore a valid config before assert
@@ -747,7 +747,7 @@ def test_ticket47823_invalid_config_3(topology):
             pass
 
     # Check the expected error message
-    regex = re.compile("Config fail: unable to parse old style")
+    regex = re.compile("Unable to parse old style")
     res = _pattern_errorlog(topology.standalone.errorlog_file, regex)
     if not res:
         # be sure to restore a valid config before assert
@@ -799,7 +799,7 @@ def test_ticket47823_invalid_config_4(topology):
             pass
 
     # Check the expected error message
-    regex = re.compile("Config info: No valid subtree is defined")
+    regex = re.compile("No valid subtree is defined")
     res = _pattern_errorlog(topology.standalone.errorlog_file, regex)
     if not res:
         # be sure to restore a valid config before assert
@@ -850,7 +850,7 @@ def test_ticket47823_invalid_config_5(topology):
             pass
 
     # Check the expected error message
-    regex = re.compile("Config info: attribute name not defined")
+    regex = re.compile("Attribute name not defined")
     res = _pattern_errorlog(topology.standalone.errorlog_file, regex)
     if not res:
         # be sure to restore a valid config before assert
@@ -901,7 +901,7 @@ def test_ticket47823_invalid_config_6(topology):
             pass
 
     # Check the expected error message
-    regex = re.compile("Config info: objectclass for subtree entries is not defined")
+    regex = re.compile("Objectclass for subtree entries is not defined")
     res = _pattern_errorlog(topology.standalone.errorlog_file, regex)
     if not res:
         # be sure to restore a valid config before assert
@@ -952,7 +952,7 @@ def test_ticket47823_invalid_config_7(topology):
             pass
 
     # Check the expected error message
-    regex = re.compile("Config info: No valid subtree is defined")
+    regex = re.compile("No valid subtree is defined")
     res = _pattern_errorlog(topology.standalone.errorlog_file, regex)
     if not res:
         # be sure to restore a valid config before assert
diff --git a/dirsrvtests/tests/tickets/ticket48784_test.py b/dirsrvtests/tests/tickets/ticket48784_test.py
index fca6d9e..bc69308 100644
--- a/dirsrvtests/tests/tickets/ticket48784_test.py
+++ b/dirsrvtests/tests/tickets/ticket48784_test.py
@@ -426,7 +426,7 @@ def test_ticket48784(topology):
 
     log.info('##### Searching for entries on master1...')
     entries = topology.master1.search_s(DEFAULT_SUFFIX, ldap.SCOPE_SUBTREE, '(uid=*)')
-    assert 12 == len(entries)
+    assert 11 == len(entries)  # This is supposed to be "1" less than master 2's entry count
 
     log.info('##### Searching for entries on master2...')
     entries = topology.master2.search_s(DEFAULT_SUFFIX, ldap.SCOPE_SUBTREE, '(uid=*)')
diff --git a/ldap/servers/plugins/uiduniq/uid.c b/ldap/servers/plugins/uiduniq/uid.c
index f05e15c..d1d0162 100644
--- a/ldap/servers/plugins/uiduniq/uid.c
+++ b/ldap/servers/plugins/uiduniq/uid.c
@@ -384,7 +384,7 @@ uniqueness_entry_to_config(Slapi_PBlock *pb, Slapi_Entry *config_entry)
         if (tmp_config->subtrees == NULL) {
                 /* Uniqueness is enforced on entries matching objectclass */
                 if (tmp_config->subtree_entries_oc == NULL) {
-                        slapi_log_error(SLAPI_LOG_ERR, plugin_name, "uniqueness_entry_to_config - objectclass for subtree entries is not defined\n");
+                        slapi_log_error(SLAPI_LOG_ERR, plugin_name, "uniqueness_entry_to_config - Objectclass for subtree entries is not defined\n");
                         rc = SLAPI_PLUGIN_FAILURE;
                         goto done;
                 }
-- 
2.7.4

