2023-06-03 02:38:28 -04:00
|
|
|
{ kubenix, test, ... }: {
|
|
|
|
|
imports = [ kubenix.modules.test ];
|
2019-03-07 23:24:28 +01:00
|
|
|
|
|
|
|
|
test = {
|
2022-08-29 02:04:47 -04:00
|
|
|
name = "example";
|
|
|
|
|
description = "can reach deployment";
|
2021-05-13 22:58:11 -04:00
|
|
|
script = ''
|
2021-05-31 21:45:22 -05:00
|
|
|
@pytest.mark.applymanifest('${test.kubernetes.resultYAML}')
|
2021-05-13 22:58:11 -04:00
|
|
|
def test_nginx_deployment(kube):
|
|
|
|
|
"""Tests whether nginx deployment gets successfully created"""
|
|
|
|
|
kube.wait_for_registered(timeout=30)
|
|
|
|
|
deployments = kube.get_deployments()
|
|
|
|
|
nginx_deploy = deployments.get('nginx')
|
|
|
|
|
assert nginx_deploy is not None
|
|
|
|
|
status = nginx_deploy.status()
|
|
|
|
|
assert status.readyReplicas == 10
|
2019-03-07 23:24:28 +01:00
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
}
|