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
cfda5690
Commit
cfda5690
authored
Mar 18, 2015
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Okay, let's see if these pauses are enough to get this passing
parent
4009c053
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
12 deletions
+38
-12
test/integration/roles/test_docker/tasks/docker-tests.yml
+12
-2
test/integration/roles/test_docker/tasks/registry-tests.yml
+26
-10
No files found.
test/integration/roles/test_docker/tasks/docker-tests.yml
View file @
cfda5690
...
...
@@ -8,6 +8,7 @@
image
:
busybox
state
:
present
pull
:
missing
docker_api_version
:
"
1.14"
-
name
:
Run a small script in busybox
docker
:
...
...
@@ -16,6 +17,7 @@
pull
:
always
command
:
"
nc
-l
-p
2000
-e
xargs
-n1
echo
hello"
detach
:
True
docker_api_version
:
"
1.14"
-
name
:
Get the docker container id
shell
:
"
docker
ps
|
grep
busybox
|
awk
'{
print
$1
}'"
...
...
@@ -25,6 +27,10 @@
shell
:
"
docker
inspect
{{
container_id.stdout_lines[0]
}}
|
grep
IPAddress
|
awk
-F
'
\"
'
'{
print
$4
}'"
register
:
container_ip
-
name
:
Pause a few moments because docker is not reliable
pause
:
seconds
:
40
-
name
:
Try to access the server
shell
:
"
echo
'world'
|
nc
{{
container_ip.stdout_lines[0]
}}
2000"
register
:
docker_output
...
...
@@ -43,6 +49,7 @@
TEST
:
hello
command
:
'
/bin/sh
-c
"nc
-l
-p
2000
-e
xargs
-n1
echo
$TEST"'
detach
:
True
docker_api_version
:
"
1.14"
-
name
:
Get the docker container id
shell
:
"
docker
ps
|
grep
busybox
|
awk
'{
print
$1
}'"
...
...
@@ -52,6 +59,10 @@
shell
:
"
docker
inspect
{{
container_id.stdout_lines[0]
}}
|
grep
IPAddress
|
awk
-F
'
\"
'
'{
print
$4
}'"
register
:
container_ip
-
name
:
Pause a few moments because docker is not reliable
pause
:
seconds
:
40
-
name
:
Try to access the server
shell
:
"
echo
'world'
|
nc
{{
container_ip.stdout_lines[0]
}}
2000"
register
:
docker_output
...
...
@@ -62,5 +73,4 @@
-
"
'hello
world'
in
docker_output.stdout_lines"
-
name
:
Remove the busybox image from the local docker
shell
:
"
docker
rmi
-f
busybox"
shell
:
"
docker
rmi
-f
$(docker
images
-q)"
test/integration/roles/test_docker/tasks/registry-tests.yml
View file @
cfda5690
...
...
@@ -19,17 +19,16 @@
-
name
:
Push docker image into the private registry
command
:
"
docker
push
localhost:5000/mine"
-
name
:
Remove
the busybox image from the local docker
command
:
"
docker
rmi
-f
{{
image_id.stdout_lines[0]
}}
"
-
name
:
Remove
containers
shell
:
"
docker
rm
$(docker
ps
-aq)
"
-
name
:
Remove
the new image
from the local docker
command
:
"
docker
rmi
-f
localhost:5000/mine
"
-
name
:
Remove
all images
from the local docker
shell
:
"
docker
rmi
-f
$(docker
images
-q)
"
-
name
:
Get number of images in docker
command
:
"
docker
images"
register
:
docker_output
-
debug
:
var=docker_output
# docker prints a header so the header should be all that's present
-
name
:
Check that there are no images in docker
assert
:
...
...
@@ -42,6 +41,7 @@
state
:
present
pull
:
missing
insecure_registry
:
True
docker_api_version
:
"
1.14"
-
name
:
Run a small script in the new image
docker
:
...
...
@@ -51,6 +51,7 @@
command
:
"
nc
-l
-p
2000
-e
xargs
-n1
echo
hello"
detach
:
True
insecure_registry
:
True
docker_api_version
:
"
1.14"
-
name
:
Get the docker container id
shell
:
"
docker
ps
|
grep
mine
|
awk
'{
print
$1
}'"
...
...
@@ -60,6 +61,10 @@
shell
:
"
docker
inspect
{{
container_id.stdout_lines[0]
}}
|
grep
IPAddress
|
awk
-F
'
\"
'
'{
print
$4
}'"
register
:
container_ip
-
name
:
Pause a few moments because docker is not reliable
pause
:
seconds
:
40
-
name
:
Try to access the server
shell
:
"
echo
'world'
|
nc
{{
container_ip.stdout_lines[0]
}}
2000"
register
:
docker_output
...
...
@@ -69,14 +74,17 @@
that
:
-
"
'hello
world'
in
docker_output.stdout_lines"
-
name
:
Remove the new image from the local docker
command
:
"
docker
rmi
-f
localhost:5000/mine"
-
name
:
Remove containers
shell
:
"
docker
rm
$(docker
ps
-aq)"
-
name
:
Remove all images from the local docker
shell
:
"
docker
rmi
-f
$(docker
images
-q)"
-
name
:
Get number of images in docker
command
:
"
docker
images"
register
:
docker_output
-
debug
:
var=docker_output
-
name
:
Check that there are no images in docker
assert
:
that
:
...
...
@@ -135,6 +143,7 @@
state
:
running
command
:
"
nc
-l
-p
2000
-e
xargs
-n1
echo
hello"
detach
:
True
docker_api_version
:
"
1.14"
-
name
:
Get the docker container id
shell
:
"
docker
ps
|
grep
mine
|
awk
'{
print
$1
}'"
...
...
@@ -144,6 +153,10 @@
shell
:
"
docker
inspect
{{
container_id.stdout_lines[0]
}}
|
grep
IPAddress
|
awk
-F
'
\"
'
'{
print
$4
}'"
register
:
container_ip
-
name
:
Pause a few moments because docker is not reliable
pause
:
seconds
:
40
-
name
:
Try to access the server
shell
:
"
echo
'world'
|
nc
{{
container_ip.stdout_lines[0]
}}
2000"
register
:
docker_output
...
...
@@ -153,8 +166,11 @@
that
:
-
"
'hello
world'
in
docker_output.stdout_lines"
-
name
:
Remove the private repo image from the local docker
command
:
"
docker
rmi
-f
dockertest.ansible.com:8080/mine"
-
name
:
Remove containers
shell
:
"
docker
rm
$(docker
ps
-aq)"
-
name
:
Remove all images from the local docker
shell
:
"
docker
rmi
-f
$(docker
images
-q)"
-
name
:
Remove domain name to hosts
lineinfile
:
...
...
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