Skip to content

Commit 1de27d8

Browse files
shiavm006Tim Zhou
authored andcommitted
test: fixing tests duo to CRUN#1767
update tests duo to CRUN#1767 to support both values Signed-off-by: Tim Zhou <tizhou@redhat.com>
1 parent a9e80f9 commit 1de27d8

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

test/apiv2/20-containers.at

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,13 +763,14 @@ if root && test -e /dev/nullb0; then
763763

764764
cgroupPath=/sys/fs/cgroup/cpu.weight
765765
# 002 is the byte length
766-
cpu_weight_expect=$'\001\0025'
766+
cpu_weight_expect_regex=$'\x01\x025|\x01\x0220'
767767

768768
# Verify CPU weight
769769
echo '{ "AttachStdout":true,"Cmd":["cat", "'$cgroupPath'"]}' >${TMPD}/exec.json
770770
t POST containers/updateCtr/exec ${TMPD}/exec.json 201 .Id~[0-9a-f]\\{64\\}
771771
eid=$(jq -r '.Id' <<<"$output")
772-
t POST exec/$eid/start 200 $cpu_weight_expect
772+
response=$('t POST exec/$eid/start 200')
773+
like "$response" "$cpu_weight_expect_regex"
773774

774775
BlkioDeviceReadBps_expected='[
775776
{

test/e2e/update_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ var _ = Describe("Podman update", func() {
141141
podmanTest.CheckFileInContainerSubstring(ctrID, "/sys/fs/cgroup/memory.swap.max", "1073741824")
142142

143143
// checking cpu-shares
144-
podmanTest.CheckFileInContainerSubstring(ctrID, "/sys/fs/cgroup/cpu.weight", "5")
144+
exec := podmanTest.PodmanExitCleanly("exec", ctrID, "cat", "/sys/fs/cgroup/cpu.weight")
145+
Expect(exec.OutputToString()).To(Or(ContainSubstring("5"), ContainSubstring("20")))
145146

146147
// checking pids-limit
147148
podmanTest.CheckFileInContainerSubstring(ctrID, "/sys/fs/cgroup/pids.max", "123")

0 commit comments

Comments
 (0)