|
| 1 | +This module describes how to conduct load test for ID Authentication using provided JMeter script. |
1 | 2 |
|
2 | 3 | ### Contains |
3 | 4 | * This directory contains performance Test script of below API endpoint categories. |
4 | | - 01. Create Identities in MOSIP Identity System (Setup) |
5 | | - 02. Third Party Certificates (Setup) |
| 5 | + 01. A01 Create Identities in MOSIP Identity System (Setup) |
| 6 | + 02. A02 Third Party Certificates (Setup) |
6 | 7 | 03. P01 Authentication with OTP (Preparation) |
7 | 8 | 04. P02 Authentication with Biometrics (Preparation) |
8 | 9 | 05. P03 Authentication with Demo (Preparation) |
|
15 | 16 | * Open source Tools used, |
16 | 17 | 01. [Apache JMeter 5.3](https://jmeter.apache.org/) |
17 | 18 | 02. [authentication-demo-service](https://github.com/mosip/mosip-functional-tests/blob/develop/authentication-demo-service/README.md) |
18 | | - 03. [Java 11](https://jdk.java.net/archive/) |
| 19 | + 03. [Java 11](https://jdk.java.net/archive/) (for JMeter 5.3) |
| 20 | + 04. [Java 21](https://jdk.java.net/archive/) (for authentication-demo-service) |
19 | 21 |
|
20 | 22 | ### How to run performance scripts using Apache JMeter tool |
21 | 23 | * Download Apache JMeter from https://jmeter.apache.org/download_jmeter.cgi |
22 | 24 | * Download JMeter Plugin Manager jar file from https://jmeter-plugins.org/get/ , and install by placing the it in "Jmeter/apache-jmeter-X.X.X/lib/ext" |
23 | | -* Download scripts for the required module from the respective module repo's. |
24 | | -* Start JMeter by running the jmeter.bat file for Windows or jmeter file for Unix. |
25 | | -* Load downloaded *.jmx script onto Jmeter. If prompted, install the required plugins. |
26 | | -* Update "User Defined Variables" within the Jmeter scripts. This list holds environment endpoint URL, protocols, users, secret keys, passwords, runtime file path, support file path etc. |
27 | | -* Validate the scripts for one user. |
| 25 | +* Download scripts for the required module from the [script](script/) folder of this repo. |
| 26 | +* Start JMeter 5.3 (while running java 11) by running jmeter.bat/jmeter.sh as per your OS. |
| 27 | +* Load downloaded *.jmx script onto JMeter. If prompted, install the required plugins. |
| 28 | +* If plugins were installed, restart JMeter. |
| 29 | +* Update "User Defined Variables" within the JMeter scripts. This list holds environment endpoint URL, protocols, users, secret keys, passwords, runtime file path, support file path etc. |
| 30 | +* Validate the scripts is working functionally. |
| 31 | + * Disable all "thread groups" within the test plan by clicking 'disable'. |
| 32 | + * Enable and execute only one thread at one time during this step. |
| 33 | + * Sequentially, execute each thread group with Number of VUser and Iteration set to 1. |
| 34 | + * Go to [script execution steps](#script-execution-steps) for further detail. |
28 | 35 | * Take average scenario response time obtained from above test and update "Scenario Response time" column in [MOSIP_TPS_Thread_setting_calculator](MOSIP_TPS_Thread_setting_calculator-ID-Authentication.xlsx) |
29 | 36 | * Execute a dry run for 10 min. The execution duration is controlled by "testDuration" variable. |
30 | 37 | * Use [MOSIP_TPS_Thread_setting_calculator](MOSIP_TPS_Thread_setting_calculator-ID-Authentication.xlsx) to calculate the thread settings required for your target load. |
31 | | -* Execute performance run with various loads in order to achieve targeted NFR's. |
| 38 | +* Execute performance run with various loads in order to achieve targeted NFR's. For a performance run, all scenarios (S01, S02, S03....) should be enabled and executed at the same time. |
32 | 39 |
|
33 | 40 | ### Setup points for Execution |
34 | 41 |
|
35 | | -* This script uses [authentication-demo-service](https://github.com/mosip/mosip-functional-tests/blob/develop/authentication-demo-service/README.md). Follow the instruction to in the documentation to install this service. |
36 | | -* Additional setup for `authentication-demo-service` |
37 | | - * Make config update in `id-authentication-default.properties`. |
38 | | - ``` |
39 | | - *authrequest.received-time-allowed.seconds=86400 |
40 | | - ``` |
41 | | - * Assign default role as AUTH_PARTNER in the keycloak for the test environment. This way all new users with the same partner id created from the jmeter script will automatically have the desired role. Create certificates with the same role. |
42 | | - * Create new keycloak user manually and assigning it to Partner Admin Access role. |
43 | | -* Run below command from the installation folder to start the service. |
| 42 | +* In keycloak, |
| 43 | + 1. Assign default role as AUTH_PARTNER in the test environment. This way all new users with the same partner id created from the JMeter script will automatically have the desired role. This will also create certificates in step 'A02 Third Party Certificates' with the same role. |
| 44 | + 2. Create new keycloak user manually and assign it to Partner Admin Access role. Use this new user in JMeter as 'User Defined Variables' |
| 45 | + |
| 46 | +* This script uses [authentication-demo-service](https://github.com/mosip/mosip-functional-tests/blob/develop/authentication-demo-service/README.md). Below are setup steps of `authentication-demo-service` for the purpose of this module. |
| 47 | + 1. Follow the instruction in the documentation to install this service. |
| 48 | + 4. Change Java version in the system to Java 21. |
| 49 | + 5. Run below command from the installation folder to start the service. |
| 50 | + |
44 | 51 | ``` |
45 | 52 | *java -jar -Dmosip.base.url=https://<<test-environment-domain>> -Dserver.port=8082 -Dauth-token-generator.rest.clientId=mosip-resident-client -Dauth-token-generator.rest.secretKey=<<testSecretKey>> -Dauth-token-generator.rest.appId=resident authentication-demo-service-<<version-number>>.jar |
46 | 53 | ``` |
|
52 | 59 | *IDA_Test_Script.jmx |
53 | 60 |
|
54 | 61 |
|
55 | | - * Create Identities in MOSIP Identity System (Setup) : This threadgroup contains the authorization api's for regproc and idrepo from which the auth token will be generated. There is set of 4 api's generate RID, generate UIN, add identity and add VID. From here we will get the VID which can be further used as individual id. These 4 api's are present in the loop controller where we can define the number of samples for creating identities in which "freshIdentityCreationCount" is used as a variable. |
| 62 | + * A01 Create Identities in MOSIP Identity System (Setup) : This threadgroup contains the authorization api's for regproc and idrepo from which the auth token will be generated. There is set of 4 api's generate RID, generate UIN, add identity and add VID. From here we will get the VID which can be further used as individual id. These 4 api's are present in the loop controller where we can define the number of samples for creating identities in which "freshIdentityCreationCount" is used as a variable. |
56 | 63 |
|
57 | | - * Third Party Certificates (Setup) : This threadgroup contains series of certificates upload to support the IDA execution. |
| 64 | + * A02 Third Party Certificates (Setup) : This threadgroup contains series of certificates upload to support the IDA execution. it requires an empty "authcerts" folder in `authentication-demo-service` working directory. |
58 | 65 | * Setup Ida Certificates to Utility: This transaction controller generates IDA certificates. |
59 | 66 | * Creating Policy And Policy Group : This transaction controller creates and publish policy and policy group. The policy ID is the random number provided by user. The ID is not fetched from environment database. |
60 | 67 | * Registering The Relying Partner : This transaction controller generates partner id for the relying partner. |
61 | 68 | * Relying Party Keycloak User And Api Key Generation : This transaction controller generates keycloak user and API key for relying partner. |
62 | 69 | * Create Misp Partner And Misp License Key : This transaction controller generates partner ID and license key for MISP partner. |
63 | 70 | * Setup Device Partner : This transaction controller generates certificate for device partner. |
64 | 71 | * Setup FTM Partner : This transaction controller generates certificate for FTM partner. |
65 | | - |
| 72 | + |
| 73 | + Note: Enable "Load MISP Licensekey From File", "Load UIN From File" and "Load Relying Party API Key From File" before running below thread groups. |
| 74 | + |
66 | 75 | * P01 Authentication with OTP (Preparation): This threadgroup creates testdata like signature and request body for the Auth Send OTP and Authentication with OTP request which expires after 24 hours. |
67 | 76 |
|
68 | 77 | * P02 Authentication with Biometrics (Preparation): This threadgroup creates testdata like signature and request body for the Authentication with Biometric request which expires after 24 hours. |
|
87 | 96 | |
88 | 97 | ### Designing the workload model for performance test execution |
89 | 98 |
|
90 | | -* The script is preconfigured for 100 tps within our test environement. Performance may vary based on hardware and infreastructure settings. |
| 99 | +* The script is preconfigured for 100 tps within our test environment. Performance may vary based on hardware and infrastructure settings. |
91 | 100 |
|
92 | 101 | * If you are testing for different tps or with different hardware settings, adjustment needs to made to thread group settings within the script. |
93 | 102 |
|
|
99 | 108 | 2. [biometrics_data.txt](support-files/biometrics_data.txt) - This support file contains sample encrypted bio data |
100 | 109 | 3. [center_machine_id_values.csv](support-files/center_machine_id_values.csv) - This support file contains center and machine ids available in master database. |
101 | 110 | 4. [face_data.txt](support-files/face_data.txt) - This support file contains sample encrypted face data that is used prepare and verify bio-authentication. |
| 111 | +5. uin_list_ida.txt - This is a list of UINs and DoB, created by 'A01 Create Identities in MOSIP Identity System'. |
| 112 | +6. misp_license_key.txt - MISP partner and MISP License detail, created by 'A02 Third Party Certificates' |
| 113 | +7. rp_api_key.txt - Relying party keycloak user detail, created by 'A02 Third Party Certificates' |
| 114 | + |
0 commit comments