MarketSquare / MarketSquare/Rammbock

Is it possible to define message values as optional?

Open
#82 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
64
Forks
48
PR merge metrics
No merged PRs in 30d

Description

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}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the GTP Create Response scenario in the issue, comparing an Accepted response with a failed response containing only Cause. Then trace the message definition and parsing behavior used by the Robot Framework keywords. Done means optional or conditionally present fields can be handled without rejecting valid responses, while the response values remain available for the checks shown.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.