on xenial help sign in
unlock_device: support more complex reboot/wait cycles
817af07Andy Doan
tools/unlock-device+2−4
@@ -4,7 +4,7 @@
4# Our goal here is to get an Ubuntu Touch device into a testable unlocked state.
4# Our goal here is to get an Ubuntu Touch device into a testable unlocked state.
5# This will include a reboot.
5# This will include a reboot.
6
6
7−WAIT_COMMAND="sleep 20"
7+WAIT_COMMAND="adb reboot; sleep 5; adb wait-for-device; sleep 20"
8
8
9while getopts s:w: opt; do
9while getopts s:w: opt; do
10 case $opt in
10 case $opt in
@@ -28,10 +28,8 @@ bus.clearSysState(cookie, dbus_interface="com.canonical.powerd");
28helpers.unlock_unity()
28helpers.unlock_unity()
29'
29'
30
30
31−adb reboot
32−sleep 5
33−adb "wait-for-device"
34eval "$WAIT_COMMAND"
31eval "$WAIT_COMMAND"
32+
35UNLOCK_OUTPUT=$(adb shell "sudo -u phablet -i python3 -c '$UNLOCK_SCRIPT'" 2>&1)
33UNLOCK_OUTPUT=$(adb shell "sudo -u phablet -i python3 -c '$UNLOCK_SCRIPT'" 2>&1)
36if echo "$UNLOCK_OUTPUT" | grep 'Greeter unlocked' >/dev/null; then
34if echo "$UNLOCK_OUTPUT" | grep 'Greeter unlocked' >/dev/null; then
37 echo "I: Unlock passed"
35 echo "I: Unlock passed"