Skip to content

Commit f79c707

Browse files
committed
Ref #187 - Make the rootless test fully using rootless and allow to skip the expose_php assertion
The HIDE_PHP_VERSION is not usable with rootless
1 parent 0109a4f commit f79c707

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

testing/docker-compose/docker-compose.testing-run-as-www-data.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
version: "3.1"
2-
31
services:
42
db_server:
53
image: ${DB:-mariadb:10.11}
4+
# mysql:mysql in MariaDB for Docker (https://stackoverflow.com/a/55241769/5155484)
5+
user: 999:999
66
environment:
77
MARIADB_ROOT_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}"
88
healthcheck:
@@ -15,8 +15,8 @@ services:
1515
testing:
1616
aliases:
1717
- phpmyadmin_testing_db
18-
tmpfs:
19-
- /var/lib/mysql:rw,noexec,nosuid,size=300m
18+
volumes:
19+
- mariadb-data:/var/lib/mysql
2020

2121
phpmyadmin:
2222
build:
@@ -27,7 +27,6 @@ services:
2727
PMA_HOST: db_server
2828
UPLOAD_LIMIT: 123M
2929
MAX_EXECUTION_TIME: 125
30-
HIDE_PHP_VERSION: 1
3130
volumes:
3231
- ../config.user.inc.php:/etc/phpmyadmin/config.user.inc.php:ro
3332
healthcheck:
@@ -45,6 +44,8 @@ services:
4544
condition: service_healthy
4645

4746
sut:
47+
# nobody:nobody
48+
user: 65534:65534
4849
depends_on:
4950
phpmyadmin:
5051
condition: service_healthy
@@ -61,6 +62,7 @@ services:
6162
TESTSUITE_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}"
6263
PMA_HOST: phpmyadmin_testing_db
6364
PMA_PORT: 3306
65+
SKIP_EXPOSE_PHP_TEST: true
6466
volumes:
6567
- ../../:/tests:ro
6668
- /var/run/docker.sock:/var/run/docker.sock
@@ -69,3 +71,6 @@ services:
6971
networks:
7072
testing:
7173
driver: bridge
74+
75+
volumes:
76+
mariadb-data:

testing/phpmyadmin_test.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ def test_phpmyadmin_secrets():
9191

9292

9393
def test_php_ini(url, username, password, server):
94+
skip_expose_php_test = os.environ.get('SKIP_EXPOSE_PHP_TEST');
95+
9496
br = create_browser()
9597
response = do_login(br, url, username, password, server)
9698

@@ -111,7 +113,9 @@ def test_php_ini(url, username, password, server):
111113
assert(b'<tr><td class="e">upload_max_filesize</td><td class="v">123M</td><td class="v">123M</td></tr>' in response)
112114
assert(b'<tr><td class="e">post_max_size</td><td class="v">123M</td><td class="v">123M</td></tr>' in response)
113115

114-
assert(b'<tr><td class="e">expose_php</td><td class="v">Off</td><td class="v">Off</td></tr>' in response)
116+
if not skip_expose_php_test:
117+
assert(b'<tr><td class="e">expose_php</td><td class="v">Off</td><td class="v">Off</td></tr>' in response)
118+
115119
assert(b'<tr><td class="e">session.save_path</td><td class="v">/sessions</td><td class="v">/sessions</td></tr>' in response)
116120

117121
def test_import_from_folder(url, username, password, server, sqlfile):

0 commit comments

Comments
 (0)