Commit 7ae33021 authored by Jochen Roth's avatar Jochen Roth Committed by Christian Kuhn
Browse files

[BUGFIX] runTests.sh: Fix macos user detection

Check for user in /etc/passwd, if it does not exist create
a temporary passwd to get values from.

Resolves: #93372
Releases: master, 10.4, 9.5
Change-Id: I60c9d2a10a0da155354546d57c823961bc39f014
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/67923

Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 9ca731de
......@@ -39,6 +39,7 @@ nbproject
/Build/typings/*
!/Build/typings/no-def*
/Build/testing-docker/local/.env
/Build/testing-docker/local/macos_passwd
/typo3/sysext/*/Resources/Private/TypeScript/*.js
/typo3/sysext/*/Resources/Public/JavaScript/*.js.map
typo3/sysext/core/Tests/Acceptance/AcceptanceTests-Job-*
......
......@@ -39,6 +39,8 @@ setUpDockerComposeDotEnv() {
# Set a custom database driver provided by option: -a
[[ ! -z "$DATABASE_DRIVER" ]] && echo "DATABASE_DRIVER=${DATABASE_DRIVER}" >> .env
echo "PASSWD_PATH=${PASSWD_PATH}" >> .env
}
# Load help text into $HELP
......@@ -252,6 +254,7 @@ MYSQL_VERSION="5.5"
POSTGRES_VERSION="10"
CHUNKS=0
THISCHUNK=0
PASSWD_PATH=/etc/passwd
# Option parsing
# Reset in case getopts has been used previously in the shell
......@@ -351,6 +354,20 @@ fi
# Move "7.2" to "php72", the latter is the docker container name
DOCKER_PHP_IMAGE=`echo "php${PHP_VERSION}" | sed -e 's/\.//'`
# Some scripts rely on a proper /etc/passwd that includes the user that runs the
# containers, for instance to determine users $HOME. yarn v1 is espcecially picky
# here since it fails if it can't write a .yarnrc file to users home ...
# MacOS in it's endless wisdom however decided that /etc/passwd is a stupid thing
# and does not write an entry for the standard user in it. In turn, stuff like yarn fails.
# As a solution, we detect if the user executing the script is within /etc/passwd
# and volume mount that file within containers. If not, we create a fake passwd file
# and mount that one.
[ -z ${USER} ] && USER=`id -u -n`
if [ `grep -c "^${USER}:" /etc/passwd` -ne 1 ]; then
echo "${USER}:x:$(id -u $USER):$(id -g $USER):$(id -gn $USER):${HOME}:/bin/bash" > macos_passwd
PASSWD_PATH="./macos_passwd"
fi
# Set $1 to first mass argument, this is the optional test file or test directory to execute
shift $((OPTIND - 1))
TEST_FILE=${1}
......
......@@ -82,7 +82,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......@@ -226,7 +226,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......@@ -266,7 +266,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......@@ -307,7 +307,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
command: >
/bin/sh -c "
......@@ -333,7 +333,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......@@ -351,7 +351,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}/Build
command: >
......@@ -369,7 +369,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}/Build
command: >
......@@ -387,7 +387,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......@@ -404,7 +404,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......@@ -422,7 +422,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......@@ -439,7 +439,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......@@ -456,7 +456,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......@@ -473,7 +473,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......@@ -490,7 +490,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......@@ -507,7 +507,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......@@ -524,7 +524,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......@@ -541,7 +541,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......@@ -558,7 +558,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......@@ -578,7 +578,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}/Build
command: >
......@@ -600,7 +600,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......@@ -617,7 +617,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......@@ -634,7 +634,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......@@ -651,7 +651,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......@@ -668,7 +668,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......@@ -690,7 +690,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......@@ -709,7 +709,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......@@ -751,7 +751,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
environment:
typo3DatabaseDriver: "${DATABASE_DRIVER:-mysqli}"
......@@ -805,7 +805,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
environment:
typo3DatabaseDriver: "${DATABASE_DRIVER:-mysqli}"
......@@ -860,7 +860,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
environment:
typo3DatabaseDriver: "${DATABASE_DRIVER:-sqlsrv}"
......@@ -916,7 +916,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
environment:
typo3DatabaseDriver: pdo_pgsql
......@@ -962,7 +962,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
environment:
typo3DatabaseDriver: pdo_sqlite
......@@ -994,7 +994,7 @@ services:
user: ${HOST_UID}
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......@@ -1012,7 +1012,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}/Build
command: >
......@@ -1030,7 +1030,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}/Build
command: >
......@@ -1048,7 +1048,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......@@ -1073,7 +1073,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......@@ -1098,7 +1098,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}/Build
command: >
......@@ -1117,7 +1117,7 @@ services:
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment