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

support passing parameters to start_test.sh #42 #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion jmeter_master_configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ data:
#!/bin/bash
#Script created to invoke jmeter test script with the slave POD IP addresses
#Script should be run like: ./load_test "path to the test script in jmx format"
/jmeter/apache-jmeter-*/bin/jmeter -n -t $1 -Dserver.rmi.ssl.disable=true -R `getent ahostsv4 jmeter-slaves-svc | cut -d' ' -f1 | sort -u | awk -v ORS=, '{print $1}' | sed 's/,$//'`
/jmeter/apache-jmeter-*/bin/jmeter -n -t $1 -Dserver.rmi.ssl.disable=true -R `getent ahostsv4 jmeter-slaves-svc | cut -d' ' -f1 | sort -u | awk -v ORS=, '{print $1}' | sed 's/,$//'` ${@:2}
6 changes: 5 additions & 1 deletion start_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ working_dir="`pwd`"
tenant=`awk '{print $NF}' "$working_dir/tenant_export"`

jmx="$1"
params="${@:2}"
[ -n "$jmx" ] || read -p 'Enter path to the jmx file ' jmx
[ -n "$params" ] || read -p 'Enter additional CLI parameters (like -Jparam1=value) ' params

if [ ! -f "$jmx" ];
then
Expand All @@ -19,6 +21,8 @@ then
fi

test_name="$(basename "$jmx")"
echo "Using test file: $test_name"
echo "Additional parameters for jmeter: $params"

#Get Master pod details

Expand All @@ -28,4 +32,4 @@ kubectl cp "$jmx" -n $tenant "$master_pod:/$test_name"

## Echo Starting Jmeter load test

kubectl exec -ti -n $tenant $master_pod -- /bin/bash /load_test "$test_name"
kubectl exec -ti -n $tenant $master_pod -- /bin/bash /load_test "$test_name" $params