Response check on DNS testcase for individual query is not proper
Test suit: DNS
TC_MEC_SRV_DNS_002_OK
[Documentation]
... Check that the IUT responds with the information on a specific DNS rule
... when queried by a MEC Application
...
... Reference ETSI GS MEC 011 V2.0.9, clause 7.2.10.3.1
... OpenAPI https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/v2.0.9/MecAppSupportApi.yaml#/definitions/DnsRule
[Tags] PIC_MEC_PLAT PIC_SERVICES
Get individual DNS rule ${APP_INSTANCE_ID} ${DNS_RULE_ID}
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is DnsRule
Check Result Contains ${response['body']['DnsRule']} dnsRuleId ${DNS_RULE_ID}
The testcase is retrieving an individual dns record and thus the body has to be an object just like below.
{
"seconds": 0.002054,
"status": 200,
"body": {
"dnsRuleId": "63684d55-cd66-43a5-975b-ea503c5edb00",
"domainName": "www.example.com",
"ipAddressType": "IP_V4",
"ipAddress": "192.0.2.0",
"ttl": 30,
"state": "ACTIVE"
},
"headers": {
"Content-Type": "application/json; charset=UTF-8",
"Server": "SERVICECENTER/0.0.1",
"Vary": "Accept-Encoding, Origin",
"X-Response-Status": "200",
"Date": "Sat, 23 May 2020 05:47:40 GMT",
"Content-Length": "158"
}
}
Here I could see two issues in below line
Check Result Contains ${response['body']['DnsRule']} dnsRuleId ${DNS_RULE_ID}
- Accessing ['DnsRule'] from body, which is different from the API specification.
- "Check Result Contains" consider the body as a list and check for value inside it, which is wrong. The body is just an object and containes a single dns entry.
Please check and update me if i'm wrong in understanding the script.