aboutsummaryrefslogtreecommitdiffstats
path: root/integration-test/src/test
diff options
context:
space:
mode:
authorToineSiebelink <toine.siebelink@est.tech>2025-01-16 14:41:18 +0000
committerToineSiebelink <toine.siebelink@est.tech>2025-01-16 14:41:27 +0000
commit9df4a57a05e3ee67ff96284a4f7b1b07c94600b1 (patch)
treeea2fbc005c69e76284e8dcc0c5ddac0638aa07b3 /integration-test/src/test
parent856619ceb02f533ec7c5dff9a67ab17ef780276c (diff)
One SchemaSet per moduleSetTag
- Registration: create and upgrade cases. - Handle moduleSetTag deletion (all orphans) for testware - Unit tests updated - additional logging of details for upgrade scenarios - Integration Tests updated - Remove cache for module sets being processed - Removed DbCleaner (startup) - Removed redundant methods in NCMP Inventory for deleting schema set(s) - Removed validation check for all schema set interactions - Updated some schema set tests to use special characters previously not allowed - Checked integration test scenarios for upgrades with and without tags: all scenarios covered! TODO - REST endpoint to remove orphaned schema set data, separate story: CPS-2554 - Investigate exception handling regarding DuplicateYangResourceException: CPS-2555 Issue-ID: CPS-2540 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Iaa59cbdb86b7a4a8044624829bc002506ff40cc7
Diffstat (limited to 'integration-test/src/test')
-rw-r--r--integration-test/src/test/groovy/org/onap/cps/integration/base/CpsIntegrationSpecBase.groovy20
-rw-r--r--integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/AnchorServiceIntegrationSpec.groovy15
-rw-r--r--integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/DataspaceServiceIntegrationSpec.groovy2
-rw-r--r--integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/ModuleServiceIntegrationSpec.groovy26
-rw-r--r--integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/CmHandleUpgradeSpec.groovy24
-rw-r--r--integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/ModuleSyncWatchdogIntegrationSpec.groovy48
-rw-r--r--integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/YangModulesSpec.groovy26
-rw-r--r--integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/ModuleQueryPerfTest.groovy2
8 files changed, 81 insertions, 82 deletions
diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/base/CpsIntegrationSpecBase.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/base/CpsIntegrationSpecBase.groovy
index fa65d9d873..f3cca801e7 100644
--- a/integration-test/src/test/groovy/org/onap/cps/integration/base/CpsIntegrationSpecBase.groovy
+++ b/integration-test/src/test/groovy/org/onap/cps/integration/base/CpsIntegrationSpecBase.groovy
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2023-2024 Nordix Foundation
+ * Copyright (C) 2023-2025 Nordix Foundation
* Modifications Copyright (C) 2024-2025 TechMahindra Ltd.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -21,7 +21,6 @@
package org.onap.cps.integration.base
-import com.hazelcast.collection.ISet
import com.hazelcast.map.IMap
import okhttp3.mockwebserver.MockWebServer
import org.onap.cps.api.CpsAnchorService
@@ -29,24 +28,23 @@ import org.onap.cps.api.CpsDataService
import org.onap.cps.api.CpsDataspaceService
import org.onap.cps.api.CpsModuleService
import org.onap.cps.api.CpsQueryService
+import org.onap.cps.api.exceptions.DataspaceNotFoundException
+import org.onap.cps.api.model.DataNode
import org.onap.cps.integration.DatabaseTestContainer
import org.onap.cps.integration.KafkaTestContainer
-import org.onap.cps.ncmp.impl.NetworkCmProxyInventoryFacadeImpl
+import org.onap.cps.ncmp.api.inventory.models.CmHandleState
import org.onap.cps.ncmp.api.inventory.models.DmiPluginRegistration
import org.onap.cps.ncmp.api.inventory.models.NcmpServiceCmHandle
+import org.onap.cps.ncmp.impl.NetworkCmProxyInventoryFacadeImpl
import org.onap.cps.ncmp.impl.data.NetworkCmProxyFacade
import org.onap.cps.ncmp.impl.data.NetworkCmProxyQueryService
import org.onap.cps.ncmp.impl.inventory.InventoryPersistence
import org.onap.cps.ncmp.impl.inventory.ParameterizedCmHandleQueryService
-import org.onap.cps.ncmp.api.inventory.models.CmHandleState
import org.onap.cps.ncmp.impl.inventory.sync.ModuleSyncService
import org.onap.cps.ncmp.impl.inventory.sync.ModuleSyncWatchdog
import org.onap.cps.ncmp.impl.utils.AlternateIdMatcher
import org.onap.cps.ri.repository.DataspaceRepository
import org.onap.cps.ri.utils.SessionManager
-import org.onap.cps.api.exceptions.DataspaceNotFoundException
-import org.onap.cps.api.model.DataNode
-import static org.onap.cps.utils.ContentType.*
import org.onap.cps.utils.JsonObjectMapper
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.beans.factory.annotation.Value
@@ -136,9 +134,6 @@ abstract class CpsIntegrationSpecBase extends Specification {
@Autowired
AlternateIdMatcher alternateIdMatcher
- @Autowired
- ISet<String> moduleSetTagsBeingProcessed
-
@Value('${ncmp.policy-executor.server.port:8080}')
private String policyServerPort;
@@ -158,7 +153,7 @@ abstract class CpsIntegrationSpecBase extends Specification {
static NO_ALTERNATE_ID = ''
static GENERAL_TEST_DATASPACE = 'generalTestDataspace'
static BOOKSTORE_SCHEMA_SET = 'bookstoreSchemaSet'
- static MODULE_SYNC_WAIT_TIME_IN_SECONDS = 10
+ static MODULE_SYNC_WAIT_TIME_IN_SECONDS = 2
static initialized = false
def now = OffsetDateTime.now()
@@ -167,6 +162,7 @@ abstract class CpsIntegrationSpecBase extends Specification {
if (!initialized) {
cpsDataspaceService.createDataspace(GENERAL_TEST_DATASPACE)
createStandardBookStoreSchemaSet(GENERAL_TEST_DATASPACE)
+ cpsAnchorService.createAnchor(GENERAL_TEST_DATASPACE, BOOKSTORE_SCHEMA_SET, 'owner-of-bookstore-schema-set-do-not-delete')
initialized = true
}
mockDmiServer1.setDispatcher(dmiDispatcher1)
@@ -186,7 +182,7 @@ abstract class CpsIntegrationSpecBase extends Specification {
mockDmiServer1.shutdown()
mockDmiServer2.shutdown()
mockPolicyServer.shutdown()
- moduleSetTagsBeingProcessed.clear()
+ cpsModuleService.deleteAllUnusedYangModuleData()
}
def static readResourceDataFile(filename) {
diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/AnchorServiceIntegrationSpec.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/AnchorServiceIntegrationSpec.groovy
index 257f10b58b..2bd5a4a1be 100644
--- a/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/AnchorServiceIntegrationSpec.groovy
+++ b/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/AnchorServiceIntegrationSpec.groovy
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2023-2024 Nordix Foundation
+ * Copyright (C) 2023-2025 Nordix Foundation
* Modifications Copyright (C) 2024 TechMahindra Ltd.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -22,7 +22,6 @@
package org.onap.cps.integration.functional.cps
import java.time.OffsetDateTime
-
import org.onap.cps.api.CpsAnchorService
import org.onap.cps.integration.base.FunctionalSpecBase
import org.onap.cps.api.parameters.FetchDescendantsOption
@@ -60,17 +59,17 @@ class AnchorServiceIntegrationSpec extends FunctionalSpecBase {
and: '1 anchor with "other" schema set is created'
createStandardBookStoreSchemaSet(GENERAL_TEST_DATASPACE, 'otherSchemaSet')
objectUnderTest.createAnchor(GENERAL_TEST_DATASPACE, 'otherSchemaSet', 'anchor3')
- then: 'there are 3 anchors in the general test database'
- assert objectUnderTest.getAnchors(GENERAL_TEST_DATASPACE).size() == 3
- and: 'there are 2 anchors associated with bookstore schema set'
- assert objectUnderTest.getAnchorsBySchemaSetName(GENERAL_TEST_DATASPACE, BOOKSTORE_SCHEMA_SET).size() == 2
+ then: 'there are 4 anchors in the general test database'
+ assert objectUnderTest.getAnchors(GENERAL_TEST_DATASPACE).size() == 4
+ and: 'there are 3 anchors associated with bookstore schema set'
+ assert objectUnderTest.getAnchorsBySchemaSetName(GENERAL_TEST_DATASPACE, BOOKSTORE_SCHEMA_SET).size() == 3
and: 'there is 1 anchor associated with other schema set'
assert objectUnderTest.getAnchorsBySchemaSetName(GENERAL_TEST_DATASPACE, 'otherSchemaSet').size() == 1
}
def 'Querying anchor(name)s (depends on previous test!).'() {
- expect: 'there are now 3 anchors using the "stores" module (both schema sets use the same modules) '
- assert objectUnderTest.queryAnchorNames(GENERAL_TEST_DATASPACE, ['stores', 'bookstore-types']).size() == 3
+ expect: 'there are now 4 anchors using the "stores" module (both schema sets use the same modules) '
+ assert objectUnderTest.queryAnchorNames(GENERAL_TEST_DATASPACE, ['stores', 'bookstore-types']).size() == 4
and: 'there are no anchors using both "stores" and a "unused-model"'
assert objectUnderTest.queryAnchorNames(GENERAL_TEST_DATASPACE, ['stores', 'unused-model']).size() == 0
}
diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/DataspaceServiceIntegrationSpec.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/DataspaceServiceIntegrationSpec.groovy
index 6cd7f21df3..178b0227ca 100644
--- a/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/DataspaceServiceIntegrationSpec.groovy
+++ b/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/DataspaceServiceIntegrationSpec.groovy
@@ -32,7 +32,7 @@ class DataspaceServiceIntegrationSpec extends FunctionalSpecBase {
def setup() { objectUnderTest = cpsDataspaceService }
- def cleanup() { cpsModuleService.deleteUnusedYangResourceModules() }
+ def cleanup() { cpsModuleService.deleteAllUnusedYangModuleData() }
def 'Dataspace CRUD operations.'() {
when: 'a dataspace is created'
diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/ModuleServiceIntegrationSpec.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/ModuleServiceIntegrationSpec.groovy
index efdd71d5f4..d8010875c1 100644
--- a/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/ModuleServiceIntegrationSpec.groovy
+++ b/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/ModuleServiceIntegrationSpec.groovy
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2023-2024 Nordix Foundation
+ * Copyright (C) 2023-2025 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
@@ -41,17 +41,17 @@ class ModuleServiceIntegrationSpec extends FunctionalSpecBase {
private static def bookStoreTypesModuleReference = new ModuleReference('bookstore-types','2024-01-30')
private static def bookStoreTypesModuleReferenceWithNamespace = new ModuleReference('bookstore-types','2024-01-30', 'org:onap:cps:types:sample')
static def NEW_RESOURCE_REVISION = '2023-05-10'
- static def NEW_RESOURCE_CONTENT = 'module test_module {\n' +
- ' yang-version 1.1;\n' +
- ' namespace "org:onap:ccsdk:sample";\n' +
- '\n' +
- ' prefix book-store;\n' +
- '\n' +
- ' revision "2023-05-10" {\n' +
- ' description\n' +
- ' "Sample Model";\n' +
- ' }' +
- '}'
+ static def NEW_RESOURCE_CONTENT = """
+ module test_module {
+ yang-version 1.1;
+ namespace "org:onap:ccsdk:sample";
+ prefix book-store;
+ revision "2023-05-10" {
+ description
+ "Sample Model";
+ }
+ }
+ """
def newYangResourcesNameToContentMap = [:]
def moduleReferences = []
@@ -61,7 +61,7 @@ class ModuleServiceIntegrationSpec extends FunctionalSpecBase {
def setup() { objectUnderTest = cpsModuleService }
- def cleanup() { objectUnderTest.deleteUnusedYangResourceModules() }
+ def cleanup() { objectUnderTest.deleteAllUnusedYangModuleData() }
/*
C R E A T E S C H E M A S E T U S E - C A S E S
diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/CmHandleUpgradeSpec.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/CmHandleUpgradeSpec.groovy
index 11a4f2c6a7..28714fd123 100644
--- a/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/CmHandleUpgradeSpec.groovy
+++ b/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/CmHandleUpgradeSpec.groovy
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2024 Nordix Foundation
+ * Copyright (C) 2024-2025 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
@@ -21,12 +21,12 @@
package org.onap.cps.integration.functional.ncmp
import org.onap.cps.integration.base.CpsIntegrationSpecBase
-import org.onap.cps.ncmp.impl.NetworkCmProxyInventoryFacadeImpl
import org.onap.cps.ncmp.api.inventory.models.CmHandleRegistrationResponse
-import org.onap.cps.ncmp.api.inventory.models.DmiPluginRegistration
-import org.onap.cps.ncmp.api.inventory.models.UpgradedCmHandles
import org.onap.cps.ncmp.api.inventory.models.CmHandleState
+import org.onap.cps.ncmp.api.inventory.models.DmiPluginRegistration
import org.onap.cps.ncmp.api.inventory.models.LockReasonCategory
+import org.onap.cps.ncmp.api.inventory.models.UpgradedCmHandles
+import org.onap.cps.ncmp.impl.NetworkCmProxyInventoryFacadeImpl
import spock.util.concurrent.PollingConditions
class CmHandleUpgradeSpec extends CpsIntegrationSpecBase {
@@ -38,10 +38,9 @@ class CmHandleUpgradeSpec extends CpsIntegrationSpecBase {
def setup() {
objectUnderTest = networkCmProxyInventoryFacade
- moduleSyncService.clearPrivateModuleSetCache()
}
- def 'Upgrade CM-handle with new moduleSetTag or no moduleSetTag.'() {
+ def 'Upgrade CM-handle with and without (new) module set tags.'() {
given: 'a CM-handle is created with expected initial modules: M1 and M2'
dmiDispatcher1.moduleNamesPerCmHandleId[cmHandleId] = ['M1', 'M2']
registerCmHandle(DMI1_URL, cmHandleId, initialModuleSetTag)
@@ -78,15 +77,16 @@ class CmHandleUpgradeSpec extends CpsIntegrationSpecBase {
and: 'CM-handle has expected updated modules: M1 and M3'
assert ['M1', 'M3'] == objectUnderTest.getYangResourcesModuleReferences(cmHandleId).moduleName.sort()
- cleanup: 'deregister CM-handle'
+ cleanup: 'deregister CM-handle and remove all associated module resources'
deregisterCmHandle(DMI1_URL, cmHandleId)
+ cpsModuleService.deleteAllUnusedYangModuleData()
where: 'following module set tags are used'
initialModuleSetTag | updatedModuleSetTag
NO_MODULE_SET_TAG | NO_MODULE_SET_TAG
- NO_MODULE_SET_TAG | 'new'
- 'initial' | NO_MODULE_SET_TAG
- 'initial' | 'new'
+ NO_MODULE_SET_TAG | 'new@set'
+ 'initial set' | NO_MODULE_SET_TAG
+ 'initial set' | 'new@set'
}
def 'Upgrade CM-handle with existing moduleSetTag.'() {
@@ -127,8 +127,8 @@ class CmHandleUpgradeSpec extends CpsIntegrationSpecBase {
where:
initialModuleSetTag | updatedModuleSetTag
- NO_MODULE_SET_TAG | 'moduleSet2'
- 'moduleSet1' | 'moduleSet2'
+ NO_MODULE_SET_TAG | 'module@Set2'
+ 'module@Set1' | 'module@Set2'
}
def 'Skip upgrade of CM-handle with same moduleSetTag as before.'() {
diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/ModuleSyncWatchdogIntegrationSpec.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/ModuleSyncWatchdogIntegrationSpec.groovy
index a6e56ab22d..43db9b208e 100644
--- a/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/ModuleSyncWatchdogIntegrationSpec.groovy
+++ b/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/ModuleSyncWatchdogIntegrationSpec.groovy
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2024 Nordix Foundation
+ * Copyright (C) 2024-2025 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
@@ -21,15 +21,16 @@
package org.onap.cps.integration.functional.ncmp
import io.micrometer.core.instrument.MeterRegistry
+import spock.lang.Ignore
+
+import java.util.concurrent.Executors
+import java.util.concurrent.TimeUnit
import org.onap.cps.integration.base.CpsIntegrationSpecBase
import org.onap.cps.ncmp.impl.inventory.sync.ModuleSyncWatchdog
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.util.StopWatch
import spock.util.concurrent.PollingConditions
-import java.util.concurrent.Executors
-import java.util.concurrent.TimeUnit
-
class ModuleSyncWatchdogIntegrationSpec extends CpsIntegrationSpecBase {
ModuleSyncWatchdog objectUnderTest
@@ -46,7 +47,6 @@ class ModuleSyncWatchdogIntegrationSpec extends CpsIntegrationSpecBase {
def cleanup() {
try {
- deregisterSequenceOfCmHandles(DMI1_URL, PARALLEL_SYNC_SAMPLE_SIZE, 1)
moduleSyncWorkQueue.clear()
} finally {
executorService.shutdownNow()
@@ -54,14 +54,21 @@ class ModuleSyncWatchdogIntegrationSpec extends CpsIntegrationSpecBase {
}
def 'Watchdog is disabled for test.'() {
- given:
+ given: 'some cm handles are registered'
registerSequenceOfCmHandlesWithManyModuleReferencesButDoNotWaitForReady(DMI1_URL, NO_MODULE_SET_TAG, PARALLEL_SYNC_SAMPLE_SIZE, 1)
when: 'wait a while but less then the initial delay of 10 minutes'
Thread.sleep(3000)
then: 'the work queue remains empty'
assert moduleSyncWorkQueue.isEmpty()
+ cleanup: 'remove advised cm handles'
+ deregisterSequenceOfCmHandles(DMI1_URL, PARALLEL_SYNC_SAMPLE_SIZE, 1)
}
+ @Ignore
+ /** this test has intermittent failures, due to timeouts.
+ * Ignored but left here as it might be valuable to further optimization investigations.
+ **/
+
def 'CPS-2478 Highlight (and improve) module sync inefficiencies.'() {
given: 'register 250 cm handles with module set tag cps-2478-A'
def numberOfTags = 2
@@ -78,34 +85,32 @@ class ModuleSyncWatchdogIntegrationSpec extends CpsIntegrationSpecBase {
when: 'sync all advised cm handles'
objectUnderTest.moduleSyncAdvisedCmHandles()
Thread.sleep(100)
- then: 'retry until all schema sets are stored in db (1 schema set for each cm handle)'
+ then: 'retry until both schema sets are stored in db (1 schema set for each module set tag)'
def dbSchemaSetStorageTimer = meterRegistry.get('cps.module.persistence.schemaset.store').timer()
new PollingConditions().within(10, () -> {
objectUnderTest.moduleSyncAdvisedCmHandles()
Thread.sleep(100)
- assert dbSchemaSetStorageTimer.count() >= 500
+ assert dbSchemaSetStorageTimer.count() == 2
})
then: 'wait till at least 5 batches of state updates are done (often more because of retries of locked cm handles)'
def dbStateUpdateTimer = meterRegistry.get('cps.ncmp.cmhandle.state.update.batch').timer()
new PollingConditions().within(10, () -> {
assert dbStateUpdateTimer.count() >= minimumBatches
})
- and: 'the db has been queried for tags exactly 2 times.'
- def dbModuleQueriesTimer = meterRegistry.get('cps.module.service.module.reference.query.by.attribute').timer()
- assert dbModuleQueriesTimer.count() == 2
- and: 'exactly 2 calls to DMI to get module references'
+ and: 'one call to DMI per module set tag to get module references (may be more due to parallel processing of batches)'
def dmiModuleRetrievalTimer = meterRegistry.get('cps.ncmp.inventory.module.references.from.dmi').timer()
- assert dmiModuleRetrievalTimer.count() == 2
+ assert dmiModuleRetrievalTimer.count() >= numberOfTags && dmiModuleRetrievalTimer.count() <= minimumBatches
+
and: 'log the relevant instrumentation'
- logInstrumentation(dbModuleQueriesTimer, 'query module references')
logInstrumentation(dmiModuleRetrievalTimer, 'get modules from DMI ')
logInstrumentation(dbSchemaSetStorageTimer, 'store schema sets ')
logInstrumentation(dbStateUpdateTimer, 'batch state updates ')
- cleanup: 'remove all cm handles'
+ cleanup: 'remove all test cm handles'
// To properly measure performance the sample-size should be increased to 20,000 cm handles or higher (10,000 per tag)
def stopWatch = new StopWatch()
stopWatch.start()
deregisterSequenceOfCmHandles(DMI1_URL, totalCmHandles, 1)
+ cpsModuleService.deleteAllUnusedYangModuleData()
stopWatch.stop()
println "*** CPS-2478, Deletion of $totalCmHandles cm handles took ${stopWatch.getTotalTimeMillis()} milliseconds"
}
@@ -122,6 +127,8 @@ class ModuleSyncWatchdogIntegrationSpec extends CpsIntegrationSpecBase {
Thread.sleep(50)
then: 'the queue size is exactly the sample size'
assert moduleSyncWorkQueue.size() == PARALLEL_SYNC_SAMPLE_SIZE
+ cleanup: 'remove all test cm handles'
+ deregisterSequenceOfCmHandles(DMI1_URL, PARALLEL_SYNC_SAMPLE_SIZE, 1)
}
def 'Populate module sync work queue on two parallel threads with a slight difference in start time.'() {
@@ -136,6 +143,8 @@ class ModuleSyncWatchdogIntegrationSpec extends CpsIntegrationSpecBase {
Thread.sleep(50)
then: 'the queue size is exactly the sample size'
assert moduleSyncWorkQueue.size() == PARALLEL_SYNC_SAMPLE_SIZE
+ cleanup: 'remove all test cm handles'
+ deregisterSequenceOfCmHandles(DMI1_URL, PARALLEL_SYNC_SAMPLE_SIZE, 1)
}
def logInstrumentation(timer, description) {
@@ -151,15 +160,6 @@ class ModuleSyncWatchdogIntegrationSpec extends CpsIntegrationSpecBase {
}
}
- def populateQueueWithoutDelayCallable = () -> {
- try {
- objectUnderTest.populateWorkQueueIfNeeded()
- return 'task acquired the lock first'
- } catch (InterruptedException e) {
- e.printStackTrace()
- }
- }
-
def populateQueueWithDelay = () -> {
try {
Thread.sleep(10)
diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/YangModulesSpec.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/YangModulesSpec.groovy
index 4492e3d183..e01af55c35 100644
--- a/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/YangModulesSpec.groovy
+++ b/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/YangModulesSpec.groovy
@@ -38,14 +38,16 @@ class YangModulesSpec extends CpsIntegrationSpecBase {
def setup() {
dmiDispatcher1.moduleNamesPerCmHandleId['ch-1'] = ['M1', 'M2']
dmiDispatcher1.moduleNamesPerCmHandleId['ch-2'] = ['M1', 'M3']
+ dmiDispatcher1.moduleNamesPerCmHandleId['ch-3'] = ['M4']
registerCmHandle(DMI1_URL, 'ch-1', NO_MODULE_SET_TAG, 'alt-1')
registerCmHandle(DMI1_URL, 'ch-2', NO_MODULE_SET_TAG, 'alt-2')
+ registerCmHandle(DMI1_URL, 'ch-3', 'my-module-set-tag', 'alt-3')
// Note DMI dispatcher is not configured to return modules for this handle, so module sync will fail
registerCmHandleWithoutWaitForReady(DMI1_URL, 'not-ready-id', NO_MODULE_SET_TAG, NO_ALTERNATE_ID)
}
def cleanup() {
- deregisterCmHandles(DMI1_URL, ['ch-1', 'ch-2', 'not-ready-id'])
+ deregisterCmHandles(DMI1_URL, ['ch-1', 'ch-2', 'ch-3', 'not-ready-id'])
}
def 'Get yang module references returns expected modules with #scenario.'() {
@@ -56,11 +58,12 @@ class YangModulesSpec extends CpsIntegrationSpecBase {
.andExpect(jsonPath('$[*].moduleName', containsInAnyOrder(expectedModuleNames.toArray())))
.andExpect(jsonPath('$[*].revision', everyItem(equalTo('2024-01-01'))))
where: 'following scenarios are applied'
- scenario | cmHandleReference || expectedModuleNames
- 'cm-handle id' | 'ch-1' || ['M1', 'M2']
- 'alternate id' | 'alt-2' || ['M1', 'M3']
- 'not ready CM handle' | 'not-ready-id' || []
- 'non-existing CM handle' | 'non-existing' || []
+ scenario | cmHandleReference || expectedModuleNames
+ 'cm-handle id' | 'ch-1' || ['M1', 'M2']
+ 'alternate id' | 'alt-2' || ['M1', 'M3']
+ 'CM handle with module set tag' | 'ch-3' || ['M4']
+ 'not ready CM handle' | 'not-ready-id' || []
+ 'non-existing CM handle' | 'non-existing' || []
}
def 'Get yang module definitions returns expected modules with #scenario.'() {
@@ -72,11 +75,12 @@ class YangModulesSpec extends CpsIntegrationSpecBase {
.andExpect(jsonPath('$[*].revision', everyItem(equalTo('2024-01-01'))))
.andExpect(jsonPath('$[*].content', not(is(emptyString()))))
where: 'following scenarios are applied'
- scenario | cmHandleReference || expectedModuleNames
- 'cm-handle id' | 'ch-1' || ['M1', 'M2']
- 'alternate id' | 'alt-2' || ['M1', 'M3']
- 'not ready CM handle' | 'not-ready-id' || []
- 'non-existing CM handle' | 'non-existing' || []
+ scenario | cmHandleReference || expectedModuleNames
+ 'cm-handle id' | 'ch-1' || ['M1', 'M2']
+ 'alternate id' | 'alt-2' || ['M1', 'M3']
+ 'CM handle with module set tag' | 'ch-3' || ['M4']
+ 'not ready CM handle' | 'not-ready-id' || []
+ 'non-existing CM handle' | 'non-existing' || []
}
def 'Get yang module definition for specific module with #scenario.'() {
diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/ModuleQueryPerfTest.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/ModuleQueryPerfTest.groovy
index b239a78d71..613f760b0c 100644
--- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/ModuleQueryPerfTest.groovy
+++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/ModuleQueryPerfTest.groovy
@@ -100,7 +100,7 @@ class ModuleQueryPerfTest extends CpsPerfTestBase {
cpsModuleService.deleteSchemaSetsWithCascade(CPS_PERFORMANCE_TEST_DATASPACE, (i..i+100).collect {SCHEMA_SET_PREFIX + it})
}
cpsModuleService.deleteSchemaSetsWithCascade(CPS_PERFORMANCE_TEST_DATASPACE, [SCHEMA_SET_PREFIX + '0'])
- cpsModuleService.deleteUnusedYangResourceModules()
+ cpsModuleService.deleteAllUnusedYangModuleData()
}
// This makes a Yang module of approximately target length in bytes by padding the description field with many '*'