コード例 #1
0
ファイル: w3af_run.py プロジェクト: zhangqin/w3af-webui
def fail_scan(scan_id, message):
    '''
    Set scan status to fail and set message to result_message
    '''
    print 'fail scan'
    scan = Scan.objects.get(pk=int(scan_id))
    previous_message = scan.result_message
    scan.result_message = previous_message + message
    scan.status = settings.SCAN_STATUS['fail']
    scan.finish = datetime.now()
    scan.save()
    scan.set_task_status_free()
    notify_set = scan.scan_task.user.get_profile().notification
    if settings.NOTIFY_MODULES[notify_set]['id'] != 'None':
        notify_about_fail(scan.user, scan.scan_task.target, scan.id)
コード例 #2
0
ファイル: w3af_run.py プロジェクト: haofree/w3af-webui
def fail_scan(scan_id, message):
    '''
    Set scan status to fail and set message to result_message
    '''
    print 'fail scan'
    scan = Scan.objects.get(pk=int(scan_id))
    previous_message = scan.result_message
    scan.result_message = previous_message + message
    scan.status = settings.SCAN_STATUS['fail']
    scan.finish = datetime.now()
    scan.save()
    scan.set_task_status_free()
    notify_set =  scan.scan_task.user.get_profile().notification
    if settings.NOTIFY_MODULES[notify_set]['id'] != 'None':
        notify_about_fail(scan.user,
                          scan.scan_task.target,
                          scan.id)
コード例 #3
0
ファイル: test_send_mail.py プロジェクト: zhangqin/w3af-webui
 def test_notify_about_fail(self):
     # Empty the test outbox
     mail.outbox = []
     result = send_mail.notify_about_fail(self.user,
                                          self.scan.scan_task.target,
                                          self.scan.id)
     self.assertEqual(len(mail.outbox), 1)
     self.assertTrue(result)
コード例 #4
0
 def test_notify_about_fail(self):
     # Empty the test outbox
     mail.outbox = []
     result = send_mail.notify_about_fail(self.user,
                                          self.scan.scan_task.target,
                                          self.scan.id)
     self.assertEqual(len(mail.outbox), 1)
     self.assertTrue(result)