File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -762,15 +762,12 @@ if root && test -e /dev/nullb0; then
762
762
t POST libpod/containers/updateCtr/update ${TMPD} /update.json 201
763
763
764
764
cgroupPath=/sys/fs/cgroup/cpu.weight
765
- # 002 is the byte length
766
- cpu_weight_expect_regex=$' \x01\x02 5|\x01\x02 20'
767
-
768
765
# Verify CPU weight
769
766
echo ' { "AttachStdout":true,"Cmd":["cat", "' $cgroupPath ' "]}' > ${TMPD} /exec.json
770
767
t POST containers/updateCtr/exec ${TMPD} /exec.json 201 .Id~[0-9a-f]\\ {64\\ }
771
768
eid=$( jq -r ' .Id' <<< " $output" )
772
769
response=$( ' t POST exec/$eid/start 200' )
773
- like " $response " " $cpu_weight_expect_regex "
770
+ like_any " $response " " cpu_weight is 5 or 20 " $' \x01\x02 5 ' $' \x01\x02 20 '
774
771
775
772
BlkioDeviceReadBps_expected=' [
776
773
{
Original file line number Diff line number Diff line change 737
737
echo " 1..${test_count} "
738
738
739
739
exit $failure_count
740
+
741
+
742
+ # LIKE_ANY
743
+ # ##############################################################################
744
+ like_any () {
745
+ local actual=" $1 "
746
+ local testname=" $2 "
747
+ shift 2
748
+ for expect in " $@ " ; do
749
+ if expr " $actual " : " $expect " & > /dev/null; then
750
+ _show_ok 1 " $testname ('$actual ') ~ $expect "
751
+ return
752
+ fi
753
+ done
754
+ _show_ok 0 " $testname " " ~ any of [$* ]" " $actual "
755
+ }
You can’t perform that action at this time.
0 commit comments