From 6dc148d82c1997263827c19edb7bb15b10c06e15 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Sun, 31 Jul 2016 08:48:32 -0700 Subject: [PATCH] Download files from S3 to improve reliability. (#16891) Binary module tests now download pre-compiled binaries from S3 instead of downloading go and compiling the modules. Files downloaded form SourceForge are now downloaded from S3. --- test/integration/Makefile | 25 +++++++++++-------- test/integration/download_binary_modules.yml | 10 ++++++++ .../roles/test_win_msi/defaults/main.yml | 2 +- 3 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 test/integration/download_binary_modules.yml diff --git a/test/integration/Makefile b/test/integration/Makefile index 944040ae4d9..aecc02ca3ac 100644 --- a/test/integration/Makefile +++ b/test/integration/Makefile @@ -315,19 +315,22 @@ no_log: setup [ "$$(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: - mytmpdir=$(MYTMPDIR); \ - ls -al $$mytmpdir; \ - curl https://storage.googleapis.com/golang/go1.6.2.$(UNAME)-amd64.tar.gz | tar -xz -C $$mytmpdir; \ - [ $$? != 0 ] && wget -qO- https://storage.googleapis.com/golang/go1.6.2.$(UNAME)-amd64.tar.gz | tar -xz -C $$mytmpdir; \ - ls -al $$mytmpdir; \ - cd library; \ - GOROOT=$$mytmpdir/go GOOS=linux GOARCH=amd64 $$mytmpdir/go/bin/go build -o helloworld_linux helloworld.go; \ - GOROOT=$$mytmpdir/go GOOS=windows GOARCH=amd64 $$mytmpdir/go/bin/go build -o helloworld_win32nt.exe helloworld.go; \ - GOROOT=$$mytmpdir/go GOOS=darwin GOARCH=amd64 $$mytmpdir/go/bin/go build -o helloworld_darwin helloworld.go; \ - cd ..; \ - rm -rf $$mytmpdir; \ + 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) +binary_modules: + # Compiled versions of these binary modules are available at the url below. + # 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 + +clean_binary_modules: + rm library/helloworld_* + test_async: # Verify that extra data before module JSON output during async call is ignored. ANSIBLE_DEBUG=0 LC_ALL=bogus ansible-playbook test_async.yml -i localhost, -e ansible_connection=ssh -v $(TEST_FLAGS) diff --git a/test/integration/download_binary_modules.yml b/test/integration/download_binary_modules.yml new file mode 100644 index 00000000000..11accf5b3e4 --- /dev/null +++ b/test/integration/download_binary_modules.yml @@ -0,0 +1,10 @@ +- hosts: all + tasks: + - debug: var=ansible_system + + - 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 }}" + mode: 0755 diff --git a/test/integration/roles/test_win_msi/defaults/main.yml b/test/integration/roles/test_win_msi/defaults/main.yml index 6e79dcd1461..ebc97b84cc0 100644 --- a/test/integration/roles/test_win_msi/defaults/main.yml +++ b/test/integration/roles/test_win_msi/defaults/main.yml @@ -1,6 +1,6 @@ --- -msi_url: http://downloads.sourceforge.net/project/sevenzip/7-Zip/9.22/7z922-x64.msi +msi_url: https://ansible-ci-files.s3.amazonaws.com/test/integration/roles/test_win_msi/7z922-x64.msi msi_download_path: "C:\\Program Files\\7z922-x64.msi" msi_install_path: "C:\\Program Files\\7-Zip" msi_product_code: "{23170F69-40C1-2702-0922-000001000000}"