|
15 | 15 | #
|
16 | 16 | # This script expects `pm`, `device-finder`, and `fuchsia_ctl` to all be in the
|
17 | 17 | # same directory as the script.
|
| 18 | +# |
| 19 | +# This script also expects a private key available at: |
| 20 | +# "/etc/botanist/keys/id_rsa_infra". |
18 | 21 |
|
19 | 22 | set -Eex
|
20 | 23 |
|
21 | 24 | script_dir=$(dirname "$(readlink -f "$0")")
|
22 | 25 |
|
| 26 | +# Bot key to pave and ssh the device. |
| 27 | +pkey="/etc/botanist/keys/id_rsa_infra" |
| 28 | + |
23 | 29 | # The nodes are named blah-blah--four-word-fuchsia-id
|
24 | 30 | device_name=${SWARMING_BOT_ID#*--}
|
25 | 31 |
|
|
33 | 39 |
|
34 | 40 | reboot() {
|
35 | 41 | # note: this will set an exit code of 255, which we can ignore.
|
36 |
| - $script_dir/fuchsia_ctl -d $device_name --dev-finder-path $script_dir/dev_finder ssh --identity-file $script_dir/.ssh/pkey -c "dm reboot-recovery" || true |
| 42 | + echo "$(date) START:REBOOT ------------------------------------------" |
| 43 | + $script_dir/fuchsia_ctl -d $device_name --dev-finder-path $script_dir/dev_finder ssh --identity-file $pkey -c "dm reboot-recovery" || true |
| 44 | + echo "$(date) END:REBOOT --------------------------------------------" |
37 | 45 | }
|
38 | 46 |
|
39 | 47 | trap reboot EXIT
|
40 | 48 |
|
41 |
| -$script_dir/fuchsia_ctl -d $device_name pave -i $1 |
42 |
| -$script_dir/fuchsia_ctl push-packages -d $device_name --repoArchive generic-x64.tar.gz -p tiles -p tiles_ctl |
| 49 | +echo "$(date) START:PAVING ------------------------------------------" |
| 50 | +ssh-keygen -y -f $pkey > key.pub |
| 51 | +$script_dir/fuchsia_ctl -d $device_name pave -i $1 --public-key "key.pub" |
| 52 | +echo "$(date) END:PAVING --------------------------------------------" |
| 53 | + |
| 54 | + |
| 55 | +$script_dir/fuchsia_ctl push-packages -d $device_name --identity-file $pkey --repoArchive generic-x64.tar.gz -p tiles -p tiles_ctl |
43 | 56 |
|
44 | 57 | # set fuchsia ssh config
|
45 |
| -export FUCHSIA_SSH_PKEY=$script_dir/.ssh/pkey |
46 | 58 | cat > $script_dir/fuchsia_ssh_config << EOF
|
47 | 59 | Host *
|
48 | 60 | CheckHostIP no
|
|
53 | 65 | UserKnownHostsFile /dev/null
|
54 | 66 | User fuchsia
|
55 | 67 | IdentitiesOnly yes
|
56 |
| - IdentityFile $FUCHSIA_SSH_PKEY |
| 68 | + IdentityFile $pkey |
57 | 69 | ControlPersist yes
|
58 | 70 | ControlMaster auto
|
59 | 71 | ControlPath /tmp/fuchsia--%r@%h:%p
|
|
66 | 78 | export FUCHSIA_SSH_CONFIG=$script_dir/fuchsia_ssh_config
|
67 | 79 |
|
68 | 80 | # Run the driver test
|
| 81 | +echo "$(date) START:DRIVER_TEST -------------------------------------" |
69 | 82 | flutter_dir=$script_dir/flutter
|
70 | 83 | flutter_bin=$flutter_dir/bin/flutter
|
71 | 84 |
|
72 | 85 | # remove all out dated .packages references
|
73 | 86 | find $flutter_dir -name ".packages" | xargs rm
|
74 |
| - |
75 | 87 | cd $flutter_dir/dev/benchmarks/test_apps/stocks/
|
76 |
| - |
77 | 88 | $flutter_bin pub get
|
78 | 89 | $flutter_bin drive -v -d $device_name --target=test_driver/stock_view.dart
|
| 90 | +echo "$(date) END:DRIVER_TEST ---------------------------------------" |
0 commit comments