-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbootstrap-instance-for-testsuite
executable file
·40 lines (34 loc) · 1.55 KB
/
bootstrap-instance-for-testsuite
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
#!/bin/sh
# Bootstrap fresh new Birdhouse instance to run testsuite at
# https://github.com/Ouranosinc/PAVICS-e2e-workflow-tests.
#
# This is a stable interface for test automation shielding it from knowing the
# intimate details of how to bootstrap a fresh new instance.
#
# Assume Birdhouse instance is already fully up (`birdhouse compose up -d` has
# been called).
#
THIS_FILE="$(readlink -f "$0" || realpath "$0")"
THIS_DIR="$(dirname "${THIS_FILE}")"
COMPOSE_DIR="${COMPOSE_DIR:-$(dirname "${THIS_DIR}")}"
SCRIPTS_DIR="${COMPOSE_DIR}/scripts"
set -x
# Populate test .nc file on Thredds.
# Need to open temporary Thredds "testdata/secure/" on Birdhouse production to anonymous group.
# Need write-access to DATASET_ROOT (/data/datasets/).
"${SCRIPTS_DIR}/bootstrap-testdata"
if [ -n "$(docker ps --filter name=solr)" ]; then
# Index Thredds catalog.
# Need to open temporary Thredds "testdata/secure/" on local Birdhouse host to anonymous group.
# Only crawl the subset enough to pass canarie-api monitoring
# see config/canarie-api/docker_configuration.py.template
"${SCRIPTS_DIR}/trigger-birdhousecrawler" target_files=birdhouse/testdata/flyingpigeon/cmip5
# For crawler to complete, assuming minimal dataset from bootstrap-testdata so
# should be super fast to finish crawling.
sleep 5
fi
# Create test user.
# Need "optional-components/secure-thredds" activated to pre-create group thredds-secure-authtest-group.
"${SCRIPTS_DIR}/create-magpie-authtest-user"
# Check if instance properly provisioned for testsuite.
"${SCRIPTS_DIR}/check-instance-ready"