Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Commit

Permalink
docker_pull_run_remove: add test for cpu-shares flag (#415)
Browse files Browse the repository at this point in the history
This changes the `docker_pull_run_remove` role to add a test for the
use of `--cpu-shares` flag when doing `docker run`.  This is to catch
regressions such as RHBZ#1585735.

Additionally, I expanded the list of images we are testing to include
images from registries other than docker.io.

Closes #414
  • Loading branch information
Micah Abbott authored and mike-nguyen committed Jun 18, 2018
1 parent 0f7487f commit 4ffadb4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
11 changes: 8 additions & 3 deletions roles/docker_pull_run_remove/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,22 @@
# popular_images is defined in roles/docker_pull_run_remove/vars/main.yml
#
- name: Pull the popular images from Docker Hub
command: "docker pull docker.io/{{ item }}"
command: "docker pull {{ item }}"
with_items: "{{ popular_images }}"
register: dpd
retries: 5
delay: 60
until: dpd|success

- name: Run the popular images
command: "docker run --rm docker.io/{{ item }} echo 'hello'"
command: "docker run --rm {{ item }} echo 'hello'"
with_items: "{{ popular_images }}"

# Test for https://bugzilla.redhat.com/show_bug.cgi?id=1585735
- name: Run the popular images with cpu-shares flag
command: "docker run --cpu-shares 2 --rm {{ item }} echo 'hello'"
with_items: "{{ popular_images }}"

- name: Remove the popular images
command: "docker rmi docker.io/{{ item }}"
command: "docker rmi {{ item }}"
with_items: "{{ popular_images }}"
9 changes: 6 additions & 3 deletions roles/docker_pull_run_remove/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# vim: set ft=ansible:
#
popular_images:
- alpine
- busybox
- ubuntu
- docker.io/alpine
- docker.io/busybox
- docker.io/ubuntu
- registry.fedoraproject.org/fedora
- registry.centos.org/centos
- registry.access.redhat.com/rhel

0 comments on commit 4ffadb4

Please sign in to comment.