Beispiel #1
0
def test_invalid_referint_log(topo):
    """If there is an invalid log line in the referint log, make sure the server
    does not crash at startup

    :id: 34807b5a-ab17-4281-ae48-4e3513e19145
    :setup: Standalone Instance
    :steps:
        1. Set the referint log delay
        2. Create invalid log
        3. Start the server (no crash)
    :expectedresults:
        1. Success
        2. Success
        3. Success
    """

    inst = topo.standalone

    # Set delay - required for log parsing at server startup
    plugin = ReferentialIntegrityPlugin(inst)
    plugin.enable()
    plugin.set_update_delay('2')
    logfile = plugin.get_log_file()
    inst.restart()

    # Create invalid log
    inst.stop()
    with open(logfile, 'w') as log_fh:
        log_fh.write("CRASH\n")

    # Start the instance
    inst.start()
    assert inst.status()
Beispiel #2
0
def manage_update_delay(inst, basedn, log, args):
    plugin = ReferentialIntegrityPlugin(inst)
    if args.value is None:
        val = plugin.get_update_delay_formatted()
        log.info(val)
    else:
        plugin.set_update_delay(args.value)
        log.info('referint-update-delay set to "{}"'.format(args.value))
Beispiel #3
0
 def apply(self, inst):
     rip = ReferentialIntegrityPlugin(inst)
     rip.set_update_delay(0)
     rip.enable()