vFW and vDNS support added to azure-plugin
[multicloud/azure.git] / azure / aria / aria-extension-cloudify / src / aria / tests / resources / scripts / test_ssh.sh
1 #!/bin/bash
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
8 #
9 #     http://www.apache.org/licenses/LICENSE-2.0
10 #
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.
16
17
18 set -u
19 set -e
20
21 test_run_script_basic() {
22     ctx node attributes test_value = "$test_value"
23 }
24
25 test_run_script_as_sudo() {
26     mkdir -p /opt/test_dir
27 }
28
29 test_run_script_default_base_dir() {
30     ctx node attributes work_dir = "$PWD"
31 }
32
33 test_run_script_with_hide() {
34     true
35 }
36
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)"
44 }
45
46 test_run_script_command_prefix() {
47     ctx node attributes dollar_dash = $-
48 }
49
50 test_run_script_reuse_existing_ctx_1() {
51     ctx node attributes test_value1 = "$test_value1"
52 }
53
54 test_run_script_reuse_existing_ctx_2() {
55     ctx node attributes test_value2 = "$test_value2"
56 }
57
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")"
62 }
63
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")"
68 }
69
70 test_run_script_inputs_as_env_variables_no_override() {
71     ctx node attributes test_value = "$custom_env_var"
72 }
73
74 test_run_script_inputs_as_env_variables_process_env_override() {
75     ctx node attributes test_value = "$custom_env_var"
76 }
77
78 test_run_script_error_in_script() {
79     ctx property-that-does-not-exist
80 }
81
82 test_run_script_abort_immediate() {
83     ctx task abort [ abort-message ]
84 }
85
86 test_run_script_retry() {
87     ctx task retry [ retry-message ]
88 }
89
90 test_run_script_abort_error_ignored_by_script() {
91     set +e
92     ctx task abort [ abort-message ]
93 }
94
95 # Injected by test
96 "$test_operation" "$@"