Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bash: fix errecho for multiple services #5345

Merged
merged 1 commit into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function test_failed {
# This function outputs everything sent to it to STDERR (standard error output).
###############################################################################
function errecho {
printf "%b\n" "$*" 2>&1
printf "%b\n" "$*" 1>&2
}

###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion aws-cli/bash-linux/iam/awsdocs_general.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ VERBOSE=false
# This function outputs everything sent to it to STDERR (standard error output).
###############################################################################
function errecho() {
printf "%s\n" "$*" 2>&1
printf "%s\n" "$*" 1>&2
}
# snippet-end:[aws-cli.bash-linux.iam.errecho]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function run_test() {

# Check to see if we got the expected error code.
if [[ "$expected_err_code" -ne "$err" ]]; then
test_failed "The test \"$description\" returned an unexpected error code: $err"
test_failed "The test \"$description\" returned an unexpected error code: $err. $test_command_response"
fi

# Check the error message, if we provided other than "".
Expand Down
2 changes: 1 addition & 1 deletion aws-cli/bash-linux/iam/tests/test_iam_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function main() {
# bashsupport disable=BP2001
export VERBOSE=false

source ./test_general.sh
source ./include_tests.sh
{
local current_directory
current_directory=$(pwd)
Expand Down
2 changes: 1 addition & 1 deletion aws-cli/bash-linux/medical-imaging/awsdocs_general.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ VERBOSE=false
# This function outputs everything sent to it to STDERR (standard error output).
###############################################################################
function errecho() {
printf "%s\n" "$*" 2>&1
printf "%s\n" "$*" 1>&2
}
# snippet-end:[aws-cli.bash-linux.medical-imaging.errecho]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function run_test() {

# Check to see if we got the expected error code.
if [[ "$expected_err_code" -ne "$err" ]]; then
test_failed "The test \"$description\" returned an unexpected error code: $err"
test_failed "The test \"$description\" returned an unexpected error code: $err. $test_command_response"
fi

# Check the error message, if we provided other than "".
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export INTERACTIVE=false
# bashsupport disable=BP2001
export VERBOSE=false

source ./test_general.sh
source ./include_tests.sh
{
local current_directory
current_directory=$(pwd)
Expand Down
20 changes: 20 additions & 0 deletions aws-cli/bash-linux/run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

base_dir=$(pwd)

echo "Running tests for S3 Bucket Lifecycle Operations"
cd s3/bucket-lifecycle-operations/
./test_bucket_operations.sh
cd $base_dir

echo "Running IAM tests"
cd iam/tests
./test_iam_examples.sh
cd $base_dir

echo "Running medical-imaging tests"
cd medical-imaging/tests
./test_medical_imaging_examples.sh
cd $base_dir

echo "Done"
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function run_test() {

# Check to see if we got the expected error code.
if [[ "$expected_err_code" -ne "$err" ]]; then
test_failed "The test \"$description\" returned an unexpected error code: $err"
test_failed "The test \"$description\" returned an unexpected error code: $err. $test_command_response"
fi

# Check the error message, if we provided other than "".
Expand Down Expand Up @@ -101,7 +101,7 @@ function test_failed() {
# This function outputs everything sent to it to STDERR (standard error output).
###############################################################################
function errecho() {
printf "%s\n" "$*" 2>&1
printf "%s\n" "$*" 1>&2
}
# snippet-end:[aws-cli.bash-linux.s3.errecho]

Expand Down
Loading