-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test with device name starting with 'crypt'. (#821)
- Loading branch information
1 parent
0f7c5f0
commit 32047dc
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
62 changes: 62 additions & 0 deletions
62
tests/integration/targets/luks_device/tasks/tests/cryptname.yml
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--- | ||
# Copyright (c) Ansible Project | ||
# 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 | ||
|
||
- name: Fix name | ||
set_fact: | ||
cryptname: "crypt{{ '%0x' % ((2**32) | random) }}" | ||
|
||
- name: Create | ||
luks_device: | ||
device: "{{ cryptfile_device }}" | ||
name: "{{ cryptname }}" | ||
state: present | ||
keyfile: "{{ remote_tmp_dir }}/keyfile1" | ||
pbkdf: | ||
iteration_time: 0.1 | ||
become: true | ||
register: create | ||
- name: Open | ||
luks_device: | ||
device: "{{ cryptfile_device }}" | ||
name: "{{ cryptname }}" | ||
state: opened | ||
keyfile: "{{ remote_tmp_dir }}/keyfile1" | ||
become: true | ||
register: open | ||
- name: Open (idempotent) | ||
luks_device: | ||
device: "{{ cryptfile_device }}" | ||
name: "{{ cryptname }}" | ||
state: opened | ||
keyfile: "{{ remote_tmp_dir }}/keyfile1" | ||
become: true | ||
register: open_idem | ||
- name: Closed (via name) | ||
luks_device: | ||
name: "{{ cryptname }}" | ||
state: closed | ||
become: true | ||
register: close | ||
- name: Closed (via name, idempotent) | ||
luks_device: | ||
name: "{{ cryptname }}" | ||
state: closed | ||
become: true | ||
register: close_idem | ||
- name: Absent | ||
luks_device: | ||
device: "{{ cryptfile_device }}" | ||
name: "{{ cryptname }}" | ||
state: absent | ||
become: true | ||
register: absent | ||
- assert: | ||
that: | ||
- create is changed | ||
- open is changed | ||
- open_idem is not changed | ||
- close is changed | ||
- close_idem is not changed | ||
- absent is changed |