Source
* Function checks that Zabbix server status is updated after failover delay passes and frontend config is re-validated.
<?php
/*
** Zabbix
** Copyright (C) 2001-2023 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__).'/../common/testSystemInformation.php';
require_once dirname(__FILE__).'/../behaviors/CMessageBehavior.php';
/**
* @backup dashboard, ha_node, config
*
* @backupConfig
*
* @onBefore prepareDashboardData
*/
class testDashboardSystemInformationWidget extends testSystemInformation {
public static $dashboardid; // Dashboard for checking widget content with enabled and disabled HA cluster.
public static $widgets_dashboardid; // Dashboard for checking creation and update of system information widgets.
/**
* Attach MessageBehavior to the test.
*/
public function getBehaviors() {
return [CMessageBehavior::class];
}
/**
* Function creates dashboards with widgets for test and defines the corresponding dashboard IDs.
*/
public static function prepareDashboardData() {
$response = CDataHelper::call('dashboard.create', [
[
'name' => 'Dashboard for Sysinfo + HA test',
'private' => 0,
'pages' => [
[
'name' => 'Page with widgets',
'widgets' => [
[
'type' => 'systeminfo',
'name' => 'System stats view',
'width' => 12,
'height' => 8
],
[
'type' => 'systeminfo',
'name' => 'High availability nodes view',