From e0170ccc7ece5f170fedb737f7cdc41dfd735cb0 Mon Sep 17 00:00:00 2001 From: odain Date: Wed, 10 Apr 2024 14:05:39 +0200 Subject: [PATCH 1/2] =?UTF-8?q?N=C2=B07407=20-=20InstallationFileServiceTe?= =?UTF-8?q?st=20relies=20on=20local=20installation.xml=20to=20reduce=20mai?= =?UTF-8?q?ntenance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InstallationFileServiceTest.php | 12 +- .../setup/unattended-install/installation.xml | 216 ++++++++++++++++++ 2 files changed, 224 insertions(+), 4 deletions(-) create mode 100644 tests/php-unit-tests/unitary-tests/setup/unattended-install/installation.xml diff --git a/tests/php-unit-tests/unitary-tests/setup/unattended-install/InstallationFileServiceTest.php b/tests/php-unit-tests/unitary-tests/setup/unattended-install/InstallationFileServiceTest.php index ba7e709d1..1795dd051 100644 --- a/tests/php-unit-tests/unitary-tests/setup/unattended-install/InstallationFileServiceTest.php +++ b/tests/php-unit-tests/unitary-tests/setup/unattended-install/InstallationFileServiceTest.php @@ -21,6 +21,10 @@ class InstallationFileServiceTest extends TestCase { $this->RecurseMoveDir(APPROOT."data/production-modules/$sModuleId", APPROOT . "datamodels/2.x/$sModuleId"); } + private function GetInstallationPath() : string { + return realpath(__DIR__ . '/installation.xml'); + } + public function GetDefaultModulesProvider() { return [ 'all checked' => [ true ], @@ -32,7 +36,7 @@ class InstallationFileServiceTest extends TestCase { * @dataProvider GetDefaultModulesProvider */ public function testProcessInstallationChoices($bInstallationOptionalChoicesChecked=false) { - $sPath = realpath(dirname(__FILE__, 6)."/datamodels/2.x/installation.xml"); + $sPath = $this->GetInstallationPath(); $this->assertTrue(is_file($sPath)); $oInstallationFileService = new \InstallationFileService($sPath, 'production', [], $bInstallationOptionalChoicesChecked); $oInstallationFileService->ProcessInstallationChoices(); @@ -89,7 +93,7 @@ class InstallationFileServiceTest extends TestCase { * @dataProvider GetDefaultModulesProvider */ public function testGetAllSelectedModules($bInstallationOptionalChoicesChecked=false) { - $sPath = realpath(dirname(__FILE__, 6)."/datamodels/2.x/installation.xml"); + $sPath = $this->GetInstallationPath(); $oInstallationFileService = new \InstallationFileService($sPath, 'production', [], $bInstallationOptionalChoicesChecked); $oInstallationFileService->Init(); @@ -195,7 +199,7 @@ class InstallationFileServiceTest extends TestCase { * @dataProvider ItilExtensionProvider */ public function testGetAllSelectedModules_withItilExtensions(array $aSelectedExtensions, bool $bKnownMgtSelected) { - $sPath = realpath(dirname(__FILE__, 6)."/datamodels/2.x/installation.xml"); + $sPath = $this->GetInstallationPath(); $oInstallationFileService = new \InstallationFileService($sPath, 'production', $aSelectedExtensions); $oInstallationFileService->Init(); @@ -286,7 +290,7 @@ class InstallationFileServiceTest extends TestCase { $this->RecurseMoveDir(APPROOT . "datamodels/2.x/$sModuleId", APPROOT."data/production-modules/$sModuleId"); } - $sPath = realpath(dirname(__FILE__, 6)."/datamodels/2.x/installation.xml"); + $sPath = $this->GetInstallationPath(); $oInstallationFileService = new \InstallationFileService($sPath, 'production', [], false); $oInstallationFileService->Init(); diff --git a/tests/php-unit-tests/unitary-tests/setup/unattended-install/installation.xml b/tests/php-unit-tests/unitary-tests/setup/unattended-install/installation.xml new file mode 100644 index 000000000..89f2a212e --- /dev/null +++ b/tests/php-unit-tests/unitary-tests/setup/unattended-install/installation.xml @@ -0,0 +1,216 @@ + + + + + Configuration Management options + The options below allow you to configure the type of elements that are to be managed inside iTop.]]> + /images/modules.png + + + itop-config-mgmt-core + Configuration Management Core + All the base objects that are mandatory in the iTop CMDB: Organizations, Locations, Teams, Persons, etc. + + itop-config-mgmt + itop-attachments + itop-profiles-itil + itop-welcome-itil + itop-tickets + itop-files-information + combodo-db-tools + itop-core-update + itop-hub-connector + itop-oauth-client + + true + + + itop-config-mgmt-datacenter + Data Center Devices + Manage Data Center devices such as Racks, Enclosures, PDUs, etc. + + itop-datacenter-mgmt + + true + + + itop-config-mgmt-end-user + End-User Devices + Manage devices related to end-users: PCs, Phones, Tablets, etc. + + itop-endusers-devices + + true + + + itop-config-mgmt-storage + Storage Devices + Manage storage devices such as NAS, SAN Switches, Tape Libraries and Tapes, etc. + + itop-storage-mgmt + + true + + + itop-config-mgmt-virtualization + Virtualization + Manage Hypervisors, Virtual Machines and Farms. + + itop-virtualization-mgmt + + true + + + + + Service Management options + Select the choice that best describes the relationships between the services and the IT infrastructure in your IT environment.]]> + ./wizard-icons/service.png + + + itop-service-mgmt-enterprise + Service Management for Enterprises + Select this option if the IT delivers services based on a shared infrastructure. For example if different organizations within your company subscribe to services (like Mail and Print services) delivered by a single shared backend. + + itop-service-mgmt + + true + + + itop-service-mgmt-service-provider + Service Management for Service Providers + Select this option if the IT manages the infrastructure of independent customers. This is the most flexible model, since the services can be delivered with a mix of shared and customer specific infrastructure devices. + + itop-service-mgmt-provider + + + + + + Tickets Management options + Select the type of tickets you want to use in order to respond to user requests and incidents.]]> + ./itop-incident-mgmt-itil/images/incident-escalated.png + + + itop-ticket-mgmt-simple-ticket + Simple Ticket Management + Select this option to use one single type of tickets for all kind of requests. + + itop-request-mgmt + + true + + + + itop-ticket-mgmt-simple-ticket-enhanced-portal + Customer Portal + + + itop-portal + itop-portal-base + + true + + + + + + itop-ticket-mgmt-itil + ITIL Compliant Tickets Management + Select this option to have different types of ticket for managing user requests and incidents. Each type of ticket has a specific life cycle and specific fields + + + + itop-ticket-mgmt-itil-user-request + User Request Management + Manage User Request tickets in iTop + + itop-request-mgmt-itil + + + + itop-ticket-mgmt-itil-incident + Incident Management + Manage Incidents tickets in iTop + + itop-incident-mgmt-itil + + + + itop-ticket-mgmt-itil-enhanced-portal + Customer Portal + + + itop-portal + itop-portal-base + + true + + + + + + itop-ticket-mgmt-none + No Tickets Management + Don't manage incidents or user requests in iTop + + + + + + + Change Management options + Select the type of tickets you want to use in order to manage changes to the IT infrastructure.]]> + ./itop-change-mgmt/images/change.png + + + itop-change-mgmt-simple + Simple Change Management + Select this option to use one type of ticket for all kind of changes. + + itop-change-mgmt + + true + + + itop-change-mgmt-itil + ITIL Change Management + Select this option to use Normal/Routine/Emergency change tickets. + + itop-change-mgmt-itil + + + + itop-change-mgmt-none + No Change Management + Don't manage changes in iTop + + + + + + + Additional ITIL tickets + Pick from the list below the additional ITIL processes that are to be implemented in iTop.]]> + ./itop-knownerror-mgmt/images/known-error.png + + + itop-kown-error-mgmt + Known Errors Management + Select this option to track "Known Errors" and FAQs in iTop. + + itop-knownerror-mgmt + + + + itop-problem-mgmt + Problem Management + Select this option track "Problems" in iTop. + + itop-problem-mgmt + + + + + + From 18d0b88531101063ee9dd9fded9941ad4d7d3271 Mon Sep 17 00:00:00 2001 From: odain Date: Wed, 10 Apr 2024 14:11:58 +0200 Subject: [PATCH 2/2] =?UTF-8?q?N=C2=B07407=20-=20fix=20merge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InstallationFileServiceTest.php | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/tests/php-unit-tests/unitary-tests/setup/unattended-install/InstallationFileServiceTest.php b/tests/php-unit-tests/unitary-tests/setup/unattended-install/InstallationFileServiceTest.php index 736913885..26a97a122 100644 --- a/tests/php-unit-tests/unitary-tests/setup/unattended-install/InstallationFileServiceTest.php +++ b/tests/php-unit-tests/unitary-tests/setup/unattended-install/InstallationFileServiceTest.php @@ -21,7 +21,7 @@ class InstallationFileServiceTest extends TestCase { $this->RecurseMoveDir(APPROOT."data/production-modules/$sModuleId", APPROOT . "datamodels/2.x/$sModuleId"); } - private function GetInstallationPath() : string { + private function GetInstallationPath() { return realpath(__DIR__ . '/installation.xml'); } @@ -36,14 +36,11 @@ class InstallationFileServiceTest extends TestCase { * @dataProvider GetDefaultModulesProvider */ public function testProcessInstallationChoices($bInstallationOptionalChoicesChecked=false) { - $sPath = $this->GetInstallationPath(); + $sPath = realpath($this->GetInstallationPath()); $this->assertTrue(is_file($sPath)); $oInstallationFileService = new \InstallationFileService($sPath, 'production', [], $bInstallationOptionalChoicesChecked); $oInstallationFileService->ProcessInstallationChoices(); $aExpectedModules = [ - 'combodo-backoffice-darkmoon-theme', - 'itop-structure', - 'itop-themes-compat', "itop-config-mgmt", "itop-attachments", "itop-profiles-itil", @@ -75,11 +72,9 @@ class InstallationFileServiceTest extends TestCase { if ($bInstallationOptionalChoicesChecked){ $aExpectedModules []= "itop-problem-mgmt"; $aExpectedModules []= "itop-knownerror-mgmt"; - $aExpectedModules []= "itop-faq-light"; } else { $aExpectedUnselectedModules []= "itop-problem-mgmt"; $aExpectedUnselectedModules []= "itop-knownerror-mgmt"; - $aExpectedUnselectedModules []= "itop-faq-light"; } sort($aExpectedModules); @@ -98,15 +93,14 @@ class InstallationFileServiceTest extends TestCase { * @dataProvider GetDefaultModulesProvider */ public function testGetAllSelectedModules($bInstallationOptionalChoicesChecked=false) { - $sPath = $this->GetInstallationPath(); + $sPath = realpath($this->GetInstallationPath()); $oInstallationFileService = new \InstallationFileService($sPath, 'production', [], $bInstallationOptionalChoicesChecked); $oInstallationFileService->Init(); $aSelectedModules = $oInstallationFileService->GetSelectedModules(); $aExpectedInstallationModules = [ 'combodo-backoffice-darkmoon-theme', - 'itop-structure', - 'itop-themes-compat', + 'itop-structure', "itop-config-mgmt", "itop-attachments", "itop-profiles-itil", @@ -130,7 +124,6 @@ class InstallationFileServiceTest extends TestCase { if ($bInstallationOptionalChoicesChecked){ $aExpectedInstallationModules []= "itop-problem-mgmt"; $aExpectedInstallationModules []= "itop-knownerror-mgmt"; - $aExpectedInstallationModules []= "itop-faq-light"; } $aExpectedAuthenticationModules = [ @@ -148,7 +141,7 @@ class InstallationFileServiceTest extends TestCase { $aAutoSelectedModules = [ 'itop-bridge-virtualization-storage', - 'itop-bridge-cmdb-ticket', + 'itop-bridge-cmdb-ticket' ]; $this->checkModuleList("installation.xml choices", $aExpectedInstallationModules, $aSelectedModules); @@ -209,15 +202,15 @@ class InstallationFileServiceTest extends TestCase { * @dataProvider ItilExtensionProvider */ public function testGetAllSelectedModules_withItilExtensions(array $aSelectedExtensions, bool $bKnownMgtSelected) { - $sPath = $this->GetInstallationPath(); + $sPath = realpath($this->GetInstallationPath()); $oInstallationFileService = new \InstallationFileService($sPath, 'production', $aSelectedExtensions); $oInstallationFileService->Init(); $aSelectedModules = $oInstallationFileService->GetSelectedModules(); $aExpectedInstallationModules = [ 'combodo-backoffice-darkmoon-theme', - 'itop-structure', - 'itop-themes-compat', + 'itop-structure', + 'itop-bridge-cmdb-ticket', "itop-config-mgmt", "itop-attachments", "itop-profiles-itil", @@ -242,7 +235,6 @@ class InstallationFileServiceTest extends TestCase { ]; if ($bKnownMgtSelected){ $aExpectedInstallationModules []= "itop-knownerror-mgmt"; - $aExpectedInstallationModules []= "itop-faq-light"; } $aExpectedAuthenticationModules = [ @@ -260,7 +252,6 @@ class InstallationFileServiceTest extends TestCase { $aAutoSelectedModules = [ 'itop-bridge-virtualization-storage', - 'itop-bridge-cmdb-ticket', ]; $this->checkModuleList("installation.xml choices", $aExpectedInstallationModules, $aSelectedModules); @@ -305,7 +296,7 @@ class InstallationFileServiceTest extends TestCase { $this->RecurseMoveDir(APPROOT . "datamodels/2.x/$sModuleId", APPROOT."data/production-modules/$sModuleId"); } - $sPath = $this->GetInstallationPath(); + $sPath = realpath($this->GetInstallationPath()); $oInstallationFileService = new \InstallationFileService($sPath, 'production', [], false); $oInstallationFileService->Init();