From 941518887ba5646ee47dd876cb6c114d21093765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sj=C3=B6gren?= Date: Thu, 2 Feb 2023 11:47:18 +0100 Subject: [PATCH] add support for .NanoCpus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Sjögren --- tests/5_container_runtime.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/5_container_runtime.sh b/tests/5_container_runtime.sh index 02cf9bb..bd9564b 100644 --- a/tests/5_container_runtime.sh +++ b/tests/5_container_runtime.sh @@ -472,12 +472,15 @@ check_5_11() { fail=0 cpu_unlimited_containers="" for c in $containers; do - shares=$(docker inspect --format '{{ .HostConfig.CpuShares }}' "$c") + cpushares=$(docker inspect --format '{{ .HostConfig.CpuShares }}' "$c") + nanocpus=$(docker inspect --format '{{ .HostConfig.NanoCpus }}' "$c") + if docker inspect --format '{{ .Config.CpuShares }}' "$c" 2> /dev/null 1>&2; then - shares=$(docker inspect --format '{{ .Config.CpuShares }}' "$c") + cpushares=$(docker inspect --format '{{ .Config.CpuShares }}' "$c") + nanocpus=$(docker inspect --format '{{ .Config.NanoCpus }}' "$c") fi - if [ "$shares" = "0" ]; then + if [ "$cpushares" = "0" ] && [ "$nanocpus" = "0" ]; then # If it's the first container, fail the test if [ $fail -eq 0 ]; then warn -s "$check"