diff --git a/completions/_cthon.zsh b/completions/_cthon.zsh index 2d26fd2..b5c812b 100644 --- a/completions/_cthon.zsh +++ b/completions/_cthon.zsh @@ -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 diff --git a/cthon.zsh b/cthon.zsh index 63737ba..789e1f5 100755 --- a/cthon.zsh +++ b/cthon.zsh @@ -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