Implement automated tests for MAAS backup/restore
Related-PROD: PROD-32673
Change-Id: Iaa4e5e132cb709cb4133af158a3fa284280c9f79
diff --git a/tcp_tests/managers/reclass_manager.py b/tcp_tests/managers/reclass_manager.py
index 0e1133c..096e468 100644
--- a/tcp_tests/managers/reclass_manager.py
+++ b/tcp_tests/managers/reclass_manager.py
@@ -69,6 +69,19 @@
path=short_path
))
+ def get_key(self, key, short_path):
+ """Find a key in a YAML
+
+ :param key: string, parameter to add
+ :param short_path: path to reclass yaml file.
+ It takes into account default path where the reclass is located.
+ May look like cluster/*/cicd/control/leader.yml
+ :return: str, key if found
+ """
+ return self.ssh.check_call(
+ "{reclass_tools} get-key {key} /srv/salt/reclass/classes".format(
+ reclass_tools=self.reclass_tools_cmd, key=key))
+
def add_bool_key(self, key, value, short_path):
"""
Shows alert if key exists
diff --git a/tcp_tests/managers/saltmanager.py b/tcp_tests/managers/saltmanager.py
index 226f408..0ecef46 100644
--- a/tcp_tests/managers/saltmanager.py
+++ b/tcp_tests/managers/saltmanager.py
@@ -271,6 +271,14 @@
result = self.local(tgt=tgt, fun='service.stop', args=service)
return result['return']
+ def pkg_install(self, tgt, pkg):
+ result = self.local(tgt=tgt, fun='pkg.install', args=pkg)
+ return result['return']
+
+ def pkg_info_installed(self, tgt, pkg):
+ result = self.local(tgt=tgt, fun='pkg.info_installed', args=pkg)
+ return result['return']
+
def cmd_run(self, tgt, cmd):
result = self.local(tgt=tgt, fun='cmd.run', args=cmd)
return result['return']