All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Resources.FitNesseRoot.PlugIns.RadiusFixture.UserGuide.Accounting.Script.RetrieveResponseData.wiki Maven / Gradle / Ivy

The newest version!
---
Test
---
!***> definitions
!define RESPONSE_0 { {{{Accounting-Response, ID 111
Proxy-State: 0x0012
Reply-Message: Accounting Done!}}} }

!define RESPONSE_1 { {{{Accounting-Response, ID 222
Proxy-State: 0x0014
Reply-Message: Accounting Done!
Reply-Message: event: Start}}} }
*!
!2 Get Data from RADIUS Accounting Response Script Mode
Following examples show how to retrieve data from responses.

NOTE: RADIUS Mock Server returns customized ''Reply-Message'' when ''Callback-Id'' is set to ''simple-reply'' or ''multi-reply''.

!3 Single Data
Retrieve single data from RADIUS Accounting Response.

|script               |radius client fixture                            |
|load radius acct endpoint                                              |
|set request id       |111                                              |
|set request attribute|Acct-Status-Type  |with value   |Start           |
|set request attribute|Callback-Id       |with value   |simple-reply    |
|set request attribute|Proxy-State       |with value   |0x0012          |
|check                |send accounting   |Accounting-Response           |
|check                |response id       |111                           |
|check                |response attribute|Proxy-State  |0x0012          |
|check                |response attribute|Reply-Message|Accounting Done!|
|check                |response          |${RESPONSE_0}                 |

!3 Multiple Data in Single Field
When response attribute id refers to a list, values are concatenated together and split by comma.

|script               |radius client fixture                                          |
|load radius acct endpoint                                                            |
|set request id       |222                                                            |
|set request attribute|Acct-Status-Type  |with value   |Start                         |
|set request attribute|Callback-Id       |with value   |multi-reply                   |
|set request attribute|Proxy-State       |with value   |0x0014                        |
|check                |send accounting   |Accounting-Response                         |
|check                |response id       |222                                         |
|check                |response attribute|Proxy-State  |0x0014                        |
|check                |response attribute|Reply-Message|Accounting Done!, event: Start|
|check                |response          |${RESPONSE_1}                               |

!3 Multiple Data in Multiple Field
When response attribute id refers to a list, values can be retrieved one by one with method ''response attribute at''.

|script               |radius client fixture                                 |
|load radius acct endpoint                                                   |
|set request id       |222                                                   |
|set request attribute|Acct-Status-Type  |with value   |Start                |
|set request attribute|Callback-Id       |with value   |multi-reply          |
|set request attribute|Proxy-State       |with value   |0x0014               |
|check                |send accounting   |Accounting-Response                |
|check                |response id       |222                                |
|check                |response attribute|Proxy-State  |0x0014               |
|check                |response attribute|Reply-Message|at|0|Accounting Done!|
|check                |response attribute|Reply-Message|at|1|event: Start    |
|check                |response          |${RESPONSE_1}                      |

When attribute id refers to a list and order is not known, values can be checked one by one with method ''response attribute contains''.

|script               |radius client fixture                                     |
|load radius acct endpoint                                                       |
|set request id       |222                                                       |
|set request attribute|Acct-Status-Type  |with value   |Start                    |
|set request attribute|Callback-Id       |with value   |multi-reply              |
|set request attribute|Proxy-State       |with value   |0x0014                   |
|check                |send accounting   |Accounting-Response                    |
|check                |response id       |222                                    |
|check                |response attribute|Proxy-State  |0x0014                   |
|ensure               |response attribute|Reply-Message|contains|event: Start    |
|ensure               |response attribute|Reply-Message|contains|Accounting Done!|
|check                |response          |${RESPONSE_1}                          |





© 2015 - 2025 Weber Informatics LLC | Privacy Policy