Skip to content

Commit 2e4418a

Browse files
Merge pull request #26760 from timcoding1988/feat/RUN-3333_fixing-cpu-weight-test
update tests duo to CRUN#1767 to support both values
2 parents a91d5f0 + 2c89069 commit 2e4418a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.cirrus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ env:
3131
DEBIAN_NAME: "debian-13"
3232

3333
# Image identifiers
34-
IMAGE_SUFFIX: "c20250627t155202z-f42f41d13"
34+
IMAGE_SUFFIX: "c20250812t173301z-f42f41d13"
3535

3636
# EC2 images
3737
FEDORA_AMI: "fedora-aws-${IMAGE_SUFFIX}"

test/apiv2/20-containers.at

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -762,14 +762,13 @@ if root && test -e /dev/nullb0; then
762762
t POST libpod/containers/updateCtr/update ${TMPD}/update.json 201
763763

764764
cgroupPath=/sys/fs/cgroup/cpu.weight
765-
# 002 is the byte length
766-
cpu_weight_expect=$'\001\0025'
767765

768766
# Verify CPU weight
769767
echo '{ "AttachStdout":true,"Cmd":["cat", "'$cgroupPath'"]}' >${TMPD}/exec.json
770768
t POST containers/updateCtr/exec ${TMPD}/exec.json 201 .Id~[0-9a-f]\\{64\\}
771769
eid=$(jq -r '.Id' <<<"$output")
772-
t POST exec/$eid/start 200 $cpu_weight_expect
770+
t POST exec/$eid/start 200
771+
like "$(<$WORKDIR/curl.result.out)" $'^\x01.\(20\|5\)$' "cpu.weight is 5 or 20"
773772

774773
BlkioDeviceReadBps_expected='[
775774
{

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)