Ansible 2.9 tests (#14)

* Add CI group 2 for Ansible 2.9 tests.

* Temporarily disable some nodes.

* Fix ignore.txt.

* Use version prefix instead of groups.

* Ansible 2.9 doesn't support Python 3.9

ci_complete

* Make Ansible 2.9 compatible.

* Replace archive/unarchive with copy.

* Remove dependency on community.general in integration tests for Ansible 2.9.

* Let's see.

* Ansible 2.9's copy doesn't create directories.

* Re-enable no dependency.

ci_complete

* path should be bytes.

* Reenable nodes, add two more.

* Force complete CI run for Ansible 2.9.

* Used wrong variable.

* Fix Ansible 2.9 compatibility...
pull/25/head
Felix Fontein 2020-04-01 11:35:43 +02:00 committed by GitHub
parent 4d157b93ee
commit 6b3ca2ca07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 76 additions and 42 deletions

View File

@ -418,7 +418,14 @@ def write_file(module, content, default_mode=None, path=None):
Uses file arguments from module.
'''
# Find out parameters for file
try:
file_args = module.load_file_common_arguments(module.params, path=path)
except TypeError:
# The path argument is only supported in Ansible 2.10+. Fall back to
# pre-2.10 behavior of module_utils/crypto.py for older Ansible versions.
file_args = module.load_file_common_arguments(module.params)
if path is not None:
file_args['path'] = path
if file_args['mode'] is None:
file_args['mode'] = default_mode
# Create tempfile name

View File

@ -8,32 +8,40 @@ matrix:
exclude:
- env: T=none
include:
- env: T=sanity/1
- env: T=devel/sanity/1
- env: T=units/2.7/1
- env: T=units/3.5/1
- env: T=units/3.6/1
- env: T=units/3.7/1
- env: T=units/3.8/1
- env: T=units/3.9/1
- env: T=devel/units/2.7/1
- env: T=devel/units/3.5/1
- env: T=devel/units/3.6/1
- env: T=devel/units/3.7/1
- env: T=devel/units/3.8/1
- env: T=devel/units/3.9/1
- env: T=osx/10.11/1
- env: T=rhel/7.6/1
- env: T=rhel/8.1/1
- env: T=freebsd/11.1/1
- env: T=freebsd/12.1/1
- env: T=linux/centos6/1
- env: T=linux/centos7/1
- env: T=linux/centos8/1
- env: T=linux/fedora30/1
- env: T=linux/fedora31/1
- env: T=linux/opensuse15py2/1
- env: T=linux/opensuse15/1
- env: T=linux/ubuntu1604/1
- env: T=linux/ubuntu1804/1
- env: T=devel/osx/10.11/1
- env: T=devel/rhel/7.6/1
- env: T=devel/rhel/8.1/1
- env: T=devel/freebsd/11.1/1
- env: T=devel/freebsd/12.1/1
- env: T=devel/linux/centos6/1
- env: T=devel/linux/centos7/1
- env: T=devel/linux/centos8/1
- env: T=devel/linux/fedora30/1
- env: T=devel/linux/fedora31/1
- env: T=devel/linux/opensuse15py2/1
- env: T=devel/linux/opensuse15/1
- env: T=devel/linux/ubuntu1604/1
- env: T=devel/linux/ubuntu1804/1
- env: T=cloud/2.7/1
- env: T=cloud/3.6/1
- env: T=devel/cloud/2.7/1
- env: T=devel/cloud/3.6/1
# For Ansible 2.9, use a combination of different targets
- env: T=2.9/sanity/1
- env: T=2.9/units/2.7/1
- env: T=2.9/units/3.8/1
- env: T=2.9/rhel/7.6/1
- env: T=2.9/linux/ubuntu1804/1
- env: T=2.9/cloud/3.6/1
branches:
except:

View File

@ -2,18 +2,16 @@
command: '{{ ansible_python.executable }} -c ''import cryptography; print(cryptography.__version__)'''
register: cryptography_version
- block:
- name: Archive test files
community.general.archive:
path: '{{ role_path }}/files/'
dest: '{{ output_dir }}/files.tgz'
- name: Create temporary directory to store files
- name: Make sure testhost directory exists
file:
state: directory
path: '{{ remote_tmp_dir }}/files/'
- name: Unarchive test files on testhost
unarchive:
src: '{{ output_dir }}/files.tgz'
state: directory
when: ansible_version.string is version('2.10', '<')
- name: Copy test files to testhost
copy:
src: '{{ role_path }}/files/'
dest: '{{ remote_tmp_dir }}/files/'
remote_src: yes
- name: Find root for cert 1
certificate_complete_chain:
input_chain: '{{ lookup(''file'', ''cert1-fullchain.pem'', rstrip=False) }}'

View File

@ -3,10 +3,10 @@
pkg_mgr: community.general.pkgng
ansible_pkg_mgr: community.general.pkgng
cacheable: yes
when: ansible_os_family == "FreeBSD"
when: ansible_os_family == 'FreeBSD' and ansible_version.string is version('2.10', '>=')
- set_fact:
pkg_mgr: community.general.zypper
ansible_pkg_mgr: community.general.zypper
cacheable: yes
when: ansible_os_family == "Suse"
when: ansible_os_family == 'Suse' and ansible_version.string is version('2.10', '>=')

View File

@ -2,8 +2,15 @@ plugins/module_utils/compat/ipaddress.py future-import-boilerplate
plugins/module_utils/compat/ipaddress.py metaclass-boilerplate
plugins/module_utils/compat/ipaddress.py no-assert
plugins/module_utils/compat/ipaddress.py no-unicode-literals
plugins/modules/acme_account_info.py validate-modules:return-syntax-error
plugins/modules/acme_certificate.py validate-modules:doc-elements-mismatch
plugins/modules/acme_certificate.py validate-modules:return-syntax-error
plugins/modules/certificate_complete_chain.py validate-modules:return-syntax-error
plugins/modules/get_certificate.py validate-modules:return-syntax-error
plugins/modules/openssh_cert.py validate-modules:return-syntax-error
plugins/modules/openssl_certificate_info.py validate-modules:return-syntax-error
plugins/modules/openssl_csr.py validate-modules:return-syntax-error
plugins/modules/openssl_csr_info.py validate-modules:return-syntax-error
plugins/modules/x509_crl.py validate-modules:return-syntax-error
plugins/modules/x509_crl_info.py validate-modules:return-syntax-error
tests/unit/mock/path.py future-import-boilerplate
tests/unit/mock/path.py metaclass-boilerplate
tests/unit/mock/yaml_helper.py future-import-boilerplate

View File

@ -5,9 +5,16 @@ set -o pipefail -eux
declare -a args
IFS='/:' read -ra args <<< "$1"
script="${args[0]}"
ansible_version="${args[0]}"
script="${args[1]}"
test="$1"
function join {
local IFS="$1";
shift;
echo "$*";
}
test="$(join / "${args[@]:1}")"
docker images ansible/ansible
docker images quay.io/ansible/*
@ -45,7 +52,14 @@ function retry
command -v pip
pip --version
pip list --disable-pip-version-check
retry pip install https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check
if [ "${ansible_version}" == "devel" ]; then
retry pip install https://github.com/felixfontein/ansible/archive/changelogs-docs-collections.tar.gz --disable-pip-version-check
# retry pip install https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check
else
retry pip install ansible==${ansible_version} --disable-pip-version-check
# force complete CI run for Ansible 2.9: 2.9's ansible-test's change detection for collections is broken
COMPLETE=yes
fi
export ANSIBLE_COLLECTIONS_PATHS="${HOME}/.ansible"
SHIPPABLE_RESULT_DIR="$(pwd)/shippable"
@ -55,7 +69,7 @@ cp -aT "${SHIPPABLE_BUILD_DIR}" "${TEST_DIR}"
cd "${TEST_DIR}"
# STAR: HACK install integration test dependencies
if [ "${script}" != "units" ] && [ "${script}" != "sanity" ]; then
if [ "${script}" != "units" ] && [ "${script}" != "sanity" ] && [ "${ansible_version}" != "2.9" ]; then
retry ansible-galaxy -vvv collection install community.general
fi
# END: HACK