summaryrefslogtreecommitdiffstats
path: root/roles/lib_openshift/src/test/integration
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2017-01-26 12:00:36 -0500
committerKenny Woodson <kwoodson@redhat.com>2017-01-26 14:20:19 -0500
commit853170d0e42ef23b8986e7b1a266232709f5b6f9 (patch)
tree86ea3d30326307cc0c33dfd69e5c7195787a3574 /roles/lib_openshift/src/test/integration
parent0db4215a5570b550251af614e8e944b9f2db7094 (diff)
downloadopenshift-853170d0e42ef23b8986e7b1a266232709f5b6f9.tar.gz
openshift-853170d0e42ef23b8986e7b1a266232709f5b6f9.tar.bz2
openshift-853170d0e42ef23b8986e7b1a266232709f5b6f9.tar.xz
openshift-853170d0e42ef23b8986e7b1a266232709f5b6f9.zip
Added unit integration tests. Enhanced unit tests. Fixed an issue in openshift_cmd for namespace.
Diffstat (limited to 'roles/lib_openshift/src/test/integration')
-rwxr-xr-xroles/lib_openshift/src/test/integration/oadm_manage_node.yml58
1 files changed, 58 insertions, 0 deletions
diff --git a/roles/lib_openshift/src/test/integration/oadm_manage_node.yml b/roles/lib_openshift/src/test/integration/oadm_manage_node.yml
new file mode 100755
index 000000000..69a701b17
--- /dev/null
+++ b/roles/lib_openshift/src/test/integration/oadm_manage_node.yml
@@ -0,0 +1,58 @@
+#!/usr/bin/ansible-playbook --module-path=../../../library/
+# ./oadm_manage_node.yml -M ../../../library -e "cli_master_test=$OPENSHIFT_MASTER cli_node_test=$OPENSHIFT_NODE
+---
+- hosts: "{{ cli_master_test }}"
+ gather_facts: no
+ user: root
+ tasks:
+ - name: list pods from a node
+ oadm_manage_node:
+ list_pods: True
+ node:
+ - "{{ cli_node_test }}"
+ register: podout
+ - debug: var=podout
+
+ - assert:
+ that: "'{{ cli_node_test }}' in podout.results.nodes"
+ msg: Pod data was not returned
+
+ - name: set node to unschedulable
+ oadm_manage_node:
+ schedulable: False
+ node:
+ - "{{ cli_node_test }}"
+ register: nodeout
+ - debug: var=nodeout
+
+ - name: assert that schedulable=False
+ assert:
+ that: nodeout.results.nodes[0]['schedulable'] == False
+ msg: "{{ cli_node_test }} schedulable set to True"
+
+ - name: get node scheduable
+ oc_obj:
+ kind: node
+ state: list
+ name: "{{ cli_node_test }}"
+ namespace: None
+ register: nodeout
+
+ - debug: var=nodeout
+
+ - name: assert that schedulable=False
+ assert:
+ that: nodeout.results.results[0]['spec']['unschedulable']
+
+ - name: set node to schedulable
+ oadm_manage_node:
+ schedulable: True
+ node:
+ - "{{ cli_node_test }}"
+ register: nodeout
+ - debug: var=nodeout
+
+ - name: assert that schedulable=False
+ assert:
+ that: nodeout.results.nodes[0]['schedulable']
+ msg: "{{ cli_node_test }} schedulable set to False"