示例#1
0
def mk_events_set(nb, timestamp=None, weight=20):
    events = []
    context = Context.make_component()
    component = "component_name"
    base_message = "This is a test event"
    for i in xrange(nb):
        event = AuditEvent.fromACL(context, component=component)
        if timestamp:
            event.timestamp = timestamp
        event.weight = weight
        events.append(event)
#        connector.commit()

    return events
示例#2
0
    def purge_data(self):
        for event in AuditEvent.get_all():
            event.delete()

        for alert in CorrelatorAlert.get_all():
            alert.delete()