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

update aet.sh with option to override name attribute specified in suite #278

Merged
merged 2 commits into from
Jul 2, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
18 changes: 13 additions & 5 deletions client/client-scripts/aet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ POLL_INTERVAL=1
UNLOCK_TIMEOUT=0
SUITE_ENDPOINT="/suite"
DOMAIN_BODY=""
SUITE_NAME_BODY=""
CORRELATION_ID_BODY=""
function usage {
echo
Expand All @@ -32,6 +33,7 @@ function usage {
echo
echo "Options:"
echo -e "\t-d --domain <DOMAIN> - Override domain attribute defined in suite file"
echo -e "\t-n --name <SUITE_NAME> - Override name attribute defined in suite file"
echo -e "\t-c --correlationId <CORRELATION_ID> - Set id of patterns to run test against."
echo -e "\t-i --interval <POLL_INTERVAL> - Set interval in seconds for polling suite status. Default interval : 1 sec."
echo -e "\t-w --waitForUnlock <TIMEOUT> - Set timeout for the script to wait for unlocked suite. Default timeout: 0 sec."
Expand Down Expand Up @@ -85,7 +87,7 @@ function process_locked_suite {

# request /suite endpoint
function start_suite {
run_response=$(curl -sw "%{http_code}" -F "suite=@$suite_file_name"$DOMAIN_BODY$CORRELATION_ID_BODY "$endpoint$SUITE_ENDPOINT")
run_response=$(curl -sw "%{http_code}" -F "suite=@$suite_file_name"$DOMAIN_BODY$SUITE_NAME_BODY$CORRELATION_ID_BODY "$endpoint$SUITE_ENDPOINT")
extract_code_and_body "$run_response"

if [ $code -eq 200 ]; then
Expand Down Expand Up @@ -119,6 +121,11 @@ while [[ $# -gt 0 ]]; do
DOMAIN_BODY=" -F domain=$DOMAIN"
shift 2
;;
-n | --name )
SUITE_NAME="$2"
SUITE_NAME_BODY=" -F name=$SUITE_NAME"
shift 2
;;
-c | --correlationId )
CORRELATION_ID=$2
CORRELATION_ID_BODY=" -F pattern=$CORRELATION_ID"
Expand All @@ -136,10 +143,11 @@ done

if [[ $VERBOSE -eq 1 ]]; then
echo -e "Test parameters:"
echo -e "\tAET endpoint: $endpoint$SUITE_ENDPOINT"
echo -e "\tSuite: $suite_file_name"
echo -e "\tOverridden domain: ${DOMAIN-not set}"
echo -e "\tPattern id: ${CORRELATION_ID-not set}"
echo -e "\tAET endpoint: $endpoint$SUITE_ENDPOINT"
echo -e "\tSuite: $suite_file_name"
echo -e "\tOverridden domain: ${DOMAIN-not set}"
echo -e "\tOverridden suite name: ${SUITE_NAME-not set}"
echo -e "\tPattern id: ${CORRELATION_ID-not set}"
echo ""
fi

Expand Down
4 changes: 3 additions & 1 deletion documentation/src/main/wiki/ClientScripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ AET Test executor

Usage:

./aet.sh <endpoint> [<suite_file_name>] [-i | --interval <POLL_INTERVAL>]
./aet.sh <endpoint> [<suite_file_name>] [options]

Options:
-d --domain <DOMAIN> - Override domain attribute defined in suite file
-n --name <SUITE_NAME> - Override name attribute defined in suite file
-c --correlationId <CORRELATION_ID> - Set id of patterns to run test against
-i --interval <POLL_INTERVAL> - Set interval in seconds for polling suite status. Default interval : 1 sec
-w --waitForUnlock <TIMEOUT> - Set timeout for the script to wait for unlocked suite. Default timeout: 0 sec
Expand All @@ -31,6 +32,7 @@ The shell script can be run with parameters which are described below:
| `endpointDomain` | an AET domain which exposes the [[Test Executor API\|TestExecutor]] | - | yes |
| `suite_file_name` | a full path to the suite definition file (at least a file name with an extension is required, e.g. `testSuite.xml`). | suite.xml | no |
| `-d \| --domain <DOMAIN>` | overrides the _domain_ parameter value from the test suite definition. | - | no |
| `-n \| --name <SUITE_NAME>` | overrides the _name_ parameter value from the test suite definition. | - | no |
| `-c \| --correlationId <CORRELATION_ID>` | Id of suite that will be used as patterns source. Identical structure of pattern and current suites is assumed. | - | no |
| `-i \| --interval <POLL_INTERVAL>` | an interval of polling the status of the test currently executed. (Unit: seconds) | 1 | no |
| `-w \| --waitForUnlock <TIMEOUT>` | specify the time that the script will wait for the suite to be unlocked. (Unit: seconds) | 0 | no |
Expand Down