fc3344010b6203f986e8e03546682b22b8f97032
[csit.git] / resources / libraries / bash / entry / bootstrap_verify_perf.sh
1 # Copyright (c) 2020 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 set -exuo pipefail
15
16 # Assumptions:
17 # + There is a directory holding CSIT code to use (this script is there).
18 # + At least one of the following is true:
19 # ++ JOB_NAME environment variable is set,
20 # ++ or this entry script has access to arguments.
21 # Consequences (and specific assumptions) are multiple,
22 # examine tree of functions for current description.
23
24 # FIXME: Define API contract (as opposed to just help) for bootstrap.
25
26 # "set -eu" handles failures from the following two lines.
27 BASH_ENTRY_DIR="$(dirname $(readlink -e "${BASH_SOURCE[0]}"))"
28 BASH_FUNCTION_DIR="$(readlink -e "${BASH_ENTRY_DIR}/../function")"
29 source "${BASH_FUNCTION_DIR}/common.sh" || {
30     echo "Source failed." >&2
31     exit 1
32 }
33 source "${BASH_FUNCTION_DIR}/gather.sh" || die "Source failed."
34 source "${BASH_FUNCTION_DIR}/ansible.sh" || die "Source failed."
35 common_dirs || die
36 check_prerequisites || die
37 get_test_code "${1-}" || die
38 get_test_tag_string || die
39 select_topology || die
40 select_arch_os || die
41 gather_build || die
42 check_download_dir || die
43 activate_virtualenv || die
44 generate_tests || die
45 archive_tests || die
46 reserve_and_cleanup_testbed || die
47 select_tags || die
48 compose_pybot_arguments || die
49 run_pybot || die
50 untrap_and_unreserve_testbed || die
51 move_archives || die
52 die_on_pybot_error || die