From aebf0781549ed901e69e4b7687eadd9fab632b94 Mon Sep 17 00:00:00 2001 From: Dmitrijs Goloscapovs Date: Thu, 10 Nov 2022 13:55:52 +0200 Subject: .......... [DEV-2329] fi --- ui/tests/integration/data/confsync_proxy_hosts.xml | 8 +-- .../data/confsync_proxy_hosts_updated.xml | 84 +++++++++++----------- ui/tests/integration/data/confsync_proxy_tmpl.xml | 8 +-- .../data/confsync_proxy_tmpl_updated.xml | 10 +-- ui/tests/integration/testProxyConfSync.php | 23 ++++-- 5 files changed, 72 insertions(+), 61 deletions(-) diff --git a/ui/tests/integration/data/confsync_proxy_hosts.xml b/ui/tests/integration/data/confsync_proxy_hosts.xml index b50f45e4a13..0ebea8c800d 100644 --- a/ui/tests/integration/data/confsync_proxy_hosts.xml +++ b/ui/tests/integration/data/confsync_proxy_hosts.xml @@ -290,13 +290,13 @@ - ItemProto + ItemProto1 CALCULATED - proto + proto[{#X}] 1 - last(/HostWithDiscovery/proto)=1 + last(/HostWithDiscovery/proto[{#X}])=1 TriggerPrototype DISASTER YES @@ -656,7 +656,7 @@ Simple check SIMPLE - icmpping[127.0.0.1] + icmpping[127.1.0.1] if1 diff --git a/ui/tests/integration/data/confsync_proxy_hosts_updated.xml b/ui/tests/integration/data/confsync_proxy_hosts_updated.xml index fe884086077..c6658dab908 100644 --- a/ui/tests/integration/data/confsync_proxy_hosts_updated.xml +++ b/ui/tests/integration/data/confsync_proxy_hosts_updated.xml @@ -203,7 +203,7 @@ - Hostname + Hostname1 agent.hostname 0 25s @@ -212,7 +212,7 @@ if1 - Chassis + Chassis1 system.hw.chassis[model] 0 25s @@ -221,7 +221,7 @@ if1 - Uname + Uname1 system.uname 0 25s @@ -256,8 +256,8 @@ - ItemWithMultilevelMacros - vfs.dir.count[/{$UU},{$CHLDTMPLMACRO},{$PRNTTMPLMACRO}] + ItemWithMultilevelMacros11 + vfs.dir.count[/tmp/{$UU},{$CHLDTMPLMACRO},{$PRNTTMPLMACRO}] {$PRNTTMPLMACRO} if1 @@ -293,13 +293,13 @@ - ItemProto + ItemProto1 CALCULATED - proto + proto[{#X}] 1 - last(/HostWithDiscovery/proto)=2 + last(/HostWithDiscovery/proto[{#X}])=2 TriggerPrototype HIGH YES @@ -395,7 +395,7 @@ - NormalItemPreproc + NormalItemPreproc11 agent.hostmetadata 0 20s @@ -412,7 +412,7 @@ if1 - Agent ping (active) + Agent ping (active)1 ZABBIX_ACTIVE agent.ping 20s @@ -432,7 +432,7 @@ - Agent version (passive) + Agent version (1passive) agent.version 20s 0 @@ -440,7 +440,7 @@ if1 - Calculated + alculated1 CALCULATED calc 1+1+1 @@ -489,13 +489,13 @@ - CalculatedAsAggregated + CalculatedAsAggregated1 CALCULATED calc_as_aggr sum(last_foreach(/*/agent.version?[group="HG1"])) - CalculatedPreproc + CalculatedPreproc1 CALCULATED calc_preproc 1 @@ -510,13 +510,13 @@ - ODBC monitor + ODBC monito1r ODBC db.odbc.select[x,y,z] select null from dual; - Dependent item + Dependent item1 DEPENDENT depitem 10s @@ -525,7 +525,7 @@ - DepItemOnCalcPreproc + DepItemOnCalcPreproc1 DEPENDENT depitem_calc_preproc 10s @@ -543,7 +543,7 @@ - DepItemOnDepCalcItem + DepItemOnDepCalcItem1 DEPENDENT depitem_depitem 10s @@ -561,7 +561,7 @@ - DepItemOnNormalDepItem + DepItemOnNormalDepItem1 DEPENDENT depitem_depitem_normal 10s @@ -579,12 +579,12 @@ - Zabbix internal + Zabbix internal1 INTERNAL zabbix[boottime] - DepItemOnInternalItem + DepItemOnInternalItem1 DEPENDENT depitem_internal 30s @@ -602,7 +602,7 @@ - DepItemOnNormalItem + DepItemOnNormalItem1 DEPENDENT depitem_normalitem 30s @@ -620,7 +620,7 @@ - DepItemOnInternalItemPreproc + DepItemOnInternalItemPreproc1 DEPENDENT depitem_normal_preproc 10s @@ -638,13 +638,13 @@ - External check + External check1 EXTERNAL extcheck if1 - HTTP agent + HTTP agent1 HTTP_AGENT httpagent BASIC @@ -670,13 +670,13 @@ YES - Simple check + Simple chec1k SIMPLE icmpping[127.1.0.1] if1 - IPMI agent + IPMI agent1 IPMI ipmi.get 0 @@ -685,7 +685,7 @@ if3 - ItemPreproc + ItemPreproc1 CALCULATED preproc 1 @@ -702,7 +702,7 @@ - Script + Script1 SCRIPT script return "1"; @@ -715,21 +715,21 @@ - SNMP trap + SNMP trap1 SNMP_TRAP snmptrap.fallback 10s if2 - SNMP agent + SNMP agent1 SNMP_AGENT SNMPv2-MIB::sysContact.0 snmp_test if2 - SSH agent + SSH agent1 SSH ssh.run[x,localhost] echo @@ -738,7 +738,7 @@ if1 - Telnet agent + Telnet agent1 TELNET telnet.run[a,localhost] echo @@ -746,14 +746,14 @@ if1 - Zabbix trapper + Zabbix trapper1 TRAP trap 10s - delay_globmacro - vfs.file.get[{$UU}] + delay_globmacro11 + vfs.file.get[/tmp/{$UU}] {$GLOBDELAY} 0 TEXT @@ -781,7 +781,7 @@ - item1 + item11 CALCULATED itm 0 @@ -796,15 +796,15 @@ - ItemWithGlobalAndHostMacro - sensor[{$HM1},{$UU}] + ItemWithGlobalAndHostMacro11 + sensor[{$UU},{$HM1}] {$GLOBDELAY} FLOAT if1 - ItemWithMacro - vfs.file.get[/{$HM1}] + ItemWithMacro1 + vfs.file.get[/tmp/{$HM1}] 0 TEXT if1 @@ -882,7 +882,7 @@ - DepItemOnWebScenario + DepItemOnWebScenario11 DEPENDENT dep_webscenario 20s diff --git a/ui/tests/integration/data/confsync_proxy_tmpl.xml b/ui/tests/integration/data/confsync_proxy_tmpl.xml index fdc9f194fcc..e7b67fb5c71 100644 --- a/ui/tests/integration/data/confsync_proxy_tmpl.xml +++ b/ui/tests/integration/data/confsync_proxy_tmpl.xml @@ -83,7 +83,7 @@ f988e57fcdc541668c3c32919d3cfa60 DepItemProtoDependsOnNormalItem DEPENDENT - depitemproto_deponnormal + depitemproto_deponnormal[{#LLDMACRO}] 0 tmpltrap @@ -91,12 +91,12 @@ ebc83aff113846518d3e1c88532274e1 - last(/SampleTemplate/depitemproto_deponnormal)=0 + last(/SampleTemplate/depitemproto_deponnormal[{#LLDMACRO}])=0 proto_dep {#LLDMACRO} proto {#LLDMACRO} - last(/SampleTemplate/depitemproto_deponnormal)=1 + last(/SampleTemplate/depitemproto_deponnormal[{#LLDMACRO}])=1 @@ -108,7 +108,7 @@ 6032b6444698467c8f41587858f089e5 - last(/SampleTemplate/depitemproto_deponnormal)=1 + last(/SampleTemplate/depitemproto_deponnormal[{#LLDMACRO}])=1 proto {#LLDMACRO} diff --git a/ui/tests/integration/data/confsync_proxy_tmpl_updated.xml b/ui/tests/integration/data/confsync_proxy_tmpl_updated.xml index e6a62ecf22c..9397219894b 100644 --- a/ui/tests/integration/data/confsync_proxy_tmpl_updated.xml +++ b/ui/tests/integration/data/confsync_proxy_tmpl_updated.xml @@ -81,9 +81,9 @@ 4d34d26d2480480c862261b1b9e9d99d - DepItemProtoDependsOnNormalItem + DepItemProtoDependsOnNormalItem1 DEPENDENT - depitemproto_deponnormal + depitemproto_deponnormal[{#LLDMACRO}] 10s tmpltrap @@ -91,12 +91,12 @@ c64594a285b64df79b137eeaec10e52b - last(/SampleTemplate/depitemproto_deponnormal)=10 + last(/SampleTemplate/depitemproto_deponnormal[{#LLDMACRO}])=10 proto_dep {#LLDMACRO} proto {#LLDMACRO} - last(/SampleTemplate/depitemproto_deponnormal)=110 + last(/SampleTemplate/depitemproto_deponnormal[{#LLDMACRO}])=110 @@ -108,7 +108,7 @@ 1f2fbda374544b0cb77869c6f1d88314 - last(/SampleTemplate/depitemproto_deponnormal)=10 + last(/SampleTemplate/depitemproto_deponnormal[{#LLDMACRO}])=10 proto {#LLDMACRO} diff --git a/ui/tests/integration/testProxyConfSync.php b/ui/tests/integration/testProxyConfSync.php index e4a03c9cfe6..abcf2d7a39f 100644 --- a/ui/tests/integration/testProxyConfSync.php +++ b/ui/tests/integration/testProxyConfSync.php @@ -396,7 +396,7 @@ class testProxyConfSync extends CIntegrationTest "insert" => "0", "update" => - "38", + "36", "delete" => "0" ] @@ -1022,10 +1022,10 @@ class testProxyConfSync extends CIntegrationTest "ip" => "127.0.0.1", "dns" => "", "useip" => "1", - "port" => "10099" + "port" => PHPUNIT_PORT_PREFIX.self::PROXY_PORT_SUFFIX ] ]); - $this->assertArrayHasKey("proxyids", $response['result']); + //$this->assertArrayHasKey("proxyids", $response['result']); } /** @@ -1047,7 +1047,7 @@ class testProxyConfSync extends CIntegrationTest 'DebugLevel' => 5, 'LogFileSize' => 0, 'Hostname' => 'Proxy', - 'ListenPort' => 10099 + 'ListenPort' => PHPUNIT_PORT_PREFIX.self::PROXY_PORT_SUFFIX ], ]; } @@ -1428,7 +1428,6 @@ class testProxyConfSync extends CIntegrationTest public function loadInitialConfiguration() { - $this->createProxy(); $this->createRegexp(); $this->createGlobalMacros(); $this->importTemplate('confsync_proxy_tmpl.xml'); @@ -1535,6 +1534,19 @@ class testProxyConfSync extends CIntegrationTest $this->purgeExisting('regexp', 'extend'); $this->purgeHostGroups(); $this->purgeGlobalMacros(); + $this->createProxy(); + + self::startComponent(self::COMPONENT_SERVER); + $this->waitForLogLineToBePresent(self::COMPONENT_SERVER, "End of DCsync_configuration()", true, 30, 1); + self::startComponent(self::COMPONENT_PROXY); + $this->waitForLogLineToBePresent(self::COMPONENT_SERVER, 'sending configuration data to proxy "Proxy"', true, 90, 1); + $this->waitForLogLineToBePresent(self::COMPONENT_PROXY, "received configuration data from server", true, 90, 1); + $this->waitForLogLineToBePresent(self::COMPONENT_PROXY, "memory statistics for configuration cache", true, 90, 1); + + self::stopComponent(self::COMPONENT_SERVER); + self::clearLog(self::COMPONENT_SERVER); + self::stopComponent(self::COMPONENT_PROXY); + self::clearLog(self::COMPONENT_PROXY); $this->loadInitialConfiguration(); @@ -1542,7 +1554,6 @@ class testProxyConfSync extends CIntegrationTest $this->waitForLogLineToBePresent(self::COMPONENT_SERVER, "End of DCsync_configuration()", true, 30, 1); self::startComponent(self::COMPONENT_PROXY); $this->waitForLogLineToBePresent(self::COMPONENT_SERVER, 'sending configuration data to proxy "Proxy"', true, 90, 1); - $this->waitForLogLineToBePresent(self::COMPONENT_PROXY, "received configuration data from server", true, 90, 1); $this->waitForLogLineToBePresent(self::COMPONENT_PROXY, "memory statistics for configuration cache", true, 90, 1); -- cgit v1.2.3