diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/apiv2/10-images.at | 10 | ||||
-rw-r--r-- | test/apiv2/20-containers.at | 6 | ||||
-rwxr-xr-x | test/buildah-bud/apply-podman-deltas | 3 | ||||
-rw-r--r-- | test/e2e/images_test.go | 1 | ||||
-rw-r--r-- | test/e2e/play_kube_test.go | 56 | ||||
-rw-r--r-- | test/system/001-basic.bats | 7 | ||||
-rw-r--r-- | test/system/250-systemd.bats | 23 |
7 files changed, 89 insertions, 17 deletions
diff --git a/test/apiv2/10-images.at b/test/apiv2/10-images.at index 53702fa0a..037a4c01f 100644 --- a/test/apiv2/10-images.at +++ b/test/apiv2/10-images.at @@ -143,12 +143,8 @@ t DELETE libpod/images/test1:latest 200 t GET "images/get?names=alpine" 200 '[POSIX tar archive]' podman pull busybox -#t GET "images/get?names=alpine&names=busybox" 200 '[POSIX tar archive]' -#img_cnt=$(tar xf "$WORKDIR/curl.result.out" manifest.json -O | jq "length") -#is "$img_cnt" 2 "number of images in tar archive" -# TODO getting multiple images is not supported yet -# once it is supported replace the test below by the tests above -t GET "images/get?names=alpine&names=busybox" 501 \ - .cause="getting multiple image is not supported yet" +t GET "images/get?names=alpine&names=busybox" 200 '[POSIX tar archive]' +img_cnt=$(tar xf "$WORKDIR/curl.result.out" manifest.json -O | jq "length") +is "$img_cnt" 2 "number of images in tar archive" # vim: filetype=sh diff --git a/test/apiv2/20-containers.at b/test/apiv2/20-containers.at index 23dd374d6..a81210855 100644 --- a/test/apiv2/20-containers.at +++ b/test/apiv2/20-containers.at @@ -161,6 +161,12 @@ t GET libpod/containers/myctr/json 200 \ .OCIConfigPath~.*config\.json \ .GraphDriver.Data.MergedDir~.*merged +# Test TS are in UTC +t GET containers/myctr/json 200 \ + .Created~.*Z \ + .State.StartedAt~.*Z \ + .State.FinishedAt~.*Z + t DELETE images/localhost/newrepo:latest?force=true 200 t DELETE images/localhost/newrepo:v1?force=true 200 t DELETE images/localhost/newrepo:v2?force=true 200 diff --git a/test/buildah-bud/apply-podman-deltas b/test/buildah-bud/apply-podman-deltas index ecdb9430c..0bf9f298d 100755 --- a/test/buildah-bud/apply-podman-deltas +++ b/test/buildah-bud/apply-podman-deltas @@ -157,8 +157,7 @@ skip "FIXME FIXME FIXME podman save/load has been fixed (but not yet used in Bui ############################################################################### # BEGIN tests which are skipped due to actual podman bugs. -skip "FIXME: podman #9915" \ - "bud with --arch flag" + ############################################################################### # Done. diff --git a/test/e2e/images_test.go b/test/e2e/images_test.go index 098d58033..f6321ec1c 100644 --- a/test/e2e/images_test.go +++ b/test/e2e/images_test.go @@ -219,7 +219,6 @@ WORKDIR /test }) It("podman pull by digest and list --all", func() { - Skip("FIXME-8165: 'rmi -af' fails with 'layer not known' (#6510)") // Prevent regressing on issue #7651. digestPullAndList := func(noneTag bool) { session := podmanTest.Podman([]string{"pull", ALPINEAMD64DIGEST}) diff --git a/test/e2e/play_kube_test.go b/test/e2e/play_kube_test.go index 3908d4075..e0af27f7a 100644 --- a/test/e2e/play_kube_test.go +++ b/test/e2e/play_kube_test.go @@ -28,6 +28,44 @@ metadata: spec: hostname: unknown ` +var sharedNamespacePodYaml = ` +apiVersion: v1 +kind: Pod +metadata: + creationTimestamp: "2021-05-07T17:25:01Z" + labels: + app: testpod1 + name: testpod1 +spec: + containers: + - command: + - top + - -d + - "1.5" + env: + - name: PATH + value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + - name: TERM + value: xterm + - name: container + value: podman + - name: HOSTNAME + value: label-pod + image: quay.io/libpod/alpine:latest + name: alpine + resources: {} + securityContext: + allowPrivilegeEscalation: true + capabilities: {} + privileged: false + readOnlyRootFilesystem: false + seLinuxOptions: {} + workingDir: / + dnsConfig: {} + restartPolicy: Never + shareProcessNamespace: true +status: {} +` var selinuxLabelPodYaml = ` apiVersion: v1 @@ -1004,6 +1042,24 @@ var _ = Describe("Podman play kube", func() { Expect(label).To(ContainSubstring("unconfined_u:system_r:spc_t:s0")) }) + It("podman play kube should share ipc,net,uts when shareProcessNamespace is set", func() { + SkipIfRootless("Requires root priviledges for sharing few namespaces") + err := writeYaml(sharedNamespacePodYaml, kubeYaml) + Expect(err).To(BeNil()) + + kube := podmanTest.Podman([]string{"play", "kube", kubeYaml}) + kube.WaitWithDefaultTimeout() + Expect(kube.ExitCode()).To(Equal(0)) + + inspect := podmanTest.Podman([]string{"inspect", "testpod1", "--format", "'{{ .SharedNamespaces }}'"}) + inspect.WaitWithDefaultTimeout() + sharednamespaces := inspect.OutputToString() + Expect(sharednamespaces).To(ContainSubstring("ipc")) + Expect(sharednamespaces).To(ContainSubstring("net")) + Expect(sharednamespaces).To(ContainSubstring("uts")) + Expect(sharednamespaces).To(ContainSubstring("pid")) + }) + It("podman play kube fail with nonexistent authfile", func() { err := generateKubeYaml("pod", getPod(), kubeYaml) Expect(err).To(BeNil()) diff --git a/test/system/001-basic.bats b/test/system/001-basic.bats index 5d44c373f..97ef61511 100644 --- a/test/system/001-basic.bats +++ b/test/system/001-basic.bats @@ -15,13 +15,6 @@ function setup() { @test "podman version emits reasonable output" { run_podman version - # FIXME FIXME FIXME: #10248: nasty message on Ubuntu cgroups v1, rootless - if [[ "$output" =~ "overlay test mount with multiple lowers failed" ]]; then - if is_rootless; then - lines=("${lines[@]:1}") - fi - fi - # First line of podman-remote is "Client:<blank>". # Just delete it (i.e. remove the first entry from the 'lines' array) if is_remote; then diff --git a/test/system/250-systemd.bats b/test/system/250-systemd.bats index b42769409..4ea192009 100644 --- a/test/system/250-systemd.bats +++ b/test/system/250-systemd.bats @@ -125,4 +125,27 @@ function service_cleanup() { service_cleanup } +# These tests can fail in dev. environment because of SELinux. +# quick fix: chcon -t container_runtime_exec_t ./bin/podman +@test "podman generate systemd - envar" { + xdg_rootless + + cname=$(random_string) + FOO=value BAR=%s run_podman create --name $cname --env FOO -e BAR --env MYVAR=myval \ + $IMAGE sh -c 'printenv && sleep 100' + + # Start systemd service to run this container + service_setup + + # Give container time to start; make sure output looks top-like + sleep 2 + run_podman logs $cname + is "$output" ".*FOO=value.*" "FOO environment variable set" + is "$output" ".*BAR=%s.*" "BAR environment variable set" + is "$output" ".*MYVAR=myval.*" "MYVAL environment variable set" + + # All good. Stop service, clean up. + service_cleanup +} + # vim: filetype=sh |