Skip to content

Commit 954af38

Browse files
Fix test helper scripts assertion
In the latest builds after alpine 3.17, the proper file mode is 755.
1 parent ade1e5b commit 954af38

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

test/container/php/test_helper_scripts.py

+15-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ def test_php_images_contain_helper_scripts(host):
1111
]
1212

1313
for file in official_helper_scripts:
14+
expected_file_mode = get_expected_os_mode(host)
15+
1416
assert host.file(file).exists is True
1517
assert host.file(file).is_file is True
16-
assert host.file(file).mode == 0o775
18+
assert host.file(file).mode == expected_file_mode
1719

1820
helper_scripts = [
1921
"/usr/local/bin/docker-php-dev-mode",
@@ -74,3 +76,15 @@ def test_php_extension_script_for_rdkafka(host):
7476
def test_php_extension_script_for_pdo_pgsql(host):
7577
host.run_expect([0], "docker-php-ext-pdo-pgsql")
7678
assert 'pdo_pgsql' in host.run('php -m').stdout
79+
80+
def get_os_version(host):
81+
return host.run("cat /etc/alpine-release").stdout
82+
83+
def get_expected_os_mode(host):
84+
expected_file_mode = 0o775
85+
os_version = get_os_version(host)
86+
87+
if os_version > "3.17":
88+
expected_file_mode = 0o755
89+
90+
return expected_file_mode

0 commit comments

Comments
 (0)