diff options
author | Priyank Maheshwari <priyank.maheshwari@est.tech> | 2024-07-11 13:29:59 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2024-07-11 13:29:59 +0000 |
commit | 00037dbbe5d2c204419ea134817fb66ef5b60c26 (patch) | |
tree | a823de565e212a663885d4fedcb331c586bb4362 | |
parent | 018743bc61b650571216bff97558d882e0623772 (diff) | |
parent | dfd3c3180b3e9e17bf42fc102dffd941234fbe41 (diff) |
Merge "Fix timing issue in CmHandleCreateSpec"
-rw-r--r-- | integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/CmHandleCreateSpec.groovy | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/CmHandleCreateSpec.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/CmHandleCreateSpec.groovy index 914f562a2f..c9a64e0ab8 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/CmHandleCreateSpec.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/CmHandleCreateSpec.groovy @@ -138,41 +138,28 @@ class CmHandleCreateSpec extends CpsIntegrationSpecBase { dmiDispatcher.isAvailable = false when: 'CM-handles are registered for creation' - def cmHandlesToCreate = [new NcmpServiceCmHandle(cmHandleId: 'ch-1'), new NcmpServiceCmHandle(cmHandleId: 'ch-2')] + def cmHandlesToCreate = [new NcmpServiceCmHandle(cmHandleId: 'ch-1')] def dmiPluginRegistration = new DmiPluginRegistration(dmiPlugin: DMI_URL, createdCmHandles: cmHandlesToCreate) objectUnderTest.updateDmiRegistrationAndSyncModule(dmiPluginRegistration) then: 'CM-handles go to LOCKED state' new PollingConditions().within(MODULE_SYNC_WAIT_TIME_IN_SECONDS, () -> { assert objectUnderTest.getCmHandleCompositeState('ch-1').cmHandleState == CmHandleState.LOCKED - assert objectUnderTest.getCmHandleCompositeState('ch-2').cmHandleState == CmHandleState.LOCKED }) - when: 'we wait for LOCKED CM handle retry time (actually just subtract 3 minutes from handles lastUpdateTime)' + when: 'DMI is available for retry' + dmiDispatcher.moduleNamesPerCmHandleId = ['ch-1': ['M1', 'M2']] + dmiDispatcher.isAvailable = true + and: 'the LOCKED CM handle retry time elapses (actually just subtract 3 minutes from handles lastUpdateTime)' overrideCmHandleLastUpdateTime('ch-1', OffsetDateTime.now().minusMinutes(3)) - overrideCmHandleLastUpdateTime('ch-2', OffsetDateTime.now().minusMinutes(3)) - then: 'CM-handles go to ADVISED state' - new PollingConditions().within(MODULE_SYNC_WAIT_TIME_IN_SECONDS, () -> { - assert objectUnderTest.getCmHandleCompositeState('ch-1').cmHandleState == CmHandleState.ADVISED - assert objectUnderTest.getCmHandleCompositeState('ch-2').cmHandleState == CmHandleState.ADVISED - }) - when: 'DMI will return expected modules' - dmiDispatcher.moduleNamesPerCmHandleId = ['ch-1': ['M1', 'M2'], 'ch-2': ['M1', 'M3']] - and: 'DMI is available for retry' - dmiDispatcher.isAvailable = true - then: 'CM-handles go to READY state' + then: 'CM-handle goes to READY state' new PollingConditions().within(MODULE_SYNC_WAIT_TIME_IN_SECONDS, () -> { assert objectUnderTest.getCmHandleCompositeState('ch-1').cmHandleState == CmHandleState.READY - assert objectUnderTest.getCmHandleCompositeState('ch-2').cmHandleState == CmHandleState.READY }) - and: 'CM-handles have expected modules' + and: 'CM-handle has expected modules' assert ['M1', 'M2'] == objectUnderTest.getYangResourcesModuleReferences('ch-1').moduleName.sort() - assert ['M1', 'M3'] == objectUnderTest.getYangResourcesModuleReferences('ch-2').moduleName.sort() - and: 'CM-handles have expected module set tags (blank)' - assert objectUnderTest.getNcmpServiceCmHandle('ch-1').moduleSetTag == '' - assert objectUnderTest.getNcmpServiceCmHandle('ch-2').moduleSetTag == '' cleanup: 'deregister CM handle' - deregisterCmHandles(DMI_URL, ['ch-1', 'ch-2']) + deregisterCmHandle(DMI_URL, 'ch-1') } } |