diff options
author | Pasi Petäjäjärvi <pasi.petajajarvi@qt.io> | 2021-09-27 18:02:52 +0300 |
---|---|---|
committer | Pasi Petäjäjärvi <pasi.petajajarvi@qt.io> | 2021-10-27 13:30:01 +0300 |
commit | 6c22f7e39c7b0f1c7508f39d7bd973b6cbe9aaaf (patch) | |
tree | 989fd01b0a33fec5a4d67005df45feafa8a5fb55 /coin/instructions/coin_module_test_qnx_start_emulator.yaml | |
parent | c91b5dae9a5e62e3912781a8e7520a746bc8983e (diff) |
CI: Add QNX qemu support
* Script used to parse env variables and run test over ssh on qemu
* Script to start qnx qemu
* Script used to set env variables for ssh so they are correct in qemu
* Add b2qt sdk host toolchain to path for actual qemu binaries
Task-number: QTBUG-87628
Pick-to: 6.2
Change-Id: I951172211c2963654899491568771310a410e616
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
Diffstat (limited to 'coin/instructions/coin_module_test_qnx_start_emulator.yaml')
-rw-r--r-- | coin/instructions/coin_module_test_qnx_start_emulator.yaml | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/coin/instructions/coin_module_test_qnx_start_emulator.yaml b/coin/instructions/coin_module_test_qnx_start_emulator.yaml new file mode 100644 index 0000000000..39a44f7f99 --- /dev/null +++ b/coin/instructions/coin_module_test_qnx_start_emulator.yaml @@ -0,0 +1,90 @@ +type: Group +instructions: + - type: Group + instructions: + - type: WriteFile + fileContents: | + #!/bin/bash + RESULT=1 # 0 upon success + TIMEOUT=60 + COUNT=0 + QEMUPID=0 + QEMUIPADDR="{{.Env.QNX_QEMU_IPADDR}}" + mkqnximage --type=qemu --hostname=QNX_QEMU_CI --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 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: 755 + - type: ChangeDirectory + directory: "{{.Env.QNX_QEMU}}" + - type: ExecuteCommand + command: "chmod 755 {{.Env.QNX_QEMU}}/start_qnx_qemu.sh" + maxTimeInSeconds: 10 + maxTimeBetweenOutput: 10 + userMessageOnFailure: > + Failed to change file permission. + disable_if: + condition: property + property: host.os + equals_value: Windows + - type: ExecuteCommand + command: "{{.Env.QNX_QEMU}}/start_qnx_qemu.sh" + maxTimeInSeconds: 100 + 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 |