'Test handling of non-zero exit statuses or exit signals.'

def _exitStatusTest(self, request, requestArg):

    self.realm.channelLookup['session'] = WorkingExecSession
    endpoint = self.create()
    factory = Factory()
    factory.protocol = Protocol
    connected = endpoint.connect(factory)
    (server, client, pump) = self.finishConnection()
    protocol = self.successResultOf(connected)
    connectionLost = []
    protocol.connectionLost = connectionLost.append
    channelId = protocol.transport.id
    channel = server.service.channels[channelId]
    server.service.sendRequest(channel, request, requestArg)
    channel.loseConnection()
    pump.pump()
    self.assertClientTransportState(client, False)
    return connectionLost[0]
