forked from sahana/eden
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
138 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<clients> | ||
<!-- Client side setup --> | ||
<client host="localhost" use_controller_vm="true" maxusers="200000"/> | ||
</clients> | ||
|
||
<servers> | ||
<!-- Server side setup --> | ||
<server host="127.0.0.1" port="8000" type="tcp"></server> | ||
</servers> | ||
|
||
<load> | ||
<!-- several arrival phases can be set: for each phase, you can set | ||
the mean inter-arrival time between new clients and the phase | ||
duration --> | ||
<arrivalphase phase="1" duration="5" unit="minute"> | ||
<users maxnumber="50" interarrival="5" unit="second"></users> | ||
</arrivalphase> | ||
|
||
<arrivalphase phase="2" duration="10" unit="minute"> | ||
<users maxnumber="100" interarrival="3" unit="second"></users> | ||
</arrivalphase> | ||
</load> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<transaction name="login_page"> | ||
<!-- Login page --> | ||
<request> | ||
<!-- Get the form-key from the login form --> | ||
<dyn_variable name="_formkey" xpath="//form//div//input[@name='_formkey']/@value" /> | ||
<http url='/eden/default/user/login' version='1.1' method='GET'></http> | ||
</request> | ||
|
||
<!-- The requests on the login form --> | ||
<request><http url='/eden/static/themes/IFRC/eden.min.css' version='1.1' method='GET'></http></request> | ||
<request><http url='/eden/static/scripts/jquery-1.10.2.min.js' version='1.1' method='GET'></http></request> | ||
<request><http url='/eden/static/scripts/jquery-migrate-1.2.1.min.js' version='1.1' method='GET'></http></request> | ||
<request><http url='/eden/static/scripts/S3/S3.min.js' version='1.1' method='GET'></http></request> | ||
<request><http url='/eden/static/themes/IFRC/js/nav.js' version='1.1' method='GET'></http></request> | ||
|
||
</transaction> | ||
|
||
<transaction name="login_query"> | ||
<!-- Submit the form --> | ||
<request subst="true"> | ||
<http url='/eden/default/user/login?_next=%2Feden%2Fdefault%2Findex' version='1.1' contents="_formname=login&_formkey=%%__formkey%%&email=admin@example.com&password=testing&_next=/eden/default/index&_utc_offset=-330" content_type='application/x-www-form-urlencoded' method='POST'></http> | ||
</request> | ||
|
||
<request><http url='/eden/default/index' version='1.1' method='GET'></http></request> | ||
|
||
</transaction> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import csv | ||
import copy | ||
fp = open('staff.csv', 'wb') | ||
with fp as csvfiles: | ||
writer = csv.writer(csvfiles, delimiter=',') | ||
baseline = ['34', '1', '', 'FirstName', 'MiddleName', 'LastName', '2-Jan-1987', | ||
'1', 'FirstName.LastName', '1234567890', '', '', '01-Jan-2012', '31-Dec-2012'] | ||
for i in range(10000): | ||
templine = copy.deepcopy(baseline) | ||
templine[3] = baseline[3] + str(i) | ||
templine[8] = baseline[8] + str(i) + "@example.com" | ||
writer.writerow(templine) | ||
fp.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
Instructions on how to run the test - | ||
http://eden.sahanafoundation.org/wiki/BluePrint/Testing/TestSuite#Runningthetests | ||
This test depends upon scripts/create_staff_data.py for its data. | ||
Run this script from the current directory if staff.csv is not present. | ||
--> | ||
<!-- The filename below is specific to the system the test is run on. --> | ||
<!DOCTYPE tsung SYSTEM "/opt/tsung-1.4.2/share/tsung/tsung-1.0.dtd" [ | ||
<!ENTITY config SYSTEM "helpers/config.xml"> | ||
<!ENTITY login_page SYSTEM "helpers/login.xml"> | ||
]> | ||
|
||
<tsung loglevel="debug" version="1.0"> | ||
|
||
<!-- Load the configuration --> | ||
&config; | ||
|
||
<options> | ||
<option name="file_server" id='newstaff' value="staff.csv"/> | ||
<option type="ts_http" name="user_agent"> | ||
<user_agent probability="80">Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Galeon/1.3.21</user_agent> | ||
<user_agent probability="20">Mozilla/5.0 (Windows; U; Windows NT 5.2; fr-FR; rv:1.7.8) Gecko/20050511 Firefox/1.0.4</user_agent> | ||
</option> | ||
</options> | ||
|
||
<sessions> | ||
<!-- start a session for a http user. the probability is the | ||
frequency of this type os session. The sum of all session's | ||
probabilities must be 100 --> | ||
<session name='staff_create' probability='100' type='ts_http'> | ||
|
||
&login_page; | ||
|
||
<request> | ||
<!-- Get the form-key from the login form --> | ||
<dyn_variable name="_formkey" xpath="//form//div[1]//input[@name='_formkey']/@value" /> | ||
<dyn_variable name="_formname" xpath="//form//div[1]//input[@name='_formname']/@value" /> | ||
<http url='/eden/hrm/staff/create' version='1.1' method='GET'></http> | ||
</request> | ||
|
||
|
||
<transaction name="create_query"> | ||
<!-- Select a random string to be fed in as the query --> | ||
<setdynvars sourcetype="file" fileid="newstaff" delimiter="," order="iter"> | ||
<var name="organisation_id"/> | ||
<var name="site_id"/> | ||
<var name="person_id"/> | ||
<var name="first_name"/> | ||
<var name="middle_name"/> | ||
<var name="last_name"/> | ||
<var name="date_of_birth"/> | ||
<var name="gender"/> | ||
<var name="email"/> | ||
<var name="mobile_phone"/> | ||
<var name="job_title_id"/> | ||
<var name="department_id"/> | ||
<var name="start_date"/> | ||
<var name="end_date"/> | ||
</setdynvars> | ||
|
||
<!-- Submit Create query --> | ||
<request subst="true"> | ||
<http url='/eden/hrm/staff/create' version='1.1' content_type='application/x-www-form-urlencoded' method='POST' contents='organisation_id=%%_organisation_id%%&site_id=%%_site_id%%&person_id=%%_person_id%%&first_name=%%_first_name%%&middle_name=%%_middle_name%%&last_name=%%_last_name%%&date_of_birth=%%_date_of_birth%%&gender=%%_gender%%&email=%%_email%%&mobile_phone=%%_mobile_phone%%&job_title_id=%%_job_title_id%%&department_id=%%_department_id%%&start_date=%%_start_date%%&end_date=%%_end_date%%'></http> | ||
</request> | ||
</transaction> | ||
|
||
<transaction name="logout"> | ||
<!-- Logout --> | ||
<request><http url='http://127.0.0.1:8000/eden/default/user/logout' version='1.1' method='GET'></http></request> | ||
<request><http url='/eden/default/index' version='1.1' method='GET'></http></request> | ||
</transaction> | ||
</session> | ||
</sessions> | ||
</tsung> | ||
|