summaryrefslogtreecommitdiffstats
path: root/tests/roles/cli/tasks/bud.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/roles/cli/tasks/bud.yaml')
-rw-r--r--tests/roles/cli/tasks/bud.yaml105
1 files changed, 92 insertions, 13 deletions
diff --git a/tests/roles/cli/tasks/bud.yaml b/tests/roles/cli/tasks/bud.yaml
index 1f1c678..6dc42fa 100644
--- a/tests/roles/cli/tasks/bud.yaml
+++ b/tests/roles/cli/tasks/bud.yaml
@@ -1,24 +1,103 @@
---
-- name: buildah bud localfile
- command: buildah bud -t testing/nginx --pull /tmp/buildah/bud
+- name: buildah bud with image's format oci
+ command: buildah bud --format=oci --tag testing/fmtoci /tmp/buildah/bud
+
+- name: buildah bud with image's format docker
+ command: buildah bud -t testing/fmtdocker --format=docker /tmp/buildah/bud
-- name: check bud images with buildah images command
- shell: buildah images | grep testing/nginx
+- name: buildah bud localfile
+ command: buildah bud -t testing/hello --pull /tmp/buildah/bud
- name: buildah bud -f localfile
- command: buildah bud -t testing/nginx2 -f /tmp/buildah/bud/Dockerfile .
+ command: buildah bud -t testing/hello2 -f /tmp/buildah/bud/Dockerfile /tmp/buildah/bud
- name: buildah bud URL
- command: buildah bud -t testing/nginx3 http://localhost/bud/Dockerfile.tar.gz
+ command: buildah bud -t testing/hello3 http://localhost/bud/Dockerfile.tar.gz
- name: buildah build-using-dockerfile localfile
- command: buildah build-using-dockerfile -t testing/nginx4 /tmp/buildah/bud
+ command: buildah build-using-dockerfile -t testing/hello4 /tmp/buildah/bud
+
+- lineinfile:
+ path: /tmp/buildah/bud/Dockerfile
+ regexp: '^COPY'
+ line: 'COPY $foo /'
+
+- name: buildah bud with build-arg
+ command: buildah bud -t testing/hello5 --build-arg foo=hello /tmp/buildah/bud
+
+- name: create container from bud images
+ command: buildah from docker.io/testing/{{ item }}
+ with_items:
+ - hello
+ - hello2
+ - hello3
+ - hello4
+ - hello5
+
+- name: list containers
+ command: buildah containers
+ register: ctrs
+
+- name: run containers from bud images
+ command: buildah run {{ item }}-working-container
+ register: hello
+ with_items:
+ - hello
+ - hello2
+ - hello3
+ - hello4
+ - hello5
+
+- name: verify string hello in container hellos
+ fail:
+ msg: '"Hello from Docker" not found after container run'
+ when: '"Hello from Docker" not in item.stdout'
+ with_items: "{{ hello.results }}"
+
+- name: buildah rm containers of hello
+ command: buildah rm {{ item }}-working-container
+ with_items:
+ - hello
+ - hello2
+ - hello3
+ - hello4
+ - hello5
+
+
+- name: buildah bud --quiet
+ command: buildah bud --quiet -t testing/hello6 /tmp/buildah/bud
+ register: budquiet
+ failed_when: '"STEP" in budquiet.stdout'
+
+- name: buildah bud -q
+ command: buildah bud -q -t testing/hello7 /tmp/buildah/bud
+ register: budq
+ failed_when: '"STEP" in budq.stdout'
+
+- lineinfile:
+ path: /tmp/buildah/bud/Dockerfile
+ regexp: "^FROM"
+ line: "FROM localhost:5000/buildah/busybox"
-- name: buildah build-using-dockerfile -f localfile
- command: buildah build-using-dockerfile -t testing/nginx5 --file /tmp/buildah/bud/Dockerfile .
+- name: verify bud image from local docker registry without tls-verify is failed
+ command: buildah bud -t testing/hellofail /tmp/buildah/bud
+ register: st
+ failed_when: st.rc != 1
-- name: buildah build-using-dockerfile URL
- command: buildah build-using-dockerfile --tag testing/nginx6 http://localhost/bud/Dockerfile.tar.gz
+- name: buildah bud image from local docker registry is successful
+ command: buildah bud --tls-verify=false -t testing/hello8 /tmp/buildah/bud
-- name: buildah rmi
- command: buildah rmi testing/nginx{2..6}
+- name: buildah rmi hello images
+ command: buildah rmi {{ item }}
+ with_items:
+ - testing/hello
+ - testing/hello2
+ - testing/hello3
+ - testing/hello4
+ - testing/hello5
+ - testing/hello6
+ - testing/hello7
+ - testing/hello8
+ - testing/fmtoci
+ - testing/fmtdocker
+ - localhost:5000/buildah/busybox