From 99e7c5cea8cc811433554f1aa56e4eeab0a42af5 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 17 Jun 2021 13:51:44 +0200 Subject: [PATCH] Fix test in case fallocate(1) is available, but fails That happens on Travis s390x for whatever reasons. Thus, instead of checking for `fallocate -h`, we attempt the real allocation and skip if that fails. --- ext/standard/tests/file/bug81145.phpt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ext/standard/tests/file/bug81145.phpt b/ext/standard/tests/file/bug81145.phpt index 2f12d9eee81..ea498b493ee 100644 --- a/ext/standard/tests/file/bug81145.phpt +++ b/ext/standard/tests/file/bug81145.phpt @@ -6,8 +6,11 @@ if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (PHP_INT_SIZE !== 8) die("skip this test is for 64bit platforms only"); if (disk_free_space(__DIR__) < 0x220000000) die("skip insuffient disk space"); if (PHP_OS_FAMILY !== "Windows") { - exec("fallocate -h", $output, $status); - if ($status !== 0) die("skip fallocate(1) not available"); + $src = __DIR__ . "/bug81145_src.bin"; + define('SIZE_4G', 0x100000000); + exec("fallocate -l " . (SIZE_4G-0x100) . " " . escapeshellarg($src), $output, $status); + if ($status !== 0) die("skip fallocate() not supported"); + @unlink(__DIR__ . "/bug81145_src.bin"); } ?> --FILE--