t_shmif.sh revision 1.5
11.5Sgson# $NetBSD: t_shmif.sh,v 1.5 2020/09/09 09:17:14 gson Exp $ 21.1Spooka# 31.1Spooka# Copyright (c) 2011 The NetBSD Foundation, Inc. 41.1Spooka# All rights reserved. 51.1Spooka# 61.1Spooka# Redistribution and use in source and binary forms, with or without 71.1Spooka# modification, are permitted provided that the following conditions 81.1Spooka# are met: 91.1Spooka# 1. Redistributions of source code must retain the above copyright 101.1Spooka# notice, this list of conditions and the following disclaimer. 111.1Spooka# 2. Redistributions in binary form must reproduce the above copyright 121.1Spooka# notice, this list of conditions and the following disclaimer in the 131.1Spooka# documentation and/or other materials provided with the distribution. 141.1Spooka# 151.1Spooka# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 161.1Spooka# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 171.1Spooka# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 181.1Spooka# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 191.1Spooka# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 201.1Spooka# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 211.1Spooka# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 221.1Spooka# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 231.1Spooka# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 241.1Spooka# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 251.1Spooka# POSSIBILITY OF SUCH DAMAGE. 261.1Spooka# 271.1Spooka 281.1Spookaatf_test_case crossping cleanup 291.1Spooka 301.2SpookaNKERN=8 311.2Spooka 321.1Spookacrossping_head() 331.1Spooka{ 341.2Spooka atf_set "descr" "run $NKERN rump kernels on one shmif bus and crossping" 351.1Spooka} 361.1Spooka 371.1Spookastartserver() 381.1Spooka{ 391.1Spooka 401.1Spooka export RUMP_SERVER=unix://sock${1} 411.1Spooka atf_check -s exit:0 rump_server -lrumpnet -lrumpnet_net \ 421.4Sbad -lrumpnet_netinet -lrumpnet_shmif ${RUMP_SERVER} 431.1Spooka atf_check -s exit:0 rump.ifconfig shmif0 create 441.1Spooka atf_check -s exit:0 rump.ifconfig shmif0 linkstr shmbus 451.1Spooka atf_check -s exit:0 rump.ifconfig shmif0 inet 1.1.1.${1} 461.1Spooka} 471.1Spooka 481.1Spookapingothers() 491.1Spooka{ 501.1Spooka 511.1Spooka} 521.1Spooka 531.1Spookacrossping_body() 541.1Spooka{ 551.1Spooka 561.2Spooka for x in `jot ${NKERN}` ; do startserver $x ; done 571.2Spooka for x in `jot ${NKERN}` 581.1Spooka do 591.1Spooka export RUMP_SERVER=unix://sock${x} 601.2Spooka for y in `jot ${NKERN}` 611.1Spooka do 621.1Spooka [ ${y} -eq ${x} ] && continue 631.1Spooka atf_check -s exit:0 -o ignore -e ignore \ 641.5Sgson rump.ping -n -c 1 1.1.1.${y} 651.1Spooka done 661.1Spooka done 671.1Spooka} 681.1Spooka 691.1Spookacrossping_cleanup() 701.1Spooka{ 711.1Spooka 721.2Spooka for x in `jot ${NKERN}` ; do RUMP_SERVER=unix://sock${x} rump.halt ;done 731.1Spooka : 741.1Spooka} 751.1Spooka 761.1Spookaatf_init_test_cases() 771.1Spooka{ 781.1Spooka 791.1Spooka atf_add_test_case crossping 801.1Spooka} 81