This project enables to proceed to OpenPaaS load testing using Gatling technology.
It aims to provide building blocks, specific OpenPaaS APIs steps as well as more complex scenarios.
The configuration is defined in the src/main/scala/com/linagora/openpaas/gatling/Configuration.scala
file.
However, all the parameters can be set through environment variables. Just copy the
env.sh.tpl file as env.sh, update the values and source it: source env.sh
Available settings:
- OpenPaaS platform admin credentials for domain provisioning
- Domain used for load testing
- Platform admin & Domain admin credentials
- Base URL for OpenPaaS endpoints
- Base URL for Sabre endpoints
- Base URL for Web Socket server
- Base URL for Jmap server
- User count for scenario
- Scenario duration
- Inject duration
- Number of contacts per virtual user
- Number of calendar events per virtual user
- Number of emails per virtual user
- Authentication strategy
- Base URL for LemonLDAP portal page
- Base URL for CAS portal page
Environment variables:
OPENPAAS_HOSTNAME
which is set tolocalhost
by defaultOPENPAAS_PORT
which is set to8080
by defaultOPENPAAS_PORT_IN_URL
which is set tofalse
by default, if set totrue
the value ofOPENPAAS_PORT
will be appended toOPENPAAS_HOSTNAME
when generating the url.OPENPAAS_PROTOCOL
which is set tohttp
by default (you can usehttps
instead for example)SABRE_BASE_URL
which is set to `` by default. If a url is provided, it will be used as the base URL for CalDAV requests, otherwise the ESN's DAV Proxy will handle CalDAV requests.WEBSOCKET_HOSTNAME
which is set toOPENPAAS_HOSTNAME
by defaultWEBSOCKET_PORT
which is set toOPENPAAS_PORT
by defaultWEBSOCKET_PROTOCOL
which is set tows
by default (you can usewss
instead for example)JMAP_HOSTNAME
which is set toOPENPAAS_HOSTNAME
by defaultJMAP_PORT
which is set to1080
by defaultJMAP_PROTOCOL
which is set toOPENPAAS_PROTOCOL
by defaultINJECT_DURATION
which is set to10
by default. Unit is secondSCENARIO_DURATION
which is set to10
by default. Unit is secondUSER_COUNT
which is set to1
by defaultHUMAN_ACTION_MIN_DELAY
which is set to7
by default. The minimum amount of seconds between 2 human actions.HUMAN_ACTION_MAX_DELAY
which is set to15
by default. The maximum amount of seconds between 2 human actions.AUTHENTICATION_STRATEGY
which is set tobasic
by default (you can uselemonldap
,oidc
,pkce
,pkce_with_cas
instead)OIDC_CLIENT
oidc client to use foroidc
andpkce
authentication strategiesOIDC_CALLBACK
url to redirect to after a successful login withoidc
andpkce
authentication strategies. Make sure to add redirect URL with explicit port in the lemonLDAP managerLEMONLDAP_PORTAL_HOSTNAME
which is set toauth.latest.integration-open-paas.org
by default.CAS_HOSTNAME
which is set toOPENPAAS_HOSTNAME
by default. used withpkce_with_cas
authentication strategy.CAS_PORT
which is set to443
by defaultCAS_PROTOCOL
which is set tohttps
by defaultCAS_PORT_IN_URL
which is set tofalse
by default, if set totrue
the value ofCAS_PORT
will be appended toCAS_HOSTNAME
when generating the url.PLATFORM_ADMIN_USER
is the user name of the platform administrator.PLATFORM_ADMIN_PWD
is the password of the platform administrator.INBOX_SPA_PATH
is the path to access the Inbox SPA. which is set toinbox
by defaultCALENDAR_SPA_PATH
is the path to access the Calendar SPA, which is set tocalendar
by defaultCONTACTS_SPA_PATH
is the path to access the Contacts SPA, which is set tocontacts
by defaultKEYCLOAK_PORTAL_PROTOCOL
which is set toOPENPAAS_PROTOCOL
by defaultKEYCLOAK_PORTAL_HOSTNAME
which is set toauth.latest.integration-open-paas.org
by defaultKEYCLOAK_REALM
which is set toopenpaas
by defaultLOAD_STATIC_ASSETS
which is set tofalse
by default, if set totrue
the simulation will load static assets delivered by nginx
For example, to run with OpenPaaS port 8000
:
$ export OPENPAAS_PORT="8000"
$ sbt
> gatling:test
There are two ways of creating a user pool for running tests:
-
Using a
src/test/resources/users.csv
file containing credentials of users. This is the default method to retrieve user credentials. It is expected to have all users provisioned in the testing platform. -
Including the provisioning steps in each scenario. This method requires platform admin credentials in configuration.
For OpenPaaS instances that are protected by LemonLDAP, you need to provide the LemonLDAP portal page url in the configuration. You also have to change the AUTHENTICATION_STRATEGY
configuration to lemonldap
. Plus, all users credentials must be stored in src/test/resources/users.csv
file.
The Gatling Recorder helps you to quickly generate scenarios, by either acting as a HTTP proxy between the browser and the HTTP server or converting HAR (Http ARchive) files. Either way, the Recorder generates a simple simulation that mimics your recorded navigation.
All the instructions to install and use are available at this documentation
You can run all the scenario via sbt:
$ sbt
> gatling:test
Run a specific scenario via sbt:
$ sbt
> gatling:testOnly SCENARIO_FQDN
For example, you can run this scenario to open Calendar and open an event to view it details:
$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.calendar.ViewEventDetailsSimulation
In this scenario, each user will:
- Login to OpenPaaS
- Go to Inbox
- Open a composer window
- Write an email, attach a 200kB file
- Send the email
- Log out
$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.unifiedinbox.SendEmailSimulation
In this scenario, each user will:
- Login to OpenPaaS
- Go to Calendar, and all the usable calendars are listed
The equivalent simulation will ramp USER_COUNT
users over INJECT_DURATION
.
$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.calendar.ListCalendarsSimulation
In this scenario, each user will:
- Login to OpenPaaS
- Go to Calendar
- Create a new calendar
The equivalent simulation will ramp USER_COUNT
users over INJECT_DURATION
.
$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.calendar.CreateCalendarSimulation
In this scenario, each user will:
- Login to OpenPaaS
- Go to Calendar
- Choose a calendar to view its details
- Update the calendar
The equivalent simulation will ramp USER_COUNT
users over INJECT_DURATION
.
$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.calendar.ViewAndUpdateCalendarSimulation
In this scenario, each user will:
- Login to OpenPaaS
- Go to Calendar
- Choose a calendar to view its details
- Delete the calendar
The equivalent simulation will ramp USER_COUNT
users over INJECT_DURATION
.
$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.calendar.ViewAndDeleteCalendarSimulation
In this scenario, each user will:
- Login to OpenPaaS
- Go to Calendar
- Create a new event in the default calendar
The equivalent simulation will ramp USER_COUNT
users over INJECT_DURATION
.
$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.calendar.CreateEventSimulation
In this scenario, each user will:
- Login to OpenPaaS
- Go to Calendar
- Create a new event in the default calendar with a lof of attendees (between 100 and 200 attendees)
The equivalent simulation will ramp 20 users over 1 second. These numbers are configurable (see the commands below).
- Run with the default configuration (ramping 20 users over 1 second):
$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.calendar.CreateEventWithLotsOfAttendeesSimulation
- Run with a custom configuration (ramping 40 users over 2 seconds):
$ sbt
> ;-DrampUserCount=40;-DrampUserDuration=2;gatling:testOnly com.linagora.openpaas.gatling.calendar.CreateEventWithLotsOfAttendeesSimulation
In this scenario, each user will:
- Login to OpenPaaS
- Go to Calendar
- Open an event to view its details
The equivalent simulation will ramp USER_COUNT
users over INJECT_DURATION
.
$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.calendar.ViewEventDetailsSimulation
In this scenario, each user will:
- Login to OpenPaaS
- Go to Calendar
- Open an event to view its details
- Update the event
The equivalent simulation will ramp USER_COUNT
users over INJECT_DURATION
.
$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.calendar.ViewAndUpdateEventSimulation
In this scenario, each user will:
- Login to OpenPaaS
- Go to Calendar
- Open an event to view its details
- Delete the event
The equivalent simulation will ramp USER_COUNT
users over INJECT_DURATION
.
$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.calendar.ViewAndDeleteEventSimulation
In this scenario, each user will:
- Login to OpenPaaS
- Go to Calendar
- Do one of the following actions at random:
- 40%: Open an event
- 20%: Create an event with a few attendees (between 1 and 10 attendees)
- 15%: Open an event and update the event
- 10%: Create a new event
- 5%: Open an event and delete the event
- 5%: Open an event and update the event
- 3%: Create a new calendar
- 2%: View a calendar's details and then delete the calendar
The equivalent simulation will ramp USER_COUNT
users over INJECT_DURATION
.
$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.calendar.CalendarMixSimulation
In this scenario, each user will:
- Login to OpenPaaS
- Go to Contacts
- Open the default address book
- Open a contact
- Log out
The equivalent simulation will ramp USER_COUNT
users over INJECT_DURATION
.
$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.addressbook.OpenContactInCollectedAddressBookSimulation
In this simulation, each user will:
- Execute one of the following scenarios randomly:
- Scenario 1 (80% chance): Calendar's mixed scenario
- Scenario 2 (20% chance): Open a contact in the default address book
- Pause between 5 and 10 seconds between scenarios
- Number of users:
USER_COUNT
- Injection duration:
INJECT_DURATION
- Scenario duration:
SCENARIO_DURATION
$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.CalendarAndContactsWithRefreshTokenSimulation
In this simulation, each user will:
- Login
- Execute one of these actions randomly:
- 5%: send email
- 10%: open mailbox
- 15%: read email
- 70%: idle
- Pause 60 seconds between each case (it's the time for the idle sync to happen)
The equivalent simulation will ramp USER_COUNT
users over INJECT_DURATION
with SCENARIO_DURATION
as the scenario duration for a user.
$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.InboxPlatformSimulation