2 # Licensed to the Apache Software Foundation (ASF) under one or more
3 # contributor license agreements. See the NOTICE file distributed with
4 # this work for additional information regarding copyright ownership.
5 # The ASF licenses this file to You under the Apache License, Version 2.0
6 # (the "License"); you may not use this file except in compliance with
7 # the License. You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
21 test_run_script_basic() {
22 ctx node attributes test_value = "$test_value"
25 test_run_script_as_sudo() {
26 mkdir -p /opt/test_dir
29 test_run_script_default_base_dir() {
30 ctx node attributes work_dir = "$PWD"
33 test_run_script_with_hide() {
37 test_run_script_process_config() {
38 ctx node attributes env_value = "$test_value_env"
39 ctx node attributes bash_version = "$BASH_VERSION"
40 ctx node attributes arg1_value = "$1"
41 ctx node attributes arg2_value = "$2"
42 ctx node attributes cwd = "$PWD"
43 ctx node attributes ctx_path = "$(which ctx)"
46 test_run_script_command_prefix() {
47 ctx node attributes dollar_dash = $-
50 test_run_script_reuse_existing_ctx_1() {
51 ctx node attributes test_value1 = "$test_value1"
54 test_run_script_reuse_existing_ctx_2() {
55 ctx node attributes test_value2 = "$test_value2"
58 test_run_script_download_resource_plain() {
59 local DESTINATION=$(mktemp)
60 ctx download-resource [ "$DESTINATION" test_resource ]
61 ctx node attributes test_value = "$(cat "$DESTINATION")"
64 test_run_script_download_resource_and_render() {
65 local DESTINATION=$(mktemp)
66 ctx download-resource-and-render [ "$DESTINATION" test_resource ]
67 ctx node attributes test_value = "$(cat "$DESTINATION")"
70 test_run_script_inputs_as_env_variables_no_override() {
71 ctx node attributes test_value = "$custom_env_var"
74 test_run_script_inputs_as_env_variables_process_env_override() {
75 ctx node attributes test_value = "$custom_env_var"
78 test_run_script_error_in_script() {
79 ctx property-that-does-not-exist
82 test_run_script_abort_immediate() {
83 ctx task abort [ abort-message ]
86 test_run_script_retry() {
87 ctx task retry [ retry-message ]
90 test_run_script_abort_error_ignored_by_script() {
92 ctx task abort [ abort-message ]
96 "$test_operation" "$@"