#-1# SPDX-License-Identifier: BSD-2-Clause2#3# Copyright (c) 2019 Netflix, Inc.4#5# Redistribution and use in source and binary forms, with or without6# modification, are permitted provided that the following conditions7# are met:8# 1. Redistributions of source code must retain the above copyright9# notice, this list of conditions and the following disclaimer.10# 2. Redistributions in binary form must reproduce the above copyright11# notice, this list of conditions and the following disclaimer in the12# documentation and/or other materials provided with the distribution.13#14# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND15# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE16# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE17# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE18# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL19# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS20# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)21# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT22# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY23# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF24# SUCH DAMAGE.25#2627. $(atf_get_srcdir)/../common/vnet.subr2829atf_test_case "scapyi386" "cleanup"30scapyi386_head() {3132atf_set descr 'Test for correct Ethernet Destination MAC address'33atf_set require.user root34atf_set require.progs python3 scapy35}3637scapyi386_body() {3839ids=6553340id=`printf "%x" ${ids}`41if [ $$ -gt 65535 ]; then42xl=`printf "%x" $(($$ - 65535))`43yl="1"44else45xl=`printf "%x" $$`46yl=""47fi4849vnet_init5051ip6a="2001:db8:6666:0000:${yl}:${id}:1:${xl}"52ip6b="2001:db8:6666:0000:${yl}:${id}:2:${xl}"5354epair=$(vnet_mkepair)55ifconfig ${epair}a up56ifconfig ${epair}a inet6 ${ip6a}/645758jname="v6t-${id}-${yl}-${xl}"59vnet_mkjail ${jname} ${epair}b60jexec ${jname} ifconfig ${epair}b up61jexec ${jname} ifconfig ${epair}b inet6 ${ip6b}/646263# Let IPv6 ND do its thing.64#ping6 -q -c 1 ff02::1%${epair}a65#ping6 -q -c 1 ${ip6b}66sleep 36768pyname=$(atf_get ident)69pyname=${pyname%*_[0-9]}7071atf_check -s exit:0 $(atf_get_srcdir)/${pyname}.py \72--sendif ${epair}a --recvif ${epair}a \73--src ${ip6a} --to ${ip6b}74}7576scapyi386_cleanup() {7778vnet_cleanup79}8081atf_init_test_cases()82{8384atf_add_test_case "scapyi386"85}8687# end888990