cthon: Add arguments for printing client and server dmesg log

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
Anna Schumaker 2022-04-18 11:24:50 -04:00
parent cbcc5ba269
commit a6d46ff0e1
2 changed files with 20 additions and 0 deletions

View File

@ -5,8 +5,10 @@ function _cthon.zsh() {
{-c,--client}'[the client to test]: : _alternative
"hosts\:hosts\: _ssh_hosts"
"domains\:domains\:($(virsh list --all --name))"' \
--dmesg'[print client dmesg log after running tests]' \
--nconnect'[number of connections]: :($(seq 1 32))' \
--krb5'[run tests with sec=krb5]' \
--srvdmesg'[print server dmesg log after running tests]' \
{-p,--mountpoint}'[the directory to mount the server]: : _files -/' \
{-r,--rdma}'[test using rdma]: :(rxe siw)' \
{-s,--server}'[the server to test against]: : _alternative

View File

@ -6,6 +6,7 @@ MOUNTPOINT=(/mnt/test)
zparseopts -F -K \
c:=CLIENT -client:=CLIENT \
-dmesg=DMESG -srvdmesg=SRVDMESG \
p:=MOUNTPOINT -mountpoint:=MOUNTPOINT \
-nconnect:=NCONNECT \
-krb5=KRB5 \
@ -33,6 +34,12 @@ fi
if [ ${#KRB5} -gt 0 ]; then
RUN_CTHON="$RUN_CTHON --dokrb5"
fi
if [ ${#DMESG} -gt 0 ]; then
ssh ${CLIENT[-1]} "sudo dmesg --clear"
fi
if [ ${#SRVDMESG} -gt 0 ]; then
ssh ${SERVER[-1]} "sudo dmesg --clear"
fi
ssh ${CLIENT[-1]} "sudo setup-testdirs.zsh ${SERVER[-1]} ${EXPORT[-1]} ${MOUNTPOINT[-1]} $USER" | python $COLOR
echo
@ -40,4 +47,15 @@ echo
#
# Run tests
#
set +e
ssh ${CLIENT[-1]} "$RUN_CTHON --server ${SERVER[-1]} --serverdir ${EXPORT[-1]}/$USER 2>&1" | python -u $COLOR
ret=$?
if [ ${#DMESG} -gt 0 ]; then
ssh ${CLIENT[-1]} "sudo dmesg --color=always"
fi
if [ ${#SRVDMESG} -gt 0 ]; then
ssh ${SERVER[-1]} "sudo dmesg --color=always"
fi
exit $ret