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
8f05e4ea
Commit
8f05e4ea
authored
Feb 16, 2015
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests for:
https://github.com/ansible/ansible-modules-core/issues/778
parent
c9fb97cc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
85 additions
and
0 deletions
+85
-0
test/integration/roles/test_file/tasks/main.yml
+85
-0
No files found.
test/integration/roles/test_file/tasks/main.yml
View file @
8f05e4ea
...
...
@@ -477,3 +477,88 @@
assert
:
that
:
-
result.stat.mode == '0644'
-
name
:
attempt to modify the permissions of the link itself
file
:
path={{output_dir}}/test_follow_link src="./test_follow" state=link mode=0600 follow=no
register
:
result
# Whether the link itself changed is platform dependent! (BSD vs Linux?)
# Just check that the underlying file was not changed
-
name
:
stat the link target
stat
:
path={{output_dir}}/test_follow
register
:
result
-
name
:
assert that the link target was unmodified
assert
:
that
:
-
result.stat.mode == '0644'
ignore_errors
:
True
# Follow + recursive tests
-
name
:
create a toplevel directory
file
:
path={{output_dir}}/test_follow_rec state=directory mode=0755
-
name
:
create a file outside of the toplevel
file
:
path={{output_dir}}/test_follow_rec_target_file state=touch mode=0700
-
name
:
create a directory outside of the toplevel
file
:
path={{output_dir}}/test_follow_rec_target_dir state=directory mode=0700
-
name
:
create a file inside of the link target directory
file
:
path={{output_dir}}/test_follow_rec_target_dir/foo state=touch mode=0700
-
name
:
create a symlink to the file
file
:
path={{output_dir}}/test_follow_rec/test_link state=link src="../test_follow_rec_target_file"
-
name
:
create a symlink to the directory
file
:
path={{output_dir}}/test_follow_rec/test_link_dir state=link src="../test_follow_rec_target_dir"
-
name
:
try to change permissions without following symlinks
file
:
path={{output_dir}}/test_follow_rec follow=False mode="a-x" recurse=True
-
name
:
stat the link file target
stat
:
path={{output_dir}}/test_follow_rec_target_file
register
:
file_result
-
name
:
stat the link dir target
stat
:
path={{output_dir}}/test_follow_rec_target_dir
register
:
dir_result
-
name
:
stat the file inside the link dir target
stat
:
path={{output_dir}}/test_follow_rec_target_dir/foo
register
:
file_in_dir_result
-
debug
:
var=file_result.stat.mode
-
debug
:
var=dir_result.stat.mode
-
debug
:
var=file_in_dir_result.stat.mode
-
name
:
assert that the link targets were unmodified
assert
:
that
:
-
file_result.stat.mode == '0700'
-
dir_result.stat.mode == '0700'
-
file_in_dir_result.stat.mode == '0700'
-
name
:
try to change permissions with following symlinks
file
:
path={{output_dir}}/test_follow_rec follow=True mode="a-x" recurse=True
-
name
:
stat the link file target
stat
:
path={{output_dir}}/test_follow_rec_target_file
register
:
file_result
-
name
:
stat the link dir target
stat
:
path={{output_dir}}/test_follow_rec_target_dir
register
:
dir_result
-
name
:
stat the file inside the link dir target
stat
:
path={{output_dir}}/test_follow_rec_target_dir/foo
register
:
file_in_dir_result
-
debug
:
var=file_result.stat.mode
-
debug
:
var=dir_result.stat.mode
-
debug
:
var=file_in_dir_result.stat.mode
-
name
:
assert that the link targets were modified
assert
:
that
:
-
file_result.stat.mode == '0600'
-
dir_result.stat.mode == '0600'
-
file_in_dir_result.stat.mode == '0600'
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