L2TPTunnelRecipe

class lnst.Recipes.ENRT.L2TPTunnelRecipe.L2TPTunnelRecipe(**kwargs)

Bases: PauseFramesHWConfigMixin, BaseTunnelRecipe

This class implements a recipe that configures a simple L2TP tunnel with one tunnel session between two hosts.

               .--------.
        .------| switch |-----.
        |      '--------'     |
        |                     |
.-------|------.      .-------|------.
|    .--'-.    |      |    .--'-.    |
|    |eth0|    |      |    |eth0|    |
|    '----'    |      |    '----'    |
|      | |     |      |      | |     |
|  ----' '---  |      |  ----' '---  |
|  L2TP tunnel |      |  L2TPtunnel  |
|  ----------  |      |  ----------  |
|              |      |              |
|    host1     |      |    host2     |
'--------------'      '--------------'

The actual test machinery is implemented in the BaseEnrtRecipe class.

The test wide configuration is implemented in the BaseTunnelRecipe class.

The recipe provides additional parameter:

param carrier_ipversion:

This parameter specifies whether IPv4 or IPv6 addresses are used for the underlying (carrier) network. The value is either ipv4 or ipv6

param l2tp_encapsulation:

(mandatory test parameter) the encapsulation mode for the L2TP tunnel, can be either udp or ip

configure_underlying_network(config: EnrtConfiguration) tuple[RemoteDevice, RemoteDevice]

The underlying network for the tunnel consists of the Ethernet devices on the matched hosts.

create_tunnel(config: EnrtConfiguration, tunnel_endpoints: tuple[RemoteDevice, RemoteDevice]) tuple[RemoteDevice, RemoteDevice]

One L2TP tunnel is configured on both hosts using the L2TPManager. Each host configures one L2TP session for the tunnel. IPv4 addresses are assigned to the l2tp session devices.

generate_ping_endpoints(config)

The ping endpoints for this recipe are simply the tunnel endpoints

Returned as:

[PingEndpoints(self.matched.host1.l2tp_session1, self.matched.host2.l2tp_session1)]