3 # SPDX-License-Identifier: BSD-2-Clause-FreeBSD
5 # Copyright (c) 2020 The FreeBSD Foundation
8 # This software was developed by Kristof Provost under sponsorship
9 # from the FreeBSD Foundation.
11 # Redistribution and use in source and binary forms, with or without
12 # modification, are permitted provided that the following conditions
14 # 1. Redistributions of source code must retain the above copyright
15 # notice, this list of conditions and the following disclaimer.
16 # 2. Redistributions in binary form must reproduce the above copyright
17 # notice, this list of conditions and the following disclaimer in the
18 # documentation and/or other materials provided with the distribution.
20 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
21 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
24 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 . $(atf_get_srcdir)/../common/vnet.subr
34 atf_test_case "bridge_transmit_ipv4_unicast" "cleanup"
35 bridge_transmit_ipv4_unicast_head()
37 atf_set descr 'bridge_transmit_ipv4_unicast bridging test'
38 atf_set require.user root
41 bridge_transmit_ipv4_unicast_body()
45 epair_alcatraz=$(vnet_mkepair)
46 epair_singsing=$(vnet_mkepair)
48 vnet_mkjail alcatraz ${epair_alcatraz}b
49 vnet_mkjail singsing ${epair_singsing}b
51 jexec alcatraz ifconfig ${epair_alcatraz}b 192.0.2.1/24 up
52 jexec singsing ifconfig ${epair_singsing}b 192.0.2.2/24 up
54 bridge=$(vnet_mkbridge)
57 ifconfig ${epair_alcatraz}a up
58 ifconfig ${epair_singsing}a up
59 ifconfig ${bridge} addm ${epair_alcatraz}a
60 ifconfig ${bridge} addm ${epair_singsing}a
62 atf_check -s exit:0 -o ignore jexec alcatraz ping -c 3 -t 1 192.0.2.2
63 atf_check -s exit:0 -o ignore jexec singsing ping -c 3 -t 1 192.0.2.1
66 bridge_transmit_ipv4_unicast_cleanup()
73 atf_add_test_case "bridge_transmit_ipv4_unicast"