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
8741065c
Commit
8741065c
authored
Feb 19, 2014
by
Michael DeHaan
Committed by
Michael DeHaan
Feb 19, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check that copy module params get delegated to the file module.
parent
3c8b47ad
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
13 deletions
+22
-13
tests_new/integration/roles/test_copy/tasks/main.yml
+16
-11
tests_new/integration/roles/test_template/tasks/main.yml
+6
-2
No files found.
tests_new/integration/roles/test_copy/tasks/main.yml
View file @
8741065c
...
@@ -19,10 +19,19 @@
...
@@ -19,10 +19,19 @@
-
name
:
record the output directory
-
name
:
record the output directory
set_fact
:
output_file={{output_dir}}/foo.txt
set_fact
:
output_file={{output_dir}}/foo.txt
-
name
:
initiate a basic copy
-
name
:
initiate a basic copy
, and also test the mode
copy
:
src=foo.txt dest={{output_file}}
copy
:
src=foo.txt dest={{output_file}}
mode=0444
register
:
copy_result
register
:
copy_result
-
name
:
check the mode of the output file
file
:
name={{output_file}} state=file
register
:
file_result_check
-
name
:
assert the mode is correct
assert
:
that
:
-
"
file_result_check.mode
==
'0444'"
-
name
:
assert basic copy worked
-
name
:
assert basic copy worked
assert
:
assert
:
that
:
that
:
...
@@ -81,15 +90,6 @@
...
@@ -81,15 +90,6 @@
that
:
that
:
-
"
copy_result3|changed"
-
"
copy_result3|changed"
-
name
:
overwrite the file again using the content system
copy
:
content="modified" dest={{output_file}}
register
:
copy_result4
-
name
:
assert that the copy result has not changed
assert
:
that
:
-
"
not
copy_result4|changed"
# test recursive copy
# test recursive copy
-
name
:
set the output subdirectory
-
name
:
set the output subdirectory
...
@@ -120,6 +120,11 @@
...
@@ -120,6 +120,11 @@
# errors on this aren't presently ignored so this test is commented out. But it would be nice to fix.
# errors on this aren't presently ignored so this test is commented out. But it would be nice to fix.
#
#
-
name
:
overwrite the file again using the content system, also passing along file params
copy
:
content="modified" dest={{output_file}}
register
:
copy_result4
#- name: assert invalid copy input location fails
#- name: assert invalid copy input location fails
# copy: src=invalid_file_location_does_not_exist dest={{output_dir}}/file.txt
# copy: src=invalid_file_location_does_not_exist dest={{output_dir}}/file.txt
# ignore_errors: True
# ignore_errors: True
...
...
tests_new/integration/roles/test_template/tasks/main.yml
View file @
8741065c
...
@@ -34,7 +34,9 @@
...
@@ -34,7 +34,9 @@
-
"
'uid'
in
template_result"
-
"
'uid'
in
template_result"
-
name
:
verify that the file was marked as changed
-
name
:
verify that the file was marked as changed
assert
:
{
that
:
"
template_result.changed
==
true"
}
assert
:
that
:
-
"
template_result.changed
==
true"
# VERIFY CONTENTS
# VERIFY CONTENTS
...
@@ -58,5 +60,7 @@
...
@@ -58,5 +60,7 @@
register
:
file_result
register
:
file_result
-
name
:
ensure file mode did not change
-
name
:
ensure file mode did not change
assert
:
{
that
:
"
file_result.changed
!=
True"
}
assert
:
that
:
-
"
file_result.changed
!=
True"
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