on xenial help sign in
unlock_device: support more complex reboot/wait cycles

Currently this script only allows you to override how to "wait" on the device. This changes the logic to also support how you go about rebooting the device. This is handy for the ubuntu-emulator because adb-reboot is not currently supported. However, we also have a more sophisticated, fool-proof way we reboot/wait in the CI lab that would be nice to take advantage of: http://bazaar.launchpad.net/~ubuntu-test-case-dev/ubuntu-test-cases/touch/view/head:/scripts/reboot-and-wait

commit817af07b9c68edbed11c7385368fc4312663cd63 authorAndy Doan <andy.doan@canonical.com> dateWed 14 May 2014, 12:09 (12 years ago) parent5679368
1 file changed+2−4
tools/unlock-device+2−4
tools/unlock-device+2−4
@@ -4,7 +4,7 @@
44# Our goal here is to get an Ubuntu Touch device into a testable unlocked state.
55# This will include a reboot.
66
7−WAIT_COMMAND="sleep 20"
7+WAIT_COMMAND="adb reboot; sleep 5; adb wait-for-device; sleep 20"
88
99while getopts s:w: opt; do
1010 case $opt in
@@ -28,10 +28,8 @@ bus.clearSysState(cookie, dbus_interface="com.canonical.powerd");
2828helpers.unlock_unity()
2929'
3030
31−adb reboot
32−sleep 5
33−adb "wait-for-device"
3431eval "$WAIT_COMMAND"
32+
3533UNLOCK_OUTPUT=$(adb shell "sudo -u phablet -i python3 -c '$UNLOCK_SCRIPT'" 2>&1)
3634if echo "$UNLOCK_OUTPUT" | grep 'Greeter unlocked' >/dev/null; then
3735 echo "I: Unlock passed"