HC Test: update persistence suite
[csit.git] / resources / libraries / python / honeycomb / HcPersistence.py
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))
+
+    @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"))