diff options
| author | Giuseppe Scrivano <gscrivan@redhat.com> | 2022-09-15 00:52:30 +0200 |
|---|---|---|
| committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2022-09-15 09:00:03 +0200 |
| commit | 60ef4ad1c873e99825dd08c9300cffb82f3b7aee (patch) | |
| tree | 21a1849d3a9194098fc0a29f751143e62413d72d /test/apiv2/test-apiv2 | |
| parent | cf2118eab3b736feb8018bcc9f4cdb548b7ab70a (diff) | |
| download | podman-60ef4ad1c873e99825dd08c9300cffb82f3b7aee.tar.gz podman-60ef4ad1c873e99825dd08c9300cffb82f3b7aee.tar.bz2 podman-60ef4ad1c873e99825dd08c9300cffb82f3b7aee.zip | |
stats: cap memory limit to the available memory
Docker compatibility: cap the memory limit reported by the cgroup to
the maximum available memory.
Closes: https://github.com/containers/podman/issues/15765
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'test/apiv2/test-apiv2')
| -rwxr-xr-x | test/apiv2/test-apiv2 | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/test/apiv2/test-apiv2 b/test/apiv2/test-apiv2 index aca7db0dd..b762cff9e 100755 --- a/test/apiv2/test-apiv2 +++ b/test/apiv2/test-apiv2 @@ -107,6 +107,22 @@ function is() { _show_ok 0 "$testname" "$expect" "$actual" } +############ +# is_not # Simple disequality +############ +function is_not() { + local actual=$1 + local expect_not=$2 + local testname=$3 + + if [ "$actual" != "$expect_not" ]; then + # On success, include expected value; this helps readers understand + _show_ok 1 "$testname!=$expect" + return + fi + _show_ok 0 "$testname" "!= $expect" "$actual" +} + ########## # like # Compare, but allowing patterns ########## @@ -377,7 +393,13 @@ function t() { fi for i; do - if expr "$i" : "[^=~]\+=.*" >/dev/null; then + if expr "$i" : '[^\!]\+\!=.\+' >/dev/null; then + # Disequality on json field + json_field=$(expr "$i" : '\([^!]*\)!') + expect_not=$(expr "$i" : '[^\!]*\!=\(.*\)') + actual=$(jq -r "$json_field" <<<"$output") + is_not "$actual" "$expect_not" "$testname : $json_field" + elif expr "$i" : "[^=~]\+=.*" >/dev/null; then # Exact match on json field json_field=$(expr "$i" : "\([^=]*\)=") expect=$(expr "$i" : '[^=]*=\(.*\)') |
