chg: [test] set a default distribution for massive event creation

pull/325/head
Alexandre Dulaunoy 2018-12-24 20:46:26 +01:00
parent 2f84b7ecdb
commit 10ccd637d9
No known key found for this signature in database
GPG Key ID: 09E2CD4944E6CBCD
1 changed files with 2 additions and 1 deletions

View File

@ -65,10 +65,11 @@ def create_dummy_event(misp):
def create_massive_dummy_events(misp, nbattribute):
event = misp.new_event(0, 4, 0, 'massive dummy event')
eventid = event['Event']['id']
distribution = '0'
functions = [floodtxt, floodip, flooddomain, flooddomainip, floodemail, floodattachment]
for i in range(nbattribute):
choice = randint(0, 5)
if choice == 5:
floodattachment(misp, eventid, event['Event']['distribution'], False, 'Payload delivery', '', event['Event']['info'], event['Event']['analysis'], event['Event']['threat_level_id'])
floodattachment(misp, eventid, distribution, False, 'Payload delivery', '', event['Event']['info'], event['Event']['analysis'], event['Event']['threat_level_id'])
else:
functions[choice](misp, event)