Skip to content

Commit

Permalink
test/system: podman run with log-opt option
Browse files Browse the repository at this point in the history
This test case is used for covering rhbz#1763007.
Replaces: containers#12221

Signed-off-by: Alex Jia <[email protected]>
Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Dec 31, 2021
1 parent 807f7cf commit fc65b0f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/system/030-run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fc65b0f

Please sign in to comment.