From: selias Date: Tue, 22 Nov 2016 16:26:05 +0000 (+0100) Subject: CSIT-426: HC Test: Netconf transaction revert X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=commitdiff_plain;h=cbc22f742633725fb44e4a95b43a301a7da0355c CSIT-426: HC Test: Netconf transaction revert - add test cases for reverting Netconf transactions - minor fixes to existing Netconf test case Change-Id: Id6e5d26f815b14da29194181bf333e845f5b623c Signed-off-by: selias --- diff --git a/resources/test_data/honeycomb/netconf/triggers.py b/resources/test_data/honeycomb/netconf/triggers.py index 77596bd052..c3a72e4df4 100644 --- a/resources/test_data/honeycomb/netconf/triggers.py +++ b/resources/test_data/honeycomb/netconf/triggers.py @@ -16,7 +16,7 @@ # Test data for issue: https://jira.fd.io/browse/HONEYCOMB-105 # Creating and removing interfaces may result in duplicated interface indices. trigger_105 = u""" - + @@ -32,7 +32,7 @@ trigger_105 = u""" ]]>]]> - + @@ -41,7 +41,7 @@ trigger_105 = u""" ]]>]]> - + @@ -67,12 +67,12 @@ a:operation="replace"> ]]>]]> - + ]]>]]> - + @@ -81,7 +81,7 @@ a:operation="replace"> ]]>]]> - + @@ -90,7 +90,7 @@ a:operation="replace"> ]]>]]> - + @@ -108,12 +108,12 @@ a:operation="delete"> ]]>]]> - + ]]>]]> - + @@ -122,7 +122,7 @@ a:operation="delete"> ]]>]]> - + @@ -131,7 +131,7 @@ a:operation="delete"> ]]>]]> - + @@ -157,12 +157,12 @@ a:operation="replace"> ]]>]]> - + ]]>]]> - + @@ -171,7 +171,7 @@ a:operation="replace"> ]]>]]> - + @@ -180,7 +180,7 @@ a:operation="replace"> ]]>]]> - + @@ -206,12 +206,12 @@ a:operation="replace"> ]]>]]> - + ]]>]]> - + @@ -220,7 +220,7 @@ a:operation="replace"> ]]>]]> - + @@ -229,7 +229,7 @@ a:operation="replace"> ]]>]]> - + @@ -255,12 +255,12 @@ a:operation="replace"> ]]>]]> - + ]]>]]> - + @@ -269,7 +269,7 @@ a:operation="replace"> ]]>]]> - + @@ -278,7 +278,7 @@ a:operation="replace"> ]]>]]> - + @@ -303,12 +303,12 @@ a:operation="replace"> ]]>]]> - + ]]>]]> - + @@ -317,7 +317,7 @@ a:operation="replace"> ]]>]]> - + @@ -326,7 +326,7 @@ a:operation="replace"> ]]>]]> - + @@ -334,3 +334,113 @@ a:operation="replace"> ]]>]]>""" + +# Test data for issue: https://jira.fd.io/browse/HONEYCOMB-255 +# Reverting transaction fails with "missing writer" +trigger_revert1 = u""" + + + + + + + + +vxlan3 + + v3po:vxlan-tunnel +true + +192.168.1.6 +192.168.1.7 +9 +0 + + + + + + +]]>]]> + + + + + + + + + +vxlan4 + + v3po:vxlan-tunnel +true + +192.168.1.6 +192.168.1.7 +9 +0 + + + + + + +]]>]]> + + + + + ]]>]]>""" + +# Test data for issue: https://jira.fd.io/browse/HONEYCOMB-255, part 2 +# Reverting transaction fails with "transaction has been closed" +trigger_revert2 = u""" + + + + + + + + +tap +v3po:tap +true + +tap + + + + + + +]]>]]> + + + + + + + + + +tap2 +v3po:tap +true + +tap + + + + + + +]]>]]> + + + + + ]]>]]>""" \ No newline at end of file diff --git a/tests/func/honeycomb/070_netconf.robot b/tests/func/honeycomb/070_netconf.robot index 3f2244633f..f74947ccf0 100644 --- a/tests/func/honeycomb/070_netconf.robot +++ b/tests/func/honeycomb/070_netconf.robot @@ -15,6 +15,9 @@ | Resource | resources/libraries/robot/default.robot | Resource | resources/libraries/robot/honeycomb/honeycomb.robot | Resource | resources/libraries/robot/honeycomb/netconf.robot +| Resource | resources/libraries/robot/honeycomb/bridge_domain.robot +| Library | resources.libraries.python.honeycomb.HcAPIKwInterfaces.InterfaceKeywords +| ... | WITH NAME | InterfaceAPI | Variables | resources/test_data/honeycomb/netconf/triggers.py | Documentation | *Netconf test suite. Contains test cases that need to bypass\ | ... | REST API.* @@ -22,11 +25,35 @@ | Suite Teardown | Run Keyword If Any Tests Failed | ... | Restart Honeycomb And VPP And Clear Persisted Configuration | ${node} +*** Variables *** +| &{bd_settings}= | flood=${True} | forward=${True} | learn=${True} +| ... | unknown-unicast-flood=${True} | arp-termination=${True} + *** Test Cases *** | Honeycomb can create and delete interfaces | | [Documentation] | Repeatedly create and delete an interface through Netconf\ | | ... | and check the reply for any errors. | | Given Netconf session is established | ${node} +| | And Honeycomb creates first L2 bridge domain +| | ... | ${node} | bd_netconf | ${bd_settings} | | :FOR | ${index} | IN RANGE | 20 | | | When Error trigger is sent | ${trigger_105} | | | Then Replies should not contain RPC errors + +| Transaction revert test case 1 +| | [Documentation] | Configure two conflicting VxLAN tunnels, then verify\ +| | ... | that neither tunnel exists. +| | Given Netconf session is established | ${node} +| | ${if_data}= | And InterfaceAPI.Get all interfaces oper data | ${node} +| | When Error trigger is sent | ${trigger_revert1} +| | ${if_data_new}= | And InterfaceAPI.Get all interfaces oper data | ${node} +| | Then Should be equal | ${if_data} | ${if_data_new} + +| Transaction revert test case 2 +| | [Documentation] | Configure two conflicting TAP interfaces, then verify\ +| | ... | that neither interface exists. +| | Given Netconf session is established | ${node} +| | ${if_data}= | And InterfaceAPI.Get all interfaces oper data | ${node} +| | When Error trigger is sent | ${trigger_revert1} +| | ${if_data_new}= | And InterfaceAPI.Get all interfaces oper data | ${node} +| | Then Should be equal | ${if_data} | ${if_data_new}