HC Test: update persistence suite 21/6221/4
authorselias <samelias@cisco.com>
Tue, 18 Apr 2017 10:01:27 +0000 (12:01 +0200)
committerTibor Frank <tifrank@cisco.com>
Tue, 18 Apr 2017 13:21:09 +0000 (13:21 +0000)
 - fix "enable persistence" is suite setup
 - update Jira links to persistence bug
 - log content of persistence file before each restart

Change-Id: I68ad759ded5d6bee277cf946953c11f19628a9e7
Signed-off-by: selias <samelias@cisco.com>
resources/libraries/python/honeycomb/HcPersistence.py
resources/libraries/robot/honeycomb/persistence.robot
tests/func/honeycomb/mgmt-statepersist-apihc-func.robot

index 83d756f..dae84bd 100644 (file)
@@ -142,3 +142,19 @@ class HcPersistence(object):
             if ret_code != 0:
                 raise HoneycombError("Failed to modify configuration on "
                                      "node {0}, {1}".format(node, stderr))
             if ret_code != 0:
                 raise HoneycombError("Failed to modify configuration on "
                                      "node {0}, {1}".format(node, stderr))
+
+    @staticmethod
+    def log_persisted_configuration(node):
+        """Read contents of Honeycomb persistence files and print to Robot log.
+
+        :param node: Honeycomb node.
+        :type node: dict
+        """
+
+        command = "cat /var/lib/honeycomb/persist/{0}/data.json"
+
+        ssh = SSH()
+        ssh.connect(node)
+
+        ssh.exec_command_sudo(command.format("config"))
+        ssh.exec_command_sudo(command.format("context"))
index aac9209..a1c08c2 100644 (file)
@@ -35,6 +35,7 @@
 | | ... | *Example:*
 | | ...
 | | ... | \| Honeycomb is restarted \| ${nodes['DUT1']} \|
 | | ... | *Example:*
 | | ...
 | | ... | \| Honeycomb is restarted \| ${nodes['DUT1']} \|
+| | ...
 | | [Arguments] | ${node}
 | | Stop Honeycomb service on DUTs | ${node}
 | | Log Persisted Configuration | ${node}
 | | [Arguments] | ${node}
 | | Stop Honeycomb service on DUTs | ${node}
 | | Log Persisted Configuration | ${node}
@@ -49,6 +50,7 @@
 | | ... | *Example:*
 | | ...
 | | ... | \| VPP is restarted \| ${nodes['DUT1']} \|
 | | ... | *Example:*
 | | ...
 | | ... | \| VPP is restarted \| ${nodes['DUT1']} \|
+| | ...
 | | [Arguments] | ${node}
 | | Setup DUT | ${node}
 | | Check VPP connection | ${node}
 | | [Arguments] | ${node}
 | | Setup DUT | ${node}
 | | Check VPP connection | ${node}
@@ -63,6 +65,7 @@
 | | ... | *Example:*
 | | ...
 | | ... | \| Check VPP connection \| ${nodes['DUT1']} \|
 | | ... | *Example:*
 | | ...
 | | ... | \| Check VPP connection \| ${nodes['DUT1']} \|
+| | ...
 | | [Arguments] | ${node}
 | | Wait until keyword succeeds | 2min | 20sec
 | | ... | Check Honeycomb startup state | ${node}
 | | [Arguments] | ${node}
 | | Wait until keyword succeeds | 2min | 20sec
 | | ... | Check Honeycomb startup state | ${node}
@@ -77,6 +80,7 @@
 | | ... | *Example:*
 | | ...
 | | ... | \| Honeycomb and VPP are restarted \| ${nodes['DUT1']} \|
 | | ... | *Example:*
 | | ...
 | | ... | \| Honeycomb and VPP are restarted \| ${nodes['DUT1']} \|
+| | ...
 | | [Arguments] | ${node}
 | | Stop Honeycomb service on DUTs | ${node}
 | | Log Persisted Configuration | ${node}
 | | [Arguments] | ${node}
 | | Stop Honeycomb service on DUTs | ${node}
 | | Log Persisted Configuration | ${node}
@@ -95,6 +99,7 @@
 | | ...
 | | ... | \| Honeycomb configures every setting \| ${nodes['DUT1']} \
 | | ... | \| GigabitEthernet0/8/0 \|
 | | ...
 | | ... | \| Honeycomb configures every setting \| ${nodes['DUT1']} \
 | | ... | \| GigabitEthernet0/8/0 \|
+| | ...
 | | [Arguments] | ${node} | ${interface}
 | | Honeycomb sets interface VxLAN configuration
 | | ... | ${node} | ${vx_interface} | ${vxlan_settings}
 | | [Arguments] | ${node} | ${interface}
 | | Honeycomb sets interface VxLAN configuration
 | | ... | ${node} | ${vx_interface} | ${vxlan_settings}
 | | ...
 | | ... | \| Honeycomb and VPP should verify every setting \| ${nodes['DUT1']} \
 | | ... | \| GigabitEthernet0/8/0 \|
 | | ...
 | | ... | \| Honeycomb and VPP should verify every setting \| ${nodes['DUT1']} \
 | | ... | \| GigabitEthernet0/8/0 \|
+| | ...
 | | [Arguments] | ${node} | ${interface}
 | | VxLAN configuration from Honeycomb should be
 | | ... | ${node} | ${vx_interface} | ${vxlan_settings}
 | | [Arguments] | ${node} | ${interface}
 | | VxLAN configuration from Honeycomb should be
 | | ... | ${node} | ${vx_interface} | ${vxlan_settings}
 | | ...
 | | ... | \| Honeycomb and VPP should have default configuration \|
 | | ... | ${nodes['DUT1']} \|
 | | ...
 | | ... | \| Honeycomb and VPP should have default configuration \|
 | | ... | ${nodes['DUT1']} \|
+| | ...
 | | [Arguments] | ${node}
 | | VxLAN configuration from Honeycomb should be empty
 | | ... | ${node} | ${vx_interface}
 | | [Arguments] | ${node}
 | | VxLAN configuration from Honeycomb should be empty
 | | ... | ${node} | ${vx_interface}
 | | ...
 | | ... | \| Honeycomb and VPP should not have default configuration \
 | | ... | \| ${nodes['DUT1']} \|
 | | ...
 | | ... | \| 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}
 
 | | [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\
 | | ... | present in configuration and vice versa.
 | Honeycomb should show no rogue interfaces
 | | [Documentation] | Checks if operational data contains interfaces not\
 | | ... | present in configuration and vice versa.
 | | ... | *Example:*
 | | ...
 | | ... | \| Honeycomb should show no rogue interfaces \| ${nodes['DUT1']} \|
 | | ... | *Example:*
 | | ...
 | | ... | \| Honeycomb should show no rogue interfaces \| ${nodes['DUT1']} \|
+| | ...
 | | [Arguments] | ${node}
 | | ${data_conf}= | InterfaceAPI.Get all interfaces cfg data | ${node}
 | | ${data_oper}= | InterfaceAPI.Get all interfaces oper data | ${node}
 | | [Arguments] | ${node}
 | | ${data_conf}= | InterfaceAPI.Get all interfaces cfg data | ${node}
 | | ${data_oper}= | InterfaceAPI.Get all interfaces oper data | ${node}
 | | ... | *Example:*
 | | ...
 | | ... | \| Persistence file is damaged during restart \| ${nodes['DUT1']} \|
 | | ... | *Example:*
 | | ...
 | | ... | \| Persistence file is damaged during restart \| ${nodes['DUT1']} \|
+| | ...
 | | [Arguments] | ${node}
 | | Stop Honeycomb service on DUTs | ${node}
 | | Modify persistence files | ${node} | { | abc
 | | Setup DUT | ${node}
 | | Setup Honeycomb service on DUTs | ${node}
 | | [Arguments] | ${node}
 | | Stop Honeycomb service on DUTs | ${node}
 | | Modify persistence files | ${node} | { | abc
 | | Setup DUT | ${node}
 | | Setup Honeycomb service on DUTs | ${node}
+
+| Log persisted configuration on node
+| | [Documentation] | Logs the content of Honeycomb's persitence files.
+| | ...
+| | ... | *Arguments:*
+| | ... | - node - information about a DUT node. Type: dictionary
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| Log persisted configuration on node \| ${nodes['DUT1']} \|
+| | ...
+| | [Arguments] | ${node}
+| | Log persisted configuration | ${node}
\ No newline at end of file
index 8aebe74..28746e6 100644 (file)
@@ -19,8 +19,8 @@
 | Resource | resources/libraries/robot/default.robot
 | Resource | resources/libraries/robot/honeycomb/persistence.robot
 | Suite Setup | Run Keywords
 | Resource | resources/libraries/robot/default.robot
 | Resource | resources/libraries/robot/honeycomb/persistence.robot
 | Suite Setup | Run Keywords
+| ... | Configure Persistence | ${node} | enable | AND
 | ... | Restart Honeycomb And VPP And Clear Persisted Configuration | ${node}
 | ... | Restart Honeycomb And VPP And Clear Persisted Configuration | ${node}
-| ... | AND | Configure Persistence | ${node} | enable
 | Suite Teardown | Configure Persistence | ${node} | disable
 | Force Tags | honeycomb_sanity
 | Documentation | *Honeycomb configuration persistence test suite.*
 | Suite Teardown | Configure Persistence | ${node} | disable
 | Force Tags | honeycomb_sanity
 | Documentation | *Honeycomb configuration persistence test suite.*
 | TC01: Honeycomb persists configuration through restart of both Honeycomb and VPP
 | | [Documentation] | Checks if Honeycomb maintains configuration after both\
 | | ... | Honeycomb and VPP are restarted.
 | TC01: Honeycomb persists configuration through restart of both Honeycomb and VPP
 | | [Documentation] | Checks if Honeycomb maintains configuration after both\
 | | ... | Honeycomb and VPP are restarted.
-# Vxlan tunnel name is sometimes not properly restored (HONEYCOMB-301)
+# Vxlan tunnel name is sometimes not properly restored (HC2VPP-47)
 | | [Tags] | EXPECTED_FAILING
 | | Given Honeycomb configures every setting | ${node} | ${interface}
 | | And Honeycomb and VPP should verify every setting | ${node} | ${interface}
 | | [Tags] | EXPECTED_FAILING
 | | Given Honeycomb configures every setting | ${node} | ${interface}
 | | And Honeycomb and VPP should verify every setting | ${node} | ${interface}
+| | And Log persisted configuration on node | ${node}
 | | 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}
 | | 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}
 | TC02: Honeycomb persists configuration through restart of Honeycomb
 | | [Documentation] | Checks if Honeycomb maintains configuration after it\
 | | ... | is restarted.
 | TC02: Honeycomb persists configuration through restart of Honeycomb
 | | [Documentation] | Checks if Honeycomb maintains configuration after it\
 | | ... | is restarted.
-# Vxlan tunnel name is sometimes not properly restored (HONEYCOMB-301)
+# Vxlan tunnel name is sometimes not properly restored (HC2VPP-47)
 | | [Tags] | EXPECTED_FAILING
 | | Given Honeycomb and VPP should verify every setting | ${node} | ${interface}
 | | [Tags] | EXPECTED_FAILING
 | | Given Honeycomb and VPP should verify every setting | ${node} | ${interface}
+| | And Log persisted configuration on node | ${node}
 | | When Honeycomb is restarted | ${node}
 | | Then Honeycomb and VPP should verify every setting | ${node} | ${interface}
 | | And Honeycomb should show no rogue interfaces | ${node}
 | | When Honeycomb is restarted | ${node}
 | | Then Honeycomb and VPP should verify every setting | ${node} | ${interface}
 | | And Honeycomb should show no rogue interfaces | ${node}
 | TC03: Honeycomb persists configuration through restart of VPP
 | | [Documentation] | Checks if Honeycomb updates VPP settings after VPP is\
 | | ... | restarted.
 | TC03: Honeycomb persists configuration through restart of VPP
 | | [Documentation] | Checks if Honeycomb updates VPP settings after VPP is\
 | | ... | restarted.
-# Vxlan tunnel name is sometimes not properly restored (HONEYCOMB-301)
+# Vxlan tunnel name is sometimes not properly restored (HC2VPP-47)
 | | [Tags] | EXPECTED_FAILING
 | | Given Honeycomb and VPP should verify every setting | ${node} | ${interface}
 | | [Tags] | EXPECTED_FAILING
 | | Given Honeycomb and VPP should verify every setting | ${node} | ${interface}
+| | And Log persisted configuration on node | ${node}
 | | When VPP is restarted | ${node}
 | | Then Honeycomb and VPP should verify every setting | ${node} | ${interface}
 | | And Honeycomb should show no rogue interfaces | ${node}
 | | When VPP is restarted | ${node}
 | | Then Honeycomb and VPP should verify every setting | ${node} | ${interface}
 | | And Honeycomb should show no rogue interfaces | ${node}