Beispiel #1
0
    def setUpClass(cls):
        mydir = os.path.dirname(os.path.abspath(__file__))

        binaries_dir = os.path.join(mydir, 'data', 'binary_metadata')
        cls.mock_server = get_mocked_server(binaries_dir)
        cls.mock_server_thread = threading.Thread(target=cls.mock_server.run, args=['127.0.0.1', 7982])
        cls.mock_server_thread.daemon = True
        cls.mock_server_thread.start()
        sleep_till_available(('127.0.0.1', 7982))
    def setUp(self):
        self.temp_directory = tempfile.mkdtemp()
        config_path = os.path.join(test_dir, "data", "daemon.conf")

        mydir = os.path.dirname(os.path.abspath(__file__))
        binaries_dir = os.path.join(mydir, 'data', 'binary_data')
        self.mock_server = get_mocked_server(binaries_dir)
        self.mock_server_thread = threading.Thread(target=self.mock_server.run, args=['127.0.0.1', 7982])
        self.mock_server_thread.daemon = True
        self.mock_server_thread.start()
        sleep_till_available(('127.0.0.1', 7982))

        self.daemon = YaraConnector('yara-test', configfile=config_path, work_directory=self.temp_directory,
                                    logfile=os.path.join(self.temp_directory, 'test.log'), debug=True)
        self.daemon.validate_config()

        self.daemon.initialize_queue()
Beispiel #3
0
    def setUp(self):
        self.temp_directory = tempfile.mkdtemp()
        config_path = os.path.join(test_dir, "data", "daemon.conf")

        mydir = os.path.dirname(os.path.abspath(__file__))
        binaries_dir = os.path.join(mydir, 'data', 'binary_data')
        self.mock_server = get_mocked_server(binaries_dir)
        self.mock_server_thread = threading.Thread(target=self.mock_server.run, args=['127.0.0.1', 7982])
        self.mock_server_thread.daemon = True
        self.mock_server_thread.start()
        sleep_till_available(('127.0.0.1', 7982))

        self.daemon = LastlineConnector('lastline-test',
                                    configfile=config_path, work_directory=self.temp_directory,
                                    logfile=os.path.join(self.temp_directory, 'test.log'), debug=True)
        self.daemon.validate_config()

        self.daemon.initialize_queue()