This commit is contained in:
Hosung Song 2018-02-18 03:37:18 +00:00
Родитель 70cfe5d4ff
Коммит 5f8d47eed6
2 изменённых файлов: 13 добавлений и 7 удалений

Просмотреть файл

@ -123,6 +123,12 @@ function create_1000_test_users_and_enroll_them_in_course
sudo -u www-data ~/bin/moosh --moodle-path=$MOODLE_PATH course-enrol $course_id m_azuretestuser_{801..1000} sudo -u www-data ~/bin/moosh --moodle-path=$MOODLE_PATH course-enrol $course_id m_azuretestuser_{801..1000}
} }
function hide_course_overview_block_for_jmeter_test
{
# "myoverview" is the registered name of the "Course overview" block
sudo -u www-data ~/bin/moosh --moodle-path=$MOODLE_PATH block-manage hide myoverview
}
# TODO hard-coded values... # TODO hard-coded values...
LOADTEST_BASE_URI=https://raw.githubusercontent.com/Azure/Moodle/hs-loadtest/loadtest LOADTEST_BASE_URI=https://raw.githubusercontent.com/Azure/Moodle/hs-loadtest/loadtest
MOODLE_TEST_USER_PASSWORD='testUserP@$$w0rd' MOODLE_TEST_USER_PASSWORD='testUserP@$$w0rd'
@ -135,6 +141,7 @@ function setup_test_course_and_users
local course_id=2 # TODO Fix this hard-coded course id #. Should be retrieved from the previous restore_course_from_url output local course_id=2 # TODO Fix this hard-coded course id #. Should be retrieved from the previous restore_course_from_url output
local password=$MOODLE_TEST_USER_PASSWORD # TODO parameterize local password=$MOODLE_TEST_USER_PASSWORD # TODO parameterize
create_1000_test_users_and_enroll_them_in_course $course_id $password create_1000_test_users_and_enroll_them_in_course $course_id $password
hide_course_overview_block_for_jmeter_test
} }
function run_cmd_on_remote_host function run_cmd_on_remote_host
@ -173,10 +180,10 @@ function run_simple_test_1_on_resource_group
mkdir -p test_outputs mkdir -p test_outputs
local prefix="test_outputs/simple_test_1_$(date +%Y%m%d%H%M%S)" local prefix="test_outputs/simple_test_1_$(date +%Y%m%d%H%M%S)"
echo $output | jq . > ${prefix}.params.json echo $output | jq . > ${prefix}.deployment.json
export JVM_ARGS="-Xms1024m -Xmx4096m" export JVM_ARGS="-Xms1024m -Xmx4096m"
local cmd="jmeter -n -t simple-test-1.jmx -l ${prefix}.jmeter.results.txt -j ${prefix}.jmeter.log -o ${prefix}.jmeter.report -Jhost=${moodle_host} -Jdb_host=${db_host} -Jdb_user=${moodle_db_user} -Jdb_pass=${moodle_db_pass} -Jmoodle_user_pass=${moodle_user_pass} -Jthreads=${test_threads_count} -Jrampup=${test_rampup_time_sec} -Jruntime=${test_run_time_sec}" local cmd="jmeter -n -t simple-test-1.jmx -l ${prefix}.jmeter.results.txt -j ${prefix}.jmeter.log -o ${prefix}.jmeter.report -Jhost=${moodle_host} -Jdb_host=${db_host} -Jdb_user=${moodle_db_user} '-Jdb_pass=${moodle_db_pass}' '-Jmoodle_user_pass=${moodle_user_pass}' -Jthreads=${test_threads_count} -Jrampup=${test_rampup_time_sec} -Jruntime=${test_run_time_sec}"
show_command_to_run $cmd show_command_to_run $cmd
eval $cmd eval $cmd
} }

Просмотреть файл

@ -16,9 +16,8 @@
<collectionProp name="Arguments.arguments"> <collectionProp name="Arguments.arguments">
<elementProp name="login_host" elementType="Argument"> <elementProp name="login_host" elementType="Argument">
<stringProp name="Argument.name">login_host</stringProp> <stringProp name="Argument.name">login_host</stringProp>
<stringProp name="Argument.value">lb-cosbae.southcentralus.cloudapp.azure.com</stringProp> <stringProp name="Argument.value">${__P(host, lb-cosbae.southcentralus.cloudapp.azure.com)}</stringProp>
<stringProp name="Argument.metadata">=</stringProp> <stringProp name="Argument.metadata">=</stringProp>
<stringProp name="Argument.desc">Not required</stringProp>
</elementProp> </elementProp>
<elementProp name="host" elementType="Argument"> <elementProp name="host" elementType="Argument">
<stringProp name="Argument.name">host</stringProp> <stringProp name="Argument.name">host</stringProp>
@ -106,7 +105,7 @@
</elementProp> </elementProp>
<elementProp name="db_user" elementType="Argument"> <elementProp name="db_user" elementType="Argument">
<stringProp name="Argument.name">db_user</stringProp> <stringProp name="Argument.name">db_user</stringProp>
<stringProp name="Argument.value">${_P(db_user,moodle@mysql-cosbae)}</stringProp> <stringProp name="Argument.value">${__P(db_user,moodle@mysql-cosbae)}</stringProp>
<stringProp name="Argument.metadata">=</stringProp> <stringProp name="Argument.metadata">=</stringProp>
</elementProp> </elementProp>
<elementProp name="db_name" elementType="Argument"> <elementProp name="db_name" elementType="Argument">
@ -116,12 +115,12 @@
</elementProp> </elementProp>
<elementProp name="db_pass" elementType="Argument"> <elementProp name="db_pass" elementType="Argument">
<stringProp name="Argument.name">db_pass</stringProp> <stringProp name="Argument.name">db_pass</stringProp>
<stringProp name="Argument.value">${_P(db_pass,)}</stringProp> <stringProp name="Argument.value">${__P(db_pass,)}</stringProp>
<stringProp name="Argument.metadata">=</stringProp> <stringProp name="Argument.metadata">=</stringProp>
</elementProp> </elementProp>
<elementProp name="moodle_user_pass" elementType="Argument"> <elementProp name="moodle_user_pass" elementType="Argument">
<stringProp name="Argument.name">moodle_user_pass</stringProp> <stringProp name="Argument.name">moodle_user_pass</stringProp>
<stringProp name="Argument.value">${_P(moodle_user_pass,testUserP@$$w0rd)}</stringProp> <stringProp name="Argument.value">${__P(moodle_user_pass,testUserP@$$w0rd)}</stringProp>
<stringProp name="Argument.metadata">=</stringProp> <stringProp name="Argument.metadata">=</stringProp>
</elementProp> </elementProp>
</collectionProp> </collectionProp>