-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix broken etcd3 module integration test (#239)
* fix broken etcd3 module integration test * rewrite etcd3 test role as role-only integration test * etcd3 module integration test changes: - add setup_etcd3 as dependency in meta - skip python2.6 target as etcd3 won't install * fix aliases
- Loading branch information
1 parent
c2e37d2
commit da4e5d3
Showing
11 changed files
with
6 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
destructive | ||
shippable/posix/group1 | ||
destructive | ||
skip/aix | ||
skip/osx | ||
skip/freebsd | ||
disabled | ||
skip/python2.6 # installing etcd3 python module will fail on python < 2.7 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
dependencies: | ||
- setup_pkg_mgr | ||
- setup_etcd3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
--- | ||
# test code for the etcd3 module | ||
# (c) 2017, Jean-Philippe Evrard <[email protected]> | ||
# 2020, SCC France, Eric Belhomme <[email protected]> | ||
|
||
# This file is part of Ansible | ||
# | ||
|
@@ -19,86 +20,6 @@ | |
|
||
# ============================================================ | ||
|
||
- name: python 2 | ||
set_fact: | ||
python_suffix: "" | ||
when: ansible_python_version is version('3', '<') | ||
|
||
- name: python 3 | ||
set_fact: | ||
python_suffix: "-py3" | ||
when: ansible_python_version is version('3', '>=') | ||
|
||
- include_vars: '{{ item }}' | ||
with_first_found: | ||
- files: | ||
- '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}{{ python_suffix }}.yml' | ||
- '{{ ansible_distribution }}-{{ ansible_distribution_version }}{{ python_suffix }}.yml' | ||
- '{{ ansible_os_family }}{{ python_suffix }}.yml' | ||
- 'default{{ python_suffix }}.yml' | ||
paths: '../vars' | ||
|
||
# Install requirements for etcd3 module | ||
- name: Install etcd3 packages | ||
package: | ||
name: "{{ etcd3_deps_packages }}" | ||
state: present | ||
|
||
- name: Install etcd3 module | ||
pip: | ||
name: etcd3 | ||
state: present | ||
|
||
# Check if re-installing etcd3 is required | ||
- name: Check if etcd3ctl exists for re-use. | ||
shell: "ETCDCTL_API=3 {{ etcd3_path }}/etcdctl --endpoints=localhost:2379 get foo" | ||
args: | ||
executable: /bin/bash | ||
changed_when: false | ||
failed_when: false | ||
register: _testetcd3ctl | ||
|
||
# Installing etcd3 | ||
- name: If can't reuse, prepare download folder | ||
file: | ||
path: "{{ etcd3_download_location }}" | ||
state: directory | ||
register: _etcddownloadexists | ||
when: | ||
- _testetcd3ctl.rc != 0 | ||
|
||
- name: Delete download folder if already exists (to start clean) | ||
file: | ||
path: "{{ etcd3_download_location }}" | ||
state: absent | ||
when: | ||
- _testetcd3ctl.rc != 0 | ||
- _etcddownloadexists is not changed | ||
|
||
- name: Recreate download folder if purged | ||
file: | ||
path: "{{ etcd3_download_location }}" | ||
state: directory | ||
when: | ||
- _testetcd3ctl.rc != 0 | ||
- _etcddownloadexists is not changed | ||
|
||
- name: Download etcd3 | ||
unarchive: | ||
src: "{{ etcd3_download_url }}" | ||
dest: "{{ etcd3_download_location }}" | ||
remote_src: yes | ||
when: | ||
- _testetcd3ctl.rc != 0 | ||
|
||
# Running etcd3 and kill afterwards if it wasn't running before. | ||
- name: Run etcd3 | ||
shell: "{{ etcd3_path }}/etcd &" | ||
register: _etcd3run | ||
changed_when: true | ||
when: | ||
- _testetcd3ctl.rc != 0 | ||
|
||
# Integration tests | ||
- name: Check mode, show need change | ||
etcd3: | ||
|
@@ -171,8 +92,3 @@ | |
- _etcd3_absnt_chgtst is changed | ||
- _etcd3_absnt_idmptnttst is not changed | ||
- _etcd3_absnt_idmptntchktst is not changed | ||
|
||
- name: kill etcd3 | ||
command: "pkill etcd" | ||
when: | ||
- _testetcd3ctl.rc != 0 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.