qtbase/coin/instructions/coin_module_test_qnx_start_emulator.yaml
Toni Saario 30e0091774 Coin: Prefer publickey in QNX emulator ssh
When starting QNX emulator this makes VM to try to publickey first.

This avoids VM from trying to use gssapi-with-mic authentication,
which in some cases hangs indefinitely causing a timeout.

Pick-to: 6.7 6.5
Change-Id: I499c668a910851d97ce8de803a1064dcd7b0b74d
Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
(cherry picked from commit 97637f909482a0b8472f99c6ecdc873029843cb1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-05 19:28:43 +00:00

81 lines
2.7 KiB
YAML

type: Group
instructions:
- type: Group
instructions:
- type: WriteFile
fileContents: |
#!/bin/bash
RESULT=1 # 0 upon success
TIMEOUT=240
COUNT=0
QEMUPID=0
QEMUIPADDR="{{.Env.QNX_QEMU_IPADDR}}"
mkqnximage --type=qemu --graphics=no --ip=${QEMUIPADDR} --build --run=-h </dev/null &>/dev/null & disown
while [[ "QEMUPID" -eq 0 ]]
do
QEMUPID=`pidof qemu-system-x86_64`
if [[ "QEMUPID" -eq 0 ]]; then
echo "QEMU not yet started, wait 1 sec."
COUNT=$((COUNT+1))
sleep 1
else
echo "QEMU running with PID: $QEMUPID"
fi
if [[ "COUNT" -eq "TIMEOUT" ]]; then
echo "Timeout waiting QEMU to start"
exit 1
fi
done
while :; do
echo "Waiting QEMU SSH coming up"
status=$(ssh -o PreferredAuthentications=publickey -o BatchMode=yes -o ConnectTimeout=1 ${QEMUIPADDR} echo ok 2>&1)
RESULT=$?
if [ $RESULT -eq 0 ]; then
echo "QEMU SSH Connected ok"
break
fi
if [ $RESULT -eq 255 ]; then
# connection refused also gets you here
if [[ $status == *"Permission denied"* ]] ; then
# permission denied indicates the ssh link is okay
echo "QEMU SSH server up"
RESULT=0
break
fi
fi
TIMEOUT=$((TIMEOUT-1))
if [ $TIMEOUT -eq 0 ]; then
echo "QEMU SSH timed out"
exit $RESULT
fi
sleep 1
done
exit $RESULT
filename: "{{.Env.QNX_QEMU}}/start_qnx_qemu.sh"
fileMode: 493
- type: ChangeDirectory
directory: "{{.Env.QNX_QEMU}}"
- type: ExecuteCommand
command: "{{.Env.QNX_QEMU}}/start_qnx_qemu.sh"
maxTimeInSeconds: 300
maxTimeBetweenOutput: 100
userMessageOnFailure: >
Failed to start QNX qemu, check logs.
disable_if:
condition: property
property: host.os
equals_value: Windows
enable_if:
condition: and
conditions:
- condition: property
property: target.osVersion
equals_value: QNX_710
- condition: property
property: features
not_contains_value: DisableTests