1#!/bin/sh 2# Copyright (c) 2017 Oracle and/or its affiliates. All Rights Reserved. 3# Copyright (c) International Business Machines Corp., 2000 4# 5# This program is free software; you can redistribute it and/or 6# modify it under the terms of the GNU General Public License as 7# published by the Free Software Foundation; either version 2 of 8# the License, or (at your option) any later version. 9# 10# This program is distributed in the hope that it would be useful, 11# but WITHOUT ANY WARRANTY; without even the implied warranty of 12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13# GNU General Public License for more details. 14# 15# You should have received a copy of the GNU General Public License 16# along with this program. If not, see <http://www.gnu.org/licenses/>. 17 18TCID="rpc01" 19TST_TOTAL=6 20TST_CLEANUP=do_cleanup 21 22TST_USE_LEGACY_API=1 23. tst_net.sh 24 25NUMLOOPS=${NUMLOOPS:=3} 26DATAFILES=${DATAFILES:="file.1 file.2"} 27 28do_cleanup() 29{ 30 pkill -9 rpc_server > /dev/null 2>&1 31} 32 33do_setup() 34{ 35 tst_resm TINFO "start rpc_server" 36 rpc_server 37 38 tst_resm TINFO "wait for server to be registered" 39 for i in $(seq 1 30); do 40 rpcinfo -T udp $(tst_ipaddr) 2000333 10 >/dev/null 2>&1 && break 41 [ "$i" -eq 30 ] && tst_brkm TBROK "server not registered" 42 tst_sleep 100ms 43 done 44} 45 46do_test() 47{ 48 local thost="$(tst_ipaddr)" 49 50 tst_resm TINFO "starting client process" 51 local cnt=1 52 while [ $cnt -le $NUMLOOPS ]; do 53 for f in $DATAFILES; do 54 EXPECT_RHOST_PASS rpc1 -s $thost -f $LTP_DATAROOT/$f 55 done 56 cnt=$(($cnt + 1)) 57 done 58} 59 60do_setup 61do_test 62 63tst_exit 64