fix unit-tests with new language-class; fix language access in standard_error/standard_success; add MysqlServer API command and possibility to allow/disallow customers available mysql-servers
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -286,7 +286,7 @@ class MysqlsTest extends TestCase
|
||||
$dbm = new \Froxlor\Database\DbManager(\Froxlor\FroxlorLogger::getInstanceOf());
|
||||
$users = $dbm->getManager()->getAllSqlUsers(false);
|
||||
foreach ($users as $user => $data) {
|
||||
if (TRAVIS_CI == 1 && strtolower($user) == 'mariadb.sys') {
|
||||
if (strtolower($user) == 'mariadb.sys') {
|
||||
// travis seems to have a user for mariadb on version 10.4
|
||||
// we do not want to test that one
|
||||
continue;
|
||||
|
||||
@@ -20,13 +20,13 @@ class FpmDaemonsTest extends TestCase
|
||||
global $admin_userdata;
|
||||
$data = [
|
||||
'description' => 'test2 fpm',
|
||||
'reload_cmd' => 'service php7.4-fpm reload',
|
||||
'config_dir' => '/etc/php/7.4/fpm/pool.d',
|
||||
'reload_cmd' => 'service php8.1-fpm reload',
|
||||
'config_dir' => '/etc/php/8.1/fpm/pool.d',
|
||||
'limit_extensions' => ''
|
||||
];
|
||||
$json_result = FpmDaemons::getLocal($admin_userdata, $data)->add();
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
$this->assertEquals('/etc/php/7.4/fpm/pool.d/', $result['config_dir']);
|
||||
$this->assertEquals('/etc/php/8.1/fpm/pool.d/', $result['config_dir']);
|
||||
$this->assertEquals('dynamic', $result['pm']);
|
||||
$this->assertEquals(5, $result['max_children']);
|
||||
$this->assertEquals('.php', $result['limit_extensions']);
|
||||
@@ -77,7 +77,7 @@ class FpmDaemonsTest extends TestCase
|
||||
];
|
||||
$json_result = FpmDaemons::getLocal($admin_userdata, $data)->update();
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
$this->assertEquals('/etc/php/7.4/fpm/pool.d/', $result['config_dir']);
|
||||
$this->assertEquals('/etc/php/8.1/fpm/pool.d/', $result['config_dir']);
|
||||
$this->assertEquals(10, $result['max_children']);
|
||||
$this->assertEquals('.php .php.xml', $result['limit_extensions']);
|
||||
}
|
||||
@@ -239,7 +239,7 @@ class FpmDaemonsTest extends TestCase
|
||||
];
|
||||
$json_result = FpmDaemons::getLocal($admin_userdata, $data)->delete();
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
$this->assertEquals('/etc/php/7.4/fpm/pool.d/', $result['config_dir']);
|
||||
$this->assertEquals('/etc/php/8.1/fpm/pool.d/', $result['config_dir']);
|
||||
$this->assertEquals(10, $result['max_children']);
|
||||
$this->assertEquals('.php', $result['limit_extensions']);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,8 @@ file_put_contents($userdata, $userdata_content);
|
||||
|
||||
// include autoloader / api / etc
|
||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||
|
||||
// include functions
|
||||
require dirname(__DIR__) . '/lib/functions.php';
|
||||
// include table definitions
|
||||
require dirname(__DIR__) . '/lib/tables.inc.php';
|
||||
|
||||
@@ -50,7 +51,9 @@ if (TRAVIS_CI == 0) {
|
||||
Database::needRoot(true);
|
||||
Database::query("DROP DATABASE IF EXISTS `froxlor010`;");
|
||||
Database::query("CREATE DATABASE `froxlor010`;");
|
||||
exec("mysql -u root -p" . $rpwd . " froxlor010 < " . dirname(__DIR__) . "/install/froxlor.sql");
|
||||
$sql = include(dirname(__DIR__) . "/install/froxlor.sql.php");
|
||||
file_put_contents("/tmp/froxlor.sql", $sql);
|
||||
exec("mysql -u root -p" . $rpwd . " froxlor010 < /tmp/froxlor.sql");
|
||||
Database::query("DROP USER IF EXISTS 'test1sql1'@'localhost';");
|
||||
Database::query("DROP USER IF EXISTS 'test1sql1'@'127.0.0.1';");
|
||||
Database::query("DROP USER IF EXISTS 'test1sql1'@'172.17.0.1';");
|
||||
|
||||
Reference in New Issue
Block a user