tools/testing/selftests/net/forwarding/min_max_mtu.sh

Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/forwarding/min_max_mtu.sh

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/net/forwarding/min_max_mtu.sh
Extension
.sh
Size
4856 bytes
Lines
284
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: tools
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

#!/bin/bash
# SPDX-License-Identifier: GPL-2.0

# +--------------------+
# | H1                 |
# |                    |
# |           $h1.10 + |
# |     192.0.2.2/24 | |
# | 2001:db8:1::2/64 | |
# |                  | |
# |              $h1 + |
# |                  | |
# +------------------|-+
#                    |
# +------------------|-+
# | SW               | |
# |            $swp1 + |
# |                  | |
# |         $swp1.10 + |
# |     192.0.2.1/24   |
# | 2001:db8:1::1/64   |
# |                    |
# +--------------------+

ALL_TESTS="
	ping_ipv4
	ping_ipv6
	max_mtu_config_test
	max_mtu_traffic_test
	min_mtu_config_test
	min_mtu_traffic_test
"

NUM_NETIFS=2
source lib.sh

h1_create()
{
	simple_if_init $h1
	vlan_create $h1 10 v$h1 192.0.2.2/24 2001:db8:1::2/64
}

h1_destroy()
{
	vlan_destroy $h1 10 192.0.2.2/24 2001:db8:1::2/64
	simple_if_fini $h1
}

switch_create()
{
	ip li set dev $swp1 up
	vlan_create $swp1 10 "" 192.0.2.1/24 2001:db8:1::1/64
}

switch_destroy()
{
	ip li set dev $swp1 down
	vlan_destroy $swp1 10
}

setup_prepare()
{
	h1=${NETIFS[p1]}
	swp1=${NETIFS[p2]}

	vrf_prepare

	h1_create

	switch_create

Annotation

Implementation Notes