Example #1
0
    def setUp(self):

        GLSetting.set_devel_mode()
        GLSetting.logging = None
        GLSetting.scheduler_threadpool = FakeThreadPool()
        GLSetting.memory_copy.allow_unencrypted = True
        GLSetting.sessions = {}
        GLSetting.failed_login_attempts = 0
        GLSetting.working_path = './working_path'
        GLSetting.ramdisk_path = './working_path/ramdisk'

        GLSetting.eval_paths()
        GLSetting.remove_directories()
        GLSetting.create_directories()

        self.setUp_dummy()

        # This mocks out the MailNotification plugin so it does not actually
        # require to perform a connection to send an email.
        # XXX we probably want to create a proper mock of the ESMTPSenderFactory
        def mail_flush_mock(self, from_address, to_address, message_file, event):
            return defer.succeed(None)

        notification.MailNotification.mail_flush = mail_flush_mock

        return db.create_tables(create_node=True)
Example #2
0
    def setUp(self):
        GLSetting.set_devel_mode()
        GLSetting.logging = None
        GLSetting.scheduler_threadpool = FakeThreadPool()
        GLSetting.memory_copy.allow_unencrypted = True
        GLSetting.sessions = {}
        GLSetting.failed_login_attempts = 0
        GLSetting.working_path = './working_path'
        GLSetting.ramdisk_path = './working_path/ramdisk'

        GLSetting.eval_paths()
        GLSetting.remove_directories()
        GLSetting.create_directories()

        self.setUp_dummy()

        # This mocks out the MailNotification plugin so it does not actually
        # require to perform a connection to send an email.
        # XXX we probably want to create a proper mock of the ESMTPSenderFactory
        def mail_flush_mock(self, from_address, to_address, message_file,
                            event):
            return defer.succeed(None)

        notification.MailNotification.mail_flush = mail_flush_mock

        return db.create_tables(create_node=True)
Example #3
0
    def setUp(self):
        GLSetting.set_devel_mode()
        GLSetting.logging = None
        GLSetting.scheduler_threadpool = FakeThreadPool()
        GLSetting.sessions = {}
        GLSetting.failed_login_attempts = 0

        if os.path.isdir('/dev/shm'):
          GLSetting.working_path = '/dev/shm/globaleaks'
          GLSetting.ramdisk_path = '/dev/shm/globaleaks/ramdisk'
        else:
            GLSetting.working_path = './working_path'
            GLSetting.ramdisk_path = './working_path/ramdisk'

        GLSetting.eval_paths()
        GLSetting.remove_directories()
        GLSetting.create_directories()

        self.setUp_dummy()

        yield db.create_tables(self.create_node)

        for fixture in getattr(self, 'fixtures', []):
            yield import_fixture(fixture)

        yield import_memory_variables()

        # overrid of imported memory variables
        GLSetting.memory_copy.allow_unencrypted = True

        anomaly.Alarm.reset()
        anomaly.EventTrackQueue.reset()
        statistics_sched.StatisticsSchedule.reset()
Example #4
0
    def setUp(self):
        GLSetting.set_devel_mode()
        GLSetting.logging = None
        GLSetting.scheduler_threadpool = FakeThreadPool()
        GLSetting.sessions = {}
        GLSetting.failed_login_attempts = 0

        if os.path.isdir('/dev/shm'):
            GLSetting.working_path = '/dev/shm/globaleaks'
            GLSetting.ramdisk_path = '/dev/shm/globaleaks/ramdisk'
        else:
            GLSetting.working_path = './working_path'
            GLSetting.ramdisk_path = './working_path/ramdisk'

        GLSetting.eval_paths()
        GLSetting.remove_directories()
        GLSetting.create_directories()

        self.setUp_dummy()

        yield db.create_tables(self.create_node)

        for fixture in getattr(self, 'fixtures', []):
            yield import_fixture(fixture)

        yield import_memory_variables()

        # override of imported memory variables
        GLSetting.memory_copy.allow_unencrypted = True

        anomaly.Alarm.reset()
        event.EventTrackQueue.reset()
        statistics_sched.StatisticsSchedule.reset()
Example #5
0
 def setUp(self):
     GLSetting.set_devel_mode()
     GLSetting.scheduler_threadpool = FakeThreadPool()
     GLSetting.sessions = {}
     GLSetting.failed_login_attempts = dict()
     GLSetting.failed_login_attempts_wb = 0
     GLSetting.working_path = os.path.abspath(os.path.join(GLSetting.root_path, 'testing_dir'))
     GLSetting.eval_paths()
     GLSetting.remove_directories()
     GLSetting.create_directories()
     return db.create_tables(create_node=True)
Example #6
0
    def setUp(self):
        GLSetting.set_devel_mode()
        GLSetting.logging = None
        GLSetting.scheduler_threadpool = FakeThreadPool()
        GLSetting.memory_copy.allow_unencrypted = True
        GLSetting.sessions = {}
        GLSetting.failed_login_attempts = 0

        if os.path.isdir('/dev/shm'):
          GLSetting.working_path = '/dev/shm/globaleaks'
          GLSetting.ramdisk_path = '/dev/shm/globaleaks/ramdisk'
        else:
            GLSetting.working_path = './working_path'
            GLSetting.ramdisk_path = './working_path/ramdisk'

        GLSetting.eval_paths()
        GLSetting.remove_directories()
        GLSetting.create_directories()

        self.setUp_dummy()

        # This mocks out the MailNotification plugin so it does not actually
        # require to perform a connection to send an email.
        # XXX we probably want to create a proper mock of the ESMTPSenderFactory
        def mail_flush_mock(self, from_address, to_address, message_file, event):
            return defer.succeed(None)

        notification.MailNotification.mail_flush = mail_flush_mock

        yield db.create_tables(self.create_node)

        for fixture in getattr(self, 'fixtures', []):
            yield import_fixture(fixture)

        import_memory_variables()

        anomaly.Alarm.reset()
        anomaly.EventTrackQueue.reset()
        statistics_sched.StatisticsSchedule.reset()