def test_ldif2db_db2ldif_no_repl(topology_be_latest): standalone = topology_be_latest.standalone standalone.stop() args = FakeArgs() args.backend = 'userRoot' args.ldif = os.path.join(standalone.get_ldif_dir(), "test.ldif") args.encrypted = False args.replication = False # Stop the instance dbtasks_db2ldif(standalone, topology_be_latest.logcap.log, args) # Assert none. assert topology_be_latest.logcap.contains("db2ldif successful") topology_be_latest.logcap.flush() # We can re-use the same arguments dbtasks_ldif2db(standalone, topology_be_latest.logcap.log, args) # Assert none. assert topology_be_latest.logcap.contains("ldif2db successful")
def run_db2ldif_and_clear_logs(topology, instance, backend, ldif, output_msg, encrypt=False, repl=False): args = FakeArgs() args.instance = instance.serverid args.backend = backend args.encrypted = encrypt args.replication = repl args.ldif = ldif dbtasks_db2ldif(instance, topology.logcap.log, args) log.info('checking output msg') if not topology.logcap.contains(output_msg): log.error('The output message is not the expected one') assert False log.info('Clear the log') topology.logcap.flush()