def test_ccp_idempotency_with_etcd_on_host(self, config, underlay,
k8s_actions):
"""Test for deploying an k8s environment and check it
pytest.mark: k8s_installed_with_etcd_on_host
Scenario:
1. Install k8s with forced etcd on host.
2. Check that count of changes in the ansible log is more than 0
3. Re-install k8s with forced etcd on host.
4. Check that count of changes in the ansible log is 0
"""
kube_settings = dict()
kube_settings.update(self.kube_settings)
kube_settings.update({
'etcd_deployment_type': 'host',
'kube_network_plugin': 'calico'
})
result = k8s_actions.install_k8s(custom_yaml=kube_settings,
verbose=False)
changed = self.get_ansible_changes_count(result.stdout_str)
assert changed != 0, "No changes during k8s install!"
result = k8s_actions.install_k8s(custom_yaml=kube_settings,
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))
评论列表
文章目录