From e5f14b515b07bcfa2079c3e68c35fee3e97970c7 Mon Sep 17 00:00:00 2001 From: Luke Meyer Date: Tue, 4 Apr 2017 12:05:20 -0400 Subject: integration tests: add CI scripts Add some scripts that can be run from Jenkins to build/push test images and to run the tests. Updated README to expand on running tests. --- .../builds/Dockerfile.test-target-base | 2 -- .../builds/build-container-images.yml | 19 ------------------- .../builds/test-target-base/Dockerfile | 2 ++ test/integration/openshift_health_checker/common.go | 2 +- .../openshift_health_checker/setup_container.yml | 2 +- 5 files changed, 4 insertions(+), 23 deletions(-) delete mode 100644 test/integration/openshift_health_checker/builds/Dockerfile.test-target-base delete mode 100644 test/integration/openshift_health_checker/builds/build-container-images.yml create mode 100644 test/integration/openshift_health_checker/builds/test-target-base/Dockerfile (limited to 'test/integration/openshift_health_checker') diff --git a/test/integration/openshift_health_checker/builds/Dockerfile.test-target-base b/test/integration/openshift_health_checker/builds/Dockerfile.test-target-base deleted file mode 100644 index 39b33c057..000000000 --- a/test/integration/openshift_health_checker/builds/Dockerfile.test-target-base +++ /dev/null @@ -1,2 +0,0 @@ -FROM centos/systemd -RUN yum install -y iproute python-dbus PyYAML yum-utils diff --git a/test/integration/openshift_health_checker/builds/build-container-images.yml b/test/integration/openshift_health_checker/builds/build-container-images.yml deleted file mode 100644 index 445d73d29..000000000 --- a/test/integration/openshift_health_checker/builds/build-container-images.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -- name: Build all the images we need for running integration tests - hosts: localhost - connection: local - tasks: - - - name: test-target-base - docker_image: - state: present - path: ./ - dockerfile: Dockerfile.test-target-base - name: test-target-base - - - name: preflight-aos-package-checks - docker_image: - state: present - pull: no - path: ./aos-package-checks - name: preflight-aos-package-checks diff --git a/test/integration/openshift_health_checker/builds/test-target-base/Dockerfile b/test/integration/openshift_health_checker/builds/test-target-base/Dockerfile new file mode 100644 index 000000000..39b33c057 --- /dev/null +++ b/test/integration/openshift_health_checker/builds/test-target-base/Dockerfile @@ -0,0 +1,2 @@ +FROM centos/systemd +RUN yum install -y iproute python-dbus PyYAML yum-utils diff --git a/test/integration/openshift_health_checker/common.go b/test/integration/openshift_health_checker/common.go index aea85342f..a92d6861d 100644 --- a/test/integration/openshift_health_checker/common.go +++ b/test/integration/openshift_health_checker/common.go @@ -25,7 +25,7 @@ func (p PlaybookTest) Run(t *testing.T) { // A PlaybookTest is intended to be run in parallel with other tests. t.Parallel() - cmd := exec.Command("ansible-playbook", p.Path) + cmd := exec.Command("ansible-playbook", "-i", "/dev/null", p.Path) cmd.Env = append(os.Environ(), "ANSIBLE_FORCE_COLOR=1") b, err := cmd.CombinedOutput() diff --git a/test/integration/openshift_health_checker/setup_container.yml b/test/integration/openshift_health_checker/setup_container.yml index 4dd2c4b1e..8793d954e 100644 --- a/test/integration/openshift_health_checker/setup_container.yml +++ b/test/integration/openshift_health_checker/setup_container.yml @@ -23,7 +23,7 @@ - name: start container docker_container: name: "{{ container_name }}" - image: "{{ image | default('test-target-base') }}" + image: "{{ lookup('env', 'IMAGE_PREFIX') | default('openshift-ansible-integration-', true) }}{{ image | default('test-target-base') }}" command: "{{ command | default('sleep 1800') }}" recreate: yes # NOTE: When/if we need to run containers that are docker hosts as well: -- cgit v1.2.1