def run(self): self.logger.info("Starting the script") smallest_bag = None needed_port = None if len(self.output_ports) == 0: self.logger.info("There are no ports in the ICD satisfying the " \ "scripts criteria") return for port in self.output_ports: bag = port.bag if smallest_bag == None: smallest_bag = bag if bag <= smallest_bag: smallest_bag = bag needed_port = port if needed_port == None: self.logger.error("The ICD has no entries") return self.sendRSET() self.logger.info("Smallest BAG chosen is %s" % smallest_bag) self.logger.info("Sending an EIPC HOLD on %s" % \ needed_port.tx_AFDX_port_id) eipc = EIPC(needed_port) self.send(eipc.buildCommand(command = 'HOLD', message = "SN Test"), Factory.GET_TX_Port()) pollForResponse('EIPC') tcrq = TCRQ() self.send(tcrq.buildCommand(257), Factory.GET_TX_Port()) self.logger.info("Sending a TCRQ command.") pollForResponse('TCRQ') raw_input("Press enter/return key to continue......")
def run(self): self.logger.info("Starting sequence 1") if len(self.output_ports) == 0: self.logger.info("There are no ports in the ICD satisfying the " \ "scripts criteria") return self.sendRSET() for port in self.output_ports: eipc = EIPC(port) message = "PortId = %s" % port.tx_AFDX_port_id offset_size = eipc.command_size command = eipc.buildCommand(command = 'HOLD', message = buildShortMessage(port, message, offset_size)) self.send(command, Factory.GET_TX_Port()) if not pollForResponse('EIPC'): self.logger.error("The ES has not responded to EIPC") tcrq = TCRQ() self.send(tcrq.buildCommand(10), Factory.GET_TX_Port()) if not pollForResponse('TCRQ'): self.logger.error("The ES has not responded to TCRQ") raw_input("Press any key to continue.")
def run(self): self.logger.info("Starting the sequence 1") if len(self.output_ports) == 0: self.logger.error("There are no ports which satisfy the scripts" \ " criteria.") return self.sendRSET() for port in self.output_ports: eipc = EIPC(port) message = "Port Id = %s" % port.tx_AFDX_port_id offset_size = eipc.command_size command = eipc.buildCommand(command = 'HOLD', message = buildBigMessage(port, message, offset_size = offset_size)) self.send(command, Factory.GET_TX_Port()) if not pollForResponse("EIPC", timeout = 2): self.logger.error("The ES has not responded to EIPC") tcrq = TCRQ() self.send(tcrq.buildCommand(1), Factory.GET_TX_Port()) if not pollForResponse("TCRQ", timeout = 10): self.logger.error("The ES has not responded to TCRQ") self.logger.info("Completed sequence 1") raw_input("Press any key to continue.")
def doOperation(self, port, snmp_port): eipc = EIPC(port) message = buildStaticMessage(port.max_frame_size + 1, "Big message") self.sendSNMP(snmp_port) self.send(eipc.buildCommand(message), Factory.GET_TX_Port()) self.sendSNMP(snmp_port) message = buildShortMessage(port, "Short message", eipc.command_size) self.send(eipc.buildCommand(message), Factory.GET_TX_Port())
def sendOnDisconnectedInterface(self, rx_port, tx_port): self.sendRSET() self.network = NETWORK_AB self.logger.info("Checking the transmission port") eipc = EIPC(tx_port) message = "PortId = %s" % tx_port.tx_AFDX_port_id message = buildShortMessage(tx_port, message) self.send(eipc.buildCommand(message = message), Factory.GET_TX_Port()) pollForResponse('EIPC') self.logger.info("Checking the reception port") message = "PortId = %s" % rx_port.RX_AFDX_port_id message = buildShortMessage(rx_port, message) self.send(message, rx_port) rrpc = RRPC(rx_port) self.send(rrpc.buildCommand(), Factory.GET_TX_Port()) pollForResponse('RRPC')
def sequence1(self): if len(self.input_ports) == 0: self.logger.info("There are no ports in the ICD satisfying the " \ "scripts criteria") return self.captureForSequence(1) self.sendRSET() for port in self.output_ports: if port.ip_frag_allowed: continue eipc = EIPC(port) message = buildStaticMessage(int(port.max_frame_size), \ "MFS + 1") self.send(eipc.buildCommand(message = message), \ Factory.GET_TX_Port()) self.logger.info("Sending an EIPC command on port : %s" % \ port.tx_AFDX_port_id) pollForResponse('EIPC')
def run(self): if len(self.ports) == 0: self.logger.info("There are no ports in the ICD satisfying the " \ "scripts criteria") return self.sendRSET() for port in self.ports: eipc = EIPC(port) message = "PortId = %s" % port.tx_AFDX_port_id command = eipc.buildCommand(messagetype = 'U', message = message) self.logger.info("Sending an EIPC request on port : %s" % \ port.tx_AFDX_port_id) self.send(command, Factory.GET_TX_Port()) if not pollForResponse("EIPC"): self.logger.error("The ES has not responded for EIPC")
def run(self): if len(self.output_ports) == 0: self.logger.info("There are no ports in the ICD satisfying the " \ "scripts criteria") return self.sendRSET() for port in self.output_ports: eipc = EIPC(port) self.logger.info("Sending EIPC HOLD on %s" % \ port.tx_AFDX_port_id) self.send(eipc.buildCommand(command = 'HOLD',\ message = buildShortMessage(port, "RM test", eipc.command_size)), Factory.GET_TX_Port()) pollForResponse("EIPC") tcrq = TCRQ() self.logger.info("Seding a TCRQ for %d times" % 2) self.send(tcrq.buildCommand(2), Factory.GET_TX_Port()) raw_input("Press enter key to continue.....")