1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/tests/integration/targets/etcd3/tasks/run_tests.yml
Eric Belhomme da4e5d3592
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
2020-04-28 08:51:10 +02:00

94 lines
2.4 KiB
YAML

---
# test code for the etcd3 module
# (c) 2017, Jean-Philippe Evrard <jean-philippe@evrard.me>
# 2020, SCC France, Eric Belhomme <ebelhomme@fr.scc.com>
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# ============================================================
# Integration tests
- name: Check mode, show need change
etcd3:
key: "foo"
value: "bar"
state: "present"
register: _etcd3_prst_chktst
check_mode: true
- name: Change to new value
etcd3:
key: "foo"
value: "bar"
state: "present"
register: _etcd3_prst_chgtst
- name: Idempotency test, show unchanged.
etcd3:
key: "foo"
value: "bar"
state: "present"
register: _etcd3_prst_idmptnttst
- name: Idempotency test in check mode, show unchanged
etcd3:
key: "foo"
value: "bar"
state: "present"
register: _etcd3_prst_idmptntchktst
check_mode: true
- name: Check mode, show need removal of key
etcd3:
key: "foo"
value: "baz"
state: "absent"
register: _etcd3_absnt_chktst
check_mode: true
- name: Remove foo key
etcd3:
key: "foo"
value: "baz"
state: "absent"
register: _etcd3_absnt_chgtst
- name: Idempotency test in check mode, show unchanged
etcd3:
key: "foo"
value: "baz"
state: "absent"
register: _etcd3_absnt_idmptnttst
check_mode: true
- name: Idempotency test, show unchanged
etcd3:
key: "foo"
value: "baz"
state: "absent"
register: _etcd3_absnt_idmptntchktst
- name: Checking the status are expected
assert:
that:
- _etcd3_prst_chktst is changed
- _etcd3_prst_chgtst is changed
- _etcd3_prst_idmptnttst is not changed
- _etcd3_prst_idmptntchktst is not changed
- _etcd3_absnt_chktst is changed
- _etcd3_absnt_chgtst is changed
- _etcd3_absnt_idmptnttst is not changed
- _etcd3_absnt_idmptntchktst is not changed