diff options
author | selias <samelias@cisco.com> | 2016-06-08 15:51:19 +0200 |
---|---|---|
committer | Samuel Eliáš <samelias@cisco.com> | 2016-06-24 10:57:28 +0000 |
commit | bcf99a0eb0e8770f28c2e3c8c0965ad6c0acba94 (patch) | |
tree | 90c73f9c96cb67245157874c99913822302bf093 | |
parent | 95253bdf705a06ec01c2a04f437bae2ef23355c3 (diff) |
Update Honeycomb persistence tests with new Vlan
JIRA: CSIT-140
- add new vlan configuration to persistence
Change-Id: I984f39986f74168b31d82143c353c7ef1bd7d650
Signed-off-by: selias <samelias@cisco.com>
-rw-r--r-- | resources/libraries/robot/honeycomb/persistence.robot | 64 | ||||
-rw-r--r-- | tests/suites/honeycomb/7 - persistence.robot | 41 | ||||
-rw-r--r-- | tests/suites/honeycomb/resources/persistence.py | 104 |
3 files changed, 145 insertions, 64 deletions
diff --git a/resources/libraries/robot/honeycomb/persistence.robot b/resources/libraries/robot/honeycomb/persistence.robot index 1c23915aca..f05fe4d5e5 100644 --- a/resources/libraries/robot/honeycomb/persistence.robot +++ b/resources/libraries/robot/honeycomb/persistence.robot @@ -102,29 +102,13 @@ | | ... | ${node} | ${tap_interface} | ${tap_settings} | | Honeycomb creates vhost-user interface | | ... | ${node} | ${vhost_interface} | ${vhost_user_server} -| | Honeycomb creates sub-interface -| | ... | ${node} | ${interface} | ${sub_interface_id} -| | ... | ${sub_interface_base_settings} | ${sub_interface_settings} +| | Honeycomb creates sub-interface | ${node} | ${interface} +| | ... | ${sub_if_1_match} | ${sub_if_1_tags} | ${sub_if_1_settings} | | Honeycomb sets interface state | ${node} | ${interface} | up -| | VxLAN configuration from Honeycomb should be -| | ... | ${node} | ${vx_interface} | ${vxlan_settings} -| | VxLAN configuration from VAT should be -| | ... | ${node} | ${vxlan_settings} -| | Bridge domain configuration from Honeycomb should be -| | ... | ${node} | ${bd_name} | ${bd_settings} -| | Bridge domain configuration from VAT should be -| | ... | ${node} | ${0} | ${bd_settings} -| | TAP configuration from Honeycomb should be -| | ... | ${node} | ${tap_interface} | ${tap_settings} -| | TAP configuration from VAT should be -| | ... | ${node} | ${tap_interface} | ${tap_settings} -| | Sub-interface configuration from Honeycomb should be -| | ... | ${node} | ${sub_interface_name} | ${sub_interface_base_settings} -| | ... | ${sub_interface_settings} -| | Sub-interface configuration from VAT should be -| | ... | ${node} | ${sub_interface_name} | ${sub_interface_settings} -| | Interface state from Honeycomb should be | ${node} | ${interface} | up -| | Interface state from VAT should be | ${node} | ${interface} | up +| | Honeycomb sets the sub-interface up +| | ... | ${node} | ${interface} | ${sub_if_id} +| | Honeycomb adds sub-interface to bridge domain +| | ... | ${node} | ${interface} | ${sub_if_id} | ${sub_bd_settings} | Honeycomb and VPP should verify every setting | | [Documentation] | Uses Honeycomb and VAT to verify settings for VxLAN,\ @@ -156,12 +140,15 @@ | | Vhost-user configuration from VAT should be | | ... | ${node} | ${vhost_user_server} | | Sub-interface configuration from Honeycomb should be -| | ... | ${node} | ${sub_interface_name} | ${sub_interface_base_settings} -| | ... | ${sub_interface_settings} +| | ... | ${node} | ${interface} | ${sub_if_id} | ${sub_if_1_oper} | | Sub-interface configuration from VAT should be -| | ... | ${node} | ${sub_interface_name} | ${sub_interface_settings} +| | ... | ${node} | ${sub_if_name} | ${sub_if_1_oper} | | Interface state from Honeycomb should be | ${node} | ${interface} | up | | Interface state from VAT should be | ${node} | ${interface} | up +| | Sub-interface bridge domain configuration from Honeycomb should be +| | ... | ${node} | ${interface} | ${sub_if_id} | ${sub_bd_settings} +| | Sub-interface bridge domain configuration from VAT should be +| | ... | ${node} | ${sub_if_name} | ${sub_bd_settings} | Honeycomb and VPP should have default configuration | | [Documentation] | Uses Honeycomb and VAT to verify settings for VxLAN,\ @@ -189,10 +176,27 @@ | | ... | ${node} | ${vhost_interface} | | Vhost-user configuration from VAT should be empty | | ... | ${node} -| | Sub-interface configuration from Honeycomb should be empty -| | ... | ${node} | ${sub_interface_name} -| | Sub-interface configuration from VAT should be empty -| | ... | ${node} | ${sub_interface_name} +| | interface state from Honeycomb should be +| | ... | ${node} | ${interface} | down +| | And interface state from VAT should be +| | ... | ${node} | ${interface} | down + +| Honeycomb and VPP should not have default configuration +| | [Documentation] | Uses Honeycomb and VAT to verify settings for VxLAN,\ +| | ... | bridge domains, TAP, vhost-user and VLAN. Expects any\ +| | ... | configuration other than default. +| | ... +| | ... | *Arguments:* +| | ... | - node - information about a DUT node. Type: dictionary +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Honeycomb and VPP should not have default configuration \ +| | ... | \| ${nodes['DUT1']} \| +| | [Arguments] | ${node} +| | Run keyword and expect error | * +| | ... | Honeycomb and VPP should have default configuration | ${node} + | Honeycomb should show no rogue interfaces | | [Documentation] | Checks if operational data contains interfaces not\ @@ -223,4 +227,4 @@ | | Stop Honeycomb service on DUTs | ${node} | | Modify persistence files | ${node} | { | abc | | Setup DUT | ${node} -| | Setup Honeycomb service on DUTs | ${node}
\ No newline at end of file +| | Setup Honeycomb service on DUTs | ${node} diff --git a/tests/suites/honeycomb/7 - persistence.robot b/tests/suites/honeycomb/7 - persistence.robot index 24043c343c..f992b64010 100644 --- a/tests/suites/honeycomb/7 - persistence.robot +++ b/tests/suites/honeycomb/7 - persistence.robot @@ -19,28 +19,24 @@ *** Settings *** | Resource | resources/libraries/robot/default.robot | Resource | resources/libraries/robot/honeycomb/persistence.robot -# Restart Honeycomb and VPP to clear configuration before tests. -| Suite Setup | Run keywords -| ... | Stop Honeycomb service on DUTs | ${node} | AND -| ... | Clear persisted Honeycomb configuration | ${node} | AND -| ... | Setup DUT | ${node} | AND -| ... | Setup Honeycomb service on DUTs | ${node} +| Suite Setup | Restart Honeycomb and VPP and clear persisted configuration +| ... | ${node} | Documentation | *Honeycomb configuration persistence test suite.* +| Force Tags | honeycomb_sanity *** Test Cases *** -| Honeycomb persists configuration through restart of both systems +| Honeycomb persists configuration through restart of both Honeycomb and VPP | | [Documentation] | Checks if Honeycomb maintains configuration after both\ | | ... | Honeycomb and VPP are restarted. -| | [Tags] | honeycomb_sanity -| | When Honeycomb configures every setting | ${node} | ${interface} -| | And Honeycomb and VPP are restarted | ${node} +| | Given Honeycomb configures every setting | ${node} | ${interface} +| | And Honeycomb and VPP should verify every setting | ${node} | ${interface} +| | When Honeycomb and VPP are restarted | ${node} | | Then Honeycomb and VPP should verify every setting | ${node} | ${interface} | | And Honeycomb should show no rogue interfaces | ${node} | Honeycomb persists configuration through restart of Honeycomb | | [Documentation] | Checks if Honeycomb maintains configuration after it\ | | ... | is restarted. -| | [Tags] | honeycomb_sanity | | Given Honeycomb and VPP should verify every setting | ${node} | ${interface} | | When Honeycomb is restarted | ${node} | | Then Honeycomb and VPP should verify every setting | ${node} | ${interface} @@ -49,7 +45,6 @@ | Honeycomb persists configuration through restart of VPP | | [Documentation] | Checks if Honeycomb updates VPP settings after VPP is\ | | ... | restarted. -| | [Tags] | honeycomb_sanity | | Given Honeycomb and VPP should verify every setting | ${node} | ${interface} | | When VPP is restarted | ${node} | | Then Honeycomb and VPP should verify every setting | ${node} | ${interface} @@ -58,7 +53,25 @@ | Honeycomb reverts to defaults if persistence files are invalid | | [Documentation] | Checks if Honeycomb reverts to default configuration when\ | | ... | persistence files are damaged or invalid. -| | [Tags] | honeycomb_sanity -| | Given Honeycomb and VPP should verify every setting | ${node} | ${interface} +| | [Teardown] | Run keyword if test failed +| | ... | Restart both systems and clear persisted configuration | ${node} +| | Given Honeycomb and VPP should not have default configuration | ${node} | | When Persistence file is damaged during restart | ${node} | | Then Honeycomb and VPP should have default configuration | ${node} + +*** Keywords *** +| Restart Honeycomb and VPP and clear persisted configuration +| | [Documentation] | Restarts Honeycomb and VPP with default configuration. +| | ... +| | ... | *Arguments:* +| | ... | - node - information about a DUT node. Type: dictionary +| | ... +| | ... | *Example:* +| | ... +| | ... | Restart both systems and clear persisted configuration \ +| | ... | \| ${nodes['DUT1']} \| +| | [Arguments] | ${node} +| | Stop Honeycomb service on DUTs | ${node} +| | Clear persisted Honeycomb configuration | ${node} +| | Setup DUT | ${node} +| | Setup Honeycomb service on DUTs | ${node}
\ No newline at end of file diff --git a/tests/suites/honeycomb/resources/persistence.py b/tests/suites/honeycomb/resources/persistence.py index d47ea662f9..f46cfba597 100644 --- a/tests/suites/honeycomb/resources/persistence.py +++ b/tests/suites/honeycomb/resources/persistence.py @@ -22,9 +22,10 @@ def get_variables(interface): :return: dictionary of test variables :rtype: dict """ - # Vlan subinterface basic settings - sub_interface_id = 10 - sub_interface_name = interface + '.' + str(sub_interface_id) + # basic settings + bd_name = 'bd_persist' + sub_if_id = 1 + sub_if_name = interface + '.' + str(sub_if_id) variables = { # VxLan settings @@ -34,7 +35,7 @@ def get_variables(interface): "vni": 88, 'encap-vrf-id': 0}, # bridge domain settings - 'bd_name': 'bd_persist', + 'bd_name': bd_name, 'bd_settings': {'flood': True, 'forward': True, 'learn': True, @@ -53,22 +54,85 @@ def get_variables(interface): 'role': 'server' }, # Vlan subinterface settings - 'sub_interface_id': sub_interface_id, - 'sub_interface_name': sub_interface_name, - 'sub_interface_base_settings': {'name': sub_interface_name, - 'type': 'v3po:sub-interface' - }, - 'sub_interface_settings': { - 'super-interface': interface, - 'identifier': sub_interface_id, - 'vlan-type': '802dot1ad', - 'number-of-tags': 2, - 'outer-id': 22, - 'inner-id': 33, - 'match-any-outer-id': False, - 'match-any-inner-id': False, - 'exact-match': True, - 'default-subif': True + 'sub_if_id': sub_if_id, + 'sub_if_name': sub_if_name, + 'sub_if_1_settings': { + "identifier": sub_if_id, + "vlan-type": "802dot1q", + "enabled": "false" + }, + 'sub_if_1_tags': [ + { + "index": "0", + "dot1q-tag": { + "tag-type": "dot1q-types:s-vlan", + "vlan-id": "100" + } + }, + { + "index": "1", + "dot1q-tag": { + "tag-type": "dot1q-types:c-vlan", + "vlan-id": "any" + } + } + ], + 'sub_if_1_match': "vlan-tagged-exact-match", + 'sub_if_1_oper': { + "identifier": sub_if_id, + "oper-status": "up", + "admin-status": "up", + "tags": { + "tag": [ + { + "index": 1, + "dot1q-tag": { + "tag-type": "dot1q-types:c-vlan", + "vlan-id": "any" + } + }, + { + "index": 0, + "dot1q-tag": { + "tag-type": "dot1q-types:s-vlan", + "vlan-id": "100" + } + } + ] + }, + "match": { + "vlan-tagged": { + "match-exact-tags": False + } + } + }, + 'sub_bd_settings': { + 'bridge-domain': bd_name, + 'split-horizon-group': '1', + 'bridged-virtual-interface': 'False' + }, + 'tag_rewrite_pop_1': { + "pop-tags": "1" + }, + + 'tag_rewrite_pop_1_oper': { + "vlan-type": "vpp-vlan:802dot1ad", + "pop-tags": 1 + }, + + 'tag_rewrite_pop_1_VAT': { + 'sub_default': 0, + 'sub_dot1ad': 0, + 'sub_exact_match': 0, + 'sub_inner_vlan_id': 0, + 'sub_inner_vlan_id_any': 1, + 'sub_number_of_tags': 2, + 'sub_outer_vlan_id': 100, + 'sub_outer_vlan_id_any': 0, + 'vtr_op': 3, + 'vtr_push_dot1q': 0, + 'vtr_tag1': 0, + 'vtr_tag2': 0 } } return variables |