Beispiel #1
0
def test_dsctl_dbverify(topology_st, set_log_file):
    """Test dbverify tool, that was ported from legacy tools to dsctl

    :id: 1b22b363-a6e5-4922-ad42-ae80446d69fe
    :setup: Standalone instance
    :steps:
         1. Create DS instance
         2. Run dbverify
         3. Check if dbverify was successful
    :expectedresults:
         1. Success
         2. Success
         3. Success
    """

    standalone = topology_st.standalone
    message = 'dbverify successful'

    args = FakeArgs()
    args.backend = DEFAULT_BENAME

    log.info('Run dbverify')
    standalone.stop()
    dbtasks_verify(standalone, log, args)

    log.info('Check dbverify was successful')
    with open(LOG_FILE, 'r+') as f:
        file_content = f.read()
        assert message in file_content
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")
Beispiel #3
0
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()