forked from mesosphere-backup/dcos-cassandra-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.sh
executable file
·46 lines (38 loc) · 1.82 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
# Exit immediately on errors -- the helper scripts all emit github statuses internally
set -e
REPO_ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $REPO_ROOT_DIR
# Grab dcos-commons build/release tools:
rm -rf dcos-commons-tools/ && curl https://infinity-artifacts.s3.amazonaws.com/dcos-commons-tools.tgz | tar xz
# Get a CCM cluster if not already configured (see available settings in dcos-commons/tools/README.md):
if [ -z "$CLUSTER_URL" ]; then
echo "CLUSTER_URL is empty/unset, launching new cluster."
export CCM_AGENTS=5
CLUSTER_INFO=$(./dcos-commons-tools/launch_ccm_cluster.py)
echo "Launched cluster: ${CLUSTER_INFO}"
export CLUSTER_URL=$(echo "${CLUSTER_INFO}" | jq .url)
export CLUSTER_ID=$(echo "${CLUSTER_INFO}" | jq .id)
export CLUSTER_AUTH_TOKEN=$(echo "${CLUSTER_INFO}" | jq .auth_token)
CLUSTER_CREATED="true"
else
echo "Using provided CLUSTER_URL as cluster: $CLUSTER_URL"
CLUSTER_CREATED=""
fi
echo Security: $SECURITY
if [ "$SECURITY" = "strict" ]; then
${REPO_ROOT_DIR}/dcos-commons-tools/setup_permissions.sh nobody cassandra-role
fi
# Run shakedown tests:
${REPO_ROOT_DIR}/dcos-commons-tools/run_tests.py shakedown ${REPO_ROOT_DIR}/integration/tests/ ${REPO_ROOT_DIR}/integration/requirements.txt
# Run legacy dcos-tests:
if [ -d "${REPO_ROOT_DIR}/dcos-tests" ]; then
${REPO_ROOT_DIR}/dcos-commons-tools/run_tests.py dcos-tests ${REPO_ROOT_DIR}/dcos-tests/infinitytests/cassandra ${REPO_ROOT_DIR}/dcos-tests/
else
echo "${REPO_ROOT_DIR}/dcos-tests/ not found, skipping dcos-tests"
fi
# Tests succeeded. Out of courtesy, trigger a teardown of the cluster if we created it ourselves.
# Don't wait for the cluster to complete teardown.
if [ -n "${CLUSTER_CREATED}" ]; then
./dcos-commons-tools/launch_ccm_cluster.py trigger-stop ${CLUSTER_ID}
fi