tests: run ssh commands in batch mode

(cherry picked from commit 711668dc99)

Related: rhbz#1785154
This commit is contained in:
Jakub Rusz 2020-01-22 16:11:03 +01:00 committed by Alexander Todorov
parent 2a310efdcf
commit 4dec82ae20
2 changed files with 3 additions and 3 deletions

View File

@ -132,7 +132,7 @@ composer_stop() {
verify_image() {
SSH_USER="$1"
SSH_MACHINE="$2"
SSH_OPTS="-o StrictHostKeyChecking=no $3"
SSH_OPTS="-o StrictHostKeyChecking=no -o BatchMode=yes $3"
rlLogInfo "verify_image: SSH_OPTS:'$SSH_OPTS' SSH_USER:'$SSH_USER' SSH_MACHINE: '$SSH_MACHINE'"
check_root_account "$@"
if [ "$CHECK_CMDLINE" != 0 ]; then

View File

@ -139,8 +139,8 @@ __EOF__
rlPhaseStartTest "Verify VM instance"
# run generic tests to verify the instance and check if cloud-init is installed and running
verify_image azure-user "$IP_ADDRESS" "-i $SSH_KEY_DIR/id_rsa"
rlRun -t -c "ssh -o StrictHostKeyChecking=no -i $SSH_KEY_DIR/id_rsa azure-user@$IP_ADDRESS 'rpm -q cloud-init'"
rlRun -t -c "ssh -o StrictHostKeyChecking=no -i $SSH_KEY_DIR/id_rsa azure-user@$IP_ADDRESS 'systemctl status cloud-init'"
rlRun -t -c "ssh -o StrictHostKeyChecking=no -o BatchMode=yes -i $SSH_KEY_DIR/id_rsa azure-user@$IP_ADDRESS 'rpm -q cloud-init'"
rlRun -t -c "ssh -o StrictHostKeyChecking=no -o BatchMode=yes -i $SSH_KEY_DIR/id_rsa azure-user@$IP_ADDRESS 'systemctl status cloud-init'"
rlPhaseEnd
rlPhaseStartCleanup