| #!/bin/bash |
| |
| ### run e2e tests for ermine shell |
| ## Usage: ./topaz/shell/ermine/test/run-e2e-ermine |
| ## |
| ## Runs the End to End tests from the current build, against the current |
| ## hardware target. |
| ## |
| ## Hint: |
| ## Use fx --dir and/or fx -d flags to modulate the selected build directory or |
| ## target device. |
| |
| source "$(cd "$(dirname "${BASH_SOURCE[0]}")"/../../../../ && pwd)"/tools/devshell/lib/vars.sh |
| fx-config-read |
| |
| fx-command-run serve-updates & |
| # To ensure any children of the above get the signal, we kill our whole process |
| # group. |
| trap "trap - EXIT; kill 0" EXIT |
| sleep 3 |
| |
| export FUCHSIA_IPV4_ADDR=$(fx-command-run shell ifconfig eth | perl -n -e 'print $1 if /inet addr:(\S*)/') |
| |
| if [[ -z "$FUCHSIA_IPV4_ADDR" ]]; then |
| fx-error "Can not determine IPV4 address of Fuchsia target" |
| exit 1 |
| fi |
| |
| export FUCHSIA_SSH_KEY="${FUCHSIA_DIR}/.ssh/pkey" |
| |
| export FUCHSIA_TEST_OUTDIR="${FUCHSIA_OUT_DIR}/test_out/$(date +'%F-%H:%M:%S')" |
| mkdir -p "${FUCHSIA_TEST_OUTDIR}" |
| |
| "${FUCHSIA_BUILD_DIR}/host_x64/ermine_session_shell_test" "$@" |