Skip to content

Commit 267cc24

Browse files
authored
Merge pull request #15 from kateyy/tradefed_shards_with_retry
Add MultiNode TradeFed tests for --shards and with session retry
2 parents 54ff3e5 + 2c59069 commit 267cc24

15 files changed

+1936
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
metadata:
2+
name: connect-to-remote-adb-tcpip-devices
3+
format: "Lava-Test-Shell Test Definition 1.0"
4+
description: "adb MultiNode setup: connect to remote devices made accessible via adb TCP/IP."
5+
maintainer:
6+
- karsten@fairphone.com
7+
- softwareteam@fairphone.com
8+
os:
9+
- debian
10+
- ubuntu
11+
devices:
12+
- lxc
13+
scope:
14+
- functional
15+
16+
params:
17+
ADB_CONNECT_TIMEOUT_SECS: "60"
18+
DEVICE_WORKER_MAPPING_FILE: "/tmp/deviceWorkerMapping"
19+
20+
run:
21+
steps:
22+
- . ./automated/lib/sh-test-lib
23+
- . ./automated/lib/android-multinode-test-lib
24+
- connect_to_remote_adb_tcpip_devices "${ADB_CONNECT_TIMEOUT_SECS}" "${DEVICE_WORKER_MAPPING_FILE}"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
metadata:
2+
name: release-remote-adb-tcpip-devices
3+
format: "Lava-Test-Shell Test Definition 1.0"
4+
description: "Disconnect from remote adb devices and cleanup."
5+
maintainer:
6+
- karsten@fairphone.com
7+
- softwareteam@fairphone.com
8+
os:
9+
- debian
10+
- ubuntu
11+
devices:
12+
- lxc
13+
scope:
14+
- functional
15+
16+
run:
17+
steps:
18+
- lava-sync release_dut
19+
# Cleanup adb server: LAVA expects only one device connected to adb.
20+
- adb kill-server
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
metadata:
2+
name: remote-adb-devices-smoke-test
3+
format: "Lava-Test-Shell Test Definition 1.0"
4+
description: "Smoke test demonstrating access to adb devices over TCP/IP."
5+
maintainer:
6+
- karsten@fairphone.com
7+
- softwareteam@fairphone.com
8+
os:
9+
- debian
10+
- ubuntu
11+
devices:
12+
- lxc
13+
scope:
14+
- functional
15+
16+
params:
17+
DEVICE_WORKER_MAPPING_FILE: "/tmp/deviceWorkerMapping"
18+
19+
run:
20+
steps:
21+
- device_worker_mapping="$(cat "${DEVICE_WORKER_MAPPING_FILE}")"
22+
- |
23+
for device_to_worker in ${device_worker_mapping}; do
24+
device="$(echo ${device_to_worker} | cut -d';' -f1)"
25+
echo "${device}: $(adb -s "${device}" shell service call iphonesubinfo 1 | \
26+
grep -oE '(\.[0-9])|([0-9]\.)' | grep -oE '[0-9]' | tr -d '\n')"
27+
done
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
metadata:
2+
name: share-local-device-over-adb-tcpip
3+
format: "Lava-Test-Shell Test Definition 1.0"
4+
description: "adb MultiNode setup: make local device remotely accessible via adb TCP/IP.
5+
Handles the device over to a role that responds to the following synchronization steps:
6+
- lava-sync start_handover
7+
- lava-send dut_address dut_address=${dut_address}
8+
- lava-sync finish_handover"
9+
maintainer:
10+
- karsten@fairphone.com
11+
- softwareteam@fairphone.com
12+
os:
13+
- debian
14+
- ubuntu
15+
devices:
16+
- lxc
17+
scope:
18+
- functional
19+
20+
params:
21+
ADB_PORT: "5555"
22+
ADB_TCPIP_ATTEMPTS: "5"
23+
TIMEOUT_SECS: "60"
24+
RAISE_ON_FAILURE: "true"
25+
26+
run:
27+
steps:
28+
- . ./automated/lib/sh-test-lib
29+
- . ./automated/lib/android-test-lib
30+
- . ./automated/lib/android-multinode-test-lib
31+
- ret_val=0
32+
- share_local_device_over_adb_tcpip "${ADB_TCPIP_ATTEMPTS}" "${TIMEOUT_SECS}" "${ADB_PORT}" || ret_val=$?
33+
- |
34+
if [ "${ret_val}" -ne 0 -a "${RAISE_ON_FAILURE}" = "true" ]; then
35+
lava-test-raise "Could not share device of adb tcpip."
36+
fi
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
job_name: MutliNode_xTS_template
2+
timeouts:
3+
job:
4+
hours: 2
5+
priority: medium
6+
visibility: public
7+
reboot_to_fastboot: false
8+
9+
protocols:
10+
lava-lxc:
11+
master:
12+
name: lxc-xts-master
13+
template: debian
14+
distribution: debian
15+
release: stretch
16+
worker:
17+
name: lxc-xts-worker
18+
template: debian
19+
distribution: debian
20+
release: stretch
21+
lava-multinode:
22+
# There must be one master and an arbitrary number of additional workers, so
23+
# that 1+n devices will be available in the TradeFed shell.
24+
roles:
25+
master:
26+
count: 1
27+
device_type: # TODO (a Android device, e.g., nexus4)
28+
timeout:
29+
minutes: 30
30+
worker:
31+
expect_role: master
32+
host_role: master
33+
count: 2
34+
device_type: # TODO (a Android device, e.g., nexus4)
35+
timeout:
36+
minutes: 30
37+
38+
actions:
39+
- deploy:
40+
namespace: tlxc
41+
to: lxc
42+
os: debian
43+
role:
44+
- master
45+
- worker
46+
timeout:
47+
minutes: 10
48+
packages:
49+
- adb
50+
- fastboot
51+
- unzip
52+
- wget
53+
- zip
54+
55+
- boot:
56+
namespace: tlxc
57+
role:
58+
- master
59+
- worker
60+
prompts:
61+
- 'root@(.*):/#'
62+
timeout:
63+
minutes: 5
64+
method: lxc
65+
66+
# TODO: Device-type specific deployment.
67+
# - deploy:
68+
# namespace: droid
69+
# to: fastboot
70+
# role:
71+
# - master
72+
# - worker
73+
# timeout:
74+
# minutes: 30
75+
# images:
76+
# # TODO
77+
# os: debian
78+
79+
- boot:
80+
namespace: droid
81+
role:
82+
- master
83+
- worker
84+
timeout:
85+
minutes: 10
86+
method: fastboot
87+
88+
- test:
89+
namespace: tlxc
90+
role:
91+
- master
92+
- worker
93+
timeout:
94+
minutes: 20
95+
definitions:
96+
- repository: https://review.linaro.org/qa/test-definitions
97+
from: git
98+
path: automated/android/wait-single-boot-completed.yaml
99+
name: wait-single-boot-completed
100+
101+
- test:
102+
namespace: tlxc
103+
role:
104+
- worker
105+
timeout:
106+
minutes: 5
107+
definitions:
108+
- repository: https://review.linaro.org/qa/test-definitions
109+
from: git
110+
path: automated/android/wait-single-network-connected.yaml
111+
name: wait-single-network-connected
112+
113+
- test:
114+
namespace: tlxc
115+
role:
116+
- worker
117+
timeout:
118+
minutes: 15
119+
definitions:
120+
- repository: https://review.linaro.org/qa/test-definitions
121+
from: git
122+
path: automated/android/multinode/share-local-device-over-adb-tcpip.yaml
123+
name: share-local-device-over-adb-tcpip
124+
params:
125+
TIMEOUT_SECS: "600"
126+
127+
- test:
128+
namespace: tlxc
129+
role:
130+
- worker
131+
timeout:
132+
hours: 1
133+
definitions:
134+
- repository: https://review.linaro.org/qa/test-definitions
135+
from: git
136+
path: automated/android/multinode/wait-and-keep-local-device-accessible.yaml
137+
name: wait-and-keep-local-device-accessible
138+
params:
139+
# The sum of these timeouts must be smaller than the lava-multinode timeout for the master.
140+
BOOT_TIMEOUT_SECS: "480"
141+
NETWORK_TIMEOUT_SECS: "300"
142+
ADB_CONNECT_TEST_TIMEOUT_SECS: "60"
143+
144+
- test:
145+
namespace: tlxc
146+
role:
147+
- worker
148+
timeout:
149+
minutes: 15
150+
definitions:
151+
- repository: https://review.linaro.org/qa/test-definitions
152+
from: git
153+
path: automated/android/multinode/wait-for-release-and-reset.yaml
154+
name: wait-for-release-and-reset
155+
156+
- test:
157+
namespace: tlxc
158+
role:
159+
- master
160+
timeout:
161+
minutes: 15
162+
definitions:
163+
- repository: https://review.linaro.org/qa/test-definitions
164+
from: git
165+
path: automated/android/multinode/connect-to-remote-adb-tcpip-devices.yaml
166+
name: connect-to-remote-adb-tcpip-devices
167+
params:
168+
ADB_CONNECT_TIMEOUT_SECS: 300
169+
170+
- test:
171+
namespace: tlxc
172+
role:
173+
- master
174+
timeout:
175+
hours: 1
176+
definitions:
177+
- repository: https://review.linaro.org/qa/test-definitions
178+
from: git
179+
path: automated/android/multinode/tradefed/tradefed-multinode.yaml
180+
params:
181+
TEST_PARAMS: "run cts --disable-reboot --include-filter CtsNetTestCases"
182+
TEST_RETRY_PARAMS: "run cts --disable-reboot"
183+
TEST_PATH: "android-cts"
184+
TEST_URL: "https://dl.google.com/dl/android/cts/android-cts-7.1_r23-linux_x86-arm.zip"
185+
STATE_CHECK_FREQUENCY_SECS: "300"
186+
MAX_NUM_RUNS: "25"
187+
RUNS_IF_UNCHANGED: "5"
188+
FAILURES_PRINTED: "50"
189+
# For Artifactorial:
190+
# URL: ""
191+
# TOKEN: ""
192+
name: cts
193+
194+
- test:
195+
namespace: tlxc
196+
role:
197+
- master
198+
timeout:
199+
minutes: 10
200+
definitions:
201+
- repository: https://review.linaro.org/qa/test-definitions
202+
from: git
203+
path: automated/android/multinode/release-remote-adb-tcpip-devices.yaml
204+
name: release-remote-adb-tcpip-devices

0 commit comments

Comments
 (0)