mirror of
https://github.com/openshift/community.okd.git
synced 2026-07-28 18:34:32 +00:00
fix integration unsafe asserts (#212)
This commit is contained in:
@@ -223,8 +223,8 @@
|
||||
- name: validate clusterrole binding candidates for prune
|
||||
assert:
|
||||
that:
|
||||
- '"{{ item.name }}-binding" in check.cluster_role_binding'
|
||||
- '"{{ test_ns }}/{{ cluster_roles[0].name }}-binding" in check.role_binding'
|
||||
- 'item["name"]+"-binding" in check.cluster_role_binding'
|
||||
- 'test_ns+"/"+cluster_roles[0].name+"-binding" in check.role_binding'
|
||||
with_items: "{{ cluster_roles }}"
|
||||
|
||||
- name: Prune Cluster Role for managing Pod
|
||||
|
||||
@@ -177,7 +177,7 @@
|
||||
|
||||
- name: validate that list role binding are candidates for prune
|
||||
assert:
|
||||
that: '"{{ test_ns }}/{{ item.name }}-bind" in check.role_binding'
|
||||
that: 'test_ns+"/"+item["name"]+"-bind" in check.role_binding'
|
||||
with_items: "{{ role_definition }}"
|
||||
|
||||
- name: Prune resource using label_selectors option
|
||||
@@ -192,7 +192,7 @@
|
||||
assert:
|
||||
that:
|
||||
- prune is changed
|
||||
- '"{{ test_ns }}/{{ role_definition[2].name }}-bind" in check.role_binding'
|
||||
- 'test_ns+"/"+role_definition[2]["name"]+"-bind" in check.role_binding'
|
||||
|
||||
- name: assert that user could not delete pod anymore
|
||||
kubernetes.core.k8s:
|
||||
@@ -262,7 +262,7 @@
|
||||
assert:
|
||||
that:
|
||||
- prune is changed
|
||||
- '"{{ test_ns }}/{{ role_definition[1].name }}-bind" in check.role_binding'
|
||||
- 'test_ns+"/"+role_definition[1]["name"]+"-bind" in check.role_binding'
|
||||
|
||||
- name: Create Pod (should failed)
|
||||
kubernetes.core.k8s:
|
||||
@@ -315,7 +315,7 @@
|
||||
assert:
|
||||
that:
|
||||
- prune is changed
|
||||
- '"{{ test_ns }}/{{ role_definition[0].name }}-bind" in check.role_binding'
|
||||
- 'test_ns+"/"+role_definition[0]["name"]+"-bind" in check.role_binding'
|
||||
|
||||
- name: List Pod
|
||||
kubernetes.core.k8s_info:
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
assert:
|
||||
that:
|
||||
- replications.resources | length == 1
|
||||
- 'replications.resources.0.metadata.name is match("{{ dc_name }}-*")'
|
||||
- replications.resources.0.metadata.name is match(dc_name+"-*")
|
||||
|
||||
- name: Assure that candidate ReplicationController was found for pruning
|
||||
assert:
|
||||
@@ -266,4 +266,4 @@
|
||||
kind: Namespace
|
||||
name: "{{ deployment_ns_2 }}"
|
||||
ignore_errors: yes
|
||||
when: deployment_ns_2 is defined
|
||||
when: deployment_ns_2 is defined
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
assert:
|
||||
that:
|
||||
- new_build is changed
|
||||
- new_build.builds.0.metadata.name == "{{ build_config }}-1"
|
||||
- new_build.builds.0.metadata.name == build_config+"-1"
|
||||
|
||||
- name: Start a new Build from previous Build
|
||||
community.okd.openshift_build:
|
||||
@@ -67,7 +67,7 @@
|
||||
assert:
|
||||
that:
|
||||
- rerun_build is changed
|
||||
- rerun_build.builds.0.metadata.name == "{{ build_config }}-2"
|
||||
- rerun_build.builds.0.metadata.name == build_config+"-2"
|
||||
|
||||
- name: Cancel first build created
|
||||
community.okd.openshift_build:
|
||||
@@ -82,8 +82,8 @@
|
||||
that:
|
||||
- cancel is changed
|
||||
- cancel.builds | length == 1
|
||||
- cancel.builds.0.metadata.name == "{{ build_config }}-1"
|
||||
- cancel.builds.0.metadata.namespace == "{{ build_ns }}"
|
||||
- cancel.builds.0.metadata.name == build_config+"-1"
|
||||
- cancel.builds.0.metadata.namespace == build_ns
|
||||
- '"cancelled" in cancel.builds.0.status'
|
||||
- cancel.builds.0.status.cancelled
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
that:
|
||||
- restart is changed
|
||||
- restart.builds | length == 1
|
||||
- 'restart.builds.0.metadata.name == "{{ build_config }}-3"'
|
||||
- restart.builds.0.metadata.name == build_config+"-3"
|
||||
|
||||
- name: Get info for 2nd Build
|
||||
kubernetes.core.k8s_info:
|
||||
@@ -175,8 +175,8 @@
|
||||
that:
|
||||
- prune_without_ns is changed
|
||||
- prune_without_ns.builds | length > 0
|
||||
- '"{{ build_config }}-1" in build_names'
|
||||
- '"{{ build_config }}-2" in build_names'
|
||||
- 'build_config+"-1" in build_names'
|
||||
- 'build_config+"-2" in build_names'
|
||||
vars:
|
||||
build_names: '{{ prune_without_ns.builds | map(attribute="metadata") | flatten | map(attribute="name") | list }}'
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
assert:
|
||||
that:
|
||||
- error_tag is failed
|
||||
- 'error_tag.msg == "image stream {{ test_ns }}/local-is does not have tags pointing to external container images"'
|
||||
- error_tag.msg == "image stream "+test_ns+"/local-is does not have tags pointing to external container images"
|
||||
|
||||
- name: import all tags for container image ibmcom/pause and specific tag for redhat/ubi8-micro
|
||||
community.okd.openshift_import_image:
|
||||
|
||||
Reference in New Issue
Block a user