Debian Codegraph @

coin/instructions/vxworks_test_env_setup.yaml

raw
1 type: Group
2 instructions:
3 # Allows access from NFS export.
4 - type: ExecuteCommand
5 command: "chmod -R 777 {{.AgentWorkingDir}}"
6 maxTimeInSeconds: 60
7 maxTimeBetweenOutput: 60
8 userMessageOnFailure: "Failed to set dir permissions"
9 - type: MakeDirectory
10 directory: "{{.AgentWorkingDir}}/vxworkshome"
11 - type: ExecuteCommand
12 command: "sudo chown 2001:100 {{.AgentWorkingDir}}/vxworkshome"
13 maxTimeInSeconds: 60
14 maxTimeBetweenOutput: 60
15 userMessageOnFailure: "Failed to vxworks home ownership"
16 - type: ExecuteCommand
17 command: "mkfifo /tmp/guest.in /tmp/guest.out"
18 maxTimeInSeconds: 60
19 maxTimeBetweenOutput: 60
20 userMessageOnFailure: "Failed to mkfifo"
21 - type: EnvironmentVariable
22 variableName: VXWORKS_EMULATOR_TYPE
23 variableValue: "arm"
24 enable_if:
25 condition: property
26 property: target.arch
27 equals_value: ARMV7
28 - type: EnvironmentVariable
29 variableName: VXWORKS_EMULATOR_TYPE
30 variableValue: "intel"
31 enable_if:
32 condition: property
33 property: target.arch
34 equals_value: X86_64
35 - type: ExecuteCommand
36 command: "{{.Env.HOME}}/vxworks_qemu_launcher.sh {{.Env.VXWORKS_EMULATOR_TYPE}}"
37 maxTimeInSeconds: 60
38 maxTimeBetweenOutput: 60
39 userMessageOnFailure: "Failed to start VxWorks emulator"
40 - type: WriteFile
41 filename: "{{.AgentWorkingDir}}/coin_vxworks_vars.sh"
42 fileMode: 493
43 fileContents: |
44 #!/bin/bash
45 sleep 10
46 declare -A hosts
47 hosts["qt-test-server"]="172.31.1.1"
48 hosts["qt-test-server.qt-test-net"]="172.31.1.1"
49 hosts["qt-test-server.test-net.qt.local"]="172.31.1.1"
50 hosts["vsftpd.test-net.qt.local"]="172.31.1.1"
51 hosts["apache2.test-net.qt.local"]="172.31.1.1"
52 hosts["squid.test-net.qt.local"]="172.31.1.1"
53 hosts["danted.test-net.qt.local"]="172.31.1.1"
54 hosts["ftp-proxy.test-net.qt.local"]="172.31.1.1"
55 hosts["echo.test-net.qt.local"]="172.31.1.1"
56 hosts["cyrus.test-net.qt.local"]="172.31.1.1"
57 hosts["iptables.test-net.qt.local"]="172.31.1.1"
58
59 declare -A env_vars
60 env_vars["LD_LIBRARY_PATH"]="$VXWORKS_TEST_LIBS_PATH"
61 env_vars["ICU_DATA"]="$WIND_CC_SYSROOT/3pp/ICU/icu/source/data/in/icudt73l.dat"
62 env_vars["TMPDIR"]="/tmp"
63 env_vars["QT_QPA_FONTDIR"]="$WIND_CC_SYSROOT/fonts"
64 env_vars["VXWORKS_CERTS_DIR"]="$WIND_CC_SYSROOT/certs"
65 env_vars["HOME"]="/home/qt/work/vxworkshome"
66 env_vars["QML_LOADERTHREAD_STACK_SIZE"]="131072"
67 env_vars["QTEST_FUNCTION_TIMEOUT"]="600000"
68 env_vars["QT_PLUGIN_PATH"]="/home/qt/work/install/target/plugins"
69 env_vars["QT_QPA_PLATFORM_PLUGIN_PATH"]="/home/qt/work/install/target/plugins/platforms"
70 env_vars["TZ"]="UTC"
71
72 for i in "${!hosts[@]}"
73 do
74 echo "hostAdd \"$i\", \"${hosts[$i]}\"" > /tmp/guest.in
75 sleep 1
76 done
77
78 for i in "${!env_vars[@]}"
79 do
80 echo "cmd setenv \"$i\" \"${env_vars[$i]}\"" > /tmp/guest.in
81 sleep 1
82 done
83
84 echo "cmd sysvar set -o ipdnsc.primaryns \"10.150.153.13\"" > /tmp/guest.in
85 sleep 1
86
87 date=($(date "+%Y-%m-%d %H:%M:%S"))
88 echo "cmd date ${date[0]}" > /tmp/guest.in
89 sleep 1
90 echo "cmd time ${date[1]}" > /tmp/guest.in
91
92 - type: ExecuteCommand
93 command: "{{.AgentWorkingDir}}/coin_vxworks_vars.sh"
94 maxTimeInSeconds: 600
95 maxTimeBetweenOutput: 600
96 userMessageOnFailure: "Failed to run coin_vxworks_vars.sh after having started the emulator"
97 enable_if:
98 condition: property
99 property: target.osVersion
100 equals_value: VxWorks