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
0f9ad9da
Commit
0f9ad9da
authored
May 14, 2015
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update integration tests from @darkk to work with the current uri module code
parent
3383a7b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
59 deletions
+28
-59
test/integration/non_destructive.yml
+1
-0
test/integration/roles/test_uri/tasks/main.yml
+27
-59
No files found.
test/integration/non_destructive.yml
View file @
0f9ad9da
...
@@ -39,6 +39,7 @@
...
@@ -39,6 +39,7 @@
-
{
role
:
test_authorized_key
,
tags
:
test_authorized_key
}
-
{
role
:
test_authorized_key
,
tags
:
test_authorized_key
}
-
{
role
:
test_get_url
,
tags
:
test_get_url
}
-
{
role
:
test_get_url
,
tags
:
test_get_url
}
-
{
role
:
test_embedded_module
,
tags
:
test_embedded_module
}
-
{
role
:
test_embedded_module
,
tags
:
test_embedded_module
}
-
{
role
:
test_uri
,
tags
:
test_uri
}
# Turn on test_binary when we start testing v2
# Turn on test_binary when we start testing v2
#- { role: test_binary, tags: test_binary }
#- { role: test_binary, tags: test_binary }
test/integration/roles/test_uri/tasks/main.yml
View file @
0f9ad9da
...
@@ -19,24 +19,39 @@
...
@@ -19,24 +19,39 @@
-
name
:
set role facts
-
name
:
set role facts
set_fact
:
set_fact
:
http_port
:
15260
http_port
:
15260
files_dir
:
'
{{
_original_file|dirname
}}/..
/files'
files_dir
:
'
{{
output_dir|expanduser
}}
/files'
checkout_dir
:
'
{{
output_dir
}}/git'
checkout_dir
:
'
{{
output_dir
}}/git'
-
name
:
create a directory to serve files from
file
:
dest
:
"
{{
files_dir
}}"
state
:
directory
-
copy
:
src
:
"
{{
item
}}"
dest
:
"
{{files_dir}}/{{
item
}}"
with_sequence
:
start=0 end=4 format=pass%d.json
-
copy
:
src
:
"
{{
item
}}"
dest
:
"
{{files_dir}}/{{
item
}}"
with_sequence
:
start=0 end=30 format=fail%d.json
-
name
:
verify that python2 is installed so this test can continue
-
name
:
verify that python2 is installed so this test can continue
shell
:
which python2
shell
:
which python2
register
:
py2
register
:
py2
-
name
:
start SimpleHTTPServer
-
name
:
start SimpleHTTPServer
shell
:
cd {{ files_dir }} && {{ py2.stdout }} -m SimpleHTTPServer {{ http_port }}
shell
:
cd {{ files_dir }} && {{ py2.stdout }} -m SimpleHTTPServer {{ http_port }}
async
:
15
# this test set takes ~8
seconds to run
async
:
60
# this test set takes ~15
seconds to run
poll
:
0
poll
:
0
-
wait_for
:
port={{ http_port }}
-
wait_for
:
port={{ http_port }}
-
name
:
md5
pass_json
-
name
:
checksum
pass_json
stat
:
path={{ files_dir }}/{{ item }}.json get_
md5
=yes
stat
:
path={{ files_dir }}/{{ item }}.json get_
checksum
=yes
register
:
pass_
md5
register
:
pass_
checksum
with_sequence
:
start=0 end=4 format=pass%d
with_sequence
:
start=0 end=4 format=pass%d
-
name
:
fetch pass_json
-
name
:
fetch pass_json
...
@@ -48,15 +63,15 @@
...
@@ -48,15 +63,15 @@
assert
:
assert
:
that
:
that
:
-
'
"json"
in
item.1'
-
'
"json"
in
item.1'
-
item.0.stat.
md5 == item.1.raw_content | md5
-
item.0.stat.
checksum == item.1.content | checksum
with_together
:
with_together
:
-
pass_
md5
.results
-
pass_
checksum
.results
-
pass.results
-
pass.results
-
name
:
md5
fail_json
-
name
:
checksum
fail_json
stat
:
path={{ files_dir }}/{{ item }}.json get_
md5
=yes
stat
:
path={{ files_dir }}/{{ item }}.json get_
checksum
=yes
register
:
fail_
md5
register
:
fail_
checksum
with_sequence
:
start=0 end=30 format=fail%d
with_sequence
:
start=0 end=30 format=fail%d
-
name
:
fetch fail_json
-
name
:
fetch fail_json
...
@@ -67,55 +82,8 @@
...
@@ -67,55 +82,8 @@
-
name
:
check fail_json
-
name
:
check fail_json
assert
:
assert
:
that
:
that
:
-
item.0.stat.
md5 == item.1.raw_content | md5
-
item.0.stat.
checksum == item.1.content | checksum
-
'
"json"
not
in
item.1'
-
'
"json"
not
in
item.1'
with_together
:
with_together
:
-
fail_
md5
.results
-
fail_
checksum
.results
-
fail.results
-
fail.results
-
name
:
check content != raw_content
assert
:
that
:
item.content != item.raw_content
with_items
:
-
'
{{
pass.results.0
}}'
-
'
{{
fail.results.14
}}'
-
'
{{
fail.results.15
}}'
-
'
{{
fail.results.16
}}'
-
'
{{
fail.results.27
}}'
-
name
:
check content == raw_content
assert
:
that
:
item.content == item.raw_content
with_items
:
-
'
{{
pass.results.1
}}'
-
'
{{
pass.results.2
}}'
-
'
{{
pass.results.3
}}'
-
'
{{
pass.results.4
}}'
-
'
{{
fail.results.0
}}'
-
'
{{
fail.results.1
}}'
-
'
{{
fail.results.2
}}'
-
'
{{
fail.results.3
}}'
-
'
{{
fail.results.4
}}'
-
'
{{
fail.results.5
}}'
-
'
{{
fail.results.6
}}'
-
'
{{
fail.results.7
}}'
-
'
{{
fail.results.8
}}'
-
'
{{
fail.results.9
}}'
-
'
{{
fail.results.10
}}'
-
'
{{
fail.results.11
}}'
-
'
{{
fail.results.12
}}'
-
'
{{
fail.results.13
}}'
-
'
{{
fail.results.17
}}'
-
'
{{
fail.results.18
}}'
-
'
{{
fail.results.19
}}'
-
'
{{
fail.results.20
}}'
-
'
{{
fail.results.21
}}'
-
'
{{
fail.results.22
}}'
-
'
{{
fail.results.23
}}'
-
'
{{
fail.results.24
}}'
-
'
{{
fail.results.25
}}'
-
'
{{
fail.results.26
}}'
-
'
{{
fail.results.28
}}'
-
'
{{
fail.results.29
}}'
-
'
{{
fail.results.30
}}'
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