summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
authorJordan Borean <jborean93@gmail.com>2018-10-13 08:20:00 +1000
committerMatt Clay <matt@mystile.com>2018-10-16 16:51:33 -0700
commit1d3aef6917d586813f491124afa9a5e568358cc9 (patch)
tree2d3939596f2f38e4bfa79f79dbf6b3bcfeba5e5f /test/integration
parent481c48c7080101dd25c926b94b69491af0497378 (diff)
downloadansible-1d3aef6917d586813f491124afa9a5e568358cc9.tar.gz
win test: add http tester container to Windows tests (#46606)
(cherry picked from commit 6e2897647c77910c0fc5c4306f381f1b5cd00635)
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/targets/prepare_http_tests/tasks/main.yml34
-rw-r--r--test/integration/targets/win_uri/aliases2
-rw-r--r--test/integration/targets/win_uri/defaults/main.yml3
-rw-r--r--test/integration/targets/win_uri/meta/main.yml3
4 files changed, 38 insertions, 4 deletions
diff --git a/test/integration/targets/prepare_http_tests/tasks/main.yml b/test/integration/targets/prepare_http_tests/tasks/main.yml
index c8c7fa99e5..e022fb9dd6 100644
--- a/test/integration/targets/prepare_http_tests/tasks/main.yml
+++ b/test/integration/targets/prepare_http_tests/tasks/main.yml
@@ -3,6 +3,11 @@
- set_fact:
has_httptester: "{{ lookup('env', 'HTTPTESTER') != '' }}"
+- name: make sure we have the ansible_os_family and ansible_distribution_version facts
+ setup:
+ gather_subset: distribution
+ when: ansible_facts == {}
+
# If we are running with access to a httptester container, grab it's cacert and install it
- block:
# Override hostname defaults with httptester linked names
@@ -22,6 +27,16 @@
get_url:
url: "http://ansible.http.tests/{{ item }}"
dest: "{{ output_dir }}/{{ item }}"
+ when: ansible_os_family != 'Windows'
+ with_items:
+ - client.pem
+ - client.key
+
+ - name: Windows - Get client cert/key
+ win_get_url:
+ url: http://ansible.http.tests/{{ item }}
+ dest: '{{ win_output_dir }}\{{ item }}'
+ when: ansible_os_family == 'Windows'
with_items:
- client.pem
- client.key
@@ -38,6 +53,12 @@
dest: "/usr/local/share/ca-certificates/ansible.crt"
when: ansible_os_family == 'Debian'
+ - name: Windows - Retrieve test cacert
+ win_get_url:
+ url: http://ansible.http.tests/cacert.pem
+ dest: '{{ win_output_dir }}\cacert.pem'
+ when: ansible_os_family == 'Windows'
+
- name: Redhat - Update ca trust
command: update-ca-trust extract
when: ansible_os_family == 'RedHat'
@@ -46,6 +67,14 @@
command: update-ca-certificates
when: ansible_os_family == 'Debian' or ansible_os_family == 'Suse'
+ - name: Windows - Update ca trust
+ win_certificate_store:
+ path: '{{ win_output_dir }}\cacert.pem'
+ state: present
+ store_location: LocalMachine
+ store_name: Root
+ when: ansible_os_family == 'Windows'
+
- name: FreeBSD - Retrieve test cacert
get_url:
url: "http://ansible.http.tests/cacert.pem"
@@ -68,4 +97,7 @@
command: /usr/local/opt/openssl/bin/c_rehash
when: ansible_os_family == 'Darwin'
- when: has_httptester|bool
+ when:
+ - has_httptester|bool
+ # skip the setup if running on Windows Server 2008 as httptester is not available
+ - ansible_os_family != 'Windows' or (ansible_os_family == 'Windows' and not ansible_distribution_version.startswith("6.0."))
diff --git a/test/integration/targets/win_uri/aliases b/test/integration/targets/win_uri/aliases
index f88e7c8109..4f7f44e704 100644
--- a/test/integration/targets/win_uri/aliases
+++ b/test/integration/targets/win_uri/aliases
@@ -1,3 +1,3 @@
shippable/windows/group3
-unstable
+needs/httptester
skip/windows/2008 # httptester requires SSH which doesn't work with 2008
diff --git a/test/integration/targets/win_uri/defaults/main.yml b/test/integration/targets/win_uri/defaults/main.yml
index 1a02bcaafe..e5ca7935c1 100644
--- a/test/integration/targets/win_uri/defaults/main.yml
+++ b/test/integration/targets/win_uri/defaults/main.yml
@@ -1,3 +1,2 @@
---
-test_uri_path: C:\ansible\win_uri
-httpbin_host: httpbin.org
+test_uri_path: '{{ win_output_dir }}\win_uri'
diff --git a/test/integration/targets/win_uri/meta/main.yml b/test/integration/targets/win_uri/meta/main.yml
new file mode 100644
index 0000000000..e0a6795056
--- /dev/null
+++ b/test/integration/targets/win_uri/meta/main.yml
@@ -0,0 +1,3 @@
+dependencies:
+- prepare_win_tests
+- prepare_http_tests