diff --git a/.travis/ansible_tests.py b/.travis/ansible_tests.py index 723f9c1a..3b5e40db 100755 --- a/.travis/ansible_tests.py +++ b/.travis/ansible_tests.py @@ -55,7 +55,7 @@ with ci_lib.Fold('job_setup'): )) # Build the binaries. - run("make -C %s", TESTS_DIR) + # run("make -C %s", TESTS_DIR) if not ci_lib.exists_in_path('sshpass'): run("sudo apt-get update") run("sudo apt-get install -y sshpass") diff --git a/tests/ansible/Makefile b/tests/ansible/Makefile index 00d6a8ab..1d4ab1dd 100644 --- a/tests/ansible/Makefile +++ b/tests/ansible/Makefile @@ -1,13 +1,15 @@ -TARGETS+=lib/modules/custom_binary_producing_junk -TARGETS+=lib/modules/custom_binary_producing_json +SYSTEM=$(shell uname -s) + +TARGETS+=lib/modules/custom_binary_producing_junk_$(SYSTEM) +TARGETS+=lib/modules/custom_binary_producing_json_$(SYSTEM) all: clean $(TARGETS) -lib/modules/custom_binary_producing_junk: lib/modules.src/custom_binary_producing_junk.c +lib/modules/custom_binary_producing_junk_$(SYSTEM): lib/modules.src/custom_binary_producing_junk.c $(CC) -o $@ $< -lib/modules/custom_binary_producing_json: lib/modules.src/custom_binary_producing_json.c +lib/modules/custom_binary_producing_json_$(SYSTEM): lib/modules.src/custom_binary_producing_json.c $(CC) -o $@ $< clean: diff --git a/tests/ansible/integration/runner/custom_binary_producing_json.yml b/tests/ansible/integration/runner/custom_binary_producing_json.yml index 00f03f07..4fe09f0d 100644 --- a/tests/ansible/integration/runner/custom_binary_producing_json.yml +++ b/tests/ansible/integration/runner/custom_binary_producing_json.yml @@ -1,12 +1,25 @@ - name: integration/runner/custom_binary_producing_json.yml hosts: test-targets any_errors_fatal: true + gather_facts: true tasks: - - custom_binary_producing_json: - foo: true - with_sequence: start=1 end={{end|default(1)}} - register: out + - block: + - custom_binary_producing_json_Darwin: + foo: true + with_sequence: start=1 end={{end|default(1)}} + register: out_darwin + - set_fact: out={{out_darwin}} + when: ansible_system == "Darwin" + - block: + - custom_binary_producing_json_Linux: + foo: true + with_sequence: start=1 end={{end|default(1)}} + register: out_linux + - set_fact: out={{out_linux}} + when: ansible_system == "Linux" + + - debug: msg={{out}} - assert: that: | out.changed and diff --git a/tests/ansible/integration/runner/custom_binary_producing_junk.yml b/tests/ansible/integration/runner/custom_binary_producing_junk.yml index 93d98065..b1672ad9 100644 --- a/tests/ansible/integration/runner/custom_binary_producing_junk.yml +++ b/tests/ansible/integration/runner/custom_binary_producing_junk.yml @@ -1,11 +1,24 @@ - name: integration/runner/custom_binary_producing_junk.yml hosts: test-targets + gather_facts: true tasks: - - custom_binary_producing_junk: - foo: true - with_sequence: start=1 end={{end|default(1)}} - ignore_errors: true - register: out + - block: + - custom_binary_producing_junk_Darwin: + foo: true + with_sequence: start=1 end={{end|default(1)}} + ignore_errors: true + register: out_darwin + - set_fact: out={{out_darwin}} + when: ansible_system == "Darwin" + + - block: + - custom_binary_producing_junk_Linux: + foo: true + with_sequence: start=1 end={{end|default(1)}} + ignore_errors: true + register: out_linux + - set_fact: out={{out_linux}} + when: ansible_system == "Linux" - hosts: test-targets diff --git a/tests/ansible/lib/modules/custom_binary_producing_json_Darwin b/tests/ansible/lib/modules/custom_binary_producing_json_Darwin new file mode 100755 index 00000000..69de2fea Binary files /dev/null and b/tests/ansible/lib/modules/custom_binary_producing_json_Darwin differ diff --git a/tests/ansible/lib/modules/custom_binary_producing_json_Linux b/tests/ansible/lib/modules/custom_binary_producing_json_Linux new file mode 100755 index 00000000..16e6d046 Binary files /dev/null and b/tests/ansible/lib/modules/custom_binary_producing_json_Linux differ diff --git a/tests/ansible/lib/modules/custom_binary_producing_junk_Darwin b/tests/ansible/lib/modules/custom_binary_producing_junk_Darwin new file mode 100755 index 00000000..108f0787 Binary files /dev/null and b/tests/ansible/lib/modules/custom_binary_producing_junk_Darwin differ diff --git a/tests/ansible/lib/modules/custom_binary_producing_junk_Linux b/tests/ansible/lib/modules/custom_binary_producing_junk_Linux new file mode 100755 index 00000000..4aadc9c1 Binary files /dev/null and b/tests/ansible/lib/modules/custom_binary_producing_junk_Linux differ