Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
92cb8dd3
Commit
92cb8dd3
authored
Feb 20, 2014
by
Richard C Isaacson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unarchive tests.
parent
ce358e70
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
86 additions
and
1 deletions
+86
-1
tests_new/integration/non_destructive.yml
+1
-1
tests_new/integration/roles/test_unarchive/files/foo.txt
+1
-0
tests_new/integration/roles/test_unarchive/meta/main.yml
+3
-0
tests_new/integration/roles/test_unarchive/tasks/main.yml
+81
-0
No files found.
tests_new/integration/non_destructive.yml
View file @
92cb8dd3
...
...
@@ -23,4 +23,4 @@
-
{
role
:
test_var_blending
,
parameterized_beats_default
:
1234
,
tags
:
test_var_blending
}
-
{
role
:
test_lineinfile
,
tags
:
test_lineinfile
}
-
{
role
:
test_ignore_errors
,
tags
:
test_ignore_errors
}
-
{
role
:
test_unarchive
,
tags
:
test_unarchive
}
tests_new/integration/roles/test_unarchive/files/foo.txt
0 → 100644
View file @
92cb8dd3
foo.txt
tests_new/integration/roles/test_unarchive/meta/main.yml
0 → 100644
View file @
92cb8dd3
dependencies
:
-
prepare_tests
tests_new/integration/roles/test_unarchive/tasks/main.yml
0 → 100644
View file @
92cb8dd3
# Test code for the unarchive module.
# (c) 2014, Richard Isaacson <richard.c.isaacson@gmail.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
:
prep our file
copy
:
src=foo.txt dest={{output_dir}}/foo-unarchive.txt
-
name
:
prep a tar file
shell
:
tar cvf test-unarchive.tar foo-unarchive.txt chdir={{output_dir}}
-
name
:
prep a tar.gz file
shell
:
tar cvf test-unarchive.tar.gz foo-unarchive.txt chdir={{output_dir}}
-
name
:
prep a zip file
shell
:
tar cvf test-unarchive.zip foo-unarchive.txt chdir={{output_dir}}
-
name
:
create our tar unarchive destination
file
:
path={{output_dir}}/test-unarchive-tar state=directory
-
name
:
unarchive a tar file
unarchive
:
src={{output_dir}}/test-unarchive.tar dest="{{output_dir | expanduser}}/test-unarchive-tar" copy=no
register
:
unarchive01
-
name
:
verify that the file was marked as changed
assert
:
{
that
:
"
unarchive01.changed
==
true"
}
-
name
:
verify that the file was unarchived
file
:
path={{output_dir}}/test-unarchive-tar/foo-unarchive.txt state=file
-
name
:
remove our tar unarchive destination
file
:
path={{output_dir}}/test-unarchive-tar state=absent
-
name
:
create our tar.gz unarchive destination
file
:
path={{output_dir}}/test-unarchive-tar-gz state=directory
-
name
:
unarchive a tar.gz file
unarchive
:
src={{output_dir}}/test-unarchive.tar.gz dest={{output_dir | expanduser}}/test-unarchive-tar-gz copy=no
register
:
unarchive02
-
name
:
verify that the file was marked as changed
assert
:
{
that
:
"
unarchive02.changed
==
true"
}
-
name
:
verify that the file was unarchived
file
:
path={{output_dir}}/test-unarchive-tar-gz/foo-unarchive.txt state=file
-
name
:
remove our tar.gz unarchive destination
file
:
path={{output_dir}}/test-unarchive-tar-gz state=absent
-
name
:
create our zip unarchive destination
file
:
path={{output_dir}}/test-unarchive-zip state=directory
-
name
:
unarchive a zip file
unarchive
:
src={{output_dir}}/test-unarchive.zip dest={{output_dir | expanduser}}/test-unarchive-zip copy=no
register
:
unarchive03
-
name
:
verify that the file was marked as changed
assert
:
{
that
:
"
unarchive03.changed
==
true"
}
-
name
:
verify that the file was unarchived
file
:
path={{output_dir}}/test-unarchive-zip/foo-unarchive.txt state=file
-
name
:
remove our tar unarchive destination
file
:
path={{output_dir}}/test-unarchive-zip state=absent
-
name
:
remove our test file for the archive
file
:
path={{output_dir}}/foo-unarchive.txt state=absent
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment