summaryrefslogtreecommitdiffstats
path: root/roles/lib_openshift/src/test/integration
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2017-02-02 12:39:13 -0500
committerKenny Woodson <kwoodson@redhat.com>2017-02-09 09:41:36 -0500
commit353a24669e7116b40a9c85367277d19040eb75ea (patch)
tree8cbebab23da6aba467d53d1206d5308e03a30bb7 /roles/lib_openshift/src/test/integration
parent63b7227d33933df83cb33a5b1a20270fa487b58d (diff)
downloadopenshift-353a24669e7116b40a9c85367277d19040eb75ea.tar.gz
openshift-353a24669e7116b40a9c85367277d19040eb75ea.tar.bz2
openshift-353a24669e7116b40a9c85367277d19040eb75ea.tar.xz
openshift-353a24669e7116b40a9c85367277d19040eb75ea.zip
Adding test cases.
Diffstat (limited to 'roles/lib_openshift/src/test/integration')
-rwxr-xr-xroles/lib_openshift/src/test/integration/oc_process.yml83
1 files changed, 83 insertions, 0 deletions
diff --git a/roles/lib_openshift/src/test/integration/oc_process.yml b/roles/lib_openshift/src/test/integration/oc_process.yml
new file mode 100755
index 000000000..7ea4c6b99
--- /dev/null
+++ b/roles/lib_openshift/src/test/integration/oc_process.yml
@@ -0,0 +1,83 @@
+#!/usr/bin/ansible-playbook --module-path=../../../library/:../../../../lib_utils/library
+
+---
+- hosts: "{{ cli_master_test }}"
+ gather_facts: no
+ user: root
+ vars:
+ template_name: mysql-ephemeral
+ ns_name: test
+
+ post_tasks:
+ - name: get the mysql-ephemeral template
+ oc_obj:
+ name: mysql-ephemeral
+ state: list
+ namespace: openshift
+ kind: template
+ register: mysqltempl
+
+ - name: fix namespace
+ yedit:
+ src: /tmp/mysql-template
+ key: metadata.namespace
+ value: test
+ backup: false
+ content: "{{ mysqltempl.results.results[0] | to_yaml }}"
+
+ - name: create the test namespace
+ oc_obj:
+ name: test
+ state: present
+ namespace: test
+ kind: namespace
+ content:
+ path: /tmp/ns_test
+ data:
+ apiVersion: v1
+ kind: Namespace
+ metadata:
+ name: test
+ spec:
+ finalizers:
+ - openshift.io/origin
+ - kubernetes
+ register: mysqltempl
+
+ - name: create the mysql-ephemeral template
+ oc_obj:
+ name: mysql-ephemeral
+ state: present
+ namespace: test
+ kind: template
+ files:
+ - /tmp/mysql-template
+ delete_after: True
+ register: mysqltempl
+
+ - name: process mysql-ephemeral
+ oc_process:
+ template_name: mysql-ephemeral
+ namespace: test
+ params:
+ NAMESPACE: test
+ DATABASE_SERVICE_NAME: testdb
+ create: False
+ reconcile: false
+ register: procout
+
+ - assert:
+ that:
+ - not procout.changed
+ - procout.results.results['items'][0]['metadata']['name'] == 'testdb'
+ - procout.results.results['items'][0]['kind'] == 'Service'
+ - procout.results.results['items'][1]['metadata']['name'] == 'testdb'
+ - procout.results.results['items'][1]['kind'] == 'DeploymentConfig'
+ msg: process failed on template
+
+ - name: remove namespace test
+ oc_obj:
+ kind: namespace
+ name: test
+ namespace: test
+ state: absent