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
67a559ed
Commit
67a559ed
authored
Mar 17, 2015
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests using a docker private registry
parent
cfc90dff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
2 deletions
+69
-2
test/integration/roles/test_docker/tasks/main.yml
+7
-2
test/integration/roles/test_docker/tasks/registry-tests.yml
+62
-0
No files found.
test/integration/roles/test_docker/tasks/main.yml
View file @
67a559ed
...
...
@@ -14,5 +14,10 @@
# Add other distributions as the proper packages become available
when
:
ansible_distribution in ['Fedora']
-
include
:
docker-tests.yml
when
:
ansible_distribution in ['RedHat', 'CentOS'] and ansible_lsb.major_release|int == 6
#- include: docker-tests.yml
# when: ansible_distribution in ['RedHat', 'CentOS'] and ansible_lsb.major_release|int == 6
-
include
:
registry-tests.yml
# Add other distributions as the proper packages become available
when
:
ansible_distribution in ['Fedora']
test/integration/roles/test_docker/tasks/registry-tests.yml
0 → 100644
View file @
67a559ed
-
name
:
Configure a private docker registry
service
:
name
:
docker-registry
state
:
started
-
name
:
Get busybox image id
shell
:
"
docker
images
|
grep
busybox
|
awk
'{
print
$3
}'"
register
:
image_id
-
name
:
Tag docker image into the local repository
shell
:
"
docker
tag
{{
image_id.stdout_lines[0]
}}
localhost:5000/mine"
-
name
:
Push docker image into the local repository
shell
:
"
docker
push
localhost:5000/mine"
-
name
:
Remove the busybox image from the local docker
shell
:
"
docker
rmi
-f
{{
image_id.stdout_lines[0]
}}"
-
name
:
Remove the new image from the local docker
shell
:
"
docker
rmi
-f
localhost:5000/mine"
-
name
:
Get number of images in docker
shell
:
"
docker
images
|wc
-l"
register
:
docker_output
-
name
:
Check that there are no images in docker
assert
:
that
:
-
"
'1'
in
docker_output.stdout_lines"
-
name
:
Retrieve the image from private docker server
docker
:
image
:
"
localhost:5000/mine"
state
:
present
pull
:
missing
insecure_registry
:
True
-
name
:
Run a small script in the new image
docker
:
image
:
"
localhost:5000/mine"
state
:
reloaded
pull
:
always
command
:
"
nc
-l
-p
2000
-e
xargs
-n1
echo
hello"
detach
:
True
insecure_registry
:
True
-
name
:
Get the docker container id
shell
:
"
docker
ps
|
grep
mine
|
awk
'{
print
$1
}'"
register
:
container_id
-
name
:
Get the docker container ip
shell
:
"
docker
inspect
{{
container_id.stdout_lines[0]
}}
|
grep
IPAddress
|
awk
-F
'
\"
'
'{
print
$4
}'"
register
:
container_ip
-
name
:
Try to access the server
shell
:
"
echo
'world'
|
nc
{{
container_ip.stdout_lines[0]
}}
2000"
register
:
docker_output
-
name
:
check that the script ran
assert
:
that
:
-
"
'hello
world'
in
docker_output.stdout_lines"
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