diff options
author | Ed Santiago <santiago@redhat.com> | 2020-07-29 13:26:02 -0600 |
---|---|---|
committer | Ed Santiago <santiago@redhat.com> | 2020-07-30 06:16:51 -0600 |
commit | 84f4b87c2e22afe0375c24936b1e6f15e731ea19 (patch) | |
tree | 906f6e8d4ae2c153caac0382cefb9f62bb583058 /test/system/320-system-df.bats | |
parent | 117043040e18e473f3b2142576303349238a36a7 (diff) | |
download | podman-84f4b87c2e22afe0375c24936b1e6f15e731ea19.tar.gz podman-84f4b87c2e22afe0375c24936b1e6f15e731ea19.tar.bz2 podman-84f4b87c2e22afe0375c24936b1e6f15e731ea19.zip |
System tests: new system-df and passwd tests
- New test for #6991 - passwd file is writable even when
run with --userns=keep-id
- Enable another keep-id test, commented out due to #6593
- New test for podman system df
Also, independently, removed this line:
apt-get -y upgrade conmon
...because it's causing CI failures, probably because of the
boothole CVE, probably because the Ubuntu grub update was
rushed out. I believe it is safe to remove this, because
both Ubuntu 19 and 20 report:
conmon is already the newest version (2.0.18~1).
Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/system/320-system-df.bats')
-rw-r--r-- | test/system/320-system-df.bats | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/test/system/320-system-df.bats b/test/system/320-system-df.bats new file mode 100644 index 000000000..a96507448 --- /dev/null +++ b/test/system/320-system-df.bats @@ -0,0 +1,61 @@ +#!/usr/bin/env bats -*- bats -*- +# +# tests for podman system df +# + +load helpers + +function teardown() { + basic_teardown + + # In case the active-volumes test failed: clean up stray volumes + run_podman volume rm -a +} + +@test "podman system df - basic functionality" { + run_podman system df + is "$output" ".*Images *1 *0 " "Exactly one image" + is "$output" ".*Containers *0 *0 " "No containers" + is "$output" ".*Local Volumes *0 *0 " "No volumes" +} + +@test "podman system df - with active containers and volumes" { + run_podman run -v /myvol1 --name c1 $IMAGE true + run_podman run -d -v /myvol2 --name c2 $IMAGE \ + sh -c 'while ! test -e /stop; do sleep 0.1;done' + + run_podman system df --format '{{ .Type }}:{{ .Total }}:{{ .Active }}--' + # FIXME: if/when #7149 gets fixed, split this into three tests (i.e. test "${lines[0]}", [1], [2] ) + is "$output" "Images:1:1--Containers:2:1--Local Volumes:2:1--" + + # Try -v. (Grrr. No way to specify individual formats) + # + # Yes, I know this would be more elegant as a separate @test, but + # container/volume setup/teardown costs ~3 seconds and that matters. + run_podman system df -v + is "${lines[2]}" \ + "${PODMAN_TEST_IMAGE_REGISTRY}/${PODMAN_TEST_IMAGE_USER}/${PODMAN_TEST_IMAGE_NAME} * ${PODMAN_TEST_IMAGE_TAG} [0-9a-f]* .* 2" \ + "system df -v: the 'Images' line" + + # Containers are listed in random order. Just check that each has 1 volume + is "${lines[5]}" \ + "[0-9a-f]\{12\} *[0-9a-f]\{12\} .* 1 .* c[12]" \ + "system df -v, 'Containers', first line" + is "${lines[6]}" \ + "[0-9a-f]\{12\} *[0-9a-f]\{12\} .* 1 .* c[12]" \ + "system df -v, 'Containers', second line" + + # Volumes, likewise: random order. + is "${lines[9]}" "[0-9a-f]\{64\} *[01] * 0B" \ + "system df -v, 'Volumes', first line" + is "${lines[10]}" "[0-9a-f]\{64\} *[01] * 0B" \ + "system df -v, 'Volumes', second line" + + # Clean up + run_podman exec c2 touch /stop + run_podman wait c2 + run_podman rm c1 c2 + run_podman volume rm -a +} + +# vim: filetype=sh |