summaryrefslogtreecommitdiffstats
path: root/test/integration/openshift_health_checker/preflight
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/openshift_health_checker/preflight')
-rw-r--r--test/integration/openshift_health_checker/preflight/playbooks/preflight_fail_all.yml11
-rw-r--r--test/integration/openshift_health_checker/preflight/playbooks/setup_container.yml23
-rw-r--r--test/integration/openshift_health_checker/preflight/preflight_test.go24
3 files changed, 58 insertions, 0 deletions
diff --git a/test/integration/openshift_health_checker/preflight/playbooks/preflight_fail_all.yml b/test/integration/openshift_health_checker/preflight/playbooks/preflight_fail_all.yml
new file mode 100644
index 000000000..e7790a0d4
--- /dev/null
+++ b/test/integration/openshift_health_checker/preflight/playbooks/preflight_fail_all.yml
@@ -0,0 +1,11 @@
+---
+- include: setup_container.yml
+ vars:
+ name: preflight_fail_all
+
+- name: Run preflight checks
+ include: ../../../../../playbooks/byo/openshift-preflight/check.yml
+
+# - include: tasks/teardown_container.yml
+# vars:
+# name: preflight_fail_all
diff --git a/test/integration/openshift_health_checker/preflight/playbooks/setup_container.yml b/test/integration/openshift_health_checker/preflight/playbooks/setup_container.yml
new file mode 100644
index 000000000..fff797c27
--- /dev/null
+++ b/test/integration/openshift_health_checker/preflight/playbooks/setup_container.yml
@@ -0,0 +1,23 @@
+---
+# Required vars:
+# * name = name of the container to be started
+
+- name: Start CentOS 7 container
+ gather_facts: no
+ hosts: localhost
+ connection: local
+ vars:
+ container_name: openshift_ansible_test_{{ name }}
+ tasks:
+ - name: start container
+ docker_container:
+ name: "{{ container_name }}"
+ image: centos:7
+ command: sleep infinity
+ recreate: yes
+ - name: add host
+ add_host:
+ name: "{{ container_name }}"
+ ansible_connection: docker
+ groups: OSEv3,masters,nodes
+ deployment_type: origin
diff --git a/test/integration/openshift_health_checker/preflight/preflight_test.go b/test/integration/openshift_health_checker/preflight/preflight_test.go
new file mode 100644
index 000000000..a1b98bf0f
--- /dev/null
+++ b/test/integration/openshift_health_checker/preflight/preflight_test.go
@@ -0,0 +1,24 @@
+package preflight
+
+import (
+ "testing"
+
+ . ".."
+)
+
+func TestPreflightFailAll(t *testing.T) {
+ PlaybookTest{
+ Path: "playbooks/preflight_fail_all.yml",
+ ExitCode: 2,
+ Output: []string{
+ "Failure summary",
+ "Cannot install all of the necessary packages",
+ "origin-clients",
+ "origin-master",
+ "origin-node",
+ "origin-sdn-ovs",
+ "python-httplib2",
+ "failed=1",
+ },
+ }.Run(t)
+}