|
1 | 1 |
|
2 | 2 | ### Contains |
3 | | -* This folder contains performance Test script of below API endpoint categories. |
| 3 | +* This directory contains performance Test script of below API endpoint categories. |
4 | 4 | 01. Create Identities in MOSIP Identity System (Setup) |
5 | 5 | 02. Third Party Certificates (Setup) |
6 | | - 03. S01 Authentication with OTP (Preparation) |
7 | | - 04. S02 Authentication with Biometrics (Preparation) |
8 | | - 05. S03 Authentication with Demo (Preparation) |
9 | | - 06. S01 Authentication with OTP (Execution) |
10 | | - 07. S02 Authentication with Biometrics (Execution) |
11 | | - 08. S03 Authentication with Demo (Execution) |
12 | | - 09. S04 EKYC with Biometrics (Execution) |
13 | | - |
| 6 | + 03. P01 Authentication with OTP (Preparation) |
| 7 | + 04. P02 Authentication with Biometrics (Preparation) |
| 8 | + 05. P03 Authentication with Demo (Preparation) |
| 9 | + 06. P04 EKYC with Biometrics (Preparation) |
| 10 | + 07. S01 Authentication with OTP (Execution) |
| 11 | + 08. S02 Authentication with Biometrics (Execution) |
| 12 | + 09. S03 Authentication with Demo (Execution) |
| 13 | + 10. S04 EKYC with Biometrics (Execution) |
14 | 14 |
|
15 | 15 | * Open source Tools used, |
16 | | - 1. [Apache JMeter](https://jmeter.apache.org/) |
| 16 | + 01. [Apache JMeter 5.3](https://jmeter.apache.org/) |
| 17 | + 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/) |
17 | 19 |
|
18 | 20 | ### How to run performance scripts using Apache JMeter tool |
19 | 21 | * Download Apache JMeter from https://jmeter.apache.org/download_jmeter.cgi |
20 | | -* Download scripts for the required module. |
| 22 | +* 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. |
21 | 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. |
22 | 27 | * Validate the scripts for one user. |
23 | | -* Execute a dry run for 10 min. |
24 | | -* Use MOSIP_TPS_Thread_setting_calculator.xlsx to calculate the thread settings required for your target load. |
| 28 | +* 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 | +* Execute a dry run for 10 min. The execution duration is controlled by "testDuration" variable. |
| 30 | +* Use [MOSIP_TPS_Thread_setting_calculator](MOSIP_TPS_Thread_setting_calculator-ID-Authentication.xlsx) to calculate the thread settings required for your target load. |
25 | 31 | * Execute performance run with various loads in order to achieve targeted NFR's. |
26 | 32 |
|
27 | 33 | ### Setup points for Execution |
28 | 34 |
|
29 | | -* We need some jar files which needs to be added in lib folder of jmeter, PFA dependency links for your reference : |
30 | | - |
31 | | - * jmeter-plugins-manager-1.10.jar |
32 | | - *<!-- https://mvnrepository.com/artifact/kg.apc/jmeter-plugins-manager --> |
33 | | -<dependency> |
34 | | - <groupId>kg.apc</groupId> |
35 | | - <artifactId>jmeter-plugins-manager</artifactId> |
36 | | - <version>1.10</version> |
37 | | -</dependency> |
38 | | - |
39 | | - * jmeter-plugins-synthesis-2.2.jar |
40 | | - * <!-- https://mvnrepository.com/artifact/kg.apc/jmeter-plugins-synthesis --> |
41 | | -<dependency> |
42 | | - <groupId>kg.apc</groupId> |
43 | | - <artifactId>jmeter-plugins-synthesis</artifactId> |
44 | | - <version>2.2</version> |
45 | | -</dependency> |
46 | | - |
47 | | -* id-authentication-default.properties: Update the value for the properties according to the execution setup. |
48 | | - *authrequest.received-time-allowed.seconds=86400 |
49 | | - |
50 | | -**Note - Before creating certificates we need to assign default role as AUTH_PARTNER in the keycloak for the environment we are using so that all new users with the same partner id which we will create will automatically have the desired role which it needs** |
51 | | - |
52 | | -**Note - Please make sure to create new keycloak user manually and assigning it to Partner Admin Access role** |
53 | | - |
54 | | -### Procedure to install and execute auth-demo-service in the local machine |
55 | | - |
56 | | -* The following link provides installation of auth-demo-service |
57 | | - * https://github.com/mosip/mosip-functional-tests/blob/master/README.md |
58 | | - |
59 | | -* Navigate to the path where auth-demo-service has been installed and run following query for cellbox1 env. |
60 | | - *java -jar -Dmosip.base.url=https://api-internal.cellbox1.mosip.net -Dserver.port=8082 -Dauth-token-generator.rest.clientId=mosip-resident-client -Dauth-token-generator.rest.secretKey=abc@123 -Dauth-token-generator.rest.appId=resident authentication-demo-service-1.2.1-develop-SNAPSHOT.jar |
61 | | - |
62 | | -### Execution points for eSignet Authentication API's |
| 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. |
| 44 | +``` |
| 45 | +*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 | +``` |
| 47 | +* The `authentication-demo-service` should be running in the background during preparation and execution of the test. |
| 48 | + |
| 49 | + |
| 50 | +### Execution points for ID Authentication API's |
63 | 51 |
|
64 | 52 | *IDA_Test_Script.jmx |
65 | | - |
66 | | - |
67 | | - * 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. |
68 | | - |
69 | | - * Third Party Certificates (Setup) : This threadgroup contains series of certificates upload to support the IDA execution. |
70 | | - * Setup Ida Certificates to Utility: This transaction controller generates IDA certificates. |
71 | | - * 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. |
72 | | - * Registering The Relying Partner : This transaction controller generates partner id for the relying partner. |
73 | | - * Relying Party Keycloak User And Api Key Generation : This transaction controller generates keycloak user and API key for relying partner. |
74 | | - * Create Misp Partner And Misp License Key : This transaction controller generates partner ID and license key for MISP partner. |
75 | | - * Setup Device Partner : This transaction controller generates certificate for device partner. |
76 | | - * Setup FTM Partner : This transaction controller generates certificate for FTM partner. |
77 | | - |
78 | | - * S01 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. |
79 | | - |
80 | | - * S02 Authentication with Biometrics (Preparation): This threadgroup creates testdata like signature and request body for the Authentication with Biometric request which expires after 24 hours. |
81 | | - |
82 | | - * S03 Authentication with Demographics (Preparation): This threadgroup creates testdata like signature and request body for the Authentication with Demographics request which expires after 24 hours. |
83 | | - |
84 | | - * S01 Authentication with OTP (Execution) : |
85 | | - * S01 T01 Auth Send OTP : This API endpoint sends OTP request. |
86 | | - * S01 T02 Authentication with OTP : This API endpoint performs OTP authentication. |
87 | | - |
88 | | - * S02 Authentication with Biometrics (Execution): |
89 | | - * S02 T01 Authentication with Biometrics: This API endpoint performs biometric authentication |
90 | | - |
91 | | - * S03 Authentication with Demographics (Execution): |
92 | | - * S03 T01 Authentication with Demographics : This API endpoint performs the authentication with Demographics. |
93 | | - |
94 | | - * S04 EKYC with Biometrics (Execution): |
95 | | - * S04 T01 EKYC with Biometrics: This API endpoint performs EKYC with biometric data. |
96 | | - |
97 | | -### Downloading Plugin manager jar file for the purpose installing other JMeter specific plugins |
98 | | - |
99 | | -* Download JMeter plugin manager from below url links. |
100 | | - *https://jmeter-plugins.org/get/ |
101 | | - |
102 | | -* After downloading the jar file place it in below folder path. |
103 | | - *lib/ext |
104 | | - |
105 | | -* Please refer to following link to download JMeter jars. |
106 | | - https://mosip.atlassian.net/wiki/spaces/PT/pages/1227751491/Steps+to+set+up+the+local+system#PluginManager |
107 | | - |
| 53 | + |
| 54 | + |
| 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. |
| 56 | + |
| 57 | + * Third Party Certificates (Setup) : This threadgroup contains series of certificates upload to support the IDA execution. |
| 58 | + * Setup Ida Certificates to Utility: This transaction controller generates IDA certificates. |
| 59 | + * 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 | + * Registering The Relying Partner : This transaction controller generates partner id for the relying partner. |
| 61 | + * Relying Party Keycloak User And Api Key Generation : This transaction controller generates keycloak user and API key for relying partner. |
| 62 | + * Create Misp Partner And Misp License Key : This transaction controller generates partner ID and license key for MISP partner. |
| 63 | + * Setup Device Partner : This transaction controller generates certificate for device partner. |
| 64 | + * Setup FTM Partner : This transaction controller generates certificate for FTM partner. |
| 65 | + |
| 66 | + * 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 | + |
| 68 | + * 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. |
| 69 | + |
| 70 | + * P03 Authentication with Demographics (Preparation): This threadgroup creates testdata like signature and request body for the Authentication with Demographics request which expires after 24 hours. |
| 71 | + |
| 72 | + * P04 EKYC with Biometrics (Preparation): This threadgroup creates testdata like signature and request body for the Authentication with Biometrics request which expires after 24 hours. |
| 73 | + |
| 74 | + * S01 Authentication with OTP (Execution) : |
| 75 | + * S01 T01 Auth Send OTP : This API endpoint sends OTP request. |
| 76 | + * S01 T02 Authentication with OTP : This API endpoint performs OTP authentication. |
| 77 | + |
| 78 | + * S02 Authentication with Biometrics (Execution): |
| 79 | + * S02 T01 Authentication with Biometrics: This API endpoint performs biometric authentication |
| 80 | + |
| 81 | + * S03 Authentication with Demographics (Execution): |
| 82 | + * S03 T01 Authentication with Demographics : This API endpoint performs the authentication with Demographics. |
| 83 | + |
| 84 | + * S04 EKYC with Biometrics (Execution): |
| 85 | + * S04 T01 EKYC with Biometrics: This API endpoint performs EKYC with biometric data. |
| 86 | + |
| 87 | + |
108 | 88 | ### Designing the workload model for performance test execution |
109 | 89 |
|
110 | 90 | * The script is preconfigured for 100 tps within our test environement. Performance may vary based on hardware and infreastructure settings. |
111 | 91 |
|
112 | 92 | * If you are testing for different tps or with different hardware settings, adjustment needs to made to thread group settings within the script. |
113 | 93 |
|
114 | | -* `MOSIP_TPS_Thread_setting_calculator-packet_credential_processing.xlsx` applies Little's law to recommend required thread settings inputs. |
| 94 | +* [MOSIP_TPS_Thread_setting_calculator](MOSIP_TPS_Thread_setting_calculator-ID-Authentication.xlsx) applies Little's law to recommend required thread settings inputs. |
115 | 95 |
|
116 | 96 | ### Support files required for this test execution: |
117 | 97 |
|
118 | | -1. add_identity_request_details.csv - This support file contains sample list of data that is used to create new identities. |
119 | | -2. biometrics_data.txt - This support file contains sample excrypted bio data |
120 | | -3. center_machine_id_values.csv - This support file contains center and machine ids available in master database. |
121 | | -4. face_data.txt - This support file contains sample excrypted face data that is used prepare and verify bio-authentication. |
| 98 | +1. [add_identity_request_details.csv](support-files/add_identity_request_details.csv) - This support file contains sample list of data that is used to create new identities. |
| 99 | +2. [biometrics_data.txt](support-files/biometrics_data.txt) - This support file contains sample encrypted bio data |
| 100 | +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 | +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. |
0 commit comments