GreTunnelOverBondRecipe

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

Bases: MTUHWConfigMixin, PauseFramesHWConfigMixin, OffloadSubConfigMixin, BaseTunnelRecipe

This class implements a recipe that configures a GRE tunnel between two hosts that are connected through a bond device.

                .--------.
     .------.---| switch |---.------.
     |      |   '--------'   |      |
     |      |                |      |
.----|-- ---|----.      .----|-- ---|----.
| .--'-.  .-'--. |      | .--'-.  .-'--. |
| |eth0|  |eth1| |      | |eth0|  |eth1| |
| '----'  '----' |      | '----'  '----' |
|     \    /     |      |     \    /     |
|   .--\--/-.    |      |   .--\--/-.    |
|   | bond0 |    |      |   | bond0 |    |
|   '-------'    |      |   '-------'    |
|      | |       |      |      | |       |
|   ---' '----   |      |   ---' '----   |
|   gre tunnel   |      |   gre tunnel   |
|   ----------   |      |   ----------   |
|                |      |                |
|    host1       |      |    host1       |
'----------------'      '----------------'

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 bonding_mode:

(mandatory test parameter) the bonding mode to be configured on the bond0 device.

param miimon_value:

(mandatory test parameter) the miimon interval to be configured on the bond0 device.

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

The underlying network for the tunnel consists of two Ethernet devices bonded together by bonding device on both of the matched hosts.

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

The GRE tunnel devices are configured with local and remote ip addresses matching the bond device IP addresses.

The GRE tunnel devices are configured with IPv4 and IPv6 addresses of individual networks. Routes are configured accordingly.

generate_ping_endpoints(config)

The ping endpoints for this recipe are simply the tunnel endpoints

Returned as:

[PingEndpoints(self.matched.host1.gre_tunnel, self.matched.host2.gre_tunnel)]
get_packet_assert_config(ping_config)

The packet assert test configuration contains filter for gre protocol and grep patterns to match the ICMP or ICMP6 echo requests.