Exemplo n.º 1
0
def default_traffic_packet_template_with_list_modifiers(permute_flag=None):
    model = make_traffic_template(LIST_MODIFIER_PACKET)

    for protocol in model.protocols:
        if protocol.modifiers:
            for modifier in protocol.modifiers.items:
                modifier.permute = permute_flag if permute_flag else False

    return model
Exemplo n.º 2
0
                            gen.config.traffic[0].packet = template
                            result = self.api.create_packet_generator(gen)
                            expect(result).to(be_valid_packet_generator)

                with description('with signatures enabled,'):
                    with it('succeeds'):
                        gen = generator_model(self.api.api_client)
                        gen.config.traffic[
                            0].signature = client.models.SpirentSignature(
                                stream_id=1, latency='start_of_frame')
                        result = self.api.create_packet_generator(gen)
                        expect(result).to(be_valid_packet_generator)

                with description('with custom packet,'):
                    with it('succeeds'):
                        template = make_traffic_template(CUSTOM_L2_PACKET)
                        gen = generator_model(self.api.api_client)
                        gen.config.traffic[0].packet = template
                        result = self.api.create_packet_generator(gen)
                        expect(result).to(be_valid_packet_generator)

                with description('with custom payload,'):
                    with it('succeeds'):
                        template = make_traffic_template(CUSTOM_PAYLOAD)
                        gen = generator_model(self.api.api_client)
                        gen.config.traffic[0].packet = template
                        result = self.api.create_packet_generator(gen)
                        expect(result).to(be_valid_packet_generator)

            with description('invalid config'):
                with description('empty target id,'):