| # Builds binaries, starts up services, waits a few seconds, then checks that the |
| # store browser responds with valid data. |
| readonly repo_root=$(git rev-parse --show-toplevel) |
| readonly workdir=$(mktemp -d "${repo_root}/go/tmp.XXXXXXXXXXX") |
| trap onexit INT TERM EXIT |
| [[ $# -gt 0 ]] && echo "${thisscript} $*" |
| cd "${repo_root}/go/src/veyron/examples/mdb" |
| make build || fail "line ${LINENO}: failed to build" |
| ./run.sh >/dev/null 2>&1 & |
| sleep 5 # Wait for services to warm up. |
| local -r URL="http://localhost:5000" |
| local -r FILE="${workdir}/index.html" |
| curl 2>/dev/null "${URL}" -o "${FILE}" || fail "line ${LINENO}: failed to fetch ${URL}" |
| if grep -q "moviesbox" "${FILE}"; then |
| fail "line ${LINENO}: fetched page does not meet expectations" |