...

Text file src/github.com/google/certificate-transparency-go/trillian/integration/ct_integration_test.sh

Documentation: github.com/google/certificate-transparency-go/trillian/integration

     1#!/bin/bash
     2set -e
     3. "$(go list -f '{{ .Dir }}' github.com/google/trillian)"/integration/functions.sh
     4INTEGRATION_DIR="$( cd "$( dirname "$0" )" && pwd )"
     5. "${INTEGRATION_DIR}"/ct_functions.sh
     6
     7# We're not using Trillian's log setup/turn down, so allow the caller to
     8# specify where the trillian log server is.
     9export RPC_SERVERS=${TRILLIAN_LOG_SERVERS:-localhost:8090}
    10export RPC_SERVER_1=${TRILLIAN_LOG_SERVER_1:-localhost:8090}
    11
    12ct_prep_test 1
    13
    14# Cleanup for the personality
    15TO_DELETE="${TO_DELETE} ${CT_CFG} ${CT_LIFECYCLE_CFG} ${CT_COMBINED_CONFIG}"
    16TO_KILL+=(${CT_SERVER_PIDS[@]})
    17
    18COMMON_ARGS="--ct_http_servers=${CT_SERVERS} --ct_metrics_servers=${CT_METRICS_SERVERS} --testdata_dir="$(go list -f '{{ .Dir }}' github.com/google/certificate-transparency-go)"/trillian/testdata"
    19
    20echo "Running test(s)"
    21pushd "${INTEGRATION_DIR}"
    22set +e
    23go test -v -run ".*LiveCT.*" --timeout=5m ./ --log_config "${CT_CFG}" ${COMMON_ARGS}
    24RESULT=$?
    25set -e
    26popd
    27
    28# Integration test run failed? Clean up and exit if so
    29if [[ "${RESULT}" != "0" ]]; then
    30  ct_stop_test
    31  TO_KILL=()
    32
    33  exit $RESULT
    34fi
    35
    36# Now run the lifecycle test. This will use the same servers but with a
    37# different set of empty logs.
    38pushd "${INTEGRATION_DIR}"
    39set +e
    40go test -v -run ".*LiveLifecycle.*" --timeout=5m ./ --log_config "${CT_LIFECYCLE_CFG}" --admin_server="${RPC_SERVER_1}" ${COMMON_ARGS}
    41RESULT=$?
    42set -e
    43popd
    44
    45ct_stop_test
    46TO_KILL=()
    47
    48exit $RESULT

View as plain text