Create an rping.zsh script

For testing RDMA connections between two machines. I also convert the
cthon.zsh script to use it before testing.

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
Anna Schumaker 2021-12-15 13:47:35 -05:00
parent f1ea1327f4
commit 38d323c5ab
3 changed files with 34 additions and 1 deletions

12
completions/_rping.zsh Normal file
View File

@ -0,0 +1,12 @@
#compdef rping.zsh
function _rping.zsh() {
_arguments \
'1:mode:(siw rxe)' \
'2:client: _alternative
"hosts:hosts: _ssh_hosts"
"domains:domains:($(virsh list --all --name))"' \
'3:server: _alternative
"hosts:hosts: _ssh_hosts"
"domains:domains:($(virsh list --all --name))"'
}

View File

@ -25,7 +25,7 @@ $BIN/vm.zsh boot ${CLIENT[-1]} ${SERVER[-1]}
$BIN/install-scripts.zsh ${CLIENT[-1]}
if [ ${#RDMA} -gt 0 ]; then
RUN_CTHON="$RUN_CTHON --rdma"
$BIN/rdma.zsh ${RDMA[-1]} ${CLIENT[-1]} ${SERVER[-1]}
$BIN/rping.zsh ${RDMA[-1]} ${CLIENT[-1]} ${SERVER[-1]}
fi
if [ ${#NCONNECT} -gt 0 ]; then
RUN_CTHON="$RUN_CTHON --nconnect ${NCONNECT[-1]}"

21
rping.zsh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/zsh -e
if [ "$#" -ne 3 ]; then
echo "Usage: $0 {rxe,siw} {client} {server}"
exit 1
fi
RDMA=$1
CLIENT=$2
SERVER=$3
IFS=$'\n'
BIN=$HOME/bin
tags=($(python $BIN/colors/vm.py $CLIENT $SERVER))
$BIN/rdma.zsh $RDMA $CLIENT $SERVER
ssh $SERVER "rping -s -C 1 -v 2>&1" | sed "s/^/${tags[2]} /" &
ssh $CLIENT "rping -c -C 1 -S 40 -v -a $SERVER 2>&1" | sed "s/^/${tags[1]} /"
wait $(jobs -pr)