This is an automated email from the ASF dual-hosted git repository. tallison pushed a commit to branch TIKA-3912 in repository https://gitbox.apache.org/repos/asf/tika-docker.git
commit 4a83d597a09fd3a2c880309d2f4d4972a74563de Author: tallison <talli...@apache.org> AuthorDate: Mon Oct 31 10:52:51 2022 -0400 TIKA-3912 -- add unit test for user --- docker-tool.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/docker-tool.sh b/docker-tool.sh index 75d5d8d..4876523 100755 --- a/docker-tool.sh +++ b/docker-tool.sh @@ -41,18 +41,30 @@ test_docker_image() { sleep 10 url=http://localhost:9998/ status=$(curl --head --location --connect-timeout 5 --write-out %{http_code} --silent --output /dev/null ${url}) + user=$(docker inspect "$1" --format '{{.Config.User}}') if [[ $status == '200' ]] then - echo "$(tput setaf 2)Image: apache/tika:${1} - Passed$(tput sgr0)" - docker kill "$1" - docker rm "$1" + echo "$(tput setaf 2)Image: apache/tika:${1} - Basic test passed$(tput sgr0)" else - echo "$(tput setaf 1)Image: apache/tika:${1} - Failed$(tput sgr0)" + echo "$(tput setaf 1)Image: apache/tika:${1} - Basic test failed$(tput sgr0)" docker kill "$1" docker rm "$1" exit 1 fi + + #now test that the user is correctly set + if [[ $user == '35002:35002' ]] + then + echo "$(tput setaf 2)Image: apache/tika:${1} - User passed$(tput sgr0)" + docker kill "$1" + docker rm "$1" + else + echo "$(tput setaf 1)Image: apache/tika:${1} - User failed$(tput sgr0)" + docker kill "$1" + docker rm "$1" + exit 1 + fi } shift $((OPTIND -1))