def test_bluecoat(self):
        CbAPIProducerThread(self.daemon.work_queue, self.daemon.cb, self.daemon.name, rate_limiter=0,
                            stop_when_done=True).run()

        dirty_flag = threading.Event()
        t = DeepAnalysisThread(self.daemon.work_queue, self.daemon.cb, self.daemon.get_provider(),
                               dirty_event=dirty_flag)
        t.start()

        unanalyzed = self.daemon.work_queue.number_unanalyzed()
        while unanalyzed:
            print unanalyzed
            sleep(.1)
            unanalyzed = self.daemon.work_queue.number_unanalyzed()

        t.stop()
        t.join()
예제 #2
0
    def test_yara(self):
        CbAPIProducerThread(self.daemon.work_queue, self.daemon.cb, self.daemon.name, rate_limiter=0,
                            stop_when_done=True).run()

        yara_provider = YaraProvider('yara-test', os.path.join(test_dir, 'data', 'yara_rules'))
        dirty_flag = threading.Event()
        t = DeepAnalysisThread(self.daemon.work_queue, self.daemon.cb, yara_provider, dirty_event=dirty_flag)
        t.start()

        unanalyzed = self.daemon.work_queue.number_unanalyzed()
        while unanalyzed:
            print unanalyzed
            sleep(.1)
            unanalyzed = self.daemon.work_queue.number_unanalyzed()

        t.stop()
        t.join()
예제 #3
0
    def test_lastline(self):
        CbAPIProducerThread(self.daemon.work_queue, self.daemon.cb, self.daemon.name, rate_limiter=0,
                            stop_when_done=True).run()

        dirty_flag = threading.Event()
        t = DeepAnalysisThread(self.daemon.work_queue, self.daemon.cb, self.daemon.get_provider(),
                               dirty_event=dirty_flag)
        t.start()

        unanalyzed = self.daemon.work_queue.number_unanalyzed()
        while unanalyzed:
            print unanalyzed
            sleep(.1)
            unanalyzed = self.daemon.work_queue.number_unanalyzed()

        t.stop()
        t.join()
예제 #4
0
    def test_yara(self):
        CbAPIProducerThread(self.daemon.work_queue,
                            self.daemon.cb,
                            self.daemon.name,
                            rate_limiter=0,
                            stop_when_done=True).run()

        yara_provider = YaraProvider(
            'yara-test', os.path.join(test_dir, 'data', 'yara_rules'))
        dirty_flag = threading.Event()
        t = DeepAnalysisThread(self.daemon.work_queue,
                               self.daemon.cb,
                               yara_provider,
                               dirty_event=dirty_flag)
        t.start()

        unanalyzed = self.daemon.work_queue.number_unanalyzed()
        while unanalyzed:
            print unanalyzed
            sleep(.1)
            unanalyzed = self.daemon.work_queue.number_unanalyzed()

        t.stop()
        t.join()