Skip to content

Commit 80021ff

Browse files
committed
torture: Make kvm-remote print diagnostics on initial ssh failure
Currently, if the initial ssh fails, kvm-remote.sh gives up, printing a message saying so. But it would be nice to get a better idea as to why ssh failed. This commit therefore dumps out ssh's exit code, stdout, and stderr upon ssh failure for diagnostic purposes. Signed-off-by: Paul E. McKenney <[email protected]>
1 parent dd3ffd1 commit 80021ff

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tools/testing/selftests/rcutorture/bin/kvm-remote.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,20 @@ chmod +x $T/bin/kvm-remote-*.sh
137137
# Check first to avoid the need for cleanup for system-name typos
138138
for i in $systems
139139
do
140-
ncpus="`ssh -o BatchMode=yes $i getconf _NPROCESSORS_ONLN 2> /dev/null`"
140+
ssh -o BatchMode=yes $i getconf _NPROCESSORS_ONLN > $T/ssh.stdout 2> $T/ssh.stderr
141141
ret=$?
142142
if test "$ret" -ne 0
143143
then
144-
echo System $i unreachable, giving up. | tee -a "$oldrun/remote-log"
144+
echo "System $i unreachable ($ret), giving up." | tee -a "$oldrun/remote-log"
145+
echo ' --- ssh stdout: vvv' | tee -a "$oldrun/remote-log"
146+
cat $T/ssh.stdout | tee -a "$oldrun/remote-log"
147+
echo ' --- ssh stdout: ^^^' | tee -a "$oldrun/remote-log"
148+
echo ' --- ssh stderr: vvv' | tee -a "$oldrun/remote-log"
149+
cat $T/ssh.stderr | tee -a "$oldrun/remote-log"
150+
echo ' --- ssh stderr: ^^^' | tee -a "$oldrun/remote-log"
145151
exit 4
146152
fi
147-
echo $i: $ncpus CPUs " " `date` | tee -a "$oldrun/remote-log"
153+
echo $i: `cat $T/ssh.stdout` CPUs " " `date` | tee -a "$oldrun/remote-log"
148154
done
149155

150156
# Download and expand the tarball on all systems.

0 commit comments

Comments
 (0)