Attempt to get stdout&stderr for CSIT tests 59/129359/8
authorJohnKeeney <john.keeney@est.tech>
Tue, 24 May 2022 11:34:49 +0000 (12:34 +0100)
committerJohnKeeney <john.keeney@est.tech>
Wed, 25 May 2022 15:26:44 +0000 (16:26 +0100)
Also small tweak for RTD documentation

Issue-ID: CCSDK-3675
Change-Id: Idd8acca0e07dc45c6f76a78a321b1075f3ee31ef
Signed-off-by: JohnKeeney <john.keeney@est.tech>
a1-policy-management/api/pms-api.json
a1-policy-management/api/pms-api.yaml
csit/scripts/healthcheck/data/preparePmsData.sh
csit/tests/healthcheck/test1.robot
csit/tests/healthcheck/test2.robot
csit/tests/healthcheck/test3.robot
docs/media/ONAP-A1ControllerArchitecture.png
docs/offeredapis/swagger/pms-api.json
docs/offeredapis/swagger/pms-api.yaml

index 9fc8e7b..5c5915c 100644 (file)
@@ -79,7 +79,7 @@
                 },
                 "keep_alive_interval_seconds": {
                     "format": "int64",
-                    "description": "keep alive interval for the service. This is a heartbeat supervision of the service, which in regular intervals must invoke a 'keepalive' REST call. When a service does not invoke this call within the given time, it is considered unavailable. An unavailable service will be automatically deregistered and its policies will be deleted. Value 0 means no timeout supervision.",
+                    "description": "keep alive interval for the service. This is used to enable optional heartbeat supervision of the service. If set (> 0) the registered service should regularly invoke a 'keepalive' REST call. When a service fails to invoke this 'keepalive' call within the configured time, the service is considered unavailable. An unavailable service will be automatically deregistered and its policies will be deleted. Value 0 means timeout supervision is disabled.",
                     "type": "integer"
                 }
             }
         },
         "/a1-policy/v2/services/{service_id}/keepalive": {"put": {
             "summary": "Heartbeat indicates that the service is running",
-            "description": "A registered service must call this in regular intervals to indicate that it is in operation. Absence of this call will lead to that the service will be deregistered and all its policies are removed.",
+            "description": "A registered service should invoke this operation regularly to indicate that it is still alive. If a registered service fails to invoke this operation before the end of a timeout period the service will be deregistered and all its A1 policies wil be removed. (This timeout can be set or disabled when each service is initially registered)",
             "operationId": "keepAliveService",
             "responses": {
                 "200": {
             "url": "http://www.apache.org/licenses/LICENSE-2.0"
         },
         "description": "<h2>General<\/h2><p>The O-RAN Non-RT RIC Policy Management Service provides a REST API for management of A1 policies. <br/>The main tasks of the service are:<\/p><ul><li>A1 Policy creation, modification and deletion.<\/li><li>Monitoring and maintaining consistency of the SMO view of A1 policies and the Near-RT RICs<\/li><li>Maintaining a view of supported Near-RT RIC policy types<\/li><li>Supervision of using services (R-APPs). When a service is unavailable, its policies are removed.<\/li><\/ul><h2>APIs provided by the service<\/h2><h3>A1 Policy Management<\/h3><p>This is an API for management of A1 Policies.<\/p><ul><li>A1 Policy retrieval, creation, modification and deletion.<\/li><li>Retrieval of supported A1 Policy types for a Near-RT RIC<\/li><li>Retrieval of status for existing A1 policies<\/li><\/ul><h3>Management of configuration<\/h3><p>API for updating and retrieval of the component configuration. Note that there other ways to maintain the configuration.<\/p><h3>Callbacks<\/h3><p>These are endpoints that are invoked by this service. The callbacks are registered in this service at service registration.<\/p><h3>NearRT-RIC Repository<\/h3><p>This is an API that provides support for looking up a NearRT-RIC. Each A1 policy is targeted for one Near-RT RIC.<\/p><h3>Health Check<\/h3><p>API used for supervision of the PMS component.<\/p><h3>Service Registry and Supervision<\/h3><p>API used for registering services that uses PMS. Each A1 policy is owned by a service. PMS can supervise each registered service and will automatically remove policies for unavailable services.<\/p>",
-        "title": "A1 Policy management service",
+        "title": "A1 Policy Management Service",
         "version": "1.1.0"
     },
     "tags": [
index 3fd496b..1f84399 100644 (file)
@@ -1,6 +1,6 @@
 openapi: 3.0.1
 info:
-  title: A1 Policy management service
+  title: A1 Policy Management Service
   description: <h2>General</h2><p>The O-RAN Non-RT RIC Policy Management Service provides
     a REST API for management of A1 policies. <br/>The main tasks of the service are:</p><ul><li>A1
     Policy creation, modification and deletion.</li><li>Monitoring and maintaining
@@ -434,9 +434,11 @@ paths:
       tags:
       - Service Registry and Supervision
       summary: Heartbeat indicates that the service is running
-      description: A registered service must call this in regular intervals to indicate
-        that it is in operation. Absence of this call will lead to that the service
-        will be deregistered and all its policies are removed.
+      description: A registered service should invoke this operation regularly to
+        indicate that it is still alive. If a registered service fails to invoke this
+        operation before the end of a timeout period the service will be deregistered
+        and all its A1 policies wil be removed. (This timeout can be set or disabled
+        when each service is initially registered)
       operationId: keepAliveService
       parameters:
       - name: service_id
@@ -896,12 +898,13 @@ components:
           description: identity of the service
         keep_alive_interval_seconds:
           type: integer
-          description: keep alive interval for the service. This is a heartbeat supervision
-            of the service, which in regular intervals must invoke a 'keepalive' REST
-            call. When a service does not invoke this call within the given time,
-            it is considered unavailable. An unavailable service will be automatically
-            deregistered and its policies will be deleted. Value 0 means no timeout
-            supervision.
+          description: keep alive interval for the service. This is used to enable
+            optional heartbeat supervision of the service. If set (> 0) the registered
+            service should regularly invoke a 'keepalive' REST call. When a service
+            fails to invoke this 'keepalive' call within the configured time, the
+            service is considered unavailable. An unavailable service will be automatically
+            deregistered and its policies will be deleted. Value 0 means timeout supervision
+            is disabled.
           format: int64
       description: Information for one service
     policy_info_list_v2:
index 3891728..c21747f 100755 (executable)
@@ -32,6 +32,8 @@ a1_sim_OSC_port=${2:-30001}
 a1_sim_STD_port=${3:-30005}
 httpx=${4:-"http"}
 SHELL_FOLDER=$(cd "$(dirname "$0")";pwd)
+ric1_id="ric1"
+ric2_id="ric2"
 
 echo "using policy_agent port: "$policy_agent_port
 echo "using a1-sim-OSC port: "$a1_sim_OSC_port
@@ -45,8 +47,21 @@ checkRes (){
       exit 1;
   fi
 }
+checkReturnContains(){
+    for ((i=0; i<$1; i++)); do
+        res=$($2)
+        expect=$3
+        echo "Check \"$4\"             Expected to contain: \"$expect\"                Received \"$res\""
+        if [[ "$res" =~ "$expect" ]]; then
+            echo -e "$4 is as expected!\n"
+            break;
+        else
+            sleep 1
+        fi
+    done
+}
 
-echo "policy agent status:"
+echo "A1 policy management service status:"
 curlString="curl -skw %{http_code} $httpx://localhost:$policy_agent_port/status"
 res=$($curlString)
 echo "$res"
@@ -86,6 +101,14 @@ expect="Policy type 2 is OK.201"
 checkRes
 echo -e "\n"
 
+echo "check $ric1_id sync status:"
+checkReturnContains 60 "curl -skw %{http_code} $httpx://localhost:$policy_agent_port/a1-policy/v2/rics/ric?ric_id=$ric1_id" "\"state\": \"AVAILABLE\"" "$ric1_id status"
+echo -e "\n"
+
+echo "check $ric2_id sync status:"
+checkReturnContains 60 "curl -skw %{http_code} $httpx://localhost:$policy_agent_port/a1-policy/v2/rics/ric?ric_id=$ric2_id" "\"state\": \"AVAILABLE\"" "$ric2_id status"
+echo -e "\n"
+
 for i in {1..300}; do
        echo "policy types from policy agent:"
     curlString="curl -skw %{http_code} $httpx://localhost:$policy_agent_port/a1-policy/v2/policy-types"
index e65928a..a8eba15 100644 (file)
@@ -5,12 +5,15 @@ Library           Process
 *** Variables ***
 
 ${health_check}      ${SCRIPTS}/healthcheck/test/health_check.sh
-
+${test1_stdout}      ${OUTPUT_DIR}/test1_healthcheck_STDOUT.log
+${test1_stderr}      ${OUTPUT_DIR}/test1_healthcheck_STDERR.log
 
 *** Test Cases ***
 
 Health check test case for NONRTRIC
-    [Documentation]                Health check
-    ${cli_cmd_output}=              Run Process    ${health_check}
-    Log                             ${cli_cmd_output.stdout}
+    [Documentation]                Health check - Test 1
+    Log Variables
+    ${cli_cmd_output}=              Run Process    ${health_check}    shell=no    stdout=${test1_stdout}    stderr=${test1_stderr}
+    Log Many                        Standard output:     ${test1_stdout}    ${\n}    ${cli_cmd_output.stdout}
+    Log Many                        Standard error:      ${test1_stderr}    ${\n}    ${cli_cmd_output.stderr}
     Should Be Equal as Integers     ${cli_cmd_output.rc}    0
index 9815169..ae51982 100644 (file)
@@ -4,13 +4,16 @@ Library           Process
 
 *** Variables ***
 
-${pms_a1sim}      ${SCRIPTS}/healthcheck/test/pms_a1sim.sh
-
+${pms_a1sim}         ${SCRIPTS}/healthcheck/test/pms_a1sim.sh
+${test2_stdout}      ${OUTPUT_DIR}/test2_pms_a1sim_STDOUT.log
+${test2_stderr}      ${OUTPUT_DIR}/test2_pms_a1sim_STDERR.log
 
 *** Test Cases ***
 
 Health check test case for NONRTRIC
-    [Documentation]                Deploy NONRTRIC without SDNC
-    ${cli_cmd_output}=              Run Process    ${pms_a1sim}
-    Log                             ${cli_cmd_output.stdout}
+    [Documentation]                 Deploy NONRTRIC without SDNC - Test 2
+    Log Variables
+    ${cli_cmd_output}=              Run Process    ${pms_a1sim}    shell=no    stdout=${test2_stdout}    stderr=${test2_stderr}
+    Log Many                        Standard output:     ${test2_stdout}    ${\n}    ${cli_cmd_output.stdout}
+    Log Many                        Standard error:      ${test2_stderr}    ${\n}    ${cli_cmd_output.stderr}
     Should Be Equal as Integers     ${cli_cmd_output.rc}    0
index f735df0..f268757 100644 (file)
@@ -4,13 +4,16 @@ Library           Process
 
 *** Variables ***
 
-${pms_a1sim_sdnc}      ${SCRIPTS}/healthcheck/test/pms_a1sim_sdnc.sh
-
+${pms_a1sim_sdnc}    ${SCRIPTS}/healthcheck/test/pms_a1sim_sdnc.sh
+${test3_stdout}      ${OUTPUT_DIR}/test3_pms_a1sim_sdnc_STDOUT.sh.log
+${test3_stderr}      ${OUTPUT_DIR}/test3_pms_a1sim_sdnc_STDERR.sh.log
 
 *** Test Cases ***
 
 Health check test case for NONRTRIC
-    [Documentation]                Deploy NONRTRIC with SDNC
-    ${cli_cmd_output}=              Run Process    ${pms_a1sim_sdnc}
-    Log                             ${cli_cmd_output.stdout}
+    [Documentation]                 Deploy NONRTRIC with SDNC - Test 3
+    Log Variables
+    ${cli_cmd_output}=              Run Process    ${pms_a1sim_sdnc}    shell=no    stdout=${test3_stdout}    stderr=${test3_stderr}
+    Log Many                        Standard output:     ${test3_stdout}    ${\n}    ${cli_cmd_output.stdout}
+    Log Many                        Standard error:      ${test3_stderr}    ${\n}    ${cli_cmd_output.stderr}
     Should Be Equal as Integers     ${cli_cmd_output.rc}    0
index 2d521ef..b32d702 100644 (file)
Binary files a/docs/media/ONAP-A1ControllerArchitecture.png and b/docs/media/ONAP-A1ControllerArchitecture.png differ
index 9fc8e7b..5c5915c 100644 (file)
@@ -79,7 +79,7 @@
                 },
                 "keep_alive_interval_seconds": {
                     "format": "int64",
-                    "description": "keep alive interval for the service. This is a heartbeat supervision of the service, which in regular intervals must invoke a 'keepalive' REST call. When a service does not invoke this call within the given time, it is considered unavailable. An unavailable service will be automatically deregistered and its policies will be deleted. Value 0 means no timeout supervision.",
+                    "description": "keep alive interval for the service. This is used to enable optional heartbeat supervision of the service. If set (> 0) the registered service should regularly invoke a 'keepalive' REST call. When a service fails to invoke this 'keepalive' call within the configured time, the service is considered unavailable. An unavailable service will be automatically deregistered and its policies will be deleted. Value 0 means timeout supervision is disabled.",
                     "type": "integer"
                 }
             }
         },
         "/a1-policy/v2/services/{service_id}/keepalive": {"put": {
             "summary": "Heartbeat indicates that the service is running",
-            "description": "A registered service must call this in regular intervals to indicate that it is in operation. Absence of this call will lead to that the service will be deregistered and all its policies are removed.",
+            "description": "A registered service should invoke this operation regularly to indicate that it is still alive. If a registered service fails to invoke this operation before the end of a timeout period the service will be deregistered and all its A1 policies wil be removed. (This timeout can be set or disabled when each service is initially registered)",
             "operationId": "keepAliveService",
             "responses": {
                 "200": {
             "url": "http://www.apache.org/licenses/LICENSE-2.0"
         },
         "description": "<h2>General<\/h2><p>The O-RAN Non-RT RIC Policy Management Service provides a REST API for management of A1 policies. <br/>The main tasks of the service are:<\/p><ul><li>A1 Policy creation, modification and deletion.<\/li><li>Monitoring and maintaining consistency of the SMO view of A1 policies and the Near-RT RICs<\/li><li>Maintaining a view of supported Near-RT RIC policy types<\/li><li>Supervision of using services (R-APPs). When a service is unavailable, its policies are removed.<\/li><\/ul><h2>APIs provided by the service<\/h2><h3>A1 Policy Management<\/h3><p>This is an API for management of A1 Policies.<\/p><ul><li>A1 Policy retrieval, creation, modification and deletion.<\/li><li>Retrieval of supported A1 Policy types for a Near-RT RIC<\/li><li>Retrieval of status for existing A1 policies<\/li><\/ul><h3>Management of configuration<\/h3><p>API for updating and retrieval of the component configuration. Note that there other ways to maintain the configuration.<\/p><h3>Callbacks<\/h3><p>These are endpoints that are invoked by this service. The callbacks are registered in this service at service registration.<\/p><h3>NearRT-RIC Repository<\/h3><p>This is an API that provides support for looking up a NearRT-RIC. Each A1 policy is targeted for one Near-RT RIC.<\/p><h3>Health Check<\/h3><p>API used for supervision of the PMS component.<\/p><h3>Service Registry and Supervision<\/h3><p>API used for registering services that uses PMS. Each A1 policy is owned by a service. PMS can supervise each registered service and will automatically remove policies for unavailable services.<\/p>",
-        "title": "A1 Policy management service",
+        "title": "A1 Policy Management Service",
         "version": "1.1.0"
     },
     "tags": [
index 3fd496b..1f84399 100644 (file)
@@ -1,6 +1,6 @@
 openapi: 3.0.1
 info:
-  title: A1 Policy management service
+  title: A1 Policy Management Service
   description: <h2>General</h2><p>The O-RAN Non-RT RIC Policy Management Service provides
     a REST API for management of A1 policies. <br/>The main tasks of the service are:</p><ul><li>A1
     Policy creation, modification and deletion.</li><li>Monitoring and maintaining
@@ -434,9 +434,11 @@ paths:
       tags:
       - Service Registry and Supervision
       summary: Heartbeat indicates that the service is running
-      description: A registered service must call this in regular intervals to indicate
-        that it is in operation. Absence of this call will lead to that the service
-        will be deregistered and all its policies are removed.
+      description: A registered service should invoke this operation regularly to
+        indicate that it is still alive. If a registered service fails to invoke this
+        operation before the end of a timeout period the service will be deregistered
+        and all its A1 policies wil be removed. (This timeout can be set or disabled
+        when each service is initially registered)
       operationId: keepAliveService
       parameters:
       - name: service_id
@@ -896,12 +898,13 @@ components:
           description: identity of the service
         keep_alive_interval_seconds:
           type: integer
-          description: keep alive interval for the service. This is a heartbeat supervision
-            of the service, which in regular intervals must invoke a 'keepalive' REST
-            call. When a service does not invoke this call within the given time,
-            it is considered unavailable. An unavailable service will be automatically
-            deregistered and its policies will be deleted. Value 0 means no timeout
-            supervision.
+          description: keep alive interval for the service. This is used to enable
+            optional heartbeat supervision of the service. If set (> 0) the registered
+            service should regularly invoke a 'keepalive' REST call. When a service
+            fails to invoke this 'keepalive' call within the configured time, the
+            service is considered unavailable. An unavailable service will be automatically
+            deregistered and its policies will be deleted. Value 0 means timeout supervision
+            is disabled.
           format: int64
       description: Information for one service
     policy_info_list_v2: