Source
// TODO: temporarily commented out due webdriver issue, alert is not displayed while leaving page during test execution
<?php
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
require_once dirname(__FILE__) . '/../../include/CWebTest.php';
require_once dirname(__FILE__).'/../../include/helpers/CDataHelper.php';
/**
* Test for checking Proxy host form.
*
* @dataSource Proxies
*
* @onBefore prepareProxyData
*
* @backup proxy
*/
class testFormAdministrationProxies extends CWebTest {
private $sql = 'SELECT * FROM proxy ORDER BY proxyid';
protected static $update_proxy = 'Active proxy for update';
const CHANGE_ACTIVE_PROXY = 'Active proxy for refresh cancel simple update';
const CHANGE_PASSIVE_PROXY = 'Passive proxy for refresh cancel simple update';
const DELETE_PROXY_WITH_HOSTS = 'Proxy_2 for filter';
const DELETE_PROXY_WITH_DISCOVERY_RULE = 'Delete Proxy used in Network discovery rule';
/**
* Attach MessageBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [CMessageBehavior::class];
}
/**
* Function used to create proxies.
*/
public function prepareProxyData() {
CDataHelper::call('proxy.create', [
[
'name' => self::$update_proxy,
'operating_mode' => PROXY_OPERATING_MODE_ACTIVE,
'description' => 'Description for update',
'tls_connect' => 1,
'tls_accept'=> 1
],
[
'name' => self::CHANGE_ACTIVE_PROXY,
'operating_mode' => PROXY_OPERATING_MODE_ACTIVE,
'description' => 'Active description for refresh',
'tls_connect' => 1,
'tls_accept'=> 7,
'tls_psk_identity' => 'activerefreshpsk',
'tls_psk' => '41b4d07b27a8efdcc15d4742e03857eba377fe010853a1499b0522df171282cb',
'tls_issuer' => 'activerefreshpsk',
'tls_subject' => 'activerefreshpsk',
'allowed_addresses' => '127.0.1.2',
'custom_timeouts' => 1,
'timeout_zabbix_agent' => '300s',
'timeout_simple_check' => '300s',
'timeout_snmp_agent' => '300s',
'timeout_external_check' => '300s',
'timeout_db_monitor' => '300s',
'timeout_http_agent' => '300s',
'timeout_ssh_agent' => '300s',
'timeout_telnet_agent' => '300s',
'timeout_script' => '300s',
'timeout_browser' => '300s'
],
[
'name' => self::CHANGE_PASSIVE_PROXY,
'operating_mode' => PROXY_OPERATING_MODE_PASSIVE,
'address' => '127.9.9.9',
'port' => 10051,
'description' => '_Passive description for refresh',
'tls_connect' => 4,
'tls_accept'=> 1,
'tls_issuer' => 'passiverefreshpsk',