未验证 提交 25a23bae 编写于 作者: C Casey Hillers 提交者: GitHub

[fuchsia] Add fuchsia_ctl func to test script (#20827)

上级 195b1480
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
# This script also expects a private key available at: # This script also expects a private key available at:
# "/etc/botanist/keys/id_rsa_infra". # "/etc/botanist/keys/id_rsa_infra".
set -Ee set -Eex
test_timeout_seconds=300 test_timeout_seconds=300
...@@ -39,24 +39,31 @@ else ...@@ -39,24 +39,31 @@ else
echo "Connecting to device $device_name" echo "Connecting to device $device_name"
fi fi
# Wrapper function to pass common args to fuchsia_ctl.
fuchsia_ctl() {
./fuchsia_ctl -d $device_name "$@"
}
reboot() { reboot() {
./fuchsia_ctl -d $device_name ssh \ fuchsia_ctl ssh \
-c "log_listener --dump_logs yes --file /tmp/log.txt" \
--timeout-seconds $ssh_timeout_seconds \ --timeout-seconds $ssh_timeout_seconds \
--identity-file $pkey --identity-file $pkey \
-c "log_listener --dump_logs yes --file /tmp/log.txt"
# As we are not using recipes we don't have a way to know the location # As we are not using recipes we don't have a way to know the location
# to upload the log to isolated. We are saving the log to a file to avoid dart # to upload the log to isolated. We are saving the log to a file to avoid dart
# hanging when running the process and then just using printing the content to # hanging when running the process and then just using printing the content to
# the console. # the console.
./fuchsia_ctl -d $device_name ssh \ fuchsia_ctl ssh \
-c "cat /tmp/log.txt" \
--timeout-seconds $ssh_timeout_seconds \ --timeout-seconds $ssh_timeout_seconds \
--identity-file $pkey --identity-file $pkey \
-c "cat /tmp/log.txt"
echo "$(date) START:REBOOT ----------------------------------------" echo "$(date) START:REBOOT ----------------------------------------"
# note: this will set an exit code of 255, which we can ignore. # note: this will set an exit code of 255, which we can ignore.
./fuchsia_ctl -d $device_name ssh -c "dm reboot-recovery" \ fuchsia_ctl ssh \
--identity-file $pkey || true --identity-file $pkey \
-c "dm reboot-recovery" || true
echo "$(date) END:REBOOT ------------------------------------------" echo "$(date) END:REBOOT ------------------------------------------"
} }
...@@ -64,13 +71,14 @@ trap reboot EXIT ...@@ -64,13 +71,14 @@ trap reboot EXIT
echo "$(date) START:PAVING ------------------------------------------" echo "$(date) START:PAVING ------------------------------------------"
ssh-keygen -y -f $pkey > key.pub ssh-keygen -y -f $pkey > key.pub
./fuchsia_ctl -d $device_name pave -i $1 \ fuchsia_ctl pave \
-i $1 \
--public-key "key.pub" --public-key "key.pub"
echo "$(date) END:PAVING --------------------------------------------" echo "$(date) END:PAVING --------------------------------------------"
echo "$(date) START:WAIT_DEVICE_READY -------------------------------" echo "$(date) START:WAIT_DEVICE_READY -------------------------------"
for i in {1..10}; do for i in {1..10}; do
./fuchsia_ctl -d $device_name ssh \ fuchsia_ctl ssh \
--identity-file $pkey \ --identity-file $pkey \
-c "echo up" && break || sleep 15; -c "echo up" && break || sleep 15;
done done
...@@ -82,7 +90,7 @@ tar -xvzf $2 -C packages 1> /dev/null ...@@ -82,7 +90,7 @@ tar -xvzf $2 -C packages 1> /dev/null
echo "$(date) END:EXTRACT_PACKAGES ---------------------------------" echo "$(date) END:EXTRACT_PACKAGES ---------------------------------"
echo "$(date) START:testing_tests -----------------------------------" echo "$(date) START:testing_tests -----------------------------------"
./fuchsia_ctl -d $device_name test \ fuchsia_ctl test \
-f testing_tests-0.far \ -f testing_tests-0.far \
-t testing_tests \ -t testing_tests \
--identity-file $pkey \ --identity-file $pkey \
...@@ -93,7 +101,7 @@ echo "$(date) DONE:testing_tests ------------------------------------" ...@@ -93,7 +101,7 @@ echo "$(date) DONE:testing_tests ------------------------------------"
# TODO(https://github.com/flutter/flutter/issues/61212): Re-enable ParagraphTest # TODO(https://github.com/flutter/flutter/issues/61212): Re-enable ParagraphTest
# once it passes on Fuchsia. # once it passes on Fuchsia.
echo "$(date) START:txt_tests ---------------------------------------" echo "$(date) START:txt_tests ---------------------------------------"
./fuchsia_ctl -d $device_name test \ fuchsia_ctl test \
-f txt_tests-0.far \ -f txt_tests-0.far \
-t txt_tests \ -t txt_tests \
-a "--gtest_filter=-ParagraphTest.*" \ -a "--gtest_filter=-ParagraphTest.*" \
...@@ -107,7 +115,7 @@ echo "$(date) DONE:txt_tests ----------------------------------------" ...@@ -107,7 +115,7 @@ echo "$(date) DONE:txt_tests ----------------------------------------"
# TODO(https://github.com/flutter/flutter/issues/58211): Re-enable MessageLoop # TODO(https://github.com/flutter/flutter/issues/58211): Re-enable MessageLoop
# test once it passes on Fuchsia. # test once it passes on Fuchsia.
echo "$(date) START:fml_tests ---------------------------------------" echo "$(date) START:fml_tests ---------------------------------------"
./fuchsia_ctl -d $device_name test \ fuchsia_ctl test \
-f fml_tests-0.far \ -f fml_tests-0.far \
-t fml_tests \ -t fml_tests \
-a "--gtest_filter=-MessageLoop.TimeSensistiveTest_*:FileTest.CanTruncateAndWrite:FileTest.CreateDirectoryStructure" \ -a "--gtest_filter=-MessageLoop.TimeSensistiveTest_*:FileTest.CanTruncateAndWrite:FileTest.CreateDirectoryStructure" \
...@@ -118,7 +126,7 @@ echo "$(date) DONE:fml_tests ----------------------------------------" ...@@ -118,7 +126,7 @@ echo "$(date) DONE:fml_tests ----------------------------------------"
echo "$(date) START:flow_tests --------------------------------------" echo "$(date) START:flow_tests --------------------------------------"
./fuchsia_ctl -d $device_name test \ fuchsia_ctl test \
-f flow_tests-0.far \ -f flow_tests-0.far \
-t flow_tests \ -t flow_tests \
--identity-file $pkey \ --identity-file $pkey \
...@@ -128,7 +136,7 @@ echo "$(date) DONE:flow_tests ---------------------------------------" ...@@ -128,7 +136,7 @@ echo "$(date) DONE:flow_tests ---------------------------------------"
echo "$(date) START:runtime_tests -----------------------------------" echo "$(date) START:runtime_tests -----------------------------------"
./fuchsia_ctl -d $device_name test \ fuchsia_ctl test \
-f runtime_tests-0.far \ -f runtime_tests-0.far \
-t runtime_tests \ -t runtime_tests \
--identity-file $pkey \ --identity-file $pkey \
...@@ -137,7 +145,7 @@ echo "$(date) START:runtime_tests -----------------------------------" ...@@ -137,7 +145,7 @@ echo "$(date) START:runtime_tests -----------------------------------"
echo "$(date) DONE:runtime_tests ------------------------------------" echo "$(date) DONE:runtime_tests ------------------------------------"
echo "$(date) START:ui_tests ----------------------------------------" echo "$(date) START:ui_tests ----------------------------------------"
./fuchsia_ctl -d $device_name test \ fuchsia_ctl test \
-f ui_tests-0.far \ -f ui_tests-0.far \
-t ui_tests \ -t ui_tests \
--identity-file $pkey \ --identity-file $pkey \
...@@ -146,7 +154,7 @@ echo "$(date) START:ui_tests ----------------------------------------" ...@@ -146,7 +154,7 @@ echo "$(date) START:ui_tests ----------------------------------------"
echo "$(date) DONE:ui_tests -----------------------------------------" echo "$(date) DONE:ui_tests -----------------------------------------"
echo "$(date) START:shell_tests -------------------------------------" echo "$(date) START:shell_tests -------------------------------------"
./fuchsia_ctl -d $device_name test \ fuchsia_ctl test \
-f shell_tests-0.far \ -f shell_tests-0.far \
-t shell_tests \ -t shell_tests \
--identity-file $pkey \ --identity-file $pkey \
...@@ -156,7 +164,7 @@ echo "$(date) DONE:shell_tests --------------------------------------" ...@@ -156,7 +164,7 @@ echo "$(date) DONE:shell_tests --------------------------------------"
# TODO(gw280): Enable tests using JIT runner # TODO(gw280): Enable tests using JIT runner
echo "$(date) START:flutter_runner_tests ----------------------------" echo "$(date) START:flutter_runner_tests ----------------------------"
./fuchsia_ctl -d $device_name test \ fuchsia_ctl test \
-f flutter_aot_runner-0.far \ -f flutter_aot_runner-0.far \
-f flutter_runner_tests-0.far \ -f flutter_runner_tests-0.far \
-t flutter_runner_tests \ -t flutter_runner_tests \
...@@ -165,7 +173,7 @@ echo "$(date) START:flutter_runner_tests ----------------------------" ...@@ -165,7 +173,7 @@ echo "$(date) START:flutter_runner_tests ----------------------------"
--packages-directory packages --packages-directory packages
# TODO(https://github.com/flutter/flutter/issues/61768): De-flake and re-enable # TODO(https://github.com/flutter/flutter/issues/61768): De-flake and re-enable
# ./fuchsia_ctl -d $device_name test \ # fuchsia_ctl test \
# -f flutter_aot_runner-0.far \ # -f flutter_aot_runner-0.far \
# -f flutter_runner_scenic_tests-0.far \ # -f flutter_runner_scenic_tests-0.far \
# -t flutter_runner_scenic_tests \ # -t flutter_runner_scenic_tests \
...@@ -173,7 +181,7 @@ echo "$(date) START:flutter_runner_tests ----------------------------" ...@@ -173,7 +181,7 @@ echo "$(date) START:flutter_runner_tests ----------------------------"
# --timeout-seconds $test_timeout_seconds \ # --timeout-seconds $test_timeout_seconds \
# --packages-directory packages # --packages-directory packages
./fuchsia_ctl -d $device_name test \ fuchsia_ctl test \
-f flutter_aot_runner-0.far \ -f flutter_aot_runner-0.far \
-f flutter_runner_tzdata_tests-0.far \ -f flutter_runner_tzdata_tests-0.far \
-t flutter_runner_tzdata_tests \ -t flutter_runner_tzdata_tests \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册