Changeset View
Changeset View
Standalone View
Standalone View
tests/sys/net/if_bridge_test.sh
# $FreeBSD$ | # $FreeBSD$ | ||||
Lint: Invalid Executable: Executable files should either be binary or contain a shebang. | |||||
# | # | ||||
# SPDX-License-Identifier: BSD-2-Clause-FreeBSD | # SPDX-License-Identifier: BSD-2-Clause-FreeBSD | ||||
# | # | ||||
# Copyright (c) 2020 The FreeBSD Foundation | # Copyright (c) 2020 The FreeBSD Foundation | ||||
# | # | ||||
# This software was developed by Kristof Provost under sponsorship | # This software was developed by Kristof Provost under sponsorship | ||||
# from the FreeBSD Foundation. | # from the FreeBSD Foundation. | ||||
▲ Show 20 Lines • Show All 177 Lines • ▼ Show 20 Lines | atf_check -s exit:0 -o ignore \ | ||||
jexec one ifconfig ${bridge} deladdr 00:01:02:03:04:05 | jexec one ifconfig ${bridge} deladdr 00:01:02:03:04:05 | ||||
} | } | ||||
static_cleanup() | static_cleanup() | ||||
{ | { | ||||
vnet_cleanup | vnet_cleanup | ||||
} | } | ||||
atf_test_case "span" "cleanup" | |||||
span_head() | |||||
{ | |||||
atf_set descr 'Bridge span test' | |||||
atf_set require.user root | |||||
} | |||||
span_body() | |||||
{ | |||||
set -x | |||||
vnet_init | |||||
epair=$(vnet_mkepair) | |||||
epair_span=$(vnet_mkepair) | |||||
bridge=$(vnet_mkbridge) | |||||
vnet_mkjail one ${bridge} ${epair}a ${epair_span}a | |||||
ifconfig ${epair}b up | |||||
ifconfig ${epair_span}b up | |||||
jexec one ifconfig ${bridge} up | |||||
jexec one ifconfig ${epair}a up | |||||
jexec one ifconfig ${epair_span}a up | |||||
jexec one ifconfig ${bridge} addm ${epair}a | |||||
jexec one ifconfig ${bridge} span ${epair_span}a | |||||
jexec one ifconfig ${bridge} 192.0.2.1/24 | |||||
# Send some traffic through the span | |||||
jexec one ping -c 1 -t 1 192.0.2.2 | |||||
jexec one ifconfig ${bridge} -span ${epair_span}a | |||||
} | |||||
span_cleanup() | |||||
{ | |||||
vnet_cleanup | |||||
} | |||||
atf_init_test_cases() | atf_init_test_cases() | ||||
{ | { | ||||
atf_add_test_case "bridge_transmit_ipv4_unicast" | atf_add_test_case "bridge_transmit_ipv4_unicast" | ||||
atf_add_test_case "stp" | atf_add_test_case "stp" | ||||
atf_add_test_case "static" | atf_add_test_case "static" | ||||
atf_add_test_case "span" | |||||
} | } |
Executable files should either be binary or contain a shebang.