Example #1
0
    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:
            if port.port_characteristic == PORT_SAP:
                cmd = ESAP(port)
                setattr(port, "ip_dst", get("TE_IP"))
                setattr(port, "udp_dst", int(get("TE_UDP")))
            else:
                #cmd = EIPC(port)
                cmd = ESAP(port)
            command_size = cmd.command_size
            message = "Short message"
            messages = []
            messages.append(buildShortMessage(port, message, command_size))
            messages.append(buildMessage(port, 
                                     (int(port.buffer_size)/2) - command_size, 
                                     message))
            messages.append(buildMessage(port,
                                        int(port.buffer_size) - command_size,
                                        message))
            for message in messages:
                command = cmd.buildCommand(command = 'SEND', message = message)
                self.send(command, Factory.GET_TX_Port())

                if not pollForResponse(("OK", "ERR")):
                    self.logger.info("The ES did not respond to EIPC command")
Example #2
0
 def sequence1(self):
     self.captureForSequence(1)
     for port in self.icmp_ports:
         setattr(port, 'buffer_size', port.rx_vl_buff_size)
         for size in range(1, 65):
             message = buildMessage(port, size)
             self.__sendicmp(port, message)
Example #3
0
 def sequence2(self):
     if len(self.input_port) == 0:
         self.logger.info("There are no ports in the ICD satisfying the " \
                          "scripts criteria")
         return
     self.captureForSequence(2)
     index = 0
     self.network = 'A'
     for port in self.input_port:
         message = buildShortMessage(port, "Background message")
         self.send(message, port)
         if index % 3 == 0:
             for icmp_port in self.icmp_ports:
                 setattr(icmp_port, 'buffer_size', icmp_port.rx_vl_buff_size)
                 message = buildMessage(icmp_port, 64)
                 self.__sendicmp(icmp_port, message, poll = False)
         index += 1