perf: add TCP Nginx+LDPRELOAD suites
[csit.git] / resources / libraries / bash / entry / bootstrap_vpp_device.sh
1 #!/usr/bin/env bash
2
3 # Copyright (c) 2021 Cisco and/or its affiliates.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at:
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 set -exuo pipefail
17
18 # Assumptions:
19 # + There is a directory holding CSIT code to use (this script is there).
20 # + At least one of the following is true:
21 # ++ JOB_NAME environment variable is set,
22 # ++ or this entry script has access to arguments.
23 # Consequences (and specific assumptions) are multiple,
24 # examine tree of functions for current description.
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 common_dirs || die
35 check_prerequisites || die
36 get_test_code "${1-}" || die
37 get_test_tag_string || die
38 select_topology || die
39 select_arch_os || die
40 gather_build || die
41 check_download_dir || die
42 activate_virtualenv || die
43 generate_tests || die
44 archive_tests || die
45 activate_docker_topology || die
46 select_vpp_device_tags || die
47 compose_pybot_arguments || die
48 set_environment_variables || die
49 run_pybot || die
50 move_archives || die
51 die_on_pybot_error || die