diff options
author | Karsten Tausche <karsten@fairphone.com> | 2018-06-19 15:03:58 +0200 |
---|---|---|
committer | Karsten Tausche <karsten@fairphone.com> | 2018-12-17 11:25:00 +0100 |
commit | df21facc8f98993f0d44228d9ed1aa0cccb4cd1e (patch) | |
tree | 01a15e274542432e007732eba6509aa31bb69ff3 /automated/android | |
parent | b3620d8e9cd1e71952ac86a86caa3ddc89a0a234 (diff) |
Add utility yaml files to facilitate waiting for device availability
These yaml files simplify waiting for a specific device state in a test
submission before running an actual test job.
Change-Id: I0f6631afc1a73358e80220f6fc51789b0c4ec296
Depends-On: Icd68e9de5a349880c52ec06229cd3f8bcb8eeecc
Signed-off-by: Karsten Tausche <karsten@fairphone.com>
Diffstat (limited to 'automated/android')
-rw-r--r-- | automated/android/wait-single-boot-completed.yaml | 30 | ||||
-rw-r--r-- | automated/android/wait-single-network-connected.yaml | 30 |
2 files changed, 60 insertions, 0 deletions
diff --git a/automated/android/wait-single-boot-completed.yaml b/automated/android/wait-single-boot-completed.yaml new file mode 100644 index 0000000..ea8f062 --- /dev/null +++ b/automated/android/wait-single-boot-completed.yaml @@ -0,0 +1,30 @@ +metadata: + name: wait-single-boot-completed + format: "Lava-Test-Shell Test Definition 1.0" + description: "Wait until one locally attached Android device is completely booted. + Usable only if at most one device is visible to adb, but has the advantage that the device's + serial number does not need to be known in advance." + maintainer: + - karsten@fairphone.com + - softwareteam@fairphone.com + os: + - debian + - ubuntu + devices: + - lxc + scope: + - functional + +params: + TIMEOUT: "900" + RAISE_ON_FAILURE: "true" + +run: + steps: + - . ./automated/lib/sh-test-lib + - . ./automated/lib/android-test-lib + - retVal=0; wait_boot_completed "${TIMEOUT}" || retVal=$? + - | + if [ "${retVal}" -ne 0 -a "${RAISE_ON_FAILURE}" = "true" ]; then + lava-test-raise "Device did not boot up within ${TIMEOUT} seconds." + fi diff --git a/automated/android/wait-single-network-connected.yaml b/automated/android/wait-single-network-connected.yaml new file mode 100644 index 0000000..3ed6db7 --- /dev/null +++ b/automated/android/wait-single-network-connected.yaml @@ -0,0 +1,30 @@ +metadata: + name: wait-single-network-connected + format: "Lava-Test-Shell Test Definition 1.0" + description: "Wait until one locally attached Android device has a network IP address. + Usable only if at most one device is visible to adb, but has the advantage that the device's + serial number does not need to be known in advance." + maintainer: + - karsten@fairphone.com + - softwareteam@fairphone.com + os: + - debian + - ubuntu + devices: + - lxc + scope: + - functional + +params: + TIMEOUT: "300" + RAISE_ON_FAILURE: "true" + +run: + steps: + - . ./automated/lib/sh-test-lib + - . ./automated/lib/android-test-lib + - retVal=0; wait_network_connected "${TIMEOUT}" || retVal=$? + - | + if [ "${retVal}" -ne 0 -a "${RAISE_ON_FAILURE}" = "true" ]; then + lava-test-raise "Device did not receive an IP address within ${TIMEOUT} seconds." + fi |