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 new arches/OSes for binary_modules tests #69052

Merged
merged 9 commits into from
Apr 21, 2020
Merged
Show file tree
Hide file tree
Changes from 2 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
10 changes: 6 additions & 4 deletions test/integration/targets/binary_modules/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ all:
# This avoids a dependency on go and keeps the binaries out of our git repository.
# https://ansible-ci-files.s3.amazonaws.com/test/integration/roles/test_binary_modules/
cd library; \
GOOS=linux GOARCH=amd64 go build -o helloworld_linux helloworld.go; \
GOOS=windows GOARCH=amd64 go build -o helloworld_win32nt.exe helloworld.go; \
GOOS=darwin GOARCH=amd64 go build -o helloworld_darwin helloworld.go; \
GOOS=freebsd GOARCH=amd64 go build -o helloworld_freebsd helloworld.go
GOOS=linux GOARCH=amd64 go build -o helloworld_linux_x86_64 helloworld.go; \
GOOS=linux GOARCH=ppc64le go build -o helloworld_linux_ppc64le helloworld.go; \
GOOS=aix GOARCH=ppc64 go build -o helloworld_aix_chrp helloworld.go; \
GOOS=windows GOARCH=amd64 go build -o helloworld_win32nt_64-bit.exe helloworld.go; \
GOOS=darwin GOARCH=amd64 go build -o helloworld_darwin_x86_64 helloworld.go; \
GOOS=freebsd GOARCH=amd64 go build -o helloworld_freebsd_x86_64 helloworld.go
relrod marked this conversation as resolved.
Show resolved Hide resolved

clean:
rm -f library/helloworld_*
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
- hosts: testhost
tasks:
- debug: var=ansible_system

- name: set module filename (POSIX)
# If you change these, change them in the role too.
- name: Make our architecture and OS match binary filenames
set_fact:
module_filename: "helloworld_{{ ansible_system | lower }}"
when: ansible_system != 'Win32NT'
filename: "helloworld_{{ system }}_{{ ansible_architecture }}{{ suffix }}"
vars:
system: "{{ ansible_system|lower }}"
suffix: "{{ '.exe' if system == 'win32nt' else '' }}"

- 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/{{ module_filename }}"
dest: "{{ playbook_dir }}/library/{{ module_filename }}"
url: "https://ansible-ci-files.s3.amazonaws.com/test/integration/roles/test_binary_modules/{{ filename }}"
dest: "{{ playbook_dir }}/library/{{ filename }}"
mode: 0755
delegate_to: localhost
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,24 @@
action: win_ping
when: ansible_system == 'Win32NT'

# If you change these, change them in the download playbook in the target root too.
- name: Make our architecture and OS match binary filenames
set_fact:
filename: "helloworld_{{ system }}_{{ ansible_architecture }}{{ suffix }}"
vars:
system: "{{ ansible_system|lower }}"
suffix: "{{ '.exe' if system == 'win32nt' else '' }}"

- name: Hello, World!
action: "helloworld_{{ ansible_system|lower }}"
action: "{{ filename }}"
register: hello_world

- assert:
that:
- 'hello_world.msg == "Hello, World!"'

- name: Hello, Ansible!
action: "helloworld_{{ ansible_system|lower }}"
action: "{{ filename }}"
args:
name: Ansible
register: hello_ansible
Expand All @@ -27,7 +35,7 @@
- 'hello_ansible.msg == "Hello, Ansible!"'

- name: Async Hello, World!
action: "helloworld_{{ ansible_system|lower }}"
action: "{{ filename }}"
async: 10
poll: 1
when: ansible_system != 'Win32NT'
Expand All @@ -39,7 +47,7 @@
when: async_hello_world is not skipped

- name: Async Hello, Ansible!
action: "helloworld_{{ ansible_system|lower }}"
action: "{{ filename }}"
args:
name: Ansible
async: 10
Expand Down
4 changes: 1 addition & 3 deletions test/integration/targets/binary_modules_posix/aliases
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
shippable/posix/group3
needs/target/binary_modules
skip/aix
skip/power/centos
needs/target/binary_modules
relrod marked this conversation as resolved.
Show resolved Hide resolved