Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add binary module tests to Windows CI. #16914

Merged
merged 1 commit into from
Aug 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion test/integration/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ test_delegate_to: setup
# Targets should be balanced to have similar run times.
ci_win: ci_win1 ci_win2 ci_win3
ci_win1: test_win_group1
ci_win2: test_win_group2
ci_win2: test_win_group2 test_binary_modules_winrm
ci_win3: test_win_group3 test_connection_winrm

test_winrm: test_win_group1 test_win_group2 test_win_group3
Expand Down Expand Up @@ -316,6 +316,9 @@ no_log: setup
# This test expects 7 loggable vars and 0 non loggable ones, if either mismatches it fails, run the ansible-playbook command to debug
[ "$$(ansible-playbook no_log_local.yml -i $(INVENTORY) -e outputdir=$(TEST_DIR) -vvvvv | awk --source 'BEGIN { logme = 0; nolog = 0; } /LOG_ME/ { logme += 1;} /DO_NOT_LOG/ { nolog += 1;} END { printf "%d/%d", logme, nolog; }')" = "26/0" ]

test_binary_modules_winrm: INVENTORY = inventory.winrm
test_binary_modules_winrm: test_binary_modules

test_binary_modules:
ANSIBLE_HOST_KEY_CHECKING=false ansible-playbook download_binary_modules.yml -i $(INVENTORY) -v $(TEST_FLAGS)
ANSIBLE_HOST_KEY_CHECKING=false ansible-playbook test_binary_modules.yml -i $(INVENTORY) -v $(TEST_FLAGS)
Expand Down
19 changes: 15 additions & 4 deletions test/integration/download_binary_modules.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
- hosts: all
- hosts: testhost_binary_modules
tasks:
- debug: var=ansible_system

- name: set module filename (POSIX)
set_fact:
module_filename: "helloworld_{{ ansible_system | lower }}"
when: ansible_system != 'Win32NT'

- name: set module filename (Win32NT)
set_fact:
module_filename: "helloworld_{{ ansible_system | lower }}.exe"
when: ansible_system == 'Win32NT'

- name: download binary module
tags: test_binary_modules
get_url:
url: "https://ansible-ci-files.s3.amazonaws.com/test/integration/roles/test_binary_modules/helloworld_{{ ansible_system|lower }}"
dest: "{{ playbook_dir }}/library/helloworld_{{ ansible_system|lower }}"
local_action:
module: get_url
url: "https://ansible-ci-files.s3.amazonaws.com/test/integration/roles/test_binary_modules/{{ module_filename }}"
dest: "{{ playbook_dir }}/library/{{ module_filename }}"
mode: 0755
2 changes: 2 additions & 0 deletions test/integration/inventory
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ testhost4 ansible_ssh_host=127.0.0.4
# For testing fact gathering
facthost[0:8] ansible_host=1270.0.0.1 ansible_connection=local

[binary_modules]
testhost_binary_modules ansible_host=127.0.0.1 ansible_connection=local

# the following inline declarations are accompanied
# by (preferred) group_vars/ and host_vars/ variables
Expand Down
7 changes: 4 additions & 3 deletions test/integration/inventory.winrm.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[windows]
server
[windows_hosts]
windows
testhost_binary_modules

[windows:vars]
[windows_hosts:vars]
ansible_connection=winrm
ansible_host=@ansible_host
ansible_user=@ansible_user
Expand Down
2 changes: 1 addition & 1 deletion test/integration/test_binary_modules.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- hosts: all
- hosts: testhost_binary_modules
roles:
- role: test_binary_modules
tags:
Expand Down