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

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

The newest version!
---
Test
---
!***> definitions
!define RESPONSE_0 { {{{Unknown (254), ID 111
NAS-Identifier: foo.bar.org
Callback-Id: simple-reply
Proxy-State: 0x0012
Reply-Message: [NAS-Identifier: foo.bar.org][Callback-Id: simple-reply][Proxy-State: 0x0012]}}} }

!define RESPONSE_1 { {{{Unknown (254), ID 222
NAS-Identifier: foo.bar.org
Callback-Id: multi-reply
Proxy-State: 0x0014
Reply-Message: NAS-Identifier: foo.bar.org
Reply-Message: Callback-Id: multi-reply
Reply-Message: Proxy-State: 0x0014}}} }
*!
!2 Get Data from RADIUS 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 Response.

|script               |radius client fixture                                                                                         |
|load radius generic endpoint                                                                                                        |
|set packet type      |254                                                                                                           |
|set request id       |111                                                                                                           |
|set request attribute|NAS-Identifier    |with value   |foo.bar.org                                                                  |
|set request attribute|Callback-Id       |with value   |simple-reply                                                                 |
|set request attribute|Proxy-State       |with value   |0x0012                                                                       |
|check                |send packet       |Unknown (254)                                                                              |
|check                |response id       |111                                                                                        |
|check                |response attribute|Proxy-State  |0x0012                                                                       |
|check                |response attribute|Reply-Message|[NAS-Identifier: foo.bar.org][Callback-Id: simple-reply][Proxy-State: 0x0012]|
|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 generic endpoint                                                                                                     |
|set packet type      |254                                                                                                        |
|set request id       |222                                                                                                        |
|set request attribute|NAS-Identifier    |with value   |foo.bar.org                                                               |
|set request attribute|Callback-Id       |with value   |multi-reply                                                               |
|set request attribute|Proxy-State       |with value   |0x0014                                                                    |
|check                |send packet       |Unknown (254)                                                                           |
|check                |response id       |222                                                                                     |
|check                |response attribute|Proxy-State  |0x0014                                                                    |
|check                |response attribute|Reply-Message|NAS-Identifier: foo.bar.org, Callback-Id: multi-reply, Proxy-State: 0x0014|
|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 array notation header.

|script               |radius client fixture                                            |
|load radius generic endpoint                                                           |
|set packet type      |254                                                              |
|set request id       |222                                                              |
|set request attribute|NAS-Identifier    |with value   |foo.bar.org                     |
|set request attribute|Callback-Id       |with value   |multi-reply                     |
|set request attribute|Proxy-State       |with value   |0x0014                          |
|check                |send packet       |Unknown (254)                                 |
|check                |response id       |222                                           |
|check                |response attribute|Proxy-State  |0x0014                          |
|check                |response attribute|Reply-Message|at|0|NAS-Identifier: foo.bar.org|
|check                |response attribute|Reply-Message|at|1|Callback-Id: multi-reply   |
|check                |response attribute|Reply-Message|at|2|Proxy-State: 0x0014        |
|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 generic endpoint                                                               |
|set packet type      |254                                                                  |
|set request id       |222                                                                  |
|set request attribute|NAS-Identifier    |with value   |foo.bar.org                         |
|set request attribute|Callback-Id       |with value   |multi-reply                         |
|set request attribute|Proxy-State       |with value   |0x0014                              |
|check                |send packet       |Unknown (254)                                     |
|check                |response id       |222                                               |
|check                |response attribute|Proxy-State  |0x0014                              |
|ensure               |response attribute|Reply-Message|contains|Proxy-State: 0x0014        |
|ensure               |response attribute|Reply-Message|contains|NAS-Identifier: foo.bar.org|
|ensure               |response attribute|Reply-Message|contains|Callback-Id: multi-reply   |
|check                |response          |${RESPONSE_1}                                     |





© 2015 - 2025 Weber Informatics LLC | Privacy Policy