Merge "Functional Test Updates for I Release"
authorJohn Keeney <john.keeney@est.tech>
Mon, 18 Dec 2023 16:56:31 +0000 (16:56 +0000)
committerGerrit Code Review <gerrit@o-ran-sc.org>
Mon, 18 Dec 2023 16:56:31 +0000 (16:56 +0000)
28 files changed:
docs/conf.py
docs/developer-guide.rst
docs/images/nonrtric-architecture-I.png [new file with mode: 0644]
docs/index.rst
docs/installation-guide.rst
docs/overview.rst
docs/release-notes.rst
test/cr/cr-build-start.sh
test/mrstub/mrstub-build-start.sh
test/prodstub/prod-stub-build-start.sh
test/servicestub/.gitignore [new file with mode: 0644]
test/servicestub/Dockerfile [new file with mode: 0644]
test/servicestub/README.md [new file with mode: 0644]
test/servicestub/build.sh [new file with mode: 0644]
test/servicestub/container-tag.yaml [new file with mode: 0644]
test/servicestub/docker-compose.yml [new file with mode: 0644]
test/servicestub/hello-world-chart/.helmignore [new file with mode: 0644]
test/servicestub/hello-world-chart/Chart.yaml [new file with mode: 0644]
test/servicestub/hello-world-chart/templates/_helpers.tpl [new file with mode: 0644]
test/servicestub/hello-world-chart/templates/deployment.yaml [new file with mode: 0644]
test/servicestub/hello-world-chart/templates/service.yaml [new file with mode: 0644]
test/servicestub/hello-world-chart/templates/tests/test-connection.yaml [new file with mode: 0644]
test/servicestub/hello-world-chart/values.yaml [new file with mode: 0644]
test/servicestub/pom.xml [new file with mode: 0644]
test/servicestub/service-stub-build-start.sh [new file with mode: 0644]
test/servicestub/src/main/java/org/oran/helloworld/HelloWorldApplication.java [new file with mode: 0644]
test/servicestub/src/main/java/org/oran/helloworld/rest/HelloWorldController.java [new file with mode: 0644]
test/servicestub/src/test/java/org/oran/helloworld/rest/HelloWorldControllerTest.java [new file with mode: 0644]

index 036bca6..642acf2 100644 (file)
@@ -1,5 +1,6 @@
 #  ============LICENSE_START===============================================
-#  Copyright (C) 2019-2022 Nordix Foundation. All rights reserved.
+#  Copyright (C) 2019-2023 Nordix Foundation. All rights reserved.
+#  Copyright (C) 2023 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.
 
 from docs_conf.conf import *
 
-#branch configuration
-
+## Update here to configure which branch is used. 
+#branch configurations
 controlpanelbranch = 'latest'
 simulatorbranch = 'latest'
 dmaapmediatorproducerbranch = 'latest'
 dmaapadapterbranch = 'latest'
 informationcoordinatorservicebranch = 'latest'
 rappcataloguebranch = 'latest'
+rappmanagerbranch = 'latest'
 helmmanagerbranch = 'latest'
 ransliceassurancebranch = 'latest'
 orufhrecoverybranch = 'latest'
@@ -32,6 +34,15 @@ a1policymanagementservicebranch = 'latest'
 smebranch = 'latest'
 ranpmbranch = 'latest'
 onapbranch = 'latest'
+# Add some useful links available in every page
+rst_epilog = """
+.. _nonrtricwiki: https://wiki.o-ran-sc.org/display/RICNR/
+.. _nonrtricwikidevguide: https://wiki.o-ran-sc.org/display/RICNR/Release+I
+.. _nonrtricwikik8s: https://wiki.o-ran-sc.org/display/RICNR/Release+I+-+Run+in+Kubernetes
+.. _nonrtricwikidocker: https://wiki.o-ran-sc.org/display/RICNR/Release+I+-+Run+in+Docker
+"""
+## 
+
 
 linkcheck_ignore = [
     'http://localhost.*',
@@ -53,6 +64,7 @@ intersphinx_mapping['dmaapmediatorproducer'] = ('https://docs.o-ran-sc.org/proje
 intersphinx_mapping['dmaapadapter'] = ('https://docs.o-ran-sc.org/projects/o-ran-sc-nonrtric-plt-dmaapadapter/en/%s' % dmaapadapterbranch, None)
 intersphinx_mapping['informationcoordinatorservice'] = ('https://docs.o-ran-sc.org/projects/o-ran-sc-nonrtric-plt-informationcoordinatorservice/en/%s' % informationcoordinatorservicebranch, None)
 intersphinx_mapping['rappcatalogue'] = ('https://docs.o-ran-sc.org/projects/o-ran-sc-nonrtric-plt-rappcatalogue/en/%s' % rappcataloguebranch, None)
+intersphinx_mapping['rappmanager'] = ('https://docs.o-ran-sc.org/projects/o-ran-sc-nonrtric-plt-rappmanager/en/%s' % rappmanagerbranch, None)
 intersphinx_mapping['helmmanager'] = ('https://docs.o-ran-sc.org/projects/o-ran-sc-nonrtric-plt-helmmanager/en/%s' % helmmanagerbranch, None)
 intersphinx_mapping['ransliceassurance'] = ('https://docs.o-ran-sc.org/projects/o-ran-sc-nonrtric-rapp-ransliceassurance/en/%s' % ransliceassurancebranch, None)
 intersphinx_mapping['orufhrecovery'] = ('https://docs.o-ran-sc.org/projects/o-ran-sc-nonrtric-rapp-orufhrecovery/en/%s' % orufhrecoverybranch, None)
index 9ef6ef2..9e83177 100644 (file)
@@ -1,13 +1,14 @@
 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
 .. SPDX-License-Identifier: CC-BY-4.0
-.. Copyright (C) 2021 Nordix
+.. Copyright (C) 2021-2023 Nordix Foundation. All rights Reserved
+.. Copyright (C) 2023 OpenInfra Foundation Europe. All Rights Reserved
 
 Developer Guide
 ===============
 
 This document provides a quickstart for developers of the Non-RT RIC parts.
 
-Additional developer guides are available on the `O-RAN SC NONRTRIC Developer wiki <https://wiki.o-ran-sc.org/display/RICNR/Release+F>`_.
+Additional developer guides are available on the `O-RAN SC NONRTRIC Developer wiki <nonrtricwiki_>`_.
 
 Kubernetes deployment
 ---------------------
@@ -16,7 +17,7 @@ Non-RT RIC can be also deployed in a Kubernetes cluster, `it/dep repository <htt
 hosts deployment and integration artifacts. Instructions and helm charts to deploy the Non-RT-RIC functions in the
 OSC NONRTRIC integrated test environment can be found in the *./nonrtric* directory.
 
-For more information on installation of NonRT-RIC in Kubernetes, see `Deploy NONRTRIC in Kubernetes <https://wiki.o-ran-sc.org/display/RICNR/Deploy+NONRTRIC+in+Kubernetes>`_.
+For more information on installation of NonRT-RIC in Kubernetes, see `Deploy NONRTRIC in Kubernetes <nonrtricwikik8s_>`_.
 
 For more information see `Integration and Testing documentation in the O-RAN-SC <https://docs.o-ran-sc.org/projects/o-ran-sc-it-dep/en/latest/index.html>`_.
 
diff --git a/docs/images/nonrtric-architecture-I.png b/docs/images/nonrtric-architecture-I.png
new file mode 100644 (file)
index 0000000..940eca0
Binary files /dev/null and b/docs/images/nonrtric-architecture-I.png differ
index ca97770..cc8b0a0 100644 (file)
@@ -1,6 +1,7 @@
 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
 .. SPDX-License-Identifier: CC-BY-4.0
-.. Copyright (C) 2021 Nordix
+.. Copyright (C) 2021-2023 Nordix Foundation. All rights Reserved
+.. Copyright (C) 2023 OpenInfra Foundation Europe. All Rights Reserved
 
 Non-RT RIC
 ==========
index 1837152..4a4f013 100644 (file)
@@ -1,6 +1,7 @@
 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
 .. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2021 Nordix
+.. Copyright (C) 2021-2023 Nordix Foundation. All rights Reserved
+.. Copyright (C) 2023 OpenInfra Foundation Europe. All Rights Reserved
 
 Installation Guide
 ==================
@@ -8,15 +9,36 @@ Installation Guide
 Abstract
 --------
 
-This document describes how to install the Non-RT RIC components, their dependencies and required system resources.
+This document describes how to install some of the Non-RT RIC components, their dependencies and required system resources.
 
 Software Installation and Deployment
 ------------------------------------
 
+Install with Helm in Kubernetes
++++++++++++++++++++++++++++++++
+
+The easiest and preferred way to install NONRTRIC functions is using Kubernetes, with installation instructions provided in Helm Charts. 
+Full details of how to install NONRTRIC functions are provided in `Deploy NONRTRIC in Kubernetes <nonrtricwikik8s_>`_.
+
+Helm charts and an example recipe are provided in the `it/dep repo <https://gerrit.o-ran-sc.org/r/admin/repos/it/dep>`_,
+under "nonrtric". By modifying the variables named "installXXX" in the beginning of the example recipe file, which
+components that will be installed can be controlled. Then the components can be installed and started by running the
+following command:
+
+      .. code-block:: bash
+
+        bin/deploy-nonrtric -f nonrtric/RECIPE_EXAMPLE/example_recipe.yaml
+
 Install with Docker
 +++++++++++++++++++
 
-Docker compose files are provided, in the "docker-compose" folder, to install the components. Run the following
+Some NONRTRIC functions, and simpler usecases can be install directly using Docker.  
+Full details of how to use Docker for NONRTRIC functions are provided in `Deploy NONRTRIC in Docker <nonrtricwikidocker_>`_.
+
+Install with Docker Compose
++++++++++++++++++++++++++++
+
+Some older docker compose files are provided, in the "docker-compose" folder, to install the components. Run the following
 command to start the components:
 
       .. code-block:: bash
@@ -26,16 +48,4 @@ command to start the components:
            -f ics/docker-compose.yaml
 
 The example above is just an example to start some of the components.
-For more information on running and configuring the functions can be found in the README file in the "`docker-compose <https://gerrit.o-ran-sc.org/r/gitweb?p=nonrtric.git;a=tree;f=docker-compose>`__" folder, and on the `wiki page <https://wiki.o-ran-sc.org/display/RICNR/Release+E+-+Run+in+Docker>`_
-
-Install with Helm
-+++++++++++++++++
-
-Helm charts and an example recipe are provided in the `it/dep repo <https://gerrit.o-ran-sc.org/r/admin/repos/it/dep>`_,
-under "nonrtric". By modifying the variables named "installXXX" in the beginning of the example recipe file, which
-components that will be installed can be controlled. Then the components can be installed and started by running the
-following command:
-
-      .. code-block:: bash
-
-        bin/deploy-nonrtric -f nonrtric/RECIPE_EXAMPLE/example_recipe.yaml
+For more information on running and configuring the functions can be found in the README file in the "`docker-compose <https://gerrit.o-ran-sc.org/r/gitweb?p=nonrtric.git;a=tree;f=docker-compose>`_" folder, and on the `wiki page <https://wiki.o-ran-sc.org/display/RICNR/Release+E+-+Run+in+Docker>`_
index 04bb0d3..f75c6f2 100644 (file)
@@ -1,8 +1,9 @@
 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
 .. SPDX-License-Identifier: CC-BY-4.0
-.. Copyright (C) 2021 Nordix
+.. Copyright (C) 2021-2023 Nordix Foundation. All rights Reserved
+.. Copyright (C) 2023 OpenInfra Foundation Europe. All Rights Reserved
 
-.. |archpic| image:: ./images/nonrtric-architecture-H.png
+.. |archpic| image:: ./images/nonrtric-architecture-I.png
   :alt: Image: O-RAN SC - NONRTRIC Overall Architecture
 
 Summary
@@ -12,39 +13,42 @@ The Non-RealTime RIC (RAN Intelligent Controller) is an Orchestration and Automa
 
 The primary goal of the Non-RealTime RIC is to support non-real-time radio resource management, higher layer procedure optimization, policy optimization in RAN, and providing guidance, parameters, policies and AI/ML models to support the operation of near-RealTime RIC functions in the RAN to achieve higher-level non-real-time objectives.
 
-Non-RealTime RIC functions include service and policy management, RAN analytics and model-training for the near-RealTime RICs.
+Non-RealTime RIC functions include service and policy management and RAN analytics for the RAN.
 The Non-RealTime RIC platform hosts and coordinates rApps (Non-RT RIC applications) to perform Non-RealTime RIC tasks.
 The Non-RealTime RIC also hosts the new R1 interface (between rApps and SMO/Non-RealTime-RIC services).
 
 The O-RAN-SC (OSC) NONRTRIC project provides concepts, architecture and reference implementations as defined and described by the `O-RAN Alliance <https://www.o-ran.org>`_ architecture.
 The OSC NONRTRIC implementation communicates with near-RealTime RIC elements in the RAN via the A1 interface. Using the A1 interface the NONRTRIC will facilitate the provision of policies for individual UEs or groups of UEs; monitor and provide basic feedback on policy state from near-RealTime RICs; provide enrichment information as required by near-RealTime RICs; and facilitate ML model training, distribution and inference in cooperation with the near-RealTime RICs.
+The OSC NONRTRIC hosts rApps, and coordinates all interactions between the rApp and underlying SMo by way of the R1 Interface. 
 
 |archpic|
 
-Find detailed description of the NONRTRIC project see the `O-RAN SC NONRTRIC Project Wiki <https://wiki.o-ran-sc.org/display/RICNR/>`_.
+Find detailed description of the NONRTRIC project see the `O-RAN SC NONRTRIC Project Wiki <nonrtricwiki_>`_.
 
 NONRTRIC components
 -------------------
 
 These are the components that make up the Non-RT-RIC:
 
-* `Non-RT-RIC Control Panel <#non-rt-ric-control-panel-nonrtric-dashboard>`_. :doc:`Documentation site <controlpanel:index>`.
-* `Information Coordinator Service <#information-coordination-service>`_. :doc:`Documentation site <informationcoordinatorservice:index>`.
-* `A1 Policy Management Service <#a1-policy-management-service-from-onap-ccsdk>`_. :doc:`Documentation site <a1policymanagementservice:index>`.
+* `Non-RT-RIC Control Panel <#non-rt-ric-control-panel-nonrtric-dashboard>`_.  (:doc:`Documentation site <controlpanel:index>`).
+* `Information Coordinator Service <#information-coordination-service>`_.  (:doc:`Documentation site <informationcoordinatorservice:index>`).
+* `A1 Policy Management Service <#a1-policy-management-service-from-onap-ccsdk>`_.  (:doc:`Documentation site <a1policymanagementservice:index>`).
 * `A1 Policy Controller / Adapter <#a1-sdnc-controller-a1-adapter-controller-plugin>`_.
-* `Near-RT RIC A1 Simulator <#a1-interface-near-rt-ric-simulator>`_. :doc:`Documentation site <simulator:index>`.
+* `Near-RT RIC A1 Simulator <#a1-interface-near-rt-ric-simulator>`_.  (:doc:`Documentation site <simulator:index>`).
 * `Non-RT-RIC (Spring Cloud) Service Gateway <#spring-cloud-service-gateway>`_.
-* `Non-RT-RIC Service Exposure Security Architecture Prototyping <#service-exposure-security-architecture-prototyping>`_. :doc:`Documentation site <service-exposure/se-overview/>`
-* `DMaaP/Kafka Information Producer Adapters <#dmaap-information-producer-adapters-kafka>`_. :doc:`Documentation site adapter <dmaapadapter:index>`. :doc:`Documentation site mediator <dmaapmediatorproducer:index>`.
-* `Initial Non-RT-RIC App Catalogue <#initial-app-catalogue>`_. :doc:`Documentation site <rappcatalogue:index>`.
-* `Initial K8S Helm Chart LCM Manager <#initial-kubernetes-helm-chart-lcm-manager>`_. :doc:`Documentation site <helmmanager:index>`.
-* `Service Management & Exposure (SME) <#service-management-and-exposure>`_. :doc:`Documentation site <sme:index>`.
+* `Non-RT-RIC Service Exposure Security Architecture Prototyping <#service-exposure-security-architecture-prototyping>`_.  (:doc:`Documentation site <service-exposure/se-overview/>`)
+* `DMaaP/Kafka Information Producer Adapters <#dmaap-information-producer-adapters-kafka>`_.  (:doc:`Documentation site adapter <dmaapadapter:index>`),  (:doc:`Documentation site mediator <dmaapmediatorproducer:index>`).
+* `Initial Non-RT-RIC App Catalogue <#initial-app-catalogue>`_.  (:doc:`Documentation site <rappcatalogue:index>`).
+* `Initial K8S Helm Chart LCM Manager <#initial-kubernetes-helm-chart-lcm-manager>`_.  (:doc:`Documentation site <helmmanager:index>`).
+* `Service Management & Exposure (SME) (CAPIF) <#service-management-and-exposure-capif>`_.  (:doc:`Documentation site <sme:index>`).
 * `Authentication Support <#authentication-support-keycloak>`_.
+* `RApp Manager Service <#rapp-manager-service>`_.  (:doc:`Documentation site <rappmanager:index>`).
+* `RAN Performance Monitoring Functions (File-based PM) <#ran-performance-monitoring-functions-file-based-pm>`_   (:doc:`Documentation site <ranpm:index>`).
 * `Test Framework <#non-rt-ric-test-framework>`_.
 * `Use Cases: <#non-rt-ric-use-cases>`_
 
-  * "Helloworld" O-RU Fronthaul Recovery use case. :doc:`Documentation site <orufhrecovery:index>`.
-  * "Helloworld" O-DU Slice Assurance use case. :doc:`Documentation site <ransliceassurance:index>`.
+  * "Helloworld" O-RU Fronthaul Recovery use case.  (:doc:`Documentation site <orufhrecovery:index>`).
+  * "Helloworld" O-DU Slice Assurance use case.  (:doc:`Documentation site <ransliceassurance:index>`).
 
 
 Non-RT-RIC Control Panel / NONRTRIC Dashboard
@@ -62,7 +66,6 @@ Implementation:
 
 - Frontend: Angular framework
 - Repo: *portal/nonrtric-controlpanel*
-- `Wiki <https://wiki.o-ran-sc.org/display/RICNR/>`_ to set up in your local environment.
 - Documentation at the :doc:`NONRTRIC-Portal documentation site <controlpanel:index>`.
 
 Information Coordination Service
@@ -117,6 +120,7 @@ Implementation:
 
 A1/SDNC Controller & A1 Adapter (Controller plugin)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
 Mediation point for A1 interface termination in SMO/NONRTRIC.
 
 - Implemented as CCSDK OSGI Feature/Bundles.
@@ -168,7 +172,9 @@ Support Apps to use NONRTRIC, SMO and other App interfaces.
 A building block for coming releases as the R1 Interface concept matures .
 
 - Support dynamic registration and exposure of service interfaces to Non-RT-RIC applications (& NONRTRIC Control panel).
-- The architecture and componets are defined in :doc:`Non-RT RIC Security Architecture Prototyping (Documentation site) <service-exposure/se-overview/>`. 
+- The architecture and components are defined in :doc:`Non-RT RIC Security Architecture Prototyping (Documentation site) <service-exposure/se-overview/>`. 
+- Works with the CAPIF `Service Management & Exposure (SME) <#service-management-and-exposure>`_. :doc:`Documentation site <sme:index>` functions.
+
 
 DMaaP Information Producer Adapters (Kafka)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -197,17 +203,17 @@ Register for Non-RT-RIC Apps.
 
 Implementation:
 
-- Implemented as a Java Spring Boot application.
+- Implemented as a Java Spring Boot application and in Python.
 - Repo: *nonrtric/plt/rappcatalogue*
 - Documentation at the :doc:`rApp Catalogue documentation site <rappcatalogue:index>`.
 
 Initial Kubernetes Helm Chart LCM Manager
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-Onboard, start, stop, and modify Non-RT-RIC App ÂµServices as Helm Charts.
+Onboard, start, stop, and modify Non-RT-RIC App Ã‚µServices as Helm Charts.
 *A building block for coming releases as the R-APP concept matures*.
 
-- Interfaces that accepts Non-RT-RIC App ÂµServices Helm Charts.
+- Interfaces that accepts Non-RT-RIC App Ã‚µServices Helm Charts.
 - Support basic LCM operations.
 - Onboard, Start, Stop, Modify, Monitor.
 - Initial version co-developed with v. similar functions in ONAP.
@@ -219,8 +225,8 @@ Implementation:
 - Repo: *nonrtric/plt/helmmanager*
 - Documentation at the :doc:`Helm Manager documentation site <helmmanager:index>`.
 
-Service Management and Exposure
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Service Management and Exposure (CAPIF)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 An initial implementation of the CAPIF Core service. It implements the following CAPIF APIs:
 
@@ -265,6 +271,22 @@ The auth-token-fetch is configured by the following environment variables.
 * AUTH_SERVICE_URL - the URL to the authentication service (Keycloak)
 * REFRESH_MARGIN_SECONDS - how long in advance before the authorization token expires it is refreshed
 
+RApp Manager Service
+~~~~~~~~~~~~~~~~~~~~
+
+Early version of a service to manage rApps and rApp instances. 
+
+- Manages the entire lifecycle and state of rApp and thie instances
+- Integrated with NONRTRIC Data Management & Exposure functions (ICS)
+- Integrates with NONRTRIC Service registration and discovery functions (SME CAPIF)
+- Also add new ONAP ACM participants to handle rApp composition elements
+
+Implementation:
+
+- Implemented as a Java Spring Boot application.
+- Repo: *nonrtric/plt/rappmanager*
+- Documentation at the :doc:`Non-RT RIC rApp Manager documentation site <rappmanager:index>`.
+
 RAN Performance Monitoring Functions (File-based PM)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
index a983665..4c37861 100644 (file)
@@ -1,6 +1,7 @@
 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
 .. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2021 Nordix
+.. Copyright (C) 2021-2023 Nordix. All rights reserved.
+.. Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved.
 
 =============
 Release-Notes
@@ -18,7 +19,7 @@ Functions, previously here, but now with their own repos have their own release
 * :doc:`Information Coordinator Service <informationcoordinatorservice:release-notes>`.
 * :doc:`A1 Policy Management Service <a1policymanagementservice:release-notes>`.
 * :doc:`Near-RT RIC A1 Simulator <simulator:release-notes>`.
-* DMaaP/Kafka Information Producer Adapters. :doc:`DMaaPAdapter <dmaapadapter:release-notes>`. :doc:`DMaaP Mediator Producer <dmaapmediatorproducer:release-notes>`.
+* DMaaP/Kafka Information Producer Adapters. :doc:`DMaaP Adapter <dmaapadapter:release-notes>`. :doc:`DMaaP Mediator Producer <dmaapmediatorproducer:release-notes>`.
 * :doc:`Non-RT-RIC App Catalogue <rappcatalogue:release-notes>`.
 * :doc:`K8S Helm Chart LCM Manager <helmmanager:release-notes>`.
 * :doc:`Service Management & Exposure (SME) <sme:release-notes>`.
@@ -29,6 +30,9 @@ Functions, previously here, but now with their own repos have their own release
 
 
 
+Release-Notes for just the nonrtric repo
+========================================
+
 Bronze
 ------
 +-----------------------------+---------------------------------------------------+
@@ -201,3 +205,17 @@ H Release
 |                             |                                                   |
 +-----------------------------+---------------------------------------------------+
 
+I Release
+---------
++-----------------------------+---------------------------------------------------+
+| **Project**                 | Non-RT RIC                                        |
+|                             |                                                   |
++-----------------------------+---------------------------------------------------+
+| **Repo/commit-ID**          | nonrtric                                          |
+|                             |                                                   |
++-----------------------------+---------------------------------------------------+
+| **Note**                    | No new images released from this repo for         |
+|                             |     the I Release.                                |
+|                             |                                                   |
++-----------------------------+---------------------------------------------------+
+
index 03e9ed2..000cd52 100755 (executable)
@@ -19,6 +19,6 @@
 
 #Builds the callback receiver container and starts it in interactive mode
 
-docker build --build-arg NEXUS_PROXY_REPO=nexus3.onap.org:10001/ -t callback-receiver .
+docker build -t callback-receiver .
 
 docker run --rm -it -p 8090:8090 -p 8091:8091 --name cr callback-receiver
index 1874f97..c245172 100755 (executable)
@@ -19,6 +19,6 @@
 
 #Builds the mrstub container and starts it in interactive mode
 
-docker build --build-arg NEXUS_PROXY_REPO=nexus3.onap.org:10001/  -t mrstub .
+docker build -t mrstub .
 
 docker run --rm --name=dmaap-mr -it -p 3904:3904 -p 3905:3905 -v "$PWD/cert:/usr/src/app/cert" mrstub
index 89cc967..d10626e 100755 (executable)
@@ -22,6 +22,6 @@
 NAME="producer-stub-test"
 IMAGE_NAME="producer-stub-test-image"
 
-docker build --build-arg NEXUS_PROXY_REPO=nexus3.onap.org:10001/ -t $IMAGE_NAME .
+docker build -t $IMAGE_NAME .
 
 docker run --rm -it -p 8992:8092 -p 8993:8093 --name $NAME $IMAGE_NAME
diff --git a/test/servicestub/.gitignore b/test/servicestub/.gitignore
new file mode 100644 (file)
index 0000000..5ff6309
--- /dev/null
@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store
\ No newline at end of file
diff --git a/test/servicestub/Dockerfile b/test/servicestub/Dockerfile
new file mode 100644 (file)
index 0000000..fb942d8
--- /dev/null
@@ -0,0 +1,47 @@
+#==================================================================================
+#   Copyright (C) 2023: OpenInfra Foundation Europe
+#
+#   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.
+#
+#   This source code is part of the near-RT RIC (RAN Intelligent Controller)
+#   platform project (RICP).
+#==================================================================================
+
+
+# Use Maven image with OpenJDK 17 for the build stage
+FROM maven:3.8.5-openjdk-17 AS maven_build
+
+# Copy Maven project files
+COPY pom.xml /tmp/
+COPY src /tmp/src/
+
+# Set working directory
+WORKDIR /tmp/
+
+# Build the Maven project
+RUN mvn package
+
+# Use a separate image with OpenJDK 17 for the runtime stage
+FROM openjdk:17-jdk-slim
+
+# Expose port 8080
+EXPOSE 8080
+
+# Set the working directory
+WORKDIR /app
+
+# Copy the JAR file from the maven_build stage to the runtime stage
+COPY --from=maven_build /tmp/target/hello-world-0.1.0.jar /app/hello-world-0.1.0.jar
+
+# Command to run the application
+CMD ["java", "-jar", "hello-world-0.1.0.jar"]
diff --git a/test/servicestub/README.md b/test/servicestub/README.md
new file mode 100644 (file)
index 0000000..601e52a
--- /dev/null
@@ -0,0 +1,37 @@
+# Hello World Service Stub\r
+\r
+This repository contains a Spring Boot application serving a Hello World endpoint. The application can be built and \r
+run using the provided script - ``service-stub-build-start.sh``.\r
+\r
+## Prerequisites\r
+\r
+- Docker installed on your machine.\r
+\r
+## Building and Running the Application\r
+Run the script:\r
+\r
+```bash\r
+  ./service-stub-build-start.sh\r
+```\r
+\r
+The script will build a Docker image and run a container with the Hello World service. After the container starts, \r
+wait for a few seconds to ensure the Spring Boot application is fully initialized. Next, it will make an HTTP request to the \r
+Hello World endpoint and display the response:\r
+\r
+```bash\r
+  response=$(curl -s http://localhost:8080/helloworld/sme)\r
+  echo "Response from the Hello World endpoint:"\r
+  echo "$response"\r
+```\r
+\r
+To stop and remove the Docker container:\r
+\r
+```bash\r
+  docker stop service-stub-hello-world-test\r
+  docker rm service-stub-hello-world-test\r
+```\r
+\r
+## Additional Information\r
+\r
+- The Hello World endpoint is available at http://localhost:8080/helloworld/sme.\r
+\r
diff --git a/test/servicestub/build.sh b/test/servicestub/build.sh
new file mode 100644 (file)
index 0000000..bb0ff80
--- /dev/null
@@ -0,0 +1,96 @@
+#!/bin/bash
+
+#  ============LICENSE_START===============================================
+#  Copyright (C) 2023: OpenInfra Foundation Europe.
+#  ========================================================================
+#  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.
+#  ============LICENSE_END=================================================
+#
+
+# Build image from Dockerfile with/without custom image tag
+# Optionally push to external image repo
+
+print_usage() {
+    echo "Usage: build.sh no-push|<docker-hub-repo-name> [<image-tag>]"
+    exit 1
+}
+
+if [ $# -ne 1 ] && [ $# -ne 2 ]; then
+    print_usage
+fi
+
+IMAGE_NAME="nonrtric-hello-world"
+IMAGE_TAG="latest"
+REPO=""
+if [ $1 == "no-push" ]; then
+    echo "Only local image build"
+else
+    REPO=$1
+    echo "Attempt to push built image to: "$REPO
+fi
+
+shift
+while [ $# -ne 0 ]; do
+    if [ $1 == "--tag" ]; then
+        shift
+        if [ -z "$1" ]; then
+            print_usage
+        fi
+        IMAGE_TAG=$1
+        echo "Setting image tag to: "$IMAGE_TAG
+        shift
+    else
+        echo "Unknown parameter: $1"
+        print_usage
+    fi
+done
+
+IMAGE=$IMAGE_NAME:$IMAGE_TAG
+
+export DOCKER_DEFAULT_PLATFORM=linux/amd64
+CURRENT_PLATFORM=$(docker system info --format '{{.OSType}}/{{.Architecture}}')
+if [ $CURRENT_PLATFORM != $DOCKER_DEFAULT_PLATFORM ]; then
+    echo "Image may not work on the current platform: $CURRENT_PLATFORM, only platform $DOCKER_DEFAULT_PLATFORM supported"
+fi
+
+echo "Building image $IMAGE"
+docker build -t $IMAGE_NAME:$IMAGE_TAG .
+if [ $? -ne 0 ]; then
+    echo "BUILD FAILED"
+    exit 1
+fi
+echo "BUILD OK"
+
+if [ "$REPO" != "" ]; then
+    echo "Tagging image"
+    NEW_IMAGE=$REPO/$IMAGE_NAME:$IMAGE_TAG
+    docker tag $IMAGE $NEW_IMAGE
+    if [ $? -ne 0 ]; then
+        echo "RE-TAGGING FAILED"
+        exit 1
+    fi
+    echo "RE-TAG OK"
+
+    echo "Pushing image $NEW_IMAGE"
+    docker push $NEW_IMAGE
+    if [ $? -ne 0 ]; then
+        echo "PUSHED FAILED"
+        echo " Perhaps not logged into docker-hub repo $REPO?"
+        exit 1
+    fi
+    IMAGE=$NEW_IMAGE
+    echo "PUSH OK"
+fi
+
+echo "IMAGE OK: $IMAGE"
+echo "DONE"
diff --git a/test/servicestub/container-tag.yaml b/test/servicestub/container-tag.yaml
new file mode 100644 (file)
index 0000000..d911388
--- /dev/null
@@ -0,0 +1,25 @@
+# -
+#   ========================LICENSE_START=================================
+#   O-RAN-SC
+#   %%
+#   Copyright (C) 2023: OpenInfra Foundation Europe.
+#   %%
+#   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.
+#   ========================LICENSE_END===================================
+#
+
+# The Jenkins job requires a tag to build the Docker image.
+# By default this file is in the docker build directory,
+# but the location can configured in the JJB template.
+---
+tag: 0.1.0
diff --git a/test/servicestub/docker-compose.yml b/test/servicestub/docker-compose.yml
new file mode 100644 (file)
index 0000000..b137ec1
--- /dev/null
@@ -0,0 +1,29 @@
+# -
+#   ========================LICENSE_START=================================
+#   O-RAN-SC
+#   %%
+#   Copyright (C) 2023: OpenInfra Foundation Europe
+#   %%
+#   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.
+#   ========================LICENSE_END===================================
+#
+
+version: "3.0"
+
+services:
+  hello-world:
+    build: 
+      context: ./
+      dockerfile: Dockerfile
+    ports:
+      - 8080:8080
\ No newline at end of file
diff --git a/test/servicestub/hello-world-chart/.helmignore b/test/servicestub/hello-world-chart/.helmignore
new file mode 100644 (file)
index 0000000..0e8a0eb
--- /dev/null
@@ -0,0 +1,23 @@
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*.orig
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
+.vscode/
diff --git a/test/servicestub/hello-world-chart/Chart.yaml b/test/servicestub/hello-world-chart/Chart.yaml
new file mode 100644 (file)
index 0000000..3f5d200
--- /dev/null
@@ -0,0 +1,44 @@
+# -
+#   ========================LICENSE_START=================================
+#   O-RAN-SC
+#   %%
+#   Copyright (C) 2023: OpenInfra Foundation Europe
+#   %%
+#   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.
+#   ========================LICENSE_END===================================
+#
+
+apiVersion: v2
+name: hello-world-chart
+description: A Helm chart for NONRTRIC Hello World
+
+# A chart can be either an 'application' or a 'library' chart.
+#
+# Application charts are a collection of templates that can be packaged into versioned archives
+# to be deployed.
+#
+# Library charts provide useful utilities or functions for the chart developer. They're included as
+# a dependency of application charts to inject those utilities and functions into the rendering
+# pipeline. Library charts do not define any templates and therefore cannot be deployed.
+type: application
+
+# This is the chart version. This version number should be incremented each time you make changes
+# to the chart and its templates, including the app version.
+# Versions are expected to follow Semantic Versioning (https://semver.org/)
+version: 0.1.0
+
+# This is the version number of the application being deployed. This version number should be
+# incremented each time you make changes to the application. Versions are not expected to
+# follow Semantic Versioning. They should reflect the version the application is using.
+# It is recommended to use it with quotes.
+appVersion: "0.1.0"
diff --git a/test/servicestub/hello-world-chart/templates/_helpers.tpl b/test/servicestub/hello-world-chart/templates/_helpers.tpl
new file mode 100644 (file)
index 0000000..5759827
--- /dev/null
@@ -0,0 +1,62 @@
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "hello-world-chart.name" -}}
+{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
+{{- end }}
+
+{{/*
+Create a default fully qualified app name.
+We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
+If release name contains chart name it will be used as a full name.
+*/}}
+{{- define "hello-world-chart.fullname" -}}
+{{- if .Values.fullnameOverride }}
+{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
+{{- else }}
+{{- $name := default .Chart.Name .Values.nameOverride }}
+{{- if contains $name .Release.Name }}
+{{- .Release.Name | trunc 63 | trimSuffix "-" }}
+{{- else }}
+{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
+{{- end }}
+{{- end }}
+{{- end }}
+
+{{/*
+Create chart name and version as used by the chart label.
+*/}}
+{{- define "hello-world-chart.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
+{{- end }}
+
+{{/*
+Common labels
+*/}}
+{{- define "hello-world-chart.labels" -}}
+helm.sh/chart: {{ include "hello-world-chart.chart" . }}
+{{ include "hello-world-chart.selectorLabels" . }}
+{{- if .Chart.AppVersion }}
+app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
+{{- end }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- end }}
+
+{{/*
+Selector labels
+*/}}
+{{- define "hello-world-chart.selectorLabels" -}}
+app.kubernetes.io/name: {{ include "hello-world-chart.name" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+{{- end }}
+
+{{/*
+Create the name of the service account to use
+*/}}
+{{- define "hello-world-chart.serviceAccountName" -}}
+{{- if .Values.serviceAccount.create }}
+{{- default (include "hello-world-chart.fullname" .) .Values.serviceAccount.name }}
+{{- else }}
+{{- default "default" .Values.serviceAccount.name }}
+{{- end }}
+{{- end }}
diff --git a/test/servicestub/hello-world-chart/templates/deployment.yaml b/test/servicestub/hello-world-chart/templates/deployment.yaml
new file mode 100644 (file)
index 0000000..57f5357
--- /dev/null
@@ -0,0 +1,43 @@
+# -
+#   ========================LICENSE_START=================================
+#   O-RAN-SC
+#   %%
+#   Copyright (C) 2023: OpenInfra Foundation Europe
+#   %%
+#   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.
+#   ========================LICENSE_END===================================
+#
+
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: {{ include "hello-world-chart.fullname" . }}
+  labels:
+    {{- include "hello-world-chart.labels" . | nindent 4 }}
+spec:
+  replicas: {{ .Values.replicaCount }}
+  selector:
+    matchLabels:
+      {{- include "hello-world-chart.selectorLabels" . | nindent 8 }}
+  template:
+    metadata:
+      labels:
+        {{- include "hello-world-chart.selectorLabels" . | nindent 12 }}
+    spec:
+      containers:
+        - name: {{ .Chart.Name }}
+          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
+          ports:
+            - name: http
+              containerPort: {{ .Values.service.port }}
+
diff --git a/test/servicestub/hello-world-chart/templates/service.yaml b/test/servicestub/hello-world-chart/templates/service.yaml
new file mode 100644 (file)
index 0000000..fdd9144
--- /dev/null
@@ -0,0 +1,37 @@
+# -
+#   ========================LICENSE_START=================================
+#   O-RAN-SC
+#   %%
+#   Copyright (C) 2023: OpenInfra Foundation Europe
+#   %%
+#   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.
+#   ========================LICENSE_END===================================
+#
+
+apiVersion: v1
+kind: Service
+metadata:
+  name: {{ include "hello-world-chart.fullname" . }}
+  labels:
+    {{- include "hello-world-chart.labels" . | nindent 4 }}
+spec:
+  type: {{ .Values.service.type }}
+  ports:
+    - port: {{ .Values.service.port }}
+      targetPort: http
+      protocol: TCP
+      name: http
+      nodePort: 30951
+  selector:
+    {{- include "hello-world-chart.selectorLabels" . | nindent 4 }}
+
diff --git a/test/servicestub/hello-world-chart/templates/tests/test-connection.yaml b/test/servicestub/hello-world-chart/templates/tests/test-connection.yaml
new file mode 100644 (file)
index 0000000..a8b1698
--- /dev/null
@@ -0,0 +1,35 @@
+# -
+#   ========================LICENSE_START=================================
+#   O-RAN-SC
+#   %%
+#   Copyright (C) 2023: OpenInfra Foundation Europe
+#   %%
+#   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.
+#   ========================LICENSE_END===================================
+#
+
+apiVersion: v1
+kind: Pod
+metadata:
+  name: "{{ include "hello-world-chart.fullname" . }}-test-connection"
+  labels:
+    {{- include "hello-world-chart.labels" . | nindent 4 }}
+  annotations:
+    "helm.sh/hook": test
+spec:
+  containers:
+    - name: wget
+      image: busybox
+      command: ['wget']
+      args: ['{{ include "hello-world-chart.fullname" . }}:{{ .Values.service.port }}']
+  restartPolicy: Never
diff --git a/test/servicestub/hello-world-chart/values.yaml b/test/servicestub/hello-world-chart/values.yaml
new file mode 100644 (file)
index 0000000..8856b1c
--- /dev/null
@@ -0,0 +1,29 @@
+# -
+#   ========================LICENSE_START=================================
+#   O-RAN-SC
+#   %%
+#   Copyright (C) 2023: OpenInfra Foundation Europe
+#   %%
+#   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.
+#   ========================LICENSE_END===================================
+#
+
+image:
+  repository: nonrtric-hello-world
+  tag: latest
+
+service:
+  name: hello-world
+  type: NodePort
+  port: 8080
+
diff --git a/test/servicestub/pom.xml b/test/servicestub/pom.xml
new file mode 100644 (file)
index 0000000..be7a791
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+* ========================LICENSE_START=================================
+* O-RAN-SC
+* %%
+* Copyright (C) 2023 OpenInfra Foundation Europe.
+* %%
+* 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.
+* ========================LICENSE_END===================================
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.o-ran-sc.nonrtric.plt</groupId>
+    <artifactId>hello-world</artifactId>
+    <version>0.1.0</version>
+
+    <properties>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>3.1.0</version>
+    </parent>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
\ No newline at end of file
diff --git a/test/servicestub/service-stub-build-start.sh b/test/servicestub/service-stub-build-start.sh
new file mode 100644 (file)
index 0000000..b798e86
--- /dev/null
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+# -
+#   ========================LICENSE_START=================================
+#   O-RAN-SC
+#   %%
+#   Copyright (C) 2023: OpenInfra Foundation Europe.
+#   %%
+#   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.
+#   ========================LICENSE_END===================================
+#
+
+NAME="service-stub-hello-world-test"
+IMAGE_NAME="nonrtric-hello-world"
+
+docker build -t $IMAGE_NAME:latest .
+
+docker run --rm -d -p 8080:8080 --name $NAME $IMAGE_NAME
+
+sleep 10
+
+echo "Make an HTTP request to the Hello World endpoint and display the response"
+response=$(curl -s http://localhost:8080/helloworld/sme)
+
+echo "Response from the /helloworld/sme endpoint: "
+echo "$response"
+
+response2=$(curl -s http://localhost:8080/helloworld)
+echo "Response from the /helloworld endpoint: "
+echo "$response2"
diff --git a/test/servicestub/src/main/java/org/oran/helloworld/HelloWorldApplication.java b/test/servicestub/src/main/java/org/oran/helloworld/HelloWorldApplication.java
new file mode 100644 (file)
index 0000000..c1fe5e9
--- /dev/null
@@ -0,0 +1,31 @@
+/*-\r
+ * ========================LICENSE_START=================================\r
+ * O-RAN-SC\r
+ * %%\r
+ * Copyright (C) 2023 OpenInfra Foundation Europe.\r
+ * %%\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *      http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * ========================LICENSE_END===================================\r
+ */\r
+\r
+package org.oran.helloworld;\r
+\r
+import org.springframework.boot.SpringApplication;\r
+import org.springframework.boot.autoconfigure.SpringBootApplication;\r
+\r
+@SpringBootApplication(scanBasePackages = "org.oran.helloworld")\r
+public class HelloWorldApplication {\r
+    public static void main(String[] args) {\r
+        SpringApplication.run(HelloWorldApplication.class, args);\r
+    }\r
+}\r
diff --git a/test/servicestub/src/main/java/org/oran/helloworld/rest/HelloWorldController.java b/test/servicestub/src/main/java/org/oran/helloworld/rest/HelloWorldController.java
new file mode 100644 (file)
index 0000000..994e151
--- /dev/null
@@ -0,0 +1,38 @@
+/*-\r
+ * ========================LICENSE_START=================================\r
+ * O-RAN-SC\r
+ * %%\r
+ * Copyright (C) 2023 OpenInfra Foundation Europe.\r
+ * %%\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *      http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * ========================LICENSE_END===================================\r
+ */\r
+\r
+package org.oran.helloworld.rest;\r
+\r
+import org.springframework.web.bind.annotation.RequestMapping;\r
+import org.springframework.web.bind.annotation.RestController;\r
+\r
+@RestController\r
+@RequestMapping("/helloworld")\r
+public class HelloWorldController {\r
+\r
+    @RequestMapping("")\r
+    public String helloWorld() {\r
+        return "Hello World from service stub\n";\r
+    }\r
+    @RequestMapping("/sme")\r
+    public String helloWorldSme() {\r
+        return "Hello World from SME\n";\r
+    }\r
+}\r
diff --git a/test/servicestub/src/test/java/org/oran/helloworld/rest/HelloWorldControllerTest.java b/test/servicestub/src/test/java/org/oran/helloworld/rest/HelloWorldControllerTest.java
new file mode 100644 (file)
index 0000000..0d29c8b
--- /dev/null
@@ -0,0 +1,59 @@
+/*-\r
+ * ========================LICENSE_START=================================\r
+ * O-RAN-SC\r
+ * %%\r
+ * Copyright (C) 2023 OpenInfra Foundation Europe.\r
+ * %%\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *      http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * ========================LICENSE_END===================================\r
+ */\r
+\r
+package org.oran.helloworld.rest;\r
+\r
+import org.junit.jupiter.api.Test;\r
+import org.springframework.beans.factory.annotation.Autowired;\r
+import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;\r
+import org.springframework.boot.test.mock.mockito.MockBean;\r
+import org.springframework.test.web.servlet.MockMvc;\r
+\r
+import static org.mockito.Mockito.when;\r
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;\r
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;\r
+\r
+@WebMvcTest(HelloWorldController.class)\r
+public class HelloWorldControllerTest {\r
+\r
+    @Autowired\r
+    private MockMvc mockMvc;\r
+\r
+    @MockBean\r
+    private HelloWorldController helloWorldController;\r
+\r
+    @Test\r
+    public void testHelloWorldEndpoint() throws Exception {\r
+        when(helloWorldController.helloWorld()).thenReturn("Hello World from service stub\n");\r
+\r
+        mockMvc.perform(get("/helloworld"))\r
+            .andExpect(status().isOk())\r
+            .andExpect(content().string("Hello World from service stub\n"));\r
+    }\r
+\r
+    @Test\r
+    public void testHelloWorldSmeEndpoint() throws Exception {\r
+        when(helloWorldController.helloWorldSme()).thenReturn("Hello World from SME\n");\r
+\r
+        mockMvc.perform(get("/helloworld/sme"))\r
+            .andExpect(status().isOk())\r
+            .andExpect(content().string("Hello World from SME\n"));\r
+    }\r
+}\r