From f06dd45e0c1b4a36bb93f33cc863d54af94b5155 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Thu, 18 Feb 2021 06:11:29 -0500 Subject: Allow podman play kube to read yaml file from stdin Fixes: https://github.com/containers/podman/issues/8996 Signed-off-by: Daniel J Walsh --- test/e2e/test.yaml | 37 -------------------------------- test/system/700-play.bats | 54 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 37 deletions(-) delete mode 100644 test/e2e/test.yaml create mode 100644 test/system/700-play.bats (limited to 'test') diff --git a/test/e2e/test.yaml b/test/e2e/test.yaml deleted file mode 100644 index 98d2c91df..000000000 --- a/test/e2e/test.yaml +++ /dev/null @@ -1,37 +0,0 @@ -# Save the output of this file and use kubectl create -f to import -# it into Kubernetes. -# -# Created with podman-1.6.2 -apiVersion: v1 -kind: Pod -metadata: - labels: - app: test - name: test -spec: - containers: - - command: - - sleep - - "100" - env: - - name: PATH - value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - - name: TERM - value: xterm - - name: container - value: podman - image: docker.io/library/fedora:latest - name: test - resources: {} - securityContext: - runAsUser: 1000 - runAsGroup: 3000 - fsGroup: 2000 - allowPrivilegeEscalation: true - capabilities: {} - privileged: false - seLinuxOptions: - level: "s0:c1,c2" - readOnlyRootFilesystem: false - workingDir: / -status: {} diff --git a/test/system/700-play.bats b/test/system/700-play.bats new file mode 100644 index 000000000..e7904f59f --- /dev/null +++ b/test/system/700-play.bats @@ -0,0 +1,54 @@ +#!/usr/bin/env bats -*- bats -*- +# +# Test podman play +# + +load helpers + +testYaml=" +apiVersion: v1 +kind: Pod +metadata: + labels: + app: test + name: test_pod +spec: + containers: + - command: + - sleep + - "100" + env: + - name: PATH + value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + - name: TERM + value: xterm + - name: container + value: podman + image: quay.io/libpod/alpine:latest + name: test + resources: {} + securityContext: + runAsUser: 1000 + runAsGroup: 3000 + fsGroup: 2000 + allowPrivilegeEscalation: true + capabilities: {} + privileged: false + seLinuxOptions: + level: "s0:c1,c2" + readOnlyRootFilesystem: false + workingDir: / +status: {} +" + +@test "podman play with stdin" { + echo "$testYaml" > $PODMAN_TMPDIR/test.yaml + run_podman play kube - < $PODMAN_TMPDIR/test.yaml + run_podman pod rm -f test_pod +} + +@test "podman play" { + echo "$testYaml" > $PODMAN_TMPDIR/test.yaml + run_podman play kube $PODMAN_TMPDIR/test.yaml + run_podman pod rm -f test_pod +} -- cgit v1.2.3-54-g00ecf