diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2021-12-31 08:49:11 -0500 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2021-12-31 08:49:21 -0500 |
commit | fc65b0f73c8803d98f772d07c7a8e9f47769f3fd (patch) | |
tree | fc4b8e42dc51d8b649aef33b3c1a67dc202aa3ad /test | |
parent | 807f7cfed3df770abcb7609e9b281d666a110b27 (diff) | |
download | podman-fc65b0f73c8803d98f772d07c7a8e9f47769f3fd.tar.gz podman-fc65b0f73c8803d98f772d07c7a8e9f47769f3fd.tar.bz2 podman-fc65b0f73c8803d98f772d07c7a8e9f47769f3fd.zip |
test/system: podman run with log-opt option
This test case is used for covering rhbz#1763007.
Replaces: #12221
Signed-off-by: Alex Jia <ajia@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/system/030-run.bats | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/system/030-run.bats b/test/system/030-run.bats index 130cf5492..5e85e9869 100644 --- a/test/system/030-run.bats +++ b/test/system/030-run.bats @@ -778,6 +778,18 @@ EOF is "$output" "1.2.3.4 foo.com.*" "users can add hosts even without /etc/hosts" } +# rhbz#1763007 : the --log-opt for podman run does not work as expected +@test "podman run with log-opt option" { + # Pseudorandom size of the form N.NNN. The '| 1' handles '0.NNN' or 'N.NN0', + # which podman displays as 'NNN kB' or 'N.NN MB' respectively. + size=$(printf "%d.%03d" $(($RANDOM % 10 | 1)) $(($RANDOM % 100 | 1))) + run_podman run -d --rm --log-opt max-size=${size}m $IMAGE sleep 5 + cid=$output + run_podman inspect --format "{{ .HostConfig.LogConfig.Size }}" $cid + is "$output" "${size}MB" + run_podman rm -t 0 -f $cid +} + @test "podman run --kernel-memory warning" { # Not sure what situations this fails in, but want to make sure warning shows. run_podman '?' run --rm --kernel-memory 100 $IMAGE false |