@@ -263,26 +263,26 @@ EOF
263263 runc run -d --console-socket " $CONSOLE_SOCKET " test_update
264264 [ " $status " -eq 0 ]
265265
266- # check that initial values were properly set
267- check_cpu_quota 500000 1000000 " 500ms "
266+ # Check that initial values were properly set.
267+ check_cpu_quota 500000 1000000
268268 check_cpu_shares 100
269269
270- # update cpu period
270+ # Update cpu period.
271271 runc update test_update --cpu-period 900000
272272 [ " $status " -eq 0 ]
273- check_cpu_quota 500000 900000 " 560ms "
273+ check_cpu_quota 500000 900000
274274
275- # update cpu quota
275+ # Update cpu quota.
276276 runc update test_update --cpu-quota 600000
277277 [ " $status " -eq 0 ]
278- check_cpu_quota 600000 900000 " 670ms "
278+ check_cpu_quota 600000 900000
279279
280- # remove cpu quota
280+ # Remove cpu quota.
281281 runc update test_update --cpu-quota -1
282282 [ " $status " -eq 0 ]
283- check_cpu_quota -1 900000 " infinity "
283+ check_cpu_quota -1 900000
284284
285- # update cpu-shares
285+ # Update cpu-shares.
286286 runc update test_update --cpu-share 200
287287 [ " $status " -eq 0 ]
288288 check_cpu_shares 200
@@ -298,21 +298,21 @@ EOF
298298}
299299EOF
300300 [ " $status " -eq 0 ]
301- check_cpu_quota 500000 1000000 " 500ms "
301+ check_cpu_quota 500000 1000000
302302
303- # redo all the changes at once
303+ # Redo all the changes at once.
304304 runc update test_update \
305305 --cpu-period 900000 --cpu-quota 600000 --cpu-share 200
306306 [ " $status " -eq 0 ]
307- check_cpu_quota 600000 900000 " 670ms "
307+ check_cpu_quota 600000 900000
308308 check_cpu_shares 200
309309
310- # remove cpu quota and reset the period
310+ # Remove cpu quota and reset the period.
311311 runc update test_update --cpu-quota -1 --cpu-period 100000
312312 [ " $status " -eq 0 ]
313- check_cpu_quota -1 100000 " infinity "
313+ check_cpu_quota -1 100000
314314
315- # reset to initial test value via json file
315+ # Reset to initial test values via json file.
316316 cat << EOF >"$BATS_RUN_TMPDIR "/runc-cgroups-integration-test.json
317317{
318318 "cpu": {
326326
327327 runc update -r " $BATS_RUN_TMPDIR " /runc-cgroups-integration-test.json test_update
328328 [ " $status " -eq 0 ]
329- check_cpu_quota 500000 1000000 " 500ms "
329+ check_cpu_quota 500000 1000000
330330 check_cpu_shares 100
331331}
332332
363363 runc run -d --console-socket " $CONSOLE_SOCKET " test_update
364364 [ " $status " -eq 0 ]
365365
366- check_cpu_quota -1 1000000 " infinity "
366+ check_cpu_quota -1 1000000
367367}
368368
369369@test " set cpu period with no quota (invalid period)" {
382382
383383 runc run -d --console-socket " $CONSOLE_SOCKET " test_update
384384 [ " $status " -eq 0 ]
385- check_cpu_quota 5000 100000 " 50ms "
385+ check_cpu_quota 5000 100000
386386}
387387
388388@test " update cpu period with no previous period/quota set" {
@@ -393,10 +393,10 @@ EOF
393393 runc run -d --console-socket " $CONSOLE_SOCKET " test_update
394394 [ " $status " -eq 0 ]
395395
396- # update the period alone, no old values were set
396+ # Update the period alone, no old values were set.
397397 runc update --cpu-period 50000 test_update
398398 [ " $status " -eq 0 ]
399- check_cpu_quota -1 50000 " infinity "
399+ check_cpu_quota -1 50000
400400}
401401
402402@test " update cpu quota with no previous period/quota set" {
@@ -407,10 +407,10 @@ EOF
407407 runc run -d --console-socket " $CONSOLE_SOCKET " test_update
408408 [ " $status " -eq 0 ]
409409
410- # update the quota alone, no old values were set
410+ # Update the quota alone, no old values were set.
411411 runc update --cpu-quota 30000 test_update
412412 [ " $status " -eq 0 ]
413- check_cpu_quota 30000 100000 " 300ms "
413+ check_cpu_quota 30000 100000
414414}
415415
416416@test " update cpu period in a pod cgroup with pod limit set" {
445445 # Finally, the test itself: set 30% limit but with lower period.
446446 runc update --cpu-period 10000 --cpu-quota 3000 test_update
447447 [ " $status " -eq 0 ]
448- check_cpu_quota 3000 10000 " 300ms "
448+ check_cpu_quota 3000 10000
449449}
450450
451451@test " update cgroup cpu.idle" {
545545 runc run -d --console-socket " $CONSOLE_SOCKET " test_update
546546 [ " $status " -eq 0 ]
547547
548- # check that initial values were properly set
549- check_cpu_quota 500000 1000000 " 500ms "
550- # initial cpu shares of 100 corresponds to weight of 4
548+ # Check that initial values were properly set.
549+ check_cpu_quota 500000 1000000
550+ # Initial cpu shares of 100 corresponds to weight of 4.
551551 check_cpu_weight 4
552552 check_systemd_value " TasksMax" 20
553553
561561}
562562EOF
563563
564- # check the updated systemd unit properties
565- check_cpu_quota -1 100000 " infinity "
564+ # Check the updated systemd unit properties.
565+ check_cpu_quota -1 100000
566566 check_cpu_weight 16
567567 check_systemd_value " TasksMax" 10
568568}
0 commit comments