From 4ffadb4ad39f1f7aa7fdd3dee688b7a70daeba60 Mon Sep 17 00:00:00 2001 From: Micah Abbott Date: Mon, 18 Jun 2018 10:33:38 -0400 Subject: [PATCH] docker_pull_run_remove: add test for cpu-shares flag (#415) 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 --- roles/docker_pull_run_remove/tasks/main.yml | 11 ++++++++--- roles/docker_pull_run_remove/vars/main.yml | 9 ++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/roles/docker_pull_run_remove/tasks/main.yml b/roles/docker_pull_run_remove/tasks/main.yml index eee5f63..ab5c8d2 100644 --- a/roles/docker_pull_run_remove/tasks/main.yml +++ b/roles/docker_pull_run_remove/tasks/main.yml @@ -4,7 +4,7 @@ # 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 @@ -12,9 +12,14 @@ 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 }}" diff --git a/roles/docker_pull_run_remove/vars/main.yml b/roles/docker_pull_run_remove/vars/main.yml index 4dc2ee1..70f6e5d 100644 --- a/roles/docker_pull_run_remove/vars/main.yml +++ b/roles/docker_pull_run_remove/vars/main.yml @@ -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