tests - add cors/linux

This commit is contained in:
bunkerity 2022-08-11 14:11:28 +02:00
parent d8071e4c43
commit 512ed7200d
No known key found for this signature in database
GPG Key ID: 3D80806F12602A7C
3 changed files with 11 additions and 8 deletions

View File

@ -2,7 +2,8 @@
"name": "cors",
"kinds": [
"docker",
"autoconf"
"autoconf",
"linux"
],
"timeout": 60,
"tests": [

View File

@ -11,9 +11,9 @@ USE_GZIP=yes
app1.example.com_USE_CORS=yes
app1.example.com_CORS_ALLOW_ORIGIN=https://app2.example.com
app1.example.com_ALLOWED_METHODS=GET|POST|HEAD|OPTIONS
app1.example.com_REMOTE_PHP=myapp1
app1.example.com_REMOTE_PHP_PATH=/app
app2.example.com_REMOTE_PHP=myapp2
app2.example.com_REMOTE_PHP_PATH=/app
app3.example.com_REMOTE_PHP=myapp3
app3.example.com_REMOTE_PHP_PATH=/app
app1.example.com_LOCAL_PHP=/run/php/php-fpm.sock
app1.example.com_LOCAL_PHP_PATH=/opt/bunkerweb/www/app1.example.com
app2.example.com_LOCAL_PHP=/run/php/php-fpm.sock
app2.example.com_LOCAL_PHP_PATH=/opt/bunkerweb/www/app2.example.com
app3.example.com_LOCAL_PHP=/run/php/php-fpm.sock
app3.example.com_LOCAL_PHP_PATH=/opt/bunkerweb/www/app3.example.com

View File

@ -63,12 +63,14 @@ class LinuxTest(Test) :
LinuxTest.docker_exec(distro, "DEBIAN_FRONTEND=noninteractive apt-get install -y php-fpm")
if distro == "ubuntu" :
LinuxTest.docker_cp(distro, "./tests/www-deb.conf", "/etc/php/8.1/fpm/pool.d/www.conf")
LinuxTest.docker_exec(distro, "systemctl stop php8.1-fpm ; systemctl start php8.1-fpm")
elif distro == "debian" :
LinuxTest.docker_cp(distro, "./tests/www-deb.conf", "/etc/php/7.4/fpm/pool.d/www.conf")
LinuxTest.docker_exec(distro, "systemctl stop php7.4-fpm ; systemctl start php7.4-fpm")
elif distro in ["centos", "fedora"] :
LinuxTest.docker_exec(distro, "dnf install -y php-fpm")
LinuxTest.docker_cp(distro, "./tests/www-rpm.conf", "/etc/php-fpm.d/www.conf")
LinuxTest.docker_exec(distro, "systemctl stop php-fpm ; systemctl start php-fpm")
LinuxTest.docker_exec(distro, "systemctl stop php-fpm ; systemctl start php-fpm")
sleep(60)
except :
log("LINUX", "", "exception while running LinuxTest.init()\n" + format_exc())