diff options
Diffstat (limited to 'include/tests_containers')
-rw-r--r-- | include/tests_containers | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/tests_containers b/include/tests_containers index c32a59d0..11764afe 100644 --- a/include/tests_containers +++ b/include/tests_containers @@ -139,7 +139,7 @@ DOCKER_CONTAINERS_TOTAL=0 fi LogText "Result: docker info shows ${DOCKER_CONTAINERS_TOTAL} containers" - DOCKER_CONTAINERS_TOTAL2=`${DOCKERBINARY} ps -a 2> /dev/null | grep -v "CONTAINER" | wc -l` + DOCKER_CONTAINERS_TOTAL2=$(${DOCKERBINARY} ps -a 2> /dev/null | grep -c -v "CONTAINER") LogText "Result: docker ps -a shows ${DOCKER_CONTAINERS_TOTAL2} containers" if [ ! "${DOCKER_CONTAINERS_TOTAL}" = "${DOCKER_CONTAINERS_TOTAL2}" ]; then LogText "Result: difference detected, which is unexpected" @@ -150,9 +150,9 @@ fi # Check running instances - DOCKER_CONTAINERS_RUNNING=`${DOCKERBINARY} ps 2> /dev/null | grep -v "CONTAINER" | wc -l` - Display --indent 8 --text "- Running containers" --result "${DOCKER_CONTAINERS_RUNNING}" --color GREEN + DOCKER_CONTAINERS_RUNNING=$(${DOCKERBINARY} ps 2> /dev/null | grep -c -v "CONTAINER") if [ ${DOCKER_CONTAINERS_RUNNING} -gt 0 ]; then + Display --indent 10 --text "- Running containers" --result "${DOCKER_CONTAINERS_RUNNING}" --color GREEN LogText "Result: ${DOCKER_CONTAINERS_RUNNING} containers are currently active" Report "docker_containers_running=${DOCKER_CONTAINERS_RUNNING}" else |