dirsrvtests/tests/tickets/ticket48665_test.py | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
New commits:
commit 9feca58eb9ed7f6e9ed2a2050320529e954599a8
Author: Simon Pichugin <spichugi(a)redhat.com>
Date: Tue Jan 10 13:55:30 2017 +0100
Ticket 48665 - Fix RHEL6 test compatibility issues
Bug description: It is impossible to use inst.whoami_s() on RHEL6.
It throws PROTOCOL_ERROR: 'unsupported extended operation'.
Fix description: Use a search to verify that the server has not
crushed.
https://fedorahosted.org/389/ticket/48665
Reviewed by: nhosoi (Thanks!)
diff --git a/dirsrvtests/tests/tickets/ticket48665_test.py
b/dirsrvtests/tests/tickets/ticket48665_test.py
index 818fad2..b11f75a 100644
--- a/dirsrvtests/tests/tickets/ticket48665_test.py
+++ b/dirsrvtests/tests/tickets/ticket48665_test.py
@@ -25,9 +25,11 @@ def test_ticket48665(topology_st):
modlist)
except:
pass
+
# Check the server has not commited seppuku.
- result = topology_st.standalone.whoami_s()
- assert (DN_DM.lower() in result.lower())
+ entries = topology_st.standalone.search_s(DEFAULT_SUFFIX, ldap.SCOPE_SUBTREE,
'(cn=*)')
+ assert len(entries) > 0
+ log.info('{} entries are returned from the server.'.format(len(entries)))
# This has a magic hack to determine if we are in cn=config.
try:
@@ -37,17 +39,20 @@ def test_ticket48665(topology_st):
log.fatal('Failed to change nsslapd-cachememsize ' +
e.message['desc'])
# Check the server has not commited seppuku.
- result = topology_st.standalone.whoami_s()
- assert (DN_DM.lower() in result.lower())
+ entries = topology_st.standalone.search_s(DEFAULT_SUFFIX, ldap.SCOPE_SUBTREE,
'(cn=*)')
+ assert len(entries) > 0
+ log.info('{} entries are returned from the server.'.format(len(entries)))
# Now try with mod_replace. This should be okay.
modlist = [(ldap.MOD_REPLACE, 'nsslapd-cachememsize', '1')]
topology_st.standalone.modify_s("cn=%s,cn=ldbm
database,cn=plugins,cn=config" % DEFAULT_BENAME,
modlist)
+
# Check the server has not commited seppuku.
- result = topology_st.standalone.whoami_s()
- assert (DN_DM.lower() in result.lower())
+ entries = topology_st.standalone.search_s(DEFAULT_SUFFIX, ldap.SCOPE_SUBTREE,
'(cn=*)')
+ assert len(entries) > 0
+ log.info('{} entries are returned from the server.'.format(len(entries)))
log.info('Test complete')