mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 20:31:27 -07:00
Moving the assemble test to the correct location
This commit is contained in:
parent
4e49b32419
commit
7517cd9398
7 changed files with 0 additions and 0 deletions
1
test/integration/roles/test_assemble/files/fragment1
Normal file
1
test/integration/roles/test_assemble/files/fragment1
Normal file
|
@ -0,0 +1 @@
|
|||
this is fragment 1
|
1
test/integration/roles/test_assemble/files/fragment2
Normal file
1
test/integration/roles/test_assemble/files/fragment2
Normal file
|
@ -0,0 +1 @@
|
|||
this is fragment 2
|
1
test/integration/roles/test_assemble/files/fragment3
Normal file
1
test/integration/roles/test_assemble/files/fragment3
Normal file
|
@ -0,0 +1 @@
|
|||
this is fragment 3
|
1
test/integration/roles/test_assemble/files/fragment4
Normal file
1
test/integration/roles/test_assemble/files/fragment4
Normal file
|
@ -0,0 +1 @@
|
|||
this is fragment 4
|
1
test/integration/roles/test_assemble/files/fragment5
Normal file
1
test/integration/roles/test_assemble/files/fragment5
Normal file
|
@ -0,0 +1 @@
|
|||
this is fragment 5
|
20
test/integration/roles/test_assemble/meta/main.yml
Normal file
20
test/integration/roles/test_assemble/meta/main.yml
Normal file
|
@ -0,0 +1,20 @@
|
|||
# test code for the assemble module
|
||||
# (c) 2014, James Cammarata <jcammarata@ansible.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/>.
|
||||
|
||||
dependencies:
|
||||
- prepare_tests
|
71
test/integration/roles/test_assemble/tasks/main.yml
Normal file
71
test/integration/roles/test_assemble/tasks/main.yml
Normal file
|
@ -0,0 +1,71 @@
|
|||
# test code for the assemble module
|
||||
# (c) 2014, James Cammarata <jcammarata@ansible.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/>.
|
||||
|
||||
- name: create a new directory for file source
|
||||
file: dest="{{output_dir}}/src" state=directory
|
||||
register: result
|
||||
|
||||
- name: assert the directory was created
|
||||
assert:
|
||||
that:
|
||||
- "result.state == 'directory'"
|
||||
|
||||
- name: copy the files to a new directory
|
||||
copy: src="./" dest="{{output_dir}}/src"
|
||||
register: result
|
||||
|
||||
- name: test assemble with all fragments
|
||||
assemble: src="{{output_dir}}/src" dest="{{output_dir}}/assembled1"
|
||||
register: result
|
||||
|
||||
- name: assert the fragments were assembled
|
||||
assert:
|
||||
that:
|
||||
- "result.state == 'file'"
|
||||
- "result.md5sum == '96905702a2ece40de6bf3a94b5062513'"
|
||||
|
||||
- name: test assemble with fragments matching a regex
|
||||
assemble: src="{{output_dir}}/src" dest="{{output_dir}}/assembled2" regexp="^fragment[1-3]$"
|
||||
register: result
|
||||
|
||||
- name: assert the fragments were assembled with a regex
|
||||
assert:
|
||||
that:
|
||||
- "result.state == 'file'"
|
||||
- "result.md5sum == 'eb9e3486a9cd6943b5242e573b9b9349'"
|
||||
|
||||
- name: test assemble with a delimiter
|
||||
assemble: src="{{output_dir}}/src" dest="{{output_dir}}/assembled3" delimiter="#--- delimiter ---#"
|
||||
register: result
|
||||
|
||||
- name: assert the fragments were assembled with a delimiter
|
||||
assert:
|
||||
that:
|
||||
- "result.state == 'file'"
|
||||
- "result.md5sum == '4773eac67aba3f0be745876331c8a450'"
|
||||
|
||||
- name: test assemble with remote_src=False
|
||||
assemble: src="./" dest="{{output_dir}}/assembled4" remote_src=no
|
||||
register: result
|
||||
|
||||
- name: assert the fragments were assembled without remote
|
||||
assert:
|
||||
that:
|
||||
- "result.state == 'file'"
|
||||
- "result.md5sum == '96905702a2ece40de6bf3a94b5062513'"
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue