Issue #10: Grammar fixes for some test tasks.

This commit is contained in:
Jeff Geerling
2020-02-13 16:05:24 -06:00
parent a75593c36a
commit bc5121363b
3 changed files with 23 additions and 22 deletions

View File

@@ -4,7 +4,7 @@
kind: Namespace
name: append-hash
- name: create k8s_resource variable
- name: Create k8s_resource variable
set_fact:
k8s_resource:
metadata:
@@ -21,26 +21,26 @@
append_hash: yes
register: k8s_configmap1
- name: check configmap is created with a hash
- name: Check configmap is created with a hash
assert:
that:
- k8s_configmap1 is changed
- k8s_configmap1.result.metadata.name != 'config-map-test'
- k8s_configmap1.result.metadata.name[:-10] == 'config-map-test-'
- name: recreate same config map
- name: Recreate same config map
k8s:
definition: "{{ k8s_resource }}"
append_hash: yes
register: k8s_configmap2
- name: check configmaps are different
- name: Check configmaps are different
assert:
that:
- k8s_configmap2 is not changed
- k8s_configmap1.result.metadata.name == k8s_configmap2.result.metadata.name
- name: add key to config map
- name: Add key to config map
k8s:
definition:
metadata:
@@ -54,14 +54,14 @@
append_hash: yes
register: k8s_configmap3
- name: check configmaps are different
- name: Check configmaps are different
assert:
that:
- k8s_configmap3 is changed
- k8s_configmap1.result.metadata.name != k8s_configmap3.result.metadata.name
always:
- name: ensure that namespace is removed
- name: Ensure that namespace is removed
k8s:
kind: Namespace
name: append-hash

View File

@@ -13,34 +13,34 @@
pause:
seconds: 5
- name: create custom resource definition
- name: Create custom resource definition
k8s:
definition: "{{ lookup('file', kubernetes_role_path + '/files/crd-resource.yml') }}"
namespace: crd
apply: "{{ create_crd_with_apply | default(omit) }}"
register: create_crd
- name: patch custom resource definition
- name: Patch custom resource definition
k8s:
definition: "{{ lookup('file', kubernetes_role_path + '/files/crd-resource.yml') }}"
namespace: crd
register: recreate_crd
ignore_errors: yes
- name: assert that recreating crd is as expected
- name: Assert that recreating crd is as expected
assert:
that:
- recreate_crd_default_merge_expectation
- block:
- name: recreate custom resource definition with merge_type
- name: Recreate custom resource definition with merge_type
k8s:
definition: "{{ lookup('file', kubernetes_role_path + '/files/crd-resource.yml') }}"
merge_type: merge
namespace: crd
register: recreate_crd_with_merge
- name: recreate custom resource definition with merge_type list
- name: Recreate custom resource definition with merge_type list
k8s:
definition: "{{ lookup('file', kubernetes_role_path + '/files/crd-resource.yml') }}"
merge_type:
@@ -51,14 +51,14 @@
when: recreate_crd is successful
- name: remove crd
- name: Remove crd
k8s:
definition: "{{ lookup('file', kubernetes_role_path + '/files/crd-resource.yml') }}"
namespace: crd
state: absent
always:
- name: remove crd namespace
- name: Remove crd namespace
k8s:
kind: Namespace
name: crd

View File

@@ -6,7 +6,7 @@
kind: Namespace
register: output
- name: show output
- name: Show output
debug:
var: output
@@ -24,14 +24,14 @@
# that:
# - output is failed
- name: k8s_info works with empty resources
- name: Ensure k8s_info works with empty resources
k8s_info:
kind: Deployment
namespace: testing
api_version: apps/v1
register: k8s_info
- name: assert that k8s_info is in correct format
- name: Assert that k8s_info is in correct format
assert:
that:
- "'resources' in k8s_info"
@@ -60,7 +60,7 @@
port: 8000
register: output
- name: show output
- name: Show output
debug:
var: output
@@ -118,7 +118,7 @@
state: present
inline: *pvc
- name: PVC creation should be idempotent
- name: Ensure PVC creation is idempotent
assert:
that: not output.changed
@@ -171,7 +171,7 @@
inline: *deployment
register: output
- name: Deployment creation should be idempotent
- name: Ensure Deployment creation is idempotent
assert:
that: not output.changed
@@ -293,7 +293,8 @@
metadata:
name: testing5
- k8s_info:
- name: Get info about terminating resources
k8s_info:
api_version: v1
kind: Namespace
name: "{{ item }}"
@@ -302,7 +303,7 @@
- testing5
register: k8s_info
- name: Resources are terminating if still in results
- name: Ensure resources are terminating if still in results
assert:
that: not item.resources or item.resources[0].status.phase == "Terminating"
loop: "{{ k8s_info.results }}"