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
dcbc69b6
Commit
dcbc69b6
authored
Feb 24, 2014
by
Richard C Isaacson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added script to the new integration tests.
parent
aaf0a182
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
87 additions
and
2 deletions
+87
-2
test/integration/non_destructive.yml
+3
-2
test/integration/roles/test_script/files/create_afile.sh
+4
-0
test/integration/roles/test_script/files/remove_afile.sh
+4
-0
test/integration/roles/test_script/files/test.sh
+4
-0
test/integration/roles/test_script/meta/main.yml
+3
-0
test/integration/roles/test_script/tasks/main.yml
+69
-0
No files found.
test/integration/non_destructive.yml
View file @
dcbc69b6
...
...
@@ -33,4 +33,5 @@
-
{
role
:
test_lookups
,
tags
:
test_lookups
}
-
{
role
:
test_iterators
,
tags
:
test_iterators
}
-
{
role
:
test_command_shell
,
tags
:
test_command_shell
}
-
{
role
:
test_failed_when
,
tags
:
test_failed_when
}
\ No newline at end of file
-
{
role
:
test_failed_when
,
tags
:
test_failed_when
}
-
{
role
:
test_script
,
tags
:
test_script
}
\ No newline at end of file
test/integration/roles/test_script/files/create_afile.sh
0 → 100755
View file @
dcbc69b6
#!/usr/bin/env bash
echo
"win"
>
"
$1
"
\ No newline at end of file
test/integration/roles/test_script/files/remove_afile.sh
0 → 100755
View file @
dcbc69b6
#!/usr/bin/env bash
rm
"
$1
"
\ No newline at end of file
test/integration/roles/test_script/files/test.sh
0 → 100755
View file @
dcbc69b6
#!/usr/bin/env bash
echo
-n
"win"
\ No newline at end of file
test/integration/roles/test_script/meta/main.yml
0 → 100644
View file @
dcbc69b6
dependencies
:
-
prepare_tests
test/integration/roles/test_script/tasks/main.yml
0 → 100644
View file @
dcbc69b6
# Test code for the command and shell modules.
# (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/>.
##
## prep
##
-
set_fact
:
output_dir_test={{output_dir}}/test_script
-
name
:
make sure our testing sub-directory does not exist
file
:
path="{{ output_dir_test }}" state=absent
-
name
:
create our testing sub-directory
file
:
path="{{ output_dir_test }}" state=directory
##
## script
##
-
name
:
execute the test.sh script via command
script
:
test.sh
register
:
script_result0
-
name
:
assert that the script executed correctly
assert
:
that
:
-
"
script_result0.rc
==
0"
-
"
script_result0.stderr
==
''"
-
"
script_result0.stdout
==
'win'"
# creates
-
name
:
verify that afile.txt is absent
file
:
path={{output_dir_test}}/afile.txt state=absent
-
name
:
create afile.txt with create_afile.sh via command
shell
:
create_afile.sh {{output_dir_test | expanduser}}/afile.txt creates={{output_dir_test | expanduser}}/afile.txt
-
name
:
verify that afile.txt is present
file
:
path={{output_dir_test}}/afile.txt state=file
# removes
-
name
:
remove afile.txt with remote_afile.sh via command
shell
:
remove_afile.sh {{output_dir_test | expanduser}}/afile.txt removes={{output_dir_test | expanduser}}/afile.txt
-
name
:
verify that afile.txt is absent
file
:
path={{output_dir_test}}/afile.txt state=absent
register
:
script_result1
-
name
:
assert that the file was removed by the script
assert
:
that
:
-
"
script_result1.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