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:
Environment variables:
OPENPAAS_HOSTNAME
which is set to localhost
by defaultOPENPAAS_PORT
which is set to 8080
by defaultOPENPAAS_PORT_IN_URL
which is set to false
by default, if set to true
the value of OPENPAAS_PORT
will be appended to OPENPAAS_HOSTNAME
when generating the url.OPENPAAS_PROTOCOL
which is set to http
by default (you can use https
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 to OPENPAAS_HOSTNAME
by defaultWEBSOCKET_PORT
which is set to OPENPAAS_PORT
by defaultWEBSOCKET_PROTOCOL
which is set to ws
by default (you can use wss
instead for example)JMAP_HOSTNAME
which is set to OPENPAAS_HOSTNAME
by defaultJMAP_PORT
which is set to 1080
by defaultJMAP_PROTOCOL
which is set to OPENPAAS_PROTOCOL
by defaultINJECT_DURATION
which is set to 10
by default. Unit is secondSCENARIO_DURATION
which is set to 10
by default. Unit is secondUSER_COUNT
which is set to 1
by defaultHUMAN_ACTION_MIN_DELAY
which is set to 7
by default. The minimum amount of seconds between 2 human actions.HUMAN_ACTION_MAX_DELAY
which is set to 15
by default. The maximum amount of seconds between 2 human actions.AUTHENTICATION_STRATEGY
which is set to basic
by default (you can use lemonldap
, oidc
, pkce
, pkce_with_cas
instead)OIDC_CLIENT
oidc client to use for oidc
and pkce
authentication strategiesOIDC_CALLBACK
url to redirect to after a successful login with oidc
and pkce
authentication strategies. Make sure to add redirect URL with explicit port in the lemonLDAP managerLEMONLDAP_PORTAL_HOSTNAME
which is set to auth.latest.integration-open-paas.org
by default.CAS_HOSTNAME
which is set to OPENPAAS_HOSTNAME
by default. used with pkce_with_cas
authentication strategy.CAS_PORT
which is set to 443
by defaultCAS_PROTOCOL
which is set to https
by defaultCAS_PORT_IN_URL
which is set to false
by default, if set to true
the value of CAS_PORT
will be appended to CAS_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 to inbox
by defaultCALENDAR_SPA_PATH
is the path to access the Calendar SPA, which is set to calendar
by defaultCONTACTS_SPA_PATH
is the path to access the Contacts SPA, which is set to contacts
by default KEYCLOAK_PORTAL_PROTOCOL
which is set to OPENPAAS_PROTOCOL
by defaultKEYCLOAK_PORTAL_HOSTNAME
which is set to auth.latest.integration-open-paas.org
by defaultKEYCLOAK_REALM
which is set to openpaas
by defaultLOAD_STATIC_ASSETS
which is set to false
by default, if set to true
the simulation will load static assets delivered by nginxFor 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:
$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.unifiedinbox.SendEmailSimulation
In this scenario, each user will:
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:
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:
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:
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:
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:
The equivalent simulation will ramp 20 users over 1 second. These numbers are configurable (see the commands below).
$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.calendar.CreateEventWithLotsOfAttendeesSimulation
$ sbt
> ;-DrampUserCount=40;-DrampUserDuration=2;gatling:testOnly com.linagora.openpaas.gatling.calendar.CreateEventWithLotsOfAttendeesSimulation
In this scenario, each user will:
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:
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:
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:
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:
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:
USER_COUNT
INJECT_DURATION
SCENARIO_DURATION
$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.CalendarAndContactsWithRefreshTokenSimulation
In this simulation, each user will:
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