From acab647f368b6483cc2cdad8a868d5a2b41d0ce9 Mon Sep 17 00:00:00 2001 From: Marek Gradzki Date: Wed, 16 May 2018 13:08:45 +0200 Subject: [PATCH] HC Tests: adapt NAT tests to ietf-nat@2018-02-23.yang (CSIT-1086) Requires: https://gerrit.fd.io/r/#/c/12516/ Change-Id: Ie0a3452f51fb89914a6a0c53aa4136279a3dfb47 Signed-off-by: Marek Gradzki --- resources/libraries/python/honeycomb/NAT.py | 8 ++++---- resources/libraries/robot/honeycomb/nat.robot | 2 +- resources/templates/honeycomb/config_nat.url | 2 +- resources/templates/honeycomb/oper_nat.url | 2 +- resources/test_data/honeycomb/nat.py | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/resources/libraries/python/honeycomb/NAT.py b/resources/libraries/python/honeycomb/NAT.py index 6ad9881333..759b801026 100644 --- a/resources/libraries/python/honeycomb/NAT.py +++ b/resources/libraries/python/honeycomb/NAT.py @@ -75,10 +75,10 @@ class NATKeywords(object): if status_code != HTTPCodes.OK: raise HoneycombError("Could not retrieve NAT operational data.") - if "nat-state" not in resp.keys(): + if "nat" not in resp.keys(): raise HoneycombError( - "Unexpected format, response does not contain nat-state.") - return resp['nat-state'] + "Unexpected format, response does not contain nat container.") + return resp['nat'] @staticmethod def configure_nat_entries(node, data, instance=0, entry=1): @@ -98,7 +98,7 @@ class NATKeywords(object): return NATKeywords._set_nat_properties( node, - '/nat-instances/nat-instance/{0}/' + '/instances/instance/{0}/' 'mapping-table/mapping-entry/{1}/'.format(instance, entry), data) diff --git a/resources/libraries/robot/honeycomb/nat.robot b/resources/libraries/robot/honeycomb/nat.robot index 0ca9f8964a..c02507f412 100644 --- a/resources/libraries/robot/honeycomb/nat.robot +++ b/resources/libraries/robot/honeycomb/nat.robot @@ -65,7 +65,7 @@ | | [Arguments] | ${node} | ${settings} | ${instance}=0 | | ${data}= | Get NAT Oper data | ${node} | | ${data}= | Set Variable -| | ... | ${data['nat-instances']['nat-instance'][${instance}]['mapping-table']} +| | ... | ${data['instances']['instance'][${instance}]['mapping-table']} | | Compare data structures | ${data} | ${settings} | Honeycomb configures NAT on interface diff --git a/resources/templates/honeycomb/config_nat.url b/resources/templates/honeycomb/config_nat.url index 5471493c2d..6c29a8846b 100644 --- a/resources/templates/honeycomb/config_nat.url +++ b/resources/templates/honeycomb/config_nat.url @@ -1 +1 @@ -/restconf/config{odl_url_part}/ietf-nat:nat-config \ No newline at end of file +/restconf/config{odl_url_part}/ietf-nat:nat \ No newline at end of file diff --git a/resources/templates/honeycomb/oper_nat.url b/resources/templates/honeycomb/oper_nat.url index a0101bb6de..672fc739a3 100644 --- a/resources/templates/honeycomb/oper_nat.url +++ b/resources/templates/honeycomb/oper_nat.url @@ -1 +1 @@ -/restconf/operational{odl_url_part}/ietf-nat:nat-state \ No newline at end of file +/restconf/operational{odl_url_part}/ietf-nat:nat \ No newline at end of file diff --git a/resources/test_data/honeycomb/nat.py b/resources/test_data/honeycomb/nat.py index a7c4b3adcd..03544e1b54 100644 --- a/resources/test_data/honeycomb/nat.py +++ b/resources/test_data/honeycomb/nat.py @@ -33,8 +33,8 @@ def get_variables(node, interface): variables = { "nat_empty": { - 'nat-instances': { - 'nat-instance': [{ + 'instances': { + 'instance': [{ 'id': 0}] } }, -- 2.16.6