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

82 lines
2 KiB
YAML
Raw Permalink Normal View History

2020-03-09 10:11:07 +01:00
---
# test code for the etcd3 module
# Copyright (c) 2017, Jean-Philippe Evrard <jean-philippe@evrard.me>
# Copyright 2020, SCC France, Eric Belhomme <ebelhomme@fr.scc.com>
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
2020-03-09 10:11:07 +01:00
# ============================================================
# 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