Blame SOURCES/0036-Issue-4513-CI-Tests-fix-test-failures.patch

be9751
From 4839898dbe69d6445f3571beec1bf3f1557d6cc6 Mon Sep 17 00:00:00 2001
be9751
From: Mark Reynolds <mreynolds@redhat.com>
be9751
Date: Tue, 12 Jan 2021 10:09:23 -0500
be9751
Subject: [PATCH] Issue 4513 - CI Tests - fix test failures
be9751
be9751
Description:
be9751
be9751
    Fixed tests in these suites:  basic, entryuuid, filter, lib389, and schema
be9751
be9751
relates: https://github.com/389ds/389-ds-base/issues/4513
be9751
be9751
Reviewed by: progier(Thanks!)
be9751
---
be9751
 dirsrvtests/tests/suites/basic/basic_test.py  | 65 ++++++++++---------
be9751
 .../filter/rfc3673_all_oper_attrs_test.py     |  4 +-
be9751
 .../suites/lib389/config_compare_test.py      |  5 +-
be9751
 .../suites/lib389/idm/user_compare_i2_test.py |  3 +
be9751
 .../tests/suites/schema/schema_reload_test.py |  3 +
be9751
 5 files changed, 47 insertions(+), 33 deletions(-)
be9751
be9751
diff --git a/dirsrvtests/tests/suites/basic/basic_test.py b/dirsrvtests/tests/suites/basic/basic_test.py
be9751
index 97908c31c..fc9af46e4 100644
be9751
--- a/dirsrvtests/tests/suites/basic/basic_test.py
be9751
+++ b/dirsrvtests/tests/suites/basic/basic_test.py
be9751
@@ -1059,6 +1059,41 @@ def test_search_ou(topology_st):
be9751
     assert len(entries) == 0
be9751
 
be9751
 
be9751
+def test_bind_invalid_entry(topology_st):
be9751
+    """Test the failing bind does not return information about the entry
be9751
+
be9751
+    :id: 5cd9b083-eea6-426b-84ca-83c26fc49a6f
be9751
+
be9751
+    :setup: Standalone instance
be9751
+
be9751
+    :steps:
be9751
+    1: bind as non existing entry
be9751
+    2: check that bind info does not report 'No such entry'
be9751
+
be9751
+    :expectedresults:
be9751
+    1: pass
be9751
+    2: pass
be9751
+    """
be9751
+
be9751
+    topology_st.standalone.restart()
be9751
+    INVALID_ENTRY="cn=foooo,%s" % DEFAULT_SUFFIX
be9751
+    try:
be9751
+        topology_st.standalone.simple_bind_s(INVALID_ENTRY, PASSWORD)
be9751
+    except ldap.LDAPError as e:
be9751
+        log.info('test_bind_invalid_entry: Failed to bind as %s (expected)' % INVALID_ENTRY)
be9751
+        log.info('exception description: ' + e.args[0]['desc'])
be9751
+        if 'info' in e.args[0]:
be9751
+            log.info('exception info: ' + e.args[0]['info'])
be9751
+        assert e.args[0]['desc'] == 'Invalid credentials'
be9751
+        assert 'info' not in e.args[0]
be9751
+        pass
be9751
+
be9751
+    log.info('test_bind_invalid_entry: PASSED')
be9751
+
be9751
+    # reset credentials
be9751
+    topology_st.standalone.simple_bind_s(DN_DM, PW_DM)
be9751
+
be9751
+
be9751
 @pytest.mark.bz1044135
be9751
 @pytest.mark.ds47319
be9751
 def test_connection_buffer_size(topology_st):
be9751
@@ -1477,36 +1512,6 @@ def test_dscreate_with_different_rdn(dscreate_test_rdn_value):
be9751
         else:
be9751
             assert True
be9751
 
be9751
-def test_bind_invalid_entry(topology_st):
be9751
-    """Test the failing bind does not return information about the entry
be9751
-
be9751
-    :id: 5cd9b083-eea6-426b-84ca-83c26fc49a6f
be9751
-
be9751
-    :setup: Standalone instance
be9751
-
be9751
-    :steps:
be9751
-    1: bind as non existing entry
be9751
-    2: check that bind info does not report 'No such entry'
be9751
-
be9751
-    :expectedresults:
be9751
-    1: pass
be9751
-    2: pass
be9751
-    """
be9751
-
be9751
-    topology_st.standalone.restart()
be9751
-    INVALID_ENTRY="cn=foooo,%s" % DEFAULT_SUFFIX
be9751
-    try:
be9751
-        topology_st.standalone.simple_bind_s(INVALID_ENTRY, PASSWORD)
be9751
-    except ldap.LDAPError as e:
be9751
-        log.info('test_bind_invalid_entry: Failed to bind as %s (expected)' % INVALID_ENTRY)
be9751
-        log.info('exception description: ' + e.args[0]['desc'])
be9751
-        if 'info' in e.args[0]:
be9751
-            log.info('exception info: ' + e.args[0]['info'])
be9751
-        assert e.args[0]['desc'] == 'Invalid credentials'
be9751
-        assert 'info' not in e.args[0]
be9751
-        pass
be9751
-
be9751
-    log.info('test_bind_invalid_entry: PASSED')
be9751
 
be9751
 
be9751
 if __name__ == '__main__':
be9751
diff --git a/dirsrvtests/tests/suites/filter/rfc3673_all_oper_attrs_test.py b/dirsrvtests/tests/suites/filter/rfc3673_all_oper_attrs_test.py
be9751
index c882bea5f..0477acda7 100644
be9751
--- a/dirsrvtests/tests/suites/filter/rfc3673_all_oper_attrs_test.py
be9751
+++ b/dirsrvtests/tests/suites/filter/rfc3673_all_oper_attrs_test.py
be9751
@@ -53,11 +53,11 @@ TEST_PARAMS = [(DN_ROOT, False, [
be9751
                (TEST_USER_DN, False, [
be9751
                 'createTimestamp', 'creatorsName', 'entrydn',
be9751
                 'entryid', 'modifiersName', 'modifyTimestamp',
be9751
-                'nsUniqueId', 'parentid'
be9751
+                'nsUniqueId', 'parentid', 'entryUUID'
be9751
                ]),
be9751
                (TEST_USER_DN, True, [
be9751
                 'createTimestamp', 'creatorsName', 'entrydn',
be9751
-                'entryid', 'modifyTimestamp', 'nsUniqueId', 'parentid'
be9751
+                'entryid', 'modifyTimestamp', 'nsUniqueId', 'parentid', 'entryUUID'
be9751
                ]),
be9751
                (DN_CONFIG, False, [
be9751
                 'numSubordinates', 'passwordHistory'
be9751
diff --git a/dirsrvtests/tests/suites/lib389/config_compare_test.py b/dirsrvtests/tests/suites/lib389/config_compare_test.py
be9751
index 709bae8cb..84f55acfa 100644
be9751
--- a/dirsrvtests/tests/suites/lib389/config_compare_test.py
be9751
+++ b/dirsrvtests/tests/suites/lib389/config_compare_test.py
be9751
@@ -22,15 +22,18 @@ def test_config_compare(topology_i2):
be9751
     st2_config = topology_i2.ins.get('standalone2').config
be9751
     # 'nsslapd-port' attribute is expected to be same in cn=config comparison,
be9751
     # but they are different in our testing environment
be9751
-    # as we are using 2 DS instances running, both running simultaneuosly.
be9751
+    # as we are using 2 DS instances running, both running simultaneously.
be9751
     # Hence explicitly adding 'nsslapd-port' to compare_exclude.
be9751
     st1_config._compare_exclude.append('nsslapd-port')
be9751
     st2_config._compare_exclude.append('nsslapd-port')
be9751
     st1_config._compare_exclude.append('nsslapd-secureport')
be9751
     st2_config._compare_exclude.append('nsslapd-secureport')
be9751
+    st1_config._compare_exclude.append('nsslapd-ldapssotoken-secret')
be9751
+    st2_config._compare_exclude.append('nsslapd-ldapssotoken-secret')
be9751
 
be9751
     assert Config.compare(st1_config, st2_config)
be9751
 
be9751
+
be9751
 if __name__ == '__main__':
be9751
     # Run isolated
be9751
     # -s for DEBUG mode
be9751
diff --git a/dirsrvtests/tests/suites/lib389/idm/user_compare_i2_test.py b/dirsrvtests/tests/suites/lib389/idm/user_compare_i2_test.py
be9751
index c7540e4ce..ccde0f6b0 100644
be9751
--- a/dirsrvtests/tests/suites/lib389/idm/user_compare_i2_test.py
be9751
+++ b/dirsrvtests/tests/suites/lib389/idm/user_compare_i2_test.py
be9751
@@ -39,6 +39,9 @@ def test_user_compare_i2(topology_i2):
be9751
     st2_users.create(properties=user_properties)
be9751
     st2_testuser = st2_users.get('testuser')
be9751
 
be9751
+    st1_testuser._compare_exclude.append('entryuuid')
be9751
+    st2_testuser._compare_exclude.append('entryuuid')
be9751
+
be9751
     assert UserAccount.compare(st1_testuser, st2_testuser)
be9751
 
be9751
 
be9751
diff --git a/dirsrvtests/tests/suites/schema/schema_reload_test.py b/dirsrvtests/tests/suites/schema/schema_reload_test.py
be9751
index 2ece5dda5..e7e7d833d 100644
be9751
--- a/dirsrvtests/tests/suites/schema/schema_reload_test.py
be9751
+++ b/dirsrvtests/tests/suites/schema/schema_reload_test.py
be9751
@@ -54,6 +54,7 @@ def test_valid_schema(topo):
be9751
             schema_file.write("objectclasses: ( 1.2.3.4.5.6.7.8 NAME 'TestObject' " +
be9751
                               "SUP top MUST ( objectclass $ cn ) MAY ( givenName $ " +
be9751
                               "sn $ ValidAttribute ) X-ORIGIN 'user defined' )')\n")
be9751
+        os.chmod(schema_filename, 0o777)
be9751
     except OSError as e:
be9751
         log.fatal("Failed to create schema file: " +
be9751
                   "{} Error: {}".format(schema_filename, str(e)))
be9751
@@ -106,6 +107,7 @@ def test_invalid_schema(topo):
be9751
             schema_file.write("objectclasses: ( 1.2.3.4.5.6.7 NAME 'MoZiLLaOBJeCT' " +
be9751
                               "SUP top MUST ( objectclass $ cn ) MAY ( givenName $ " +
be9751
                               "sn $ MozillaAttribute ) X-ORIGIN 'user defined' )')\n")
be9751
+        os.chmod(schema_filename, 0o777)
be9751
     except OSError as e:
be9751
         log.fatal("Failed to create schema file: " +
be9751
                   "{} Error: {}".format(schema_filename, str(e)))
be9751
@@ -122,6 +124,7 @@ def test_invalid_schema(topo):
be9751
             schema_file.write("objectclasses: ( 1.2.3.4.5.6.70 NAME 'MoZiLLaOBJeCT' " +
be9751
                               "SUP top MUST ( objectclass $ cn ) MAY ( givenName $ " +
be9751
                               "cn $ MoZiLLaATTRiBuTe ) X-ORIGIN 'user defined' )')\n")
be9751
+        os.chmod(schema_filename, 0o777)
be9751
     except OSError as e:
be9751
         log.fatal("Failed to create schema file: " +
be9751
                   "{} Error: {}".format(schema_filename, str(e)))
be9751
-- 
be9751
2.26.2
be9751