Example #1
0
def test_schedule_job_reinvestigation():

    class func():

        def __init__(self):
            self.logger = logger
            self.faucet_event = []
            self.controller = Config().get_config()
            self.controller['max_concurrent_reinvestigations'] = 10
            self.s = SDNConnect()
            if 'POSEIDON_TRAVIS' in os.environ:
                self.s.r = redis.StrictRedis(host='localhost',
                                             port=6379,
                                             db=0,
                                             decode_responses=True)
            endpoint = Endpoint('foo')
            endpoint.endpoint_data = {
                'tenant': 'foo', 'mac': '00:00:00:00:00:00', 'segment': 'foo', 'port': '1'}
            endpoint.mirror()
            endpoint.known()
            self.s.endpoints.append(endpoint)
            endpoint = Endpoint('foo2')
            endpoint.endpoint_data = {
                'tenant': 'foo', 'mac': '00:00:00:00:00:00', 'segment': 'foo', 'port': '1'}
            endpoint.mirror()
            endpoint.known()
            self.s.endpoints.append(endpoint)
            self.s.store_endpoints()
            self.s.get_stored_endpoints()

    schedule_job_reinvestigation(func())
Example #2
0
def test_schedule_job_reinvestigation():
    class func():
        def __init__(self):
            self.logger = logger
            self.faucet_event = []
            self.controller = Config().get_config()
            self.controller['max_concurrent_reinvestigations'] = 10
            self.s = SDNConnect(self.controller)
            endpoint = endpoint_factory('foo')
            endpoint.endpoint_data = {
                'tenant': 'foo',
                'mac': '00:00:00:00:00:00',
                'segment': 'foo',
                'port': '1'
            }
            endpoint.mirror()
            endpoint.known()
            self.s.endpoints[endpoint.name] = endpoint
            endpoint = endpoint_factory('foo2')
            endpoint.endpoint_data = {
                'tenant': 'foo',
                'mac': '00:00:00:00:00:00',
                'segment': 'foo',
                'port': '1'
            }
            endpoint.mirror()
            endpoint.known()
            self.s.endpoints[endpoint.name] = endpoint
            self.s.store_endpoints()
            self.s.get_stored_endpoints()

    schedule_job_reinvestigation(func())