def test_ccp_idempotency_with_ready_ssh_keys(self, ssh_keys_dir,
config, underlay,
k8s_actions):
"""Test for deploying an k8s environment and check it
pytest.mark: k8s_installed_with_ready_ssh_keys
Scenario:
1. Install k8s (with prepared ssh keys).
2. Check that count of changes in the ansible log is more than 0
3. Re-install k8s (with prepared ssh keys).
4. Check that count of changes in the ansible log is 0
"""
add_var = {
"WORKSPACE": ssh_keys_dir
}
result = k8s_actions.install_k8s(env_var=add_var,
verbose=False)
changed = self.get_ansible_changes_count(result.stdout_str)
assert changed != 0, "No changes during k8s install!"
result = k8s_actions.install_k8s(env_var=add_var,
verbose=False)
changed = self.get_ansible_changes_count(result.stdout_str)
assert changed == 0, (
"Should be no changes during the second install "
"of k8s while there are '{0}' changes!".format(changed))
评论列表
文章目录