Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to define message values as optional? #82

Open
dzvancuks opened this issue May 15, 2024 · 0 comments
Open

Is it possible to define message values as optional? #82

dzvancuks opened this issue May 15, 2024 · 0 comments

Comments

@dzvancuks
Copy link

In GTP example Create Request defines what fields should be present. By this example I've managed to prepare Create Response. But unlike Request we may receive either predicted set of fields, or only part, all depending on Cause in Response.

For example. On Create Response where Cause is Accepted, there we can expect F-TEID of PGW. But if Cause is not Accepted (i.e. System Failure), then no additional fields will be present besides Cause itself.
Thus if in the test I expect failed Create procedure, then I define Create response with only Cause present. But due to some bug I receive Accepted response with additional fields present. And Robot FW fails on message parsing due to unknown fields are present.

[FAIL] Not enough data for 'F-TEID.ie_type'. Needs 1 bytes, given 0

So question is: can I define protocol where some fields and values might be optionally present? Or present if some condition is met?

Then I could define generic Create response and check if expected fields are present:

Test Failed Create Response
    [Tags]    GTPv2    Smoke
    Create Session Request
    Client Sends Message    APN.value.access_point_name:apn.to.fail.test
    Create Session Response    # here I want to have generic Response message applicable for most scenarios and than will be verified in lines below
    ${response}=     Client receives message    header:teid:0x12345
    Should Be Equal As Integers    ${response.Cause.value.cause}    ${Cause_MissingOrUnknownAPN}
    Should Be Empty    ${response.F-TEID}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant