Jelajahi Sumber

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: spichugi(Thanks!)
Mark Reynolds 9 tahun lalu
induk
melakukan
b3a167557c

+ 1 - 1
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:

+ 7 - 7
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

+ 1 - 1
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=*)')

+ 1 - 1
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;
                 }