|
|
@@ -248,24 +248,32 @@ def test_basic_import_export(topology_st, import_example_ldif):
|
|
|
|
|
|
log.info('Running test_basic_import_export...')
|
|
|
|
|
|
- tmp_dir = '/tmp'
|
|
|
-
|
|
|
#
|
|
|
# Test online/offline LDIF imports
|
|
|
#
|
|
|
topology_st.standalone.start()
|
|
|
|
|
|
# Generate a test ldif (50k entries)
|
|
|
+ log.info("Generating LDIF...")
|
|
|
ldif_dir = topology_st.standalone.get_ldif_dir()
|
|
|
import_ldif = ldif_dir + '/basic_import.ldif'
|
|
|
dbgen(topology_st.standalone, 50000, import_ldif, DEFAULT_SUFFIX)
|
|
|
|
|
|
# Online
|
|
|
+ log.info("Importing LDIF online...")
|
|
|
r = ImportTask(topology_st.standalone)
|
|
|
r.import_suffix_from_ldif(ldiffile=import_ldif, suffix=DEFAULT_SUFFIX)
|
|
|
+
|
|
|
+ # Good as place as any to quick test the task has some expected attributes
|
|
|
+ assert r.present('nstaskcreated')
|
|
|
+ assert r.present('nstasklog')
|
|
|
+ assert r.present('nstaskcurrentitem')
|
|
|
+ assert r.present('nstasktotalitems')
|
|
|
+
|
|
|
r.wait()
|
|
|
|
|
|
# Offline
|
|
|
+ log.info("Importing LDIF offline...")
|
|
|
topology_st.standalone.stop()
|
|
|
if not topology_st.standalone.ldif2db(DEFAULT_BENAME, None, None, None, import_ldif):
|
|
|
log.fatal('test_basic_import_export: Offline import failed')
|
|
|
@@ -277,14 +285,15 @@ def test_basic_import_export(topology_st, import_example_ldif):
|
|
|
#
|
|
|
|
|
|
# Online export
|
|
|
+ log.info("Exporting LDIF online...")
|
|
|
export_ldif = ldif_dir + '/export.ldif'
|
|
|
|
|
|
-
|
|
|
r = ExportTask(topology_st.standalone)
|
|
|
r.export_suffix_to_ldif(ldiffile=export_ldif, suffix=DEFAULT_SUFFIX)
|
|
|
r.wait()
|
|
|
|
|
|
# Offline export
|
|
|
+ log.info("Exporting LDIF offline...")
|
|
|
topology_st.standalone.stop()
|
|
|
if not topology_st.standalone.db2ldif(DEFAULT_BENAME, (DEFAULT_SUFFIX,),
|
|
|
None, None, None, export_ldif):
|
|
|
@@ -296,6 +305,7 @@ def test_basic_import_export(topology_st, import_example_ldif):
|
|
|
#
|
|
|
# Cleanup - Import the Example LDIF for the other tests in this suite
|
|
|
#
|
|
|
+ log.info("Restore datrabase, import initial LDIF...")
|
|
|
ldif = '%s/dirsrv/data/Example.ldif' % topology_st.standalone.get_data_dir()
|
|
|
import_ldif = topology_st.standalone.get_ldif_dir() + "/Example.ldif"
|
|
|
shutil.copyfile(ldif, import_ldif)
|
|
|
@@ -361,6 +371,7 @@ def test_basic_backup(topology_st, import_example_ldif):
|
|
|
|
|
|
log.info('test_basic_backup: PASSED')
|
|
|
|
|
|
+
|
|
|
def test_basic_db2index(topology_st, import_example_ldif):
|
|
|
"""Assert db2index can operate correctly.
|
|
|
|
|
|
@@ -897,7 +908,7 @@ def create_users(topology_st):
|
|
|
|
|
|
log.info('Adding 5 test users')
|
|
|
for name in user_names:
|
|
|
- user = users.create(properties={
|
|
|
+ users.create(properties={
|
|
|
'uid': name,
|
|
|
'sn': name,
|
|
|
'cn': name,
|
|
|
@@ -1015,6 +1026,7 @@ def test_connection_buffer_size(topology_st):
|
|
|
with pytest.raises(ldap.OPERATIONS_ERROR):
|
|
|
topology_st.standalone.config.replace('nsslapd-connection-buffer', value)
|
|
|
|
|
|
+
|
|
|
@pytest.mark.bz1637439
|
|
|
def test_critical_msg_on_empty_range_idl(topology_st):
|
|
|
"""Doing a range index lookup should not report a critical message even if IDL is empty
|
|
|
@@ -1087,6 +1099,7 @@ def test_critical_msg_on_empty_range_idl(topology_st):
|
|
|
# Step 5
|
|
|
assert not topology_st.standalone.searchErrorsLog('CRIT - list_candidates - NULL idl was recieved from filter_candidates_ext.')
|
|
|
|
|
|
+
|
|
|
def audit_pattern_found(server, log_pattern):
|
|
|
file_obj = open(server.ds_paths.audit_log, "r")
|
|
|
|
|
|
@@ -1102,6 +1115,7 @@ def audit_pattern_found(server, log_pattern):
|
|
|
|
|
|
return found
|
|
|
|
|
|
+
|
|
|
@pytest.mark.ds50026
|
|
|
def test_ticketldbm_audit(topology_st):
|
|
|
"""When updating LDBM config attributes, those attributes/values are not listed
|
|
|
@@ -1208,5 +1222,3 @@ if __name__ == '__main__':
|
|
|
# -s for DEBUG mode
|
|
|
CURRENT_FILE = os.path.realpath(__file__)
|
|
|
pytest.main("-s %s" % CURRENT_FILE)
|
|
|
-
|
|
|
-
|