mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-05-28 04:36:06 -04:00
Merge 1e7152bbda into 01b7431ad5
This commit is contained in:
commit
a3f402f650
1 changed files with 25 additions and 2 deletions
|
|
@ -307,7 +307,7 @@ class MigrateCommandTest extends TestCase
|
|||
'filter' => 'host_name=%2Afoo%2A',
|
||||
'owner' => 'test'
|
||||
],
|
||||
'hosts_encoded_params' => [
|
||||
'shared-hosts_encoded_params' => [
|
||||
'type' => 'host-action',
|
||||
'url' => 'monitoring/list/hosts?host_name=%28foo%29&sort=_host_%28foo%29',
|
||||
'filter' => '_host_%28foo%29=bar',
|
||||
|
|
@ -327,7 +327,7 @@ class MigrateCommandTest extends TestCase
|
|||
'filter' => 'host.name~%2Afoo%2A',
|
||||
'owner' => 'test'
|
||||
],
|
||||
'hosts_encoded_params' => [
|
||||
'shared-hosts_encoded_params' => [
|
||||
'type' => 'icingadb-host-action',
|
||||
'url' => 'icingadb/hosts?host.name=%28foo%29&sort=host.vars.%28foo%29',
|
||||
'filter' => 'host.vars.%28foo%29=bar',
|
||||
|
|
@ -961,6 +961,29 @@ class MigrateCommandTest extends TestCase
|
|||
$this->assertSame($services, $servicesAfterSecondRun);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the following:
|
||||
* - Whether existing Icinga DB Actions are transformed regarding wildcard filters
|
||||
*/
|
||||
public function testTest()
|
||||
{
|
||||
[$legacyHostActions, $expectedMigrated] = $this->getConfig('host-actions');
|
||||
|
||||
$this->createConfig('navigation/host-actions.ini', $legacyHostActions);
|
||||
$this->createConfig('preferences/test/icingadb-host-actions.ini', $expectedMigrated);
|
||||
|
||||
$command = $this->createCommandInstance('--user', 'test');
|
||||
$command->navigationAction();
|
||||
|
||||
$legacyConfig = $this->loadConfig('navigation/host-actions.ini');
|
||||
$shouldBeEmpty = $this->loadConfig('navigation/icingadb-host-actions.ini');
|
||||
$expectedConfig = $this->loadConfig('preferences/test/icingadb-host-actions.ini');
|
||||
|
||||
$this->assertSame($legacyHostActions, $legacyConfig);
|
||||
$this->assertSame($expectedMigrated, $expectedConfig);
|
||||
$this->assertEmpty($shouldBeEmpty);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the following:
|
||||
* - Whether legacy host/service macros are migrated
|
||||
|
|
|
|||
Loading…
Reference in a new issue