Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Commit 85b7c45

Browse files
authored
Merge branch 'master' into dmius-text-dump
2 parents 94b180a + 0dff1c6 commit 85b7c45

6 files changed

+39
-5
lines changed

nancy_run.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,13 @@ while true; do
236236
TMP_PATH="$2"; shift 2 ;;
237237
--debug-timeout )
238238
DEBUG_TIMEOUT="$2"; shift 2 ;;
239-
-- ) shift; break ;;
240-
* ) break ;;
239+
-- )
240+
>&2 echo "ERROR: Invalid option '$1'"
241+
exit 1;
242+
break ;;
243+
* )
244+
[ "$1" != "" ] && >&2 echo "ERROR: Invalid option '$1'. Please verify command options." && exit 1;
245+
break ;;
241246
esac
242247
done
243248

@@ -329,6 +334,13 @@ function checkParams() {
329334
>&2 echo "ERROR: AWS EC2 Instance type not given."
330335
exit 1
331336
fi
337+
elif [ "$RUN_ON" = "localhost" ]; then
338+
if [ ! -z ${AWS_KEY_PAIR+x} ] || [ ! -z ${AWS_KEY_PATH+x} ] ; then
339+
>&2 echo "WARNING: AWS keys given but run-on option has value 'localhost'."
340+
fi
341+
if [ ! -z ${AWS_EC2_TYPE+x} ]; then
342+
>&2 echo "WARNING: AWS instance type given but run-on option has value 'localhost'."
343+
fi
332344
fi
333345

334346
if [ -z ${PG_VERSION+x} ]

tests/nancy_run_invalid_aws_option.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
output=$(${BASH_SOURCE%/*}/../nancy run --run-on localhost --aws-keypair-name awskey --aws-ssh-key-path /path/.ssh/awskey.pem --aws-ec2-type i3.large 2>&1)
4+
5+
if [[ $output =~ "WARNING: AWS keys given but run-on option has value 'localhost'." ]] && [[ $output =~ "WARNING: AWS instance type given but run-on option has value 'localhost'." ]]; then
6+
echo -e "\e[36mOK\e[39m"
7+
else
8+
>&2 echo -e "\e[31mFAILED\e[39m"
9+
>&2 echo -e "Output: $output"
10+
exit 1
11+
fi

tests/nancy_run_invalid_option.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
output=$(${BASH_SOURCE%/*}/../nancy run --run-on-type test 2>&1)
4+
5+
if [[ $output =~ "ERROR: Invalid option '--run-on-type'. Please verify command options." ]]; then
6+
echo -e "\e[36mOK\e[39m"
7+
else
8+
>&2 echo -e "\e[31mFAILED\e[39m"
9+
>&2 echo -e "Output: $output"
10+
exit 1
11+
fi

tests/nancy_run_options_ddl_do+_undo-.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ read -r -d '' params <<PARAMS
88
--workload-full-path "s3://somebucket/db.sql.30min.pgreplay" \
99
--tmp-path tmp \
1010
--db-dump-path "s3://somebucket/dump.sql.bz2" \
11-
--target-ddl-do "create index i_zzz on sometable(col1);"
11+
--target-ddl-do "create\tindex\ti_zzz\ton\tsometable(col1);"
1212
PARAMS
1313

1414
output=$(${BASH_SOURCE%/*}/../nancy_run.sh $params 2>&1)

tests/nancy_run_options_ddl_do-_undo+.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ read -r -d '' params <<PARAMS
88
--workload-full-path "s3://somebucket/db.sql.30min.pgreplay" \
99
--tmp-path tmp \
1010
--db-dump-path "s3://somebucket/dump.sql.bz2" \
11-
--target-ddl-undo "drop index i_zzz;"
11+
--target-ddl-undo "drop\tindex\ti_zzz;"
1212
PARAMS
1313

1414
output=$(${BASH_SOURCE%/*}/../nancy_run.sh $params 2>&1)

tests/nancy_run_options_multi_workloads.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ read -r -d '' params <<PARAMS
66
--aws-ec2-type "r4.large" \
77
--s3cfg-path "/home/someuser/.s3cfg" \
88
--workload-full-path "s3://somebucket/db.sql.30min.pgreplay" \
9-
--workload-custom-sql "select now();" \
9+
--workload-custom-sql "select\tnow();" \
1010
--tmp-path tmp \
1111
--db-dump-path "s3://somebucket/dump.sql.bz2"
1212
PARAMS

0 commit comments

Comments
 (0)