Source
['proxyid' => ':proxy:psk1.example.com', 'tls_psk_identity' => 'psk3.example.com', 'tls_psk' => 'de4f735c561e5444b0932f7ebd636b85']
<?php
/*
** Zabbix
** 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 General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
require_once dirname(__FILE__).'/../include/CAPITest.php';
/**
* @backup hosts
* @onBefore prepareTestData
* @onAfter cleanTestData
*/
class testProxy extends CAPITest {
public static $data = [
'proxy' => [],
'host' => [],
'hostgroup' => []
];
public static function prepareTestData(): void {
$proxies = [];
// dataProviderInvalidProxyCreate: Field "tls_psk" cannot have different values for same "tls_psk_identity"
$proxies[] = [
'host' => 'test.example.com',
'status' => HOST_STATUS_PROXY_ACTIVE,
'tls_accept' => HOST_ENCRYPTION_PSK,
'tls_psk_identity' => 'public',
'tls_psk' => '79cbf232a3ad3bfe38dee29861f8ba6b'
];
// dataProviderInvalidProxyUpdate, dataProviderValidProxyUpdate
$proxies[] = [
'host' => 'psk1.example.com',
'status' => HOST_STATUS_PROXY_ACTIVE,
'tls_accept' => HOST_ENCRYPTION_PSK,
'tls_psk_identity' => 'example.com',
'tls_psk' => '79cbf232a3ad3bfe38dee29861f8ba6b'
];
$proxies[] = [
'host' => 'psk2.example.com',
'status' => HOST_STATUS_PROXY_ACTIVE,
'tls_accept' => HOST_ENCRYPTION_PSK,
'tls_psk_identity' => 'example.com',
'tls_psk' => '79cbf232a3ad3bfe38dee29861f8ba6b'
];
$proxies[] = [