============LICENSE_START=======================================================
Copyright (c) 2021 Pantheon.tech.
Modifications Copyright (C) 2021 Bell Canada.
- Modifications Copyright (C) 2021-2024 Nordix Foundation
+ Modifications Copyright (C) 2021-2025 OpenInfra Foundation Europe. All rights reserved.
Modifications Copyright (C) 2022 Deutsche Telekom AG
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
<properties>
<app>org.onap.cps.Application</app>
<maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
- <minimum-coverage>0.68</minimum-coverage>
<base.image>${docker.pull.registry}/onap/integration-java17:12.0.0</base.image>
<image.tag>${project.version}-${maven.build.timestamp}</image.tag>
</properties>
- name: cps-ncmp-inventory
url: /api-docs/cps-ncmp/openapi-inventory.yaml
-security:
- # comma-separated uri patterns which do not require authorization
- permit-uri: /actuator/**,/swagger-ui.html,/swagger-ui/**,/swagger-resources/**,/api-docs/**,/v3/api-docs/**
- auth:
- username: ${CPS_USERNAME:cpsuser}
- password: ${CPS_PASSWORD:cpsr0cks!}
-
cps:
monitoring:
micrometer-jvm-extras: false
--- /dev/null
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2025 OpenInfra Foundation Europe. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.cps
+
+
+import spock.lang.Specification
+
+class ApplicationSpec extends Specification {
+
+ def 'Starting CPS application.'() {
+ when: 'start the application'
+ Application.main()
+ then: 'no exception is thrown'
+ noExceptionThrown()
+ }
+
+}
+++ /dev/null
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2020 Pantheon.tech
- * Modifications Copyright (C) 2023 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.cps.rest.controller
-
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get
-
-import org.springframework.beans.factory.annotation.Autowired
-import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
-import org.springframework.http.HttpStatus
-import org.springframework.test.web.servlet.MockMvc
-import spock.lang.Ignore
-import spock.lang.Specification
-
-@WebMvcTest(TestController)
-class ControllerSecuritySpec extends Specification {
-
- @Autowired
- MockMvc mvc
-
- def testEndpoint = '/test'
-
- def 'Get request with authentication'() {
- when: 'request is sent with authentication'
- def response = mvc.perform(
- get(testEndpoint).header("Authorization", 'Basic Y3BzdXNlcjpjcHNyMGNrcyE=')
- ).andReturn().response
- then: 'HTTP OK status code is returned'
- assert response.status == HttpStatus.OK.value()
- }
-
- @Ignore // CPS-2126
- def 'Get request without authentication is not authorized'() {
- when: 'request is sent without authentication'
- def response = mvc.perform(get(testEndpoint)).andReturn().response
- then: 'HTTP Unauthorized status code is returned'
- assert response.status == HttpStatus.UNAUTHORIZED.value()
- }
-
- @Ignore // CPS-2126
- def 'Get request with invalid authentication is not authorized'() {
- when: 'request is sent with invalid authentication'
- def response = mvc.perform(
- get(testEndpoint).header("Authorization", 'Basic invalid auth')
- ).andReturn().response
- then: 'HTTP Unauthorized status code is returned'
- assert response.status == HttpStatus.UNAUTHORIZED.value()
- }
-}
-# ============LICENSE_START=======================================================
-# Copyright (C) 2021 Pantheon.tech
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
+# ============LICENSE_START=======================================================
+# Copyright (C) 2021-2025 OpenInfra Foundation Europe. All rights reserved.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
+#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
-security:
- auth:
- username: cpsuser
- password: cpsr0cks!
+# This is a full copy of the real application.yml except that liquibase.enabled is set to false!
+# This is needed te be able to test Application.main () method (coverage and context loading test).
+# Cannot use a custom profile. That would require the test to be a springboot test which is even harder to achieve
+
+rest:
+ api:
+ cps-base-path: /cps/api
+ ncmp-base-path: /ncmp
+ ncmp-inventory-base-path: /ncmpInventory
+
+spring:
+ main:
+ banner-mode: "off"
+ application:
+ name: "cps-application"
+ jpa:
+ show-sql: false
+ ddl-auto: create
+ open-in-view: false
+ properties:
+ hibernate.enable_lazy_load_no_trans: true
+ hibernate.dialect: org.hibernate.dialect.PostgreSQLDialect
+ # Please ensure these values match those used in integration-test/src/test/resources/application.yml
+ hibernate.id.new_generator_mappings: true
+ hibernate.jdbc.batch_size: 100
+
+ datasource:
+ url: jdbc:postgresql://${DB_HOST:localhost}:${DB_PORT:5432}/cpsdb
+ username: ${DB_USERNAME}
+ password: ${DB_PASSWORD}
+ driverClassName: org.postgresql.Driver
+ hikari:
+ minimumIdle: 5
+ maximumPoolSize: 80
+ idleTimeout: 60000
+ connectionTimeout: 30000
+ leakDetectionThreshold: 30000
+ pool-name: CpsDatabasePool
+
+ cache:
+ type: caffeine
+ cache-names: yangSchema
+ caffeine:
+ spec: maximumSize=10000,expireAfterAccess=10m
+
+ liquibase:
+ enabled: false
+
+ servlet:
+ multipart:
+ enabled: true
+ max-file-size: 100MB
+ max-request-size: 100MB
+
+ kafka:
+ bootstrap-servers: ${KAFKA_BOOTSTRAP_SERVER:localhost:9092}
+ security:
+ protocol: PLAINTEXT
+ producer:
+ value-serializer: io.cloudevents.kafka.CloudEventSerializer
+ client-id: cps-core
+ consumer:
+ group-id: ${NCMP_CONSUMER_GROUP_ID:ncmp-group}
+ key-deserializer: org.springframework.kafka.support.serializer.ErrorHandlingDeserializer
+ value-deserializer: org.springframework.kafka.support.serializer.ErrorHandlingDeserializer
+ properties:
+ spring.deserializer.key.delegate.class: org.apache.kafka.common.serialization.StringDeserializer
+ spring.deserializer.value.delegate.class: io.cloudevents.kafka.CloudEventDeserializer
+ spring.json.use.type.headers: false
+
+ jackson:
+ default-property-inclusion: NON_NULL
+ serialization:
+ FAIL_ON_EMPTY_BEANS: false
+ sql:
+ init:
+ mode: ALWAYS
+app:
+ ncmp:
+ async-m2m:
+ topic: ${NCMP_ASYNC_M2M_TOPIC:ncmp-async-m2m}
+ avc:
+ cm-subscription-ncmp-in: ${CM_SUBSCRIPTION_NCMP_IN_TOPIC:subscription}
+ cm-subscription-dmi-in: ${CM_SUBSCRIPTION_DMI_IN_TOPIC:ncmp-dmi-cm-avc-subscription}
+ cm-subscription-dmi-out: ${CM_SUBSCRIPTION_DMI_OUT_TOPIC:dmi-ncmp-cm-avc-subscription}
+ cm-subscription-ncmp-out: ${CM_SUBSCRIPTION_NCMP_OUT_TOPIC:subscription-response}
+ cm-events-topic: ${NCMP_CM_EVENTS_TOPIC:cm-events}
+ inventory-events-topic: ncmp-inventory-events
+ lcm:
+ events:
+ topic: ${LCM_EVENTS_TOPIC:ncmp-events}
+ dmi:
+ cm-events:
+ topic: ${DMI_CM_EVENTS_TOPIC:dmi-cm-events}
+ device-heartbeat:
+ topic: ${DMI_DEVICE_HEARTBEAT_TOPIC:dmi-device-heartbeat}
+ cps:
+ data-updated:
+ change-event-notifications-enabled: ${CPS_CHANGE_EVENT_NOTIFICATIONS_ENABLED:false}
+ topic: ${CPS_CHANGE_EVENT_TOPIC:cps-data-updated-events}
+
+notification:
+ enabled: true
+ async:
+ executor:
+ core-pool-size: 2
+ max-pool-size: 10
+ queue-capacity: 500
+ wait-for-tasks-to-complete-on-shutdown: true
+ thread-name-prefix: Async-
+ time-out-value-in-ms: 60000
+
+springdoc:
+ swagger-ui:
+ disable-swagger-default-url: true
+ urlsPrimaryName: cps-core
+ urls:
+ - name: cps-core
+ url: /api-docs/cps-core/openapi.yaml
+ - name: cps-ncmp
+ url: /api-docs/cps-ncmp/openapi.yaml
+ - name: cps-ncmp-inventory
+ url: /api-docs/cps-ncmp/openapi-inventory.yaml
+
+cps:
+ monitoring:
+ micrometer-jvm-extras: false
+ tracing:
+ sampler:
+ jaeger_remote:
+ endpoint: ${ONAP_OTEL_SAMPLER_JAEGER_REMOTE_ENDPOINT:http://onap-otel-collector:14250}
+ exporter:
+ endpoint: ${ONAP_OTEL_EXPORTER_ENDPOINT:http://onap-otel-collector:4317}
+ protocol: ${ONAP_OTEL_EXPORTER_PROTOCOL:grpc}
+ enabled: ${ONAP_TRACING_ENABLED:false}
+ excluded-observation-names: ${ONAP_EXCLUDED_OBSERVATION_NAMES:tasks.scheduled.execution}
+
+# Actuator
+management:
+ tracing:
+ propagation:
+ produce: ${ONAP_PROPAGATOR_PRODUCE:[W3C]}
+ sampling:
+ probability: 1.0
+ endpoints:
+ web:
+ exposure:
+ include: info,health,loggers,prometheus,metrics,heapdump,threaddump
+ endpoint:
+ health:
+ show-details: always
+ # kubernetes probes: liveness and readiness
+ probes:
+ enabled: true
+
+ info:
+ git:
+ enabled: true
+ mode: full
+
+logging:
+ format: json
+ level:
+ org:
+ springframework: INFO
+ onap:
+ cps: INFO
+ncmp:
+ policy-executor:
+ enabled: ${POLICY_SERVICE_ENABLED:false}
+ defaultDecision: ${POLICY_SERVICE_DEFAULT_DECISION:"allow"}
+ server:
+ address: ${POLICY_SERVICE_URL:http://policy-executor-stub}
+ port: ${POLICY_SERVICE_PORT:8093}
+ httpclient:
+ all-services:
+ maximumInMemorySizeInMegabytes: 16
+ maximumConnectionsTotal: 100
+ pendingAcquireMaxCount: 50
+ connectionTimeoutInSeconds: 30
+ readTimeoutInSeconds: 30
+ writeTimeoutInSeconds: 30
+ responseTimeoutInSeconds: 60
+ dmi:
+ httpclient:
+ data-services:
+ maximumInMemorySizeInMegabytes: 16
+ maximumConnectionsTotal: 100
+ pendingAcquireMaxCount: 50
+ connectionTimeoutInSeconds: 30
+ readTimeoutInSeconds: 30
+ writeTimeoutInSeconds: 30
+ responseTimeoutInSeconds: 60
+ model-services:
+ maximumInMemorySizeInMegabytes: 16
+ maximumConnectionsTotal: 100
+ pendingAcquireMaxCount: 50
+ connectionTimeoutInSeconds: 30
+ readTimeoutInSeconds: 30
+ writeTimeoutInSeconds: 30
+ responseTimeoutInSeconds: 60
+ auth:
+ username: ${DMI_USERNAME:cpsuser}
+ password: ${DMI_PASSWORD:cpsr0cks!}
+ enabled: ${DMI_AUTH_ENABLED:true}
+ api:
+ base-path: dmi
+
+ timers:
+ advised-modules-sync:
+ initial-delay-ms: 40000
+ sleep-time-ms: 5000
+ cm-handle-data-sync:
+ initial-delay-ms: 40000
+ sleep-time-ms: 30000
+ subscription-forwarding:
+ dmi-response-timeout-ms: 30000
+ model-loader:
+ retry-time-ms: 1000
+ trust-level:
+ dmi-availability-watchdog-ms: 30000
+
+ model-loader:
+ maximum-attempt-count: 20
+
+# Custom Hazelcast Config.
+hazelcast:
+ cluster-name: ${CPS_NCMP_CACHES_CLUSTER_NAME:"cps-and-ncmp-common-cache-cluster"}
+ instance-config-name: ${CPS_NCMP_INSTANCE_CONFIG_NAME:"cps-and-ncmp-hazelcast-instance-config"}
+ mode:
+ kubernetes:
+ enabled: ${HAZELCAST_MODE_KUBERNETES_ENABLED:false}
+ service-name: ${CPS_NCMP_SERVICE_NAME:"cps-and-ncmp-service"}
+
+otel:
+ exporter:
+ otlp:
+ traces:
+ protocol: ${ONAP_OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:grpc}
version: "3.6.2"
servers:
- url: /ncmpInventory
-components:
- securitySchemes:
- basicAuth:
- type: http
- scheme: basic
paths:
/v1/ch:
$ref: 'ncmp-inventory.yml#/updateDmiRegistration'
/v1/ch/searches:
$ref: 'ncmp-inventory.yml#/searchCmHandleIds'
-
-security:
- - basicAuth: []
version: "3.6.2"
servers:
- url: /ncmp
-components:
- securitySchemes:
- basicAuth:
- type: http
- scheme: basic
paths:
/v1/ch/{cm-handle}/data/ds/{datastore-name}:
$ref: 'ncmp.yml#/resourceDataForCmHandle'
/v1/ch/{cm-handle}/data-sync:
$ref: 'ncmp.yml#/setDataSyncEnabledFlag'
-security:
- - basicAuth: []
PASSTHROUGH_OPERATIONAL.getDatastoreName(), yangModelCmHandle, "/", null,
null);
return dmiRestClient.synchronousPostOperationWithJsonData(DATA, urlTemplateParameters, jsonRequestBody, READ,
- null);
+ DmiRestClient.NO_AUTHORIZATION);
}
/**
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2021-2025 Nordix Foundation
+ * Copyright (C) 2021-2025 OpenInfra Foundation Europe. All rights reserved.
* Modifications Copyright (C) 2022 Bell Canada
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@Slf4j
public class DmiRestClient {
+ public static final String NO_AUTHORIZATION = null;
+
private static final String NOT_SPECIFIED = "";
- private static final String NO_AUTHORIZATION = null;
private final DmiProperties dmiProperties;
private final JsonObjectMapper jsonObjectMapper;
servers:
- url: /cps/api
-components:
- securitySchemes:
- basicAuth:
- type: http
- scheme: basic
tags:
- name: cps-admin
description: cps Admin
/v2/notification-subscription:
$ref: 'cpsAdminV2.yml#/notificationSubscription'
-
-security:
- - basicAuth: []
<!--
============LICENSE_START=======================================================
- Copyright (C) 2021-2022 Nordix Foundation
+ Copyright (C) 2021-2025 OpenInfra Foundation Europe. All rights reserved.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
<include resource="org/springframework/boot/logging/logback/console-appender.xml" />
<springProperty scope="context" name="springAppName" source="spring.application.name"/>
- <springProperty scope="context" name="username" source="security.auth.username"/>
<springProperty scope="context" name="loggingFormat" source="logging.format"/>
<property name="currentTimeStamp" value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX,UTC}"/>
#!/bin/bash
#
-# Copyright 2024 Nordix Foundation.
+# Copyright 2024-2025 OpenInfra Foundation Europe. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# Download docker-compose.
if [ ! -x bin/docker-compose ]; then
echo " Downloading docker-compose"
- curl -s -L https://github.com/docker/compose/releases/download/v2.29.2/docker-compose-linux-x86_64 > bin/docker-compose
+ curl -s -L https://github.com/docker/compose/releases/download/v2.35.1/docker-compose-linux-x86_64 > bin/docker-compose
chmod +x bin/docker-compose
else
echo " docker-compose already installed"
+#
+# Copyright 2025 OpenInfra Foundation Europe. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
set -exu
ROBOT3_VENV=$(mktemp -d --suffix=robot_venv)
python3 -m venv "${ROBOT3_VENV}"
source "${ROBOT3_VENV}/bin/activate"
-
# Make sure pip3 itself us up-to-date.
python3 -m pip install --upgrade pip
# Modifications copyright (c) 2020-2021 Samsung Electronics Co., Ltd.
# Modifications Copyright (C) 2021 Pantheon.tech
# Modifications Copyright (C) 2021 Bell Canada.
-# Modifications Copyright (C) 2021-2025 OpenInfra Foundation Europe.
+# Modifications Copyright (C) 2021-2025 OpenInfra Foundation Europe. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
CPS_CORE_HOST=$LOCAL_IP
CPS_CORE_PORT=8883
-CPS_CORE_USERNAME=cpsuser
-CPS_CORE_PASSWORD=cpsr0cks!
DMI_HOST=ncmp-dmi-plugin
DMI_PORT=8080
#
# Copyright 2019-2021 © Samsung Electronics Co., Ltd.
# Modifications Copyright (C) 2021 Pantheon.tech
+# Modifications Copyright 2025 OpenInfra Foundation Europe. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
source ${WORKSPACE}/env.properties
fi
if [ -f ${ROBOT3_VENV}/bin/activate ]; then
+ echo "Activating existing Robot3 Env"
source ${ROBOT3_VENV}/bin/activate
else
+ echo "Installing Robot3 Env"
rm -rf /tmp/ci-management
rm -f ${WORKSPACE}/env.properties
cd /tmp
python3 -m pip install --upgrade --extra-index-url="https://nexus3.onap.org/repository/PyPi.staging/simple" 'robotframework-onap==11.0.0.dev17' --pre
-echo "Versioning information:"
+echo "[Prepare] Versioning information:"
python3 --version
echo "Installing confluent kafka library for robot framework:"
pip install robotframework-confluentkafkalibrary==2.4.0-2
pip freeze
-python3 -m robot.run --version || :
\ No newline at end of file
+python3 -m robot.run --version || :
echo "Starting Robot test suites ${SUITES} ..."
relax_set
-echo "Versioning information:"
+echo "[Run] Versioning information:"
python3 --version
pip freeze
python3 -m robot.run --version || :
#
# Copyright 2020-2021 © Samsung Electronics Co., Ltd.
# Modifications Copyright (C) 2021 Pantheon.tech
-# Modifications Copyright (C) 2024 Nordix Foundation.
+# Modifications Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2022-2024 Nordix Foundation
+ * Copyright (C) 2022-2025 OpenInfra Foundation Europe. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*** Variables ***
-${auth} Basic Y3BzdXNlcjpjcHNyMGNrcyE=
${ncmpBasePath} /ncmp/v1
${jsonModuleAndPropertyQueryParameters} {"cmHandleQueryParameters": [{"conditionName": "hasAllModules", "conditionParameters": [ {"moduleName": "iana-crypt-hash"} ]}, {"conditionName": "hasAllProperties", "conditionParameters": [ {"Contact": "newemailforstore@bookstore.com"} ]}]}
${jsonEmptyQueryParameters} {}
*** Test Cases ***
Retrieve CM Handle ids where query parameters Match (module and property query)
${uri}= Set Variable ${ncmpBasePath}/ch/id-searches
- ${headers}= Create Dictionary Content-Type=application/json Authorization=${auth}
+ ${headers}= Create Dictionary Content-Type=application/json
${response}= POST On Session CPS_URL ${uri} headers=${headers} data=${jsonModuleAndPropertyQueryParameters}
Should Be Equal As Strings ${response.status_code} 200
Should Contain ${response.json()} ietfYang-PNFDemo
Retrieve CM Handle ids where query parameters Match (empty query)
${uri}= Set Variable ${ncmpBasePath}/ch/id-searches
- ${headers}= Create Dictionary Content-Type=application/json Authorization=${auth}
+ ${headers}= Create Dictionary Content-Type=application/json
${response}= POST On Session CPS_URL ${uri} headers=${headers} data=${jsonEmptyQueryParameters}
Should Be Equal As Strings ${response.status_code} 200
Should Contain ${response.json()} ietfYang-PNFDemo
Throw 400 when Structure of Request is Incorrect
${uri}= Set Variable ${ncmpBasePath}/ch/id-searches
- ${headers}= Create Dictionary Content-Type=application/json Authorization=${auth}
+ ${headers}= Create Dictionary Content-Type=application/json
${response}= POST On Session CPS_URL ${uri} headers=${headers} data=${jsonMissingPropertyQueryParameters} expected_status=400
Should Be Equal As Strings ${response} <Response [400]>
# ============LICENSE_START=======================================================
# Copyright (c) 2021 Pantheon.tech.
+# Modifications Copyright (C) 2025 OpenInfra Foundation Europe. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
*** Variables ***
-${auth} Basic Y3BzdXNlcjpjcHNyMGNrcyE=
${basePath} /cps/api
${dataspaceName} CSIT-Dataspace
${schemaSetName} CSIT-SchemaSet
Create Dataspace
${uri}= Set Variable ${basePath}/v1/dataspaces
${params}= Create Dictionary dataspace-name=${dataspaceName}
- ${headers}= Create Dictionary Authorization=${auth}
- ${response}= POST On Session CPS_URL ${uri} params=${params} headers=${headers}
+ ${response}= POST On Session CPS_URL ${uri} params=${params}
Should Be Equal As Strings ${response.status_code} 201
Create Schema Set from YANG file
${fileData}= Get Binary File ${DATADIR_CPS_CORE}${/}test-tree.yang
${fileTuple}= Create List test.yang ${fileData} application/zip
&{files}= Create Dictionary file=${fileTuple}
- ${headers}= Create Dictionary Authorization=${auth}
- ${response}= POST On Session CPS_URL ${uri} files=${files} params=${params} headers=${headers}
+ ${response}= POST On Session CPS_URL ${uri} files=${files} params=${params}
Should Be Equal As Strings ${response.status_code} 201
Create Schema Set from ZIP file
${fileData}= Get Binary File ${DATADIR_CPS_CORE}${/}yang-resources.zip
${fileTuple}= Create List test.zip ${fileData} application/zip
&{files}= Create Dictionary file=${fileTuple}
- ${headers}= Create Dictionary Authorization=${auth}
- ${response}= POST On Session CPS_URL ${uri} files=${files} params=${params} headers=${headers}
+ ${response}= POST On Session CPS_URL ${uri} files=${files} params=${params}
Should Be Equal As Strings ${response.status_code} 201
Get Schema Set info
${uri}= Set Variable ${basePath}/v1/dataspaces/${dataspaceName}/schema-sets/${schemaSetName}
- ${headers}= Create Dictionary Authorization=${auth}
- ${response}= Get On Session CPS_URL ${uri} headers=${headers} expected_status=200
+ ${response}= Get On Session CPS_URL ${uri} expected_status=200
${responseJson}= Set Variable ${response.json()}
Should Be Equal As Strings ${responseJson['name']} ${schemaSetName}
Should Be Equal As Strings ${responseJson['dataspaceName']} ${dataspaceName}
Create Anchor
${uri}= Set Variable ${basePath}/v1/dataspaces/${dataspaceName}/anchors
${params}= Create Dictionary schema-set-name=${schemaSetName} anchor-name=${anchorName}
- ${headers}= Create Dictionary Authorization=${auth}
- ${response}= POST On Session CPS_URL ${uri} params=${params} headers=${headers}
+ ${response}= POST On Session CPS_URL ${uri} params=${params}
Should Be Equal As Strings ${response.status_code} 201
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2023-2024 Nordix Foundation
+ * Copyright (C) 2023-2025 OpenInfra Foundation Europe. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*** Variables ***
-${auth} Basic Y3BzdXNlcjpjcHNyMGNrcyE=
${topic} data-operation-client-topic
${ncmpBasePath} /ncmp
${expectedRequestId} ${EMPTY}
${uri}= Set Variable ${ncmpBasePath}/v1/data
${dataOperationReqBody}= Get Binary File ${DATADIR_CPS_CORE}${/}dataOperationRequest.json
${params}= Create Dictionary topic=${topic}
- ${headers}= Create Dictionary Content-Type=application/json Authorization=${auth}
+ ${headers}= Create Dictionary Content-Type=application/json
POST On Session CPS_URL ncmpInventory/v1/ch headers=${headers} data=${newCmHandleRequestBody}
${getCmHandleUri}= Set Variable ${ncmpBasePath}/v1/ch/CMHandle1
- ${getCmHandleHeaders}= Create Dictionary Authorization=${auth}
- Wait Until Keyword Succeeds 20sec 200ms Is CM Handle READY ${getCmHandleUri} ${getCmHandleHeaders} CMHandle1
+ Wait Until Keyword Succeeds 20sec 200ms Is CM Handle READY ${getCmHandleUri} CMHandle1
${response}= POST On Session CPS_URL ${uri} params=${params} headers=${headers} data=${dataOperationReqBody}
Set Global Variable ${expectedRequestId} ${response.json()}[requestId]
Should Be Equal As Strings ${response.status_code} 200
END
Is CM Handle READY
- [Arguments] ${uri} ${headers} ${cmHandle}
- ${response}= GET On Session CPS_URL ${uri} headers=${headers}
+ [Arguments] ${uri} ${cmHandle}
+ ${response}= GET On Session CPS_URL ${uri}
Should Be Equal As Strings ${response.status_code} 200
${number_of_items}= Count Items In JSON Response ${response}
Should Be True ${number_of_items} > 0
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2022-2024 Nordix Foundation
+ * Copyright (C) 2022-2025 OpenInfra Foundation Europe. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*** Variables ***
-${auth} Basic Y3BzdXNlcjpjcHNyMGNrcyE=
${ncmpBasePath} /ncmp
*** Test Cases ***
Operational state goes to UNSYNCHRONIZED when data sync (flag) is enabled
${uri}= Set Variable ${ncmpBasePath}/v1/ch/ietfYang-PNFDemo/data-sync
${params}= Create Dictionary dataSyncEnabled=true
- ${headers}= Create Dictionary Authorization=${auth}
- ${response}= PUT On Session CPS_URL ${uri} params=${params} headers=${headers}
+ ${response}= PUT On Session CPS_URL ${uri} params=${params}
Should Be Equal As Strings ${response.status_code} 200
${verifyUri}= Set Variable ${ncmpBasePath}/v1/ch/ietfYang-PNFDemo/state
- ${verifyHeaders}= Create Dictionary Authorization=${auth}
- ${verifyResponse}= GET On Session CPS_URL ${verifyUri} headers=${verifyHeaders}
+ ${verifyResponse}= GET On Session CPS_URL ${verifyUri}
Should Be Equal As Strings ${verifyResponse.json()['state']['dataSyncState']['operational']['syncState']} UNSYNCHRONIZED
Operational state goes to SYNCHRONIZED after sometime when data sync (flag) is enabled
${uri}= Set Variable ${ncmpBasePath}/v1/ch/ietfYang-PNFDemo/state
- ${headers}= Create Dictionary Authorization=${auth}
- Wait Until Keyword Succeeds 40sec 100ms Is CM Handle State SYNCHRONIZED ${uri} ${headers}
+ Wait Until Keyword Succeeds 40sec 100ms Is CM Handle State SYNCHRONIZED ${uri}
*** Keywords ***
Is CM Handle State SYNCHRONIZED
- [Arguments] ${uri} ${headers}
- ${response}= GET On Session CPS_URL ${uri} headers=${headers}
+ [Arguments] ${uri}
+ ${response}= GET On Session CPS_URL ${uri}
Should Be Equal As Strings ${response.json()['state']['dataSyncState']['operational']['syncState']} SYNCHRONIZED
# ============LICENSE_START=======================================================
# Copyright (c) 2021 Pantheon.tech.
# Modifications Copyright (C) 2022 Bell Canada.
-# Modifications Copyright (C) 2022-2023 Nordix Foundation.
+# Modifications Copyright (C) 2022-2025 OpenInfra Foundation Europe. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
*** Variables ***
-${auth} Basic Y3BzdXNlcjpjcHNyMGNrcyE=
${basePath} /cps/api
${dataspaceName} CSIT-Dataspace
${anchorName} CSIT-Anchor
*** Test Cases ***
Create Data Node
${uri}= Set Variable ${basePath}/v1/dataspaces/${dataspaceName}/anchors/${anchorName}/nodes
- ${headers} Create Dictionary Content-Type=application/json Authorization=${auth}
+ ${headers} Create Dictionary Content-Type=application/json
${jsonData}= Get Binary File ${DATADIR_CPS_CORE}${/}test-tree.json
${response}= POST On Session CPS_URL ${uri} headers=${headers} data=${jsonData}
Should Be Equal As Strings ${response.status_code} 201
Patch Data Node
${uri}= Set Variable ${basePath}/v1/dataspaces/${dataspaceName}/anchors/${anchorName}/nodes
${params}= Create Dictionary xpath=/test-tree/branch[@name='Right']
- ${headers} Create Dictionary Content-Type=application/json Authorization=${auth}
+ ${headers} Create Dictionary Content-Type=application/json
${jsonData}= Get Binary File ${DATADIR_CPS_CORE}${/}testTreePatchExample.json
${response}= PATCH On Session CPS_URL ${uri} params=${params} headers=${headers} data=${jsonData}
Should Be Equal As Strings ${response.status_code} 200
Get Updated Data Node by XPath
${uri}= Set Variable ${basePath}/v1/dataspaces/${dataspaceName}/anchors/${anchorName}/node
${params}= Create Dictionary xpath=/test-tree/branch[@name='Right']/nest
- ${headers}= Create Dictionary Authorization=${auth}
- ${response}= Get On Session CPS_URL ${uri} params=${params} headers=${headers} expected_status=200
+ ${response}= Get On Session CPS_URL ${uri} params=${params} expected_status=200
${responseJson}= Set Variable ${response.json()['tree:nest']}
Should Be Equal As Strings ${responseJson['name']} Bigger
${length_birds}= Get Length ${responseJson['birds']}
Get Data Node by XPath
${uri}= Set Variable ${basePath}/v1/dataspaces/${dataspaceName}/anchors/${anchorName}/node
${params}= Create Dictionary xpath=/test-tree/branch[@name='LEFT/left']/nest
- ${headers}= Create Dictionary Authorization=${auth}
- ${response}= Get On Session CPS_URL ${uri} params=${params} headers=${headers} expected_status=200
+ ${response}= Get On Session CPS_URL ${uri} params=${params} expected_status=200
Should Be Equal As Strings ${response.json()['tree:nest']['name']} SMALL/small
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2021-2024 Nordix Foundation
+ * Copyright (C) 2021-2025 OpenInfra Foundation Europe. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*** Variables ***
-${auth} Basic Y3BzdXNlcjpjcHNyMGNrcyE=
${ncmpInventoryBasePath} /ncmpInventory
${ncmpBasePath} /ncmp
${dmiUrl} http://${DMI_HOST}:${DMI_PORT}
*** Test Cases ***
Register data node and sync modules.
${uri}= Set Variable ${ncmpInventoryBasePath}/v1/ch
- ${headers}= Create Dictionary Content-Type=application/json Authorization=${auth}
+ ${headers}= Create Dictionary Content-Type=application/json
${response}= POST On Session CPS_URL ${uri} headers=${headers} data=${createPayload}
Should Be Equal As Strings ${response.status_code} 200
Get CM Handle details and confirm it has been registered.
${uri}= Set Variable ${ncmpBasePath}/v1/ch/ietfYang-PNFDemo
- ${headers}= Create Dictionary Authorization=${auth}
- ${response}= GET On Session CPS_URL ${uri} headers=${headers}
+ ${response}= GET On Session CPS_URL ${uri}
${responseJson}= Set Variable ${response.json()}
${schemaCount}= Get length ${responseJson}
Should Be Equal As Strings ${response.status_code} 200
Update data node and sync modules.
${uri}= Set Variable ${ncmpInventoryBasePath}/v1/ch
- ${headers}= Create Dictionary Content-Type=application/json Authorization=${auth}
+ ${headers}= Create Dictionary Content-Type=application/json
${response}= POST On Session CPS_URL ${uri} headers=${headers} data=${updatePayload}
Should Be Equal As Strings ${response.status_code} 200
Get CM Handle details and confirm it has been updated.
${uri}= Set Variable ${ncmpBasePath}/v1/ch/ietfYang-PNFDemo
- ${headers}= Create Dictionary Authorization=${auth}
- ${response}= GET On Session CPS_URL ${uri} headers=${headers}
+ ${response}= GET On Session CPS_URL ${uri}
${responseJson}= Set Variable ${response.json()}
${schemaCount}= Get length ${responseJson}
Should Be Equal As Strings ${response.status_code} 200
Check if ietfYang-PNFDemo is READY
${uri}= Set Variable ${ncmpBasePath}/v1/ch/ietfYang-PNFDemo
- ${headers}= Create Dictionary Authorization=${auth}
- Wait Until Keyword Succeeds 20sec 200ms Is CM Handle READY ${uri} ${headers} ietfYang-PNFDemo
+ Wait Until Keyword Succeeds 20sec 200ms Is CM Handle READY ${uri} ietfYang-PNFDemo
Get modules for registered data node
${uri}= Set Variable ${ncmpBasePath}/v1/ch/ietfYang-PNFDemo/modules
- ${headers}= Create Dictionary Authorization=${auth}
- ${response}= GET On Session CPS_URL ${uri} headers=${headers}
+ ${response}= GET On Session CPS_URL ${uri}
Should Be Equal As Strings ${response.status_code} 200
${number_of_items}= Count Items In JSON Response ${response}
Should Be True ${number_of_items} > 0
Delete cm handle
${uri}= Set Variable ${ncmpInventoryBasePath}/v1/ch
- ${headers}= Create Dictionary Content-Type=application/json Authorization=${auth}
+ ${headers}= Create Dictionary Content-Type=application/json
${response}= POST On Session CPS_URL ${uri} headers=${headers} data=${deletePayload}
Should Be Equal As Strings ${response.status_code} 200
Get cm handle details and confirm it has been deleted
${uri}= Set Variable ${ncmpBasePath}/v1/ch/CmHandleForDelete
- ${headers}= Create Dictionary Authorization=${auth}
- ${response}= GET On Session CPS_URL ${uri} headers=${headers} expected_status=404
+ ${response}= GET On Session CPS_URL ${uri} expected_status=404
*** Keywords ***
Is CM Handle READY
- [Arguments] ${uri} ${headers} ${cmHandle}
- ${response}= GET On Session CPS_URL ${uri} headers=${headers}
+ [Arguments] ${uri} ${cmHandle}
+ ${response}= GET On Session CPS_URL ${uri}
Should Be Equal As Strings ${response.status_code} 200
${number_of_items}= Count Items In JSON Response ${response}
Should Be True ${number_of_items} > 0
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2023-2025 Nordix Foundation
+ * Copyright (C) 2023-2025 OpenInfra Foundation Europe. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Suite Setup Create Session CPS_URL http://${CPS_CORE_HOST}:${CPS_CORE_PORT}
*** Variables ***
-${auth} Basic Y3BzdXNlcjpjcHNyMGNrcyE=
${ncmpInventoryBasePath} /ncmpInventory
${ncmpBasePath} /ncmp/v1
${dmiUrl} http://${DMI_HOST}:${DMI_PORT}
*** Test Cases ***
Register data node
${uri}= Set Variable ${ncmpInventoryBasePath}/v1/ch
- ${headers}= Create Dictionary Content-Type=application/json Authorization=${auth}
+ ${headers}= Create Dictionary Content-Type=application/json
${response}= POST On Session CPS_URL ${uri} headers=${headers} data=${jsonCreateCmHandles}
Should Be Equal As Strings ${response.status_code} 200
Retrieve CM Handle ids where query parameters Match (trust level query)
${uri}= Set Variable ${ncmpBasePath}/ch/id-searches
- ${headers}= Create Dictionary Content-Type=application/json Authorization=${auth}
+ ${headers}= Create Dictionary Content-Type=application/json
${response}= POST On Session CPS_URL ${uri} headers=${headers} data=${jsonTrustLevelPropertyQueryParameters}
${responseJson}= Set Variable ${response.json()}
Should Be Equal As Strings ${response.status_code} 200
Basic Teardown
[Arguments] ${group_id}
Unsubscribe ${group_id}
- Close Consumer ${group_id}
\ No newline at end of file
+ Close Consumer ${group_id}
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2021-2024 Nordix Foundation
+ * Copyright (C) 2021-2025 OpenInfra Foundation Europe. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*** Variables ***
-${auth} Basic Y3BzdXNlcjpjcHNyMGNrcyE=
${ncmpBasePath} /ncmp
${netconf} NETCONF
Get for Passthrough Operational (CF, RO) with fields & topic
${uri}= Set Variable ${ncmpBasePath}/v1/ch/ietfYang-PNFDemo/data/ds/ncmp-datastore:passthrough-operational?resourceIdentifier=ietf-netconf-monitoring:netconf-state&options=(fields=schemas/schema)&topic=test-topic
- ${headers}= Create Dictionary Authorization=${auth}
- ${response}= Get On Session CPS_URL ${uri} headers=${headers} expected_status=200
+ ${response}= Get On Session CPS_URL ${uri} expected_status=200
Should Be Equal As Strings ${response.status_code} 200
Get for Passthrough Operational (CF, RO) with fields
${uri}= Set Variable ${ncmpBasePath}/v1/ch/ietfYang-PNFDemo/data/ds/ncmp-datastore:passthrough-operational?resourceIdentifier=ietf-netconf-monitoring:netconf-state&options=(fields=schemas/schema)
- ${headers}= Create Dictionary Authorization=${auth}
- ${response}= Get On Session CPS_URL ${uri} headers=${headers} expected_status=200
+ ${response}= Get On Session CPS_URL ${uri} expected_status=200
${responseJson}= Set Variable ${response.json()}
${schemaCount}= Get length ${responseJson['ietf-netconf-monitoring:netconf-state']['schemas']}
Should Be True ${schemaCount} >0
Create to bookstore using passthrough-running
${uri}= Set Variable ${ncmpBasePath}/v1/ch/ietfYang-PNFDemo/data/ds/ncmp-datastore:passthrough-running?resourceIdentifier=stores:bookstore
- ${headers}= Create Dictionary Content-Type=application/json Authorization=${auth}
+ ${headers}= Create Dictionary Content-Type=application/json
${jsonData}= Get Binary File ${DATADIR_NCMP}${/}bookstoreCreateExample.json
${response}= POST On Session CPS_URL ${uri} headers=${headers} data=${jsonData}
Should Be Equal As Strings ${response.status_code} 201
Verify create to bookstore using passthrough-running
${uri}= Set Variable ${ncmpBasePath}/v1/ch/ietfYang-PNFDemo/data/ds/ncmp-datastore:passthrough-running?resourceIdentifier=stores:bookstore
- ${headers}= Create Dictionary Authorization=${auth}
- ${response}= Get On Session CPS_URL ${uri} headers=${headers}
+ ${response}= Get On Session CPS_URL ${uri}
Should Be Equal As Strings ${response.status_code} 200
FOR ${item} IN @{response.json()['stores:bookstore']['categories']}
IF "${item['code']}" == "01"
Update Bookstore using passthrough-running update Category 01 (replace category)
${uri}= Set Variable ${ncmpBasePath}/v1/ch/ietfYang-PNFDemo/data/ds/ncmp-datastore:passthrough-running?resourceIdentifier=stores:bookstore/categories=01
- ${headers}= Create Dictionary Content-Type=application/json Authorization=${auth}
+ ${headers}= Create Dictionary Content-Type=application/json
${jsonData}= Get Binary File ${DATADIR_NCMP}${/}bookstoreUpdateExample.json
${response}= PUT On Session CPS_URL ${uri} headers=${headers} data=${jsonData}
Should Be Equal As Strings ${response.status_code} 200
Verify update to bookstore using passthrough-running updated category 01
${uri}= Set Variable ${ncmpBasePath}/v1/ch/ietfYang-PNFDemo/data/ds/ncmp-datastore:passthrough-running?resourceIdentifier=stores:bookstore/categories=01
- ${headers}= Create Dictionary Authorization=${auth}
- ${response}= Get On Session CPS_URL ${uri} headers=${headers}
+ ${response}= Get On Session CPS_URL ${uri}
Should Be Equal As Strings ${response.status_code} 200
FOR ${item} IN @{response.json()['stores:categories']}
IF "${item['code']}" == "01"
Verify update to bookstore using passthrough-running did not remove category 02
${uri}= Set Variable ${ncmpBasePath}/v1/ch/ietfYang-PNFDemo/data/ds/ncmp-datastore:passthrough-running?resourceIdentifier=stores:bookstore
- ${headers}= Create Dictionary Authorization=${auth}
- ${response}= Get On Session CPS_URL ${uri} headers=${headers}
+ ${response}= Get On Session CPS_URL ${uri}
Should Be Equal As Strings ${response.status_code} 200
${schemaCount}= Get length ${response.json()['stores:bookstore']['categories']}
Should Be Equal As Numbers ${schemaCount} 2
Delete Bookstore using passthrough-running for Category 01
${uri}= Set Variable ${ncmpBasePath}/v1/ch/ietfYang-PNFDemo/data/ds/ncmp-datastore:passthrough-running?resourceIdentifier=stores:bookstore/categories=01
- ${headers}= Create Dictionary Content-Type=application/json Authorization=${auth}
- ${response}= DELETE On Session CPS_URL ${uri} headers=${headers}
+ ${response}= DELETE On Session CPS_URL ${uri}
Should Be Equal As Strings ${response.status_code} 204
Verify delete to bookstore using passthrough-running removed only category 01
${uri}= Set Variable ${ncmpBasePath}/v1/ch/ietfYang-PNFDemo/data/ds/ncmp-datastore:passthrough-running?resourceIdentifier=stores:bookstore
- ${headers}= Create Dictionary Authorization=${auth}
- ${response}= Get On Session CPS_URL ${uri} headers=${headers}
+ ${response}= Get On Session CPS_URL ${uri}
${responseJson}= Set Variable ${response.json()['stores:bookstore']['categories']}
Should Be Equal As Strings ${response.status_code} 200
${schemaCount}= Get length ${responseJson}
Patch will add new category with new book and add a new book to an existing category
${uri}= Set Variable ${ncmpBasePath}/v1/ch/ietfYang-PNFDemo/data/ds/ncmp-datastore:passthrough-running?resourceIdentifier=stores:bookstore
- ${headers}= Create Dictionary Content-Type=application/yang.patch+json Authorization=${auth}
+ ${headers}= Create Dictionary Content-Type=application/yang.patch+json
${jsonData}= Get Binary File ${DATADIR_NCMP}${/}bookstorePatchExample.json
${response}= PATCH On Session CPS_URL ${uri} headers=${headers} data=${jsonData}
Should Be Equal As Strings ${response.status_code} 200
${verifyUri}= Set Variable ${ncmpBasePath}/v1/ch/ietfYang-PNFDemo/data/ds/ncmp-datastore:passthrough-running?resourceIdentifier=stores:bookstore/categories=100
- ${verifyHeaders}= Create Dictionary Authorization=${auth}
- ${verifyResponse}= Get On Session CPS_URL ${verifyUri} headers=${verifyHeaders}
+ ${verifyResponse}= Get On Session CPS_URL ${verifyUri}
Should Be Equal As Strings ${verifyResponse.status_code} 200
FOR ${item} IN @{verifyResponse.json()['stores:categories']}
IF "${item['code']}" == "100"
END
END
${verifyUri}= Set Variable ${ncmpBasePath}/v1/ch/ietfYang-PNFDemo/data/ds/ncmp-datastore:passthrough-running?resourceIdentifier=stores:bookstore/categories=02/books=A%20New%20book%20in%20existing%20category
- ${verifyResponse}= Get On Session CPS_URL ${verifyUri} headers=${verifyHeaders}
+ ${verifyResponse}= Get On Session CPS_URL ${verifyUri}
Should Be Equal As Strings ${verifyResponse.status_code} 200
<!--
============LICENSE_START=======================================================
Copyright (C) 2020 Pantheon.tech
- Modifications Copyright (C) 2020-2024 Nordix Foundation.
+ Modifications Copyright (C) 2020-2025 OpenInfra Foundation Europe. All rights reserved.
Modifications Copyright (C) 2021 Bell Canada.
Modifications Copyright (C) 2022 TechMahindra Ltd.
================================================================================
Following command starts the application using JAR file:
```bash
-DB_HOST=localhost DB_USERNAME=cps DB_PASSWORD=cps CPS_USERNAME=cpsuser CPS_PASSWORD=cpsr0cks! \
+DB_HOST=localhost DB_USERNAME=cps DB_PASSWORD=cps \
DMI_USERNAME=cpsuser DMI_PASSWORD=cpsr0cks! \
java -jar cps-application/target/cps-application-x.y.z-SNAPSHOT.jar
```
1. Enable the desired maven profile form Maven Tool Window
2. Run a configuration from `Run -> Edit configurations` with following settings:
* `Environment variables`: `DB_HOST=localhost;DB_USERNAME=cps;DB_PASSWORD=cps
- CPS_USERNAME=cpsuser CPS_PASSWORD=cpsr0cks!
DMI_USERNAME=cpsuser DMI_PASSWORD=cpsr0cks!`
## Accessing services
### DEBUG: Uncomment next line to enable java debugging (ensure 'ports' aligns with 'deploy')
### - ${CPS_CORE_DEBUG_PORT:-5005}:5005-
environment:
- CPS_USERNAME: ${CPS_CORE_USERNAME:-cpsuser}
- CPS_PASSWORD: ${CPS_CORE_PASSWORD:-cpsr0cks!}
DB_HOST: ${DB_HOST:-dbpostgresql}
DB_USERNAME: ${DB_USERNAME:-cps}
DB_PASSWORD: ${DB_PASSWORD:-cps}
# ============LICENSE_START=======================================================
-# Copyright (C) 2023-2024 Nordix Foundation.
+# Copyright (C) 2023-2025 OpenInfra Foundation Europe. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
- name: cps-ncmp-inventory
url: /api-docs/cps-ncmp/openapi-inventory.yaml
-security:
- # comma-separated uri patterns which do not require authorization
- permit-uri: /actuator/**,/swagger-ui.html,/swagger-ui/**,/swagger-resources/**,/api-docs/**,/v3/api-docs/**
- auth:
- username: cps
- password: cpsr0cks!
-
# Actuator
management:
endpoints:
#!/bin/bash
#
-# Copyright 2024 Nordix Foundation.
+# Copyright 2024-2025 OpenInfra Foundation Europe. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# Download docker-compose.
if [ ! -x bin/docker-compose ]; then
echo " Downloading docker-compose"
- curl -s -L https://github.com/docker/compose/releases/download/v2.29.2/docker-compose-linux-x86_64 > bin/docker-compose
+ curl -s -L https://github.com/docker/compose/releases/download/v2.35.1/docker-compose-linux-x86_64 > bin/docker-compose
chmod +x bin/docker-compose
else
echo " docker-compose already installed"
#!/bin/bash
#
-# Copyright 2024 Nordix Foundation.
+# Copyright 2024-2025 OpenInfra Foundation Europe. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
############################
CPS_HOST=localhost
CPS_PORT=8883
-CPS_USERNAME=cpsuser
-CPS_PASSWORD=cpsr0cks!
PARALLEL_REQUESTS=12
WARMUP_REQUESTS=600
MEASUREMENT_REQUESTS=240
function cmHandleExists() {
local cmHandleId=$1
- curl --silent --fail --output /dev/null --user "$CPS_USERNAME:$CPS_PASSWORD" --basic "http://$CPS_HOST:$CPS_PORT/ncmp/v1/ch/$cmHandleId"
+ curl --silent --fail --output /dev/null "http://$CPS_HOST:$CPS_PORT/ncmp/v1/ch/$cmHandleId"
}
function failIfCmHandlesNotFound() {
curl --show-error --fail --fail-early \
--output /dev/null --write-out '%{time_total}\n' \
--parallel --parallel-max $PARALLEL_REQUESTS --parallel-immediate \
- --user "$CPS_USERNAME:$CPS_PASSWORD" --basic \
--request POST "http://$CPS_HOST:$CPS_PORT/ncmp/v1/ch/ch-[1-$totalRequests]/data/ds/ncmp-datastore%3Apassthrough-operational?resourceIdentifier=x&include-descendants=true" |
awk '{ sum += $1; n++ } END { if (n > 0) print (sum / n) * 1000; }'
}