From a4e35827c5f115abe8deac8c936893274e154beb Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Fri, 7 Oct 2022 16:12:40 +0200 Subject: [PATCH 1/3] Update cirrus environment for opcache.preload_user tests --- .cirrus.yml | 10 ++++++---- ext/opcache/tests/preload_user_002.phpt | 1 + ext/opcache/tests/preload_user_004.phpt | 7 +------ 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index a7676803d1fe3..ba18ff7de0f35 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -68,6 +68,7 @@ asan_task: libjpeg-dev libpng-dev libfreetype6-dev + - useradd testuser build_script: - ./buildconf -f - >- @@ -155,8 +156,6 @@ asan_task: - mkdir -p /etc/php.d - echo opcache.enable_cli=1 > /etc/php.d/opcache.ini - echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini - # Specify opcache.preload_user as we're running as root. - - echo opcache.preload_user=root >> /etc/php.d/opcache.ini tests_script: - export SKIP_IO_CAPTURE_TESTS=1 - export CI_NO_IPV6=1 @@ -166,6 +165,8 @@ asan_task: - export PDO_MYSQL_TEST_DSN="mysql:host=mysql;dbname=test" - export PDO_MYSQL_TEST_USER=root - export PDO_MYSQL_TEST_PASS=root + - export TEST_NON_ROOT_USER=testuser + - export TEST_FPM_RUN_AS_ROOT=1 - >- sapi/cli/php run-tests.php -P -q -x -j2 @@ -188,6 +189,7 @@ freebsd_task: #- pkg upgrade -y - kldload accf_http - pkg install -y autoconf bison gmake re2c icu libiconv png freetype2 enchant2 bzip2 krb5 t1lib gmp tidyp libsodium libzip libxml2 libxslt openssl oniguruma pkgconf webp libavif + - pw useradd testuser script: - ./buildconf -f - ./configure --prefix=/usr/local --enable-debug --enable-option-checking=fatal --enable-fpm --with-pdo-sqlite --without-pear --with-bz2 --with-avif --with-jpeg --with-webp --with-freetype --enable-gd --enable-exif --with-zip --with-zlib --enable-soap --enable-xmlreader --with-xsl --with-libxml --enable-shmop --enable-pcntl --enable-mbstring --with-curl --enable-sockets --with-openssl --with-iconv=/usr/local --enable-bcmath --enable-calendar --enable-ftp --with-kerberos --with-ffi --enable-zend-test --enable-dl-test=shared --enable-intl --with-mhash --with-sodium --enable-werror --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d @@ -196,10 +198,10 @@ freebsd_task: - gmake install - echo opcache.enable_cli=1 > /etc/php.d/opcache.ini - echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini - # Specify opcache.preload_user as we're running as root. - - echo opcache.preload_user=root >> /etc/php.d/opcache.ini tests_script: - export SKIP_IO_CAPTURE_TESTS=1 - export CI_NO_IPV6=1 - export STACK_LIMIT_DEFAULTS_CHECK=1 + - export TEST_NON_ROOT_USER=testuser + - export TEST_FPM_RUN_AS_ROOT=1 - sapi/cli/php run-tests.php -P -q -j2 -g FAIL,BORK,LEAK,XLEAK --no-progress --offline --show-diff --show-slow 1000 --set-timeout 120 -d zend_extension=opcache.so diff --git a/ext/opcache/tests/preload_user_002.phpt b/ext/opcache/tests/preload_user_002.phpt index 90b2be8c27640..0480a89c21cd5 100644 --- a/ext/opcache/tests/preload_user_002.phpt +++ b/ext/opcache/tests/preload_user_002.phpt @@ -14,6 +14,7 @@ posix --FILE-- start($args); -var_dump($tester->getLogLines(1)); +$tester->expectLogPattern('#Fatal Error "opcache.preload" requires "opcache.preload_user" when running under uid 0#'); $tester->terminate(); $tester->close(); ?> Done --EXPECTF-- -array(1) { - [0]=> - string(%d) "%sFatal Error "opcache.preload" requires "opcache.preload_user" when running under uid 0 -" -} Done --CLEAN-- Date: Fri, 7 Oct 2022 16:12:51 +0200 Subject: [PATCH 2/3] Debug CI --- .cirrus.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index ba18ff7de0f35..f92ed3598edce 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -170,7 +170,6 @@ asan_task: - >- sapi/cli/php run-tests.php -P -q -x -j2 - -g FAIL,BORK,LEAK,XLEAK --no-progress --offline --show-diff @@ -204,4 +203,4 @@ freebsd_task: - export STACK_LIMIT_DEFAULTS_CHECK=1 - export TEST_NON_ROOT_USER=testuser - export TEST_FPM_RUN_AS_ROOT=1 - - sapi/cli/php run-tests.php -P -q -j2 -g FAIL,BORK,LEAK,XLEAK --no-progress --offline --show-diff --show-slow 1000 --set-timeout 120 -d zend_extension=opcache.so + - sapi/cli/php run-tests.php -P -q -j2 --no-progress --offline --show-diff --show-slow 1000 --set-timeout 120 -d zend_extension=opcache.so From 5a1349e9bb94e1ff4264cfd6765fbd850bf6fe18 Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Sun, 29 Jan 2023 11:44:58 +0100 Subject: [PATCH 3/3] Skip test under ASAN --- ext/opcache/tests/gh10405.phpt | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/opcache/tests/gh10405.phpt b/ext/opcache/tests/gh10405.phpt index decc538ca46e0..24e974227ed50 100644 --- a/ext/opcache/tests/gh10405.phpt +++ b/ext/opcache/tests/gh10405.phpt @@ -14,6 +14,7 @@ posix --FILE--