

def testPresenceUnknownSrc(self):
    '\n        Test Presenter handles request from unknown (disconnected) source (C2)\n        '
    console.terse('{0}\n'.format(self.testPresenceUnknownSrc.__doc__))
    self.addEnterDeed('TestOptsSetupMaster')
    self.addEnterDeed('SaltRaetManorLaneSetup')
    self.addEnterDeed('PresenterTestSetup')
    act = self.addRecurDeed('SaltRaetPresenter')
    self.resolve()
    self.frame.enter()
    testStack = self.store.fetch('.salt.test.lane.stack').value
    presenceReq = self.store.fetch('.salt.presence.event_req').value
    ryn = 'manor'
    name = 'unknown_name'
    self.assertNotEqual(name, testStack.local.name)
    msg = {
        'route': {
            'dst': (None, ryn, 'presence_req'),
            'src': (None, name, None),
        },
    }
    presenceReq.append(msg)
    self.frame.recur()
    self.assertEqual(len(testStack.rxMsgs), 0)
    testStack.serviceAll()
    self.assertEqual(len(testStack.rxMsgs), 0)
    act.actor.lane_stack.value.server.close()
    testStack = self.store.fetch('.salt.test.lane.stack')
    if testStack:
        testStack.value.server.close()

dataset/ETHPy150Open saltstack/salt/salt/daemons/test/test_presence.py PresenterTestCase.testPresenceUnknownSrc/original