From: emaclee Date: Mon, 16 Mar 2026 15:58:09 +0000 (+0000) Subject: Fix: Functional integration tests failing on old dmi-registry model X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=HEAD;p=cps.git Fix: Functional integration tests failing on old dmi-registry model - updated dmi-registry model used on tests Issue-ID: CPS-3187 Change-Id: I01804b1f2c87f7845088f447ed3f97de1deff829 Signed-off-by: emaclee --- diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/inventory/ModuleUpgradeServiceIntegrationSpec.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/inventory/ModuleUpgradeServiceIntegrationSpec.groovy index f762c3863e..942c4981b0 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/inventory/ModuleUpgradeServiceIntegrationSpec.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/inventory/ModuleUpgradeServiceIntegrationSpec.groovy @@ -57,13 +57,13 @@ class ModuleUpgradeServiceIntegrationSpec extends FunctionalSpecBase { then: 'After module sync, the CM-handle transitions to READY state' assert CmHandleState.READY == objectUnderTest.getCmHandleCompositeState(cmHandleId).cmHandleState when: 'A new version of the dmi-registry module (upgrade) is available' - def newYangContent = readResourceDataFile('inventory/dmi-registry@2025-07-22.yang') - def newYangResourceContentPerName = ["dmi-registry@2025-07-22.yang": newYangContent] - then: 'Install the latest version of inventory model dmi-registry-2025-07-22' - if (!cpsModulePersistenceService.schemaSetExists('NCMP-Admin', 'dmi-registry-2025-07-22')) { - cpsModulePersistenceService.createSchemaSet('NCMP-Admin', 'dmi-registry-2025-07-22', newYangResourceContentPerName) + def newYangContent = readResourceDataFile('inventory/dmi-registry@2026-01-28.yang') + def newYangResourceContentPerName = ["dmi-registry@2026-01-28.yang": newYangContent] + then: 'Install the latest version of inventory model dmi-registry-2026-01-28' + if (!cpsModulePersistenceService.schemaSetExists('NCMP-Admin', 'dmi-registry-2026-01-28')) { + cpsModulePersistenceService.createSchemaSet('NCMP-Admin', 'dmi-registry-2026-01-28', newYangResourceContentPerName) } - cpsAnchorService.updateAnchorSchemaSet('NCMP-Admin','ncmp-dmi-registry','dmi-registry-2025-07-22') + cpsAnchorService.updateAnchorSchemaSet('NCMP-Admin','ncmp-dmi-registry','dmi-registry-2026-01-28') when: 'that state gets updated to a different value' final Collection cmHandleDataNodes = inventoryPersistence.getCmHandleDataNodeByCmHandleId('ch-1', FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS) YangModelCmHandle yangModelCmHandle= YangDataConverter.toYangModelCmHandle(cmHandleDataNodes[0]) diff --git a/integration-test/src/test/resources/data/inventory/dmi-registry@2026-01-28.yang b/integration-test/src/test/resources/data/inventory/dmi-registry@2026-01-28.yang new file mode 100644 index 0000000000..9594b6ca69 --- /dev/null +++ b/integration-test/src/test/resources/data/inventory/dmi-registry@2026-01-28.yang @@ -0,0 +1,173 @@ +module dmi-registry { + + yang-version 1.1; + + namespace "org:onap:cps:ncmp"; + + prefix dmi-reg; + + contact "toine.siebelink@est.tech"; + + revision "2026-01-28" { + description + "Added dmi-datajobs-read-service, dmi-datajobs-write-service"; + } + + revision "2025-07-22" { + description + "Added dmi-registry.cm-handles.dmi-properties (string) to replace (now deprecated) dmi-registry.cm-handles.additional-properties (list). + Added dmi-registry.cm-handles.cm-handle-state to replace (now deprecated) and dmi-registry.cm-handles.state.cm-handle-state"; + } + + revision "2024-02-23" { + description + "Added data-producer-identifier"; + } + + revision "2023-11-27" { + description + "Added alternate-id"; + } + + revision "2023-08-23" { + description + "Added module-set-tag"; + } + + revision "2022-05-10" { + description + "Added data-sync-enabled, sync-state with state, last-sync-time, data-store-sync-state with operational and running sync-state"; + } + + revision "2022-02-10" { + description + "Added state, lock-reason, lock-reason-details to aid with cmHandle sync and timestamp to aid with retry/timeout scenarios"; + } + + revision "2021-12-13" { + description + "Added new list of public-properties and additional-properties for a Cm-Handle which are exposed to clients of the NCMP interface"; + } + + revision "2021-10-20" { + description + "Added dmi-data-service-name & dmi-model-service-name to allow separate DMI instances for each responsibility"; + } + + revision "2021-05-20" { + description + "Initial Version"; + } + + grouping LockReason { + leaf reason { + type string; + } + leaf details { + type string; + } + } + + grouping SyncState { + leaf sync-state { + type string; + } + leaf last-sync-time { + type string; + } + } + + grouping Datastores { + container operational { + uses SyncState; + } + container running { + uses SyncState; + } + } + + container dmi-registry { + list cm-handles { + key "id"; + leaf id { + type string; + } + leaf dmi-service-name { + type string; + } + leaf dmi-data-service-name { + type string; + } + leaf dmi-model-service-name { + type string; + } + leaf dmi-datajobs-read-service { + type string; + } + leaf dmi-datajobs-write-service { + type string; + } + leaf module-set-tag { + type string; + } + leaf alternate-id { + type string; + } + leaf data-producer-identifier { + type string; + } + leaf dmi-properties { + type string; + } + leaf cm-handle-state { + type string; + } + + list additional-properties { + key "name"; + leaf name { + type string; + } + leaf value { + type string; + } + status deprecated; // Replaced by dmi-properties + } + + list public-properties { + key "name"; + leaf name { + type string; + } + leaf value { + type string; + } + } + + container state { + leaf cm-handle-state { + type string; + status deprecated; + } + + container lock-reason { + uses LockReason; + } + + leaf last-update-time { + type string; + } + + leaf data-sync-enabled { + type boolean; + default "false"; + } + + container datastores { + uses Datastores; + } + } + } + } +} +