From 7904b3a47ef4ea81f026543a13cec0f0ef4456fd Mon Sep 17 00:00:00 2001 From: ktimoney Date: Mon, 4 Sep 2023 10:59:17 +0100 Subject: [PATCH 01/16] Update readthedocs config Issue-ID: NONRTRIC-921 Change-Id: Idde1242268b3efe63974b03b0b8df544772c47c8 Signed-off-by: ktimoney --- .readthedocs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 6fcc5c8..8b778e3 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -28,7 +28,7 @@ formats: build: os: ubuntu-22.04 tools: - python: "3.7" + python: "3.11" jobs: pre_build: - mkdir --parents _readthedocs/html/ -- 2.16.6 From 0cdfdb69c0bcc7dc81bd366ec5f05a6fdbb38ea0 Mon Sep 17 00:00:00 2001 From: ktimoney Date: Mon, 4 Sep 2023 11:36:02 +0100 Subject: [PATCH 02/16] Update readthedocs config Issue-ID: NONRTRIC-921 Change-Id: I36e72e9335612ae40275a46ce6d23635703a0d23 Signed-off-by: ktimoney --- docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index 8e8fd5b..36cbb00 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,6 +1,6 @@ .. 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 Non-RT RIC RAN PM Usecase / Functions =========================================== -- 2.16.6 From 41a1c82b8b1b30644c85b90487f013ccc8ff7f92 Mon Sep 17 00:00:00 2001 From: DenisGNoonan Date: Tue, 19 Sep 2023 14:18:11 +0100 Subject: [PATCH 03/16] NONRTRIC-924: RANPM - remove proxy Change-Id: I859b72e1c4d9ef0f52d4662b43fa39284d453272 Signed-off-by: DenisGNoonan --- install/README.md | 4 +- install/helm/nrt-pm-rapp/templates/app-pod.yaml | 2 +- install/helm/ran/templates/app-deployment.yaml | 2 +- install/scripts/README.md | 2 +- install/scripts/populate_keycloak.sh | 223 ++++++++++++------------ 5 files changed, 120 insertions(+), 113 deletions(-) diff --git a/install/README.md b/install/README.md index 6260248..90ce2c6 100644 --- a/install/README.md +++ b/install/README.md @@ -21,7 +21,7 @@ The ranpm setup works on linux/MacOS or on windows via WSL using a local or remo - kubernetes cluster - local docker for building images -It is recommended to run the ranpm on a kubernetes cluster instead of local docker-desktop etc as the setup requires a fair amount of computer resouces. +It is recommended to run the ranpm on a kubernetes cluster instead of local docker-desktop etc as the setup requires a fair amount of computer resources. # Requirement on kubernetes @@ -42,7 +42,7 @@ Nodeports exposed by the kubernetes instance must be accessible by the local mac ## Before installation The following images need to be built manually. If remote or multi node cluster is used, then an image repo needs to be available to push the built images to. -If external repo is used, use the same repo for all built images and configure the reponame in `helm/global-values.yaml` (the parameter value of extimagerepo shall have a trailing `/`) +If external repo is used, use the same repo for all built images and configure the reponame in `helm/global-values.yaml` Build the following images (build instruction in each dir) - ranpm/https-server diff --git a/install/helm/nrt-pm-rapp/templates/app-pod.yaml b/install/helm/nrt-pm-rapp/templates/app-pod.yaml index 5df4d71..2264dfa 100644 --- a/install/helm/nrt-pm-rapp/templates/app-pod.yaml +++ b/install/helm/nrt-pm-rapp/templates/app-pod.yaml @@ -25,7 +25,7 @@ metadata: spec: containers: - name: pm-rapp - image: {{ .Values.global.extimagerepo }}pm-rapp:latest + image: {{ .Values.global.extimagerepo }}/pm-rapp:latest {{- if .Values.global.extimagerepo }} imagePullPolicy: Always {{- else }} diff --git a/install/helm/ran/templates/app-deployment.yaml b/install/helm/ran/templates/app-deployment.yaml index 01b94f4..88e219a 100644 --- a/install/helm/ran/templates/app-deployment.yaml +++ b/install/helm/ran/templates/app-deployment.yaml @@ -60,7 +60,7 @@ spec: runAsUser: 0 containers: - name: pm-https-server - image: {{ .Values.global.extimagerepo }}pm-https-server:latest + image: {{ .Values.global.extimagerepo }}/pm-https-server:latest {{- if .Values.global.extimagerepo }} imagePullPolicy: Always {{- else }} diff --git a/install/scripts/README.md b/install/scripts/README.md index b1e5572..890eb66 100644 --- a/install/scripts/README.md +++ b/install/scripts/README.md @@ -24,7 +24,7 @@ The event will contain a url to each pm file. These urls points to a web server - file-extension : The pm file extension - should match the actual pm file to be downloaded from the web-servers (simulated RAN nodes) - sftp|ftps|https - Protocol for downloading pm files - only https is currently supported - num-servers - The number of web servers for pm file download. Should match the number of web servers actually started by the install script. This script generates pm file url to one of the web servers to spread the load. Note that this number can be different from the node-count parameter. -- hist : By default, each event only contains the reference to a single pm file. If the parameter is given then each event will contain the latest pm file and 95 of the previous file to represent a full 24h set of pm files. +- hist : By default, each event only contains the reference to a single pm file. If the parameter is given then each event will contain the latest pm file and 95 of the previous files to represent a full 24h set of pm files. ## Script - push-genfiles-to-ves-collector.sh diff --git a/install/scripts/populate_keycloak.sh b/install/scripts/populate_keycloak.sh index abc43f2..eed5492 100755 --- a/install/scripts/populate_keycloak.sh +++ b/install/scripts/populate_keycloak.sh @@ -21,9 +21,6 @@ echo "Cluster ip: $KUBERNETESHOST" -KC_URL=http://keycloak.nonrtric:8080 -echo "Keycloak url: "$KC_URL - KC_PROXY_PORT=$(kubectl get svc -n nonrtric keycloak-proxy --output jsonpath='{.spec.ports[?(@.name=="http")].nodePort}') echo "Nodeport to keycloak proxy: "$KC_PROXY_PORT @@ -31,7 +28,15 @@ __get_admin_token() { echo "Get admin token" ADMIN_TOKEN="" while [ "${#ADMIN_TOKEN}" -lt 20 ]; do - ADMIN_TOKEN=$(curl --proxy $KUBERNETESHOST:$KC_PROXY_PORT -s -X POST --max-time 2 "$KC_URL/realms/master/protocol/openid-connect/token" -H "Content-Type: application/x-www-form-urlencoded" -d "username=admin" -d "password=admin" -d 'grant_type=password' -d "client_id=admin-cli" | jq -r '.access_token') + ADMIN_TOKEN=$(curl -s -X POST "$KUBERNETESHOST:$KC_PROXY_PORT/realms/master/protocol/openid-connect/token" \ + --max-time 2 \ + -H "Content-Type: application/x-www-form-urlencoded" \ + -d "username=admin" \ + -d "password=admin" \ + -d 'grant_type=password' \ + -d "client_id=admin-cli" \ + | jq -r '.access_token') + if [ "${#ADMIN_TOKEN}" -lt 20 ]; then echo "Could not get admin token, retrying..." echo "Retrieved token: $ADMIN_TOKEN" @@ -67,25 +72,26 @@ decode_jwt() { list_realms() { echo "Listing all realms" __check_admin_token - curl --proxy $KUBERNETESHOST:$KC_PROXY_PORT -s \ - -X GET \ + + curl -s -X GET "$KUBERNETESHOST:$KC_PROXY_PORT/admin/realms" \ -H "Authorization: Bearer ${ADMIN_TOKEN}" \ - "$KC_URL/admin/realms" | jq -r '.[].id' | indent2 + | jq -r '.[].id' | indent2 } delete_realms() { echo "$@" for realm in "$@"; do echo "Attempt to delete realm: $realm" __check_admin_token - curl --proxy $KUBERNETESHOST:$KC_PROXY_PORT -s \ - -X DELETE \ - -H "Authorization: Bearer ${ADMIN_TOKEN}" \ - "$KC_URL/admin/realms/$realm" | indent1 + + curl -s -X DELETE "$KUBERNETESHOST:$KC_PROXY_PORT/admin/realms/$realm" \ + -H "Authorization: Bearer ${ADMIN_TOKEN}" \ + | indent1 + if [ $? -ne 0 ]; then - echo "Command failed" + echo "Command failed, delete_realms" exit 1 fi - echo " OK" + echo " OK, delete_realms" done } @@ -102,17 +108,17 @@ cat > .jsonfile1 <<- "EOF" EOF export __realm_name=$1 envsubst < .jsonfile1 > .jsonfile2 - curl --proxy $KUBERNETESHOST:$KC_PROXY_PORT -s \ - -X POST \ - -H "Authorization: Bearer ${ADMIN_TOKEN}" \ - -H "Content-Type: application/json" \ - -d @".jsonfile2" \ - "$KC_URL/admin/realms" | indent2 + curl -s -X POST "$KUBERNETESHOST:$KC_PROXY_PORT/admin/realms" \ + -H "Authorization: Bearer ${ADMIN_TOKEN}" \ + -H "Content-Type: application/json" \ + -d @".jsonfile2" \ + | indent2 + if [ $? -ne 0 ]; then - echo "Command failed" + echo "Command failed, create_realms" exit 1 fi - echo " OK" + echo " OK, create_realms" shift done } @@ -136,26 +142,26 @@ EOF __check_admin_token export __client_name=$1 envsubst < .jsonfile1 > .jsonfile2 - curl --proxy $KUBERNETESHOST:$KC_PROXY_PORT -s \ - -X POST \ - -H "Authorization: Bearer ${ADMIN_TOKEN}" \ - -H "Content-Type: application/json" \ - -d @".jsonfile2" \ - "$KC_URL/admin/realms/$__realm/clients" | indent1 + + curl -s -X POST "$KUBERNETESHOST:$KC_PROXY_PORT/admin/realms/$__realm/clients" \ + -H "Authorization: Bearer ${ADMIN_TOKEN}" \ + -H "Content-Type: application/json" \ + -d @".jsonfile2" \ + | indent1 + if [ $? -ne 0 ]; then - echo "Command failed" + echo "Command failed, create_clients" exit 1 fi - echo " OK" + echo " OK, create_clients" shift done } __get_client_id() { - __client_data=$(curl --proxy $KUBERNETESHOST:$KC_PROXY_PORT -s \ - -X GET \ - -H "Authorization: Bearer ${ADMIN_TOKEN}" \ - "$KC_URL/admin/realms/$1/clients?clientId=$2") + __client_data=$(curl -s -X GET "$KUBERNETESHOST:$KC_PROXY_PORT/admin/realms/$1/clients?clientId=$2" \ + -H "Authorization: Bearer ${ADMIN_TOKEN}" ) + if [ $? -ne 0 ]; then return 1 fi @@ -172,31 +178,32 @@ generate_client_secrets() { __check_admin_token __client_id=$(__get_client_id $__realm $1) if [ $? -ne 0 ]; then - echo "Command failed" + echo "Command failed, generate_client_secrets, __get_client_id" exit 1 fi echo " Client id for client $1 in realm $__realm: "$__client_id | indent1 echo " Creating secret" - __client_secret=$(curl --proxy $KUBERNETESHOST:$KC_PROXY_PORT -s \ - -X POST \ - -H "Authorization: Bearer ${ADMIN_TOKEN}" \ - "$KC_URL/admin/realms/$__realm/clients/$__client_id/client-secret") + + __client_secret=$(curl -s -X POST "$KUBERNETESHOST:$KC_PROXY_PORT/admin/realms/$__realm/clients/$__client_id/client-secret" \ + -H "Authorization: Bearer ${ADMIN_TOKEN}" ) + if [ $? -ne 0 ]; then - echo "Command failed" + echo "Command failed, generate_client_secrets, client_secret POST" exit 1 fi - __client_secret=$(curl --proxy $KUBERNETESHOST:$KC_PROXY_PORT -s \ - -X GET \ - -H "Authorization: Bearer ${ADMIN_TOKEN}" \ - "$KC_URL/admin/realms/$__realm/clients/$__client_id/client-secret") + + __client_secret=$(curl -s -X GET "$KUBERNETESHOST:$KC_PROXY_PORT/admin/realms/$__realm/clients/$__client_id/client-secret" \ + -H "Authorization: Bearer ${ADMIN_TOKEN}" ) + if [ $? -ne 0 ]; then - echo "Command failed" + echo "Command failed, generate_client_secrets, client_secret GET" exit 1 fi + __client_secret=$(echo $__client_secret | jq -r .value) echo " Client secret for client $1 in realm $__realm: "$__client_secret | indent1 echo $__client_secret > ".sec_$__realm""_$1" - echo " OK" + echo " OK, generate_client_secrets" shift done } @@ -206,7 +213,7 @@ create_client_roles() { __check_admin_token __client_id=$(__get_client_id $1 $2) if [ $? -ne 0 ]; then - echo "Command failed" + echo "Command failed, create_client_roles, __get_client_id" exit 1 fi __realm=$1 @@ -220,14 +227,15 @@ cat > .jsonfile1 <<- "EOF" EOF export __role=$1 envsubst < .jsonfile1 > .jsonfile2 - curl --proxy $KUBERNETESHOST:$KC_PROXY_PORT -s \ - -X POST \ - -H "Authorization: Bearer ${ADMIN_TOKEN}" \ - -H "Content-Type: application/json" \ - -d @".jsonfile2" \ - "$KC_URL/admin/realms/$__realm/clients/$__client_id/roles" | indent1 + + curl -s -X POST "$KUBERNETESHOST:$KC_PROXY_PORT/admin/realms/$__realm/clients/$__client_id/roles" \ + -H "Authorization: Bearer ${ADMIN_TOKEN}" \ + -H "Content-Type: application/json" \ + -d @".jsonfile2" \ + | indent1 + if [ $? -ne 0 ]; then - echo "Command failed" + echo "Command failed, create_client_roles" exit 1 fi shift @@ -236,32 +244,28 @@ EOF __get_service_account_id() { # - __service_account_data=$(curl --proxy $KUBERNETESHOST:$KC_PROXY_PORT -s \ - -X GET \ - -H "Authorization: Bearer ${ADMIN_TOKEN}" \ - "$KC_URL/admin/realms/$1/clients/$2/service-account-user") + + __service_account_data=$(curl -s -X GET "$KUBERNETESHOST:$KC_PROXY_PORT/admin/realms/$1/clients/$2/service-account-user" \ + -H "Authorization: Bearer ${ADMIN_TOKEN}" ) + if [ $? -ne 0 ]; then return 1 fi + __service_account_id=$(echo $__service_account_data | jq -r '.id') echo $__service_account_id return 0 } -# curl --proxy $KUBERNETESHOST:$KC_PROXY_PORT -s \ -# -X GET \ -# -H "Authorization: Bearer ${ADMIN_TOKEN}" \ -# "$KC_URL/admin/realms/$__realm/users/$__service_account_id/role-mappings/clients/$__client_id/available" __get_client_available_role_id() { # - __client_role_data=$(curl --proxy $KUBERNETESHOST:$KC_PROXY_PORT -s \ - -X GET \ - -H "Authorization: Bearer ${ADMIN_TOKEN}" \ - "$KC_URL/admin/realms/$1/users/$2/role-mappings/clients/$3/available") + + __client_role_data=$(curl -s -X GET "$KUBERNETESHOST:$KC_PROXY_PORT/admin/realms/$1/users/$2/role-mappings/clients/$3/available" \ + -H "Authorization: Bearer ${ADMIN_TOKEN}" ) + if [ $? -ne 0 ]; then return 1 fi - #__client_role_id=$(echo $__client_role_data | jq -r '.id') __client_role_id=$(echo $__client_role_data | jq -r '.[] | select(.name=="'$4'") | .id ') echo $__client_role_id return 0 @@ -269,14 +273,13 @@ __get_client_available_role_id() { __get_client_mapped_role_id() { # - __client_role_data=$(curl --proxy $KUBERNETESHOST:$KC_PROXY_PORT -s \ - -X GET \ - -H "Authorization: Bearer ${ADMIN_TOKEN}" \ - "$KC_URL/admin/realms/$1/users/$2/role-mappings/clients/$3") + + __client_role_data=$(curl -s -X GET "$KUBERNETESHOST:$KC_PROXY_PORT/admin/realms/$1/users/$2/role-mappings/clients/$3" \ + -H "Authorization: Bearer ${ADMIN_TOKEN}" ) + if [ $? -ne 0 ]; then return 1 fi - #__client_role_id=$(echo $__client_role_data | jq -r '.id') __client_role_id=$(echo $__client_role_data | jq -r '.[] | select(.name=="'$4'") | .id ') echo $__client_role_id return 0 @@ -290,26 +293,28 @@ add_client_roles_mapping() { __client=$2 __client_id=$(__get_client_id $__realm $__client) if [ $? -ne 0 ]; then - echo "Command failed" + echo "Command failed, add_client_roles_mapping, __get_client_id" exit 1 fi echo " Client id for client $__client in realm $__realm: "$__client_id | indent1 __service_account_id=$(__get_service_account_id $__realm $__client_id) if [ $? -ne 0 ]; then - echo "Command failed" + echo "Command failed, add_client_roles_mapping, __get_service_account_id" exit 1 fi echo " Service account id for client $__client in realm $__realm: "$__service_account_id | indent1 shift; shift + __cntr=0 __all_roles=$@ + while [ $# -gt 0 ]; do if [ $__cntr -eq 0 ]; then echo "[" > .jsonfile2 fi __client_role_id=$(__get_client_available_role_id $__realm $__service_account_id $__client_id $1) if [ $? -ne 0 ]; then - echo "Command failed" + echo "Command failed, add_client_roles_mapping, __get_client_available_role_id" exit 1 fi #echo "CLIENT ROLE ID $1 "$__client_role_id @@ -322,20 +327,21 @@ add_client_roles_mapping() { let __cntr=__cntr+1 shift done + echo "]" >> .jsonfile2 echo " Adding roles $__all_roles to client $__client in realm $__realm" - curl --proxy $KUBERNETESHOST:$KC_PROXY_PORT -s \ - -X POST \ - -H "Authorization: Bearer ${ADMIN_TOKEN}" \ - -H "Content-Type: application/json" \ - -d @".jsonfile2" \ - "$KC_URL/admin/realms/$__realm/users/$__service_account_id/role-mappings/clients/$__client_id" | indent2 + curl -s -X POST "$KUBERNETESHOST:$KC_PROXY_PORT/admin/realms/$__realm/users/$__service_account_id/role-mappings/clients/$__client_id" \ + -H "Authorization: Bearer ${ADMIN_TOKEN}" \ + -H "Content-Type: application/json" \ + -d @".jsonfile2" \ + | indent2 + if [ $? -ne 0 ]; then - echo "Command failed" + echo "Command failed, add_client_roles_mapping, adding roles" exit 1 fi - echo " OK" + echo " OK, add_client_roles_mapping" } @@ -348,13 +354,13 @@ remove_client_roles_mapping() { __client=$2 __client_id=$(__get_client_id $__realm $__client) if [ $? -ne 0 ]; then - echo "Command failed" + echo "Command failed, remove_client_roles_mapping, __get_client_id" exit 1 fi echo " Client id for client $__client in realm $__realm: "$__client_id | indent1 __service_account_id=$(__get_service_account_id $__realm $__client_id) if [ $? -ne 0 ]; then - echo "Command failed" + echo "Command failed, remove_client_roles_mapping, __get_service_account_id" exit 1 fi echo " Service account id for client $__client in realm $__realm: "$__service_account_id | indent1 @@ -367,7 +373,7 @@ remove_client_roles_mapping() { fi __client_role_id=$(__get_client_mapped_role_id $__realm $__service_account_id $__client_id $1) if [ $? -ne 0 ]; then - echo "Command failed" + echo "Command failed, remove_client_roles_mapping, __get_client_mapped_role_id" exit 1 fi #echo "CLIENT ROLE ID $1 "$__client_role_id @@ -383,17 +389,17 @@ remove_client_roles_mapping() { echo "]" >> .jsonfile2 echo " Removing roles $__all_roles from client $__client in realm $__realm" - curl --proxy $KUBERNETESHOST:$KC_PROXY_PORT -s \ - -X DELETE \ - -H "Authorization: Bearer ${ADMIN_TOKEN}" \ - -H "Content-Type: application/json" \ - -d @".jsonfile2" \ - "$KC_URL/admin/realms/$__realm/users/$__service_account_id/role-mappings/clients/$__client_id" | indent2 + curl -s -X DELETE "$KUBERNETESHOST:$KC_PROXY_PORT/admin/realms/$__realm/users/$__service_account_id/role-mappings/clients/$__client_id" \ + -H "Authorization: Bearer ${ADMIN_TOKEN}" \ + -H "Content-Type: application/json" \ + -d @".jsonfile2" \ + | indent2 + if [ $? -ne 0 ]; then - echo "Command failed" + echo "Command failed, remove_client_roles_mapping, delete" exit 1 fi - echo " OK" + echo " OK, remove client roles mapping" } add_client_hardcoded-claim-mapper() { @@ -427,19 +433,20 @@ add_client_hardcoded-claim-mapper() { } EOF envsubst < .jsonfile1 > .jsonfile2 - curl --proxy $KUBERNETESHOST:$KC_PROXY_PORT -s \ - -X POST \ - -H "Authorization: Bearer ${ADMIN_TOKEN}" \ - -H "Content-Type: application/json" \ - -d @".jsonfile2" \ - "$KC_URL/admin/realms/nonrtric-realm/clients/"$__client_id"/protocol-mappers/models" | indent2 + + curl -s -X POST "$KUBERNETESHOST:$KC_PROXY_PORT/admin/realms/nonrtric-realm/clients/"$__client_id"/protocol-mappers/models" \ + -H "Authorization: Bearer ${ADMIN_TOKEN}" \ + -H "Content-Type: application/json" \ + -d @".jsonfile2" \ + | indent2 + if [ $? -ne 0 ]; then - echo "Command failed" + echo "Command failed, add_client_hardcoded-claim-mapper" exit 1 fi set +x cat .jsonfile2 - echo " OK" + echo " OK, add_client_hardcoded-claim-mapper" } # Get a client token @@ -455,10 +462,9 @@ get_client_token() { fi #echo " Client id for client $__client in realm $__realm: "$__client_id | indent1 - __client_secret=$(curl --proxy $KUBERNETESHOST:$KC_PROXY_PORT -s -f \ - -X GET \ - -H "Authorization: Bearer ${ADMIN_TOKEN}" \ - "$KC_URL/admin/realms/$__realm/clients/$__client_id/client-secret") + __client_secret=$(curl -s -f -X GET "$KUBERNETESHOST:$KC_PROXY_PORT/admin/realms/$__realm/clients/$__client_id/client-secret" \ + -H "Authorization: Bearer ${ADMIN_TOKEN}" ) + if [ $? -ne 0 ]; then echo " Fatal error when getting client secret, response: "$? exit 1 @@ -466,9 +472,10 @@ get_client_token() { __client_secret=$(echo $__client_secret | jq -r .value) - __TMP_TOKEN=$(curl --proxy $KUBERNETESHOST:$KC_PROXY_PORT -f -s -X POST $KC_URL/realms/$__realm/protocol/openid-connect/token \ - -H Content-Type:application/x-www-form-urlencoded \ - -d client_id="$__client" -d client_secret="$__client_secret" -d grant_type=client_credentials) + __TMP_TOKEN=$(curl -s -f -X POST "$KUBERNETESHOST:$KC_PROXY_PORT/realms/$__realm/protocol/openid-connect/token" \ + -H Content-Type:application/x-www-form-urlencoded \ + -d client_id="$__client" -d client_secret="$__client_secret" -d grant_type=client_credentials) + if [ $? -ne 0 ]; then echo " Fatal error when getting client token, response: "$? exit 1 -- 2.16.6 From 0f61d072cc9813e1890f6b28c3b06c3c470f6b7a Mon Sep 17 00:00:00 2001 From: ambrishest Date: Wed, 20 Sep 2023 13:03:50 +0100 Subject: [PATCH 04/16] Improve code coverage for PM File Converter (Go) Issue-ID: NONRTRIC-879 Change-Id: I0c7df26cf1fb087ffc3f01f055d3e86671553433 Signed-off-by: ambrishest --- pm-file-converter/common/utils/utils.go | 5 +- pm-file-converter/common/utils/utils_test.go | 30 + .../components/kafkacollector/kafkacollector.go | 10 +- .../miniocollector/minio_upload_test.json | 12701 +++++++++++++++++++ .../components/miniocollector/miniocollector.go | 14 +- .../miniocollector/miniocollector_test.go | 175 + .../components/xmltransform/xmltransform.go | 1 + pm-file-converter/go.mod | 42 +- pm-file-converter/go.sum | 102 +- sonar-project.properties | 6 + 10 files changed, 12990 insertions(+), 96 deletions(-) create mode 100644 pm-file-converter/common/utils/utils_test.go create mode 100644 pm-file-converter/components/miniocollector/minio_upload_test.json create mode 100644 pm-file-converter/components/miniocollector/miniocollector_test.go create mode 100644 sonar-project.properties diff --git a/pm-file-converter/common/utils/utils.go b/pm-file-converter/common/utils/utils.go index 5466d2c..dccf3c5 100644 --- a/pm-file-converter/common/utils/utils.go +++ b/pm-file-converter/common/utils/utils.go @@ -21,14 +21,17 @@ package utils import ( "bytes" - log "github.com/sirupsen/logrus" "main/components/kafkacollector" "net/http" + + log "github.com/sirupsen/logrus" ) var httpclient = &http.Client{} // Send a http request with json (json may be nil) +// +//lint:ignore S100 func Send_http_request(json []byte, method string, url string, retry bool, useAuth bool) bool { // set the HTTP method, url, and request body diff --git a/pm-file-converter/common/utils/utils_test.go b/pm-file-converter/common/utils/utils_test.go new file mode 100644 index 0000000..2cf3f1f --- /dev/null +++ b/pm-file-converter/common/utils/utils_test.go @@ -0,0 +1,30 @@ +package utils + +import ( + "github.com/stretchr/testify/assert" + "testing" +) + +func TestSend_http_request(t *testing.T) { + type testCase struct { + Name string + + Json []byte + Method string + Url string + Retry bool + UseAuth bool + + ExpectedBool bool + } + + validate := func(t *testing.T, tc *testCase) { + t.Run(tc.Name, func(t *testing.T) { + actualBool := Send_http_request(tc.Json, tc.Method, tc.Url, tc.Retry, tc.UseAuth) + + assert.Equal(t, tc.ExpectedBool, actualBool) + }) + } + + validate(t, &testCase{}) +} diff --git a/pm-file-converter/components/kafkacollector/kafkacollector.go b/pm-file-converter/components/kafkacollector/kafkacollector.go index d70114c..7451dd2 100644 --- a/pm-file-converter/components/kafkacollector/kafkacollector.go +++ b/pm-file-converter/components/kafkacollector/kafkacollector.go @@ -22,14 +22,15 @@ package kafkacollector import ( "context" "fmt" + "main/common/dataTypes" + "main/components/miniocollector" + "os" + "time" + "github.com/confluentinc/confluent-kafka-go/kafka" jsoniter "github.com/json-iterator/go" log "github.com/sirupsen/logrus" "golang.org/x/oauth2/clientcredentials" - "main/common/dataTypes" - "main/components/miniocollector" - "os" - "time" ) var creds_grant_type = os.Getenv("CREDS_GRANT_TYPE") @@ -42,6 +43,7 @@ var creds_service_url = os.Getenv("AUTH_SERVICE_URL") const parallelism_limiter = 100 //For all jobs var jobLimiterChan = make(chan struct{}, parallelism_limiter) +// noinspection GoCognitiveComplexity func Start_topic_reader(topic string, type_id string, control_ch chan dataTypes.ReaderControl, data_ch chan *dataTypes.KafkaPayload, gid string, cid string) { log.Info("Topic reader starting, topic: ", topic, " for type: ", type_id) diff --git a/pm-file-converter/components/miniocollector/minio_upload_test.json b/pm-file-converter/components/miniocollector/minio_upload_test.json new file mode 100644 index 0000000..5131c75 --- /dev/null +++ b/pm-file-converter/components/miniocollector/minio_upload_test.json @@ -0,0 +1,12701 @@ +{ + "event": { + "commonEventHeader": { + "domain": "", + "eventId": "", + "sequence": 0, + "eventName": "", + "sourceName": "GNODEB-0", + "reportingEntityName": "", + "priority": "", + "startEpochMicrosec": 0, + "lastEpochMicrosec": 0, + "version": "", + "vesEventListenerVersion": "", + "timeZoneOffset": "+05:00" + }, + "perf3gppFields": { + "perf3gppFieldsVersion": "1.0", + "measDataCollection": { + "granularityPeriod": 900, + "measuredEntityUserName": "", + "measuredEntityDn": "GNODEB-0", + "measuredEntitySoftwareVersion": "ABC2001155_1 X12Y34", + "measInfoList": [ + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=NRCellCU_GNBCUCP" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber0", + "pmCounterNumber1", + "pmCounterNumber2", + "pmCounterNumber3", + "pmCounterNumber4", + "pmCounterNumber5", + "pmCounterNumber6", + "pmCounterNumber7", + "pmCounterNumber8", + "pmCounterNumber9", + "pmCounterNumber10", + "pmCounterNumber11", + "pmCounterNumber12", + "pmCounterNumber13", + "pmCounterNumber14", + "pmCounterNumber15", + "pmCounterNumber16", + "pmCounterNumber17", + "pmCounterNumber18", + "pmCounterNumber19", + "pmCounterNumber20", + "pmCounterNumber21", + "pmCounterNumber22", + "pmCounterNumber23", + "pmCounterNumber24", + "pmCounterNumber25", + "pmCounterNumber26", + "pmCounterNumber27", + "pmCounterNumber28", + "pmCounterNumber29", + "pmCounterNumber30", + "pmCounterNumber31", + "pmCounterNumber32", + "pmCounterNumber33", + "pmCounterNumber34", + "pmCounterNumber35", + "pmCounterNumber36", + "pmCounterNumber37", + "pmCounterNumber38", + "pmCounterNumber39", + "pmCounterNumber40", + "pmCounterNumber41", + "pmCounterNumber42", + "pmCounterNumber43", + "pmCounterNumber44", + "pmCounterNumber45", + "pmCounterNumber46", + "pmCounterNumber47", + "pmCounterNumber48", + "pmCounterNumber49", + "pmCounterNumber50", + "pmCounterNumber51", + "pmCounterNumber51Act", + "pmCounterNumber53", + "pmCounterNumber53Act", + "pmCounterNumber55", + "pmCounterNumber56", + "pmCounterNumber57", + "pmCounterNumber58", + "pmCounterNumber59", + "pmCounterNumber60", + "pmCounterNumber60IntgProt64kbps", + "pmCounterNumber62", + "pmCounterNumber63", + "pmCounterNumber64", + "pmCounterNumber65", + "pmCounterNumber66", + "pmCounterNumber67", + "pmCounterNumber68", + "pmCounterNumber69", + "pmCounterNumber70", + "pmCounterNumber71", + "pmCounterNumber72", + "pmCounterNumber73", + "pmCounterNumber74", + "pmCounterNumber75", + "pmCounterNumber76", + "pmCounterNumber77", + "pmCounterNumber78", + "pmCounterNumber79", + "pmCounterNumber80", + "pmCounterNumber81", + "pmCounterNumber82", + "pmCounterNumber83", + "pmCounterNumber84", + "pmCounterNumber84Em", + "pmCounterNumber84EmFbInd", + "pmCounterNumber87", + "pmCounterNumber88", + "pmCounterNumber89", + "pmCounterNumber90", + "pmCounterNumber91" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBCUCPFunction=1,NRCellCU=32", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0" + }, + { + "p": 20, + "sValue": "0" + }, + { + "p": 21, + "sValue": "0" + }, + { + "p": 22, + "sValue": "0" + }, + { + "p": 23, + "sValue": "0" + }, + { + "p": 24, + "sValue": "0" + }, + { + "p": 25, + "sValue": "0" + }, + { + "p": 26, + "sValue": "0" + }, + { + "p": 27, + "sValue": "0" + }, + { + "p": 28, + "sValue": "0" + }, + { + "p": 29, + "sValue": "0" + }, + { + "p": 30, + "sValue": "0" + }, + { + "p": 31, + "sValue": "0" + }, + { + "p": 32, + "sValue": "0" + }, + { + "p": 33, + "sValue": "0" + }, + { + "p": 34, + "sValue": "0" + }, + { + "p": 35, + "sValue": "0" + }, + { + "p": 36, + "sValue": "0" + }, + { + "p": 37, + "sValue": "0" + }, + { + "p": 38, + "sValue": "0" + }, + { + "p": 39, + "sValue": "0" + }, + { + "p": 40, + "sValue": "0" + }, + { + "p": 41, + "sValue": "0" + }, + { + "p": 42, + "sValue": "0" + }, + { + "p": 43, + "sValue": "0" + }, + { + "p": 44, + "sValue": "0" + }, + { + "p": 45, + "sValue": "0" + }, + { + "p": 46, + "sValue": "0" + }, + { + "p": 47, + "sValue": "0" + }, + { + "p": 48, + "sValue": "0" + }, + { + "p": 49, + "sValue": "0" + }, + { + "p": 50, + "sValue": "0" + }, + { + "p": 51, + "sValue": "0" + }, + { + "p": 52, + "sValue": "0" + }, + { + "p": 53, + "sValue": "0" + }, + { + "p": 54, + "sValue": "0" + }, + { + "p": 55, + "sValue": "0" + }, + { + "p": 56, + "sValue": "0" + }, + { + "p": 57, + "sValue": "0" + }, + { + "p": 58, + "sValue": "0" + }, + { + "p": 59, + "sValue": "0" + }, + { + "p": 60, + "sValue": "0" + }, + { + "p": 61, + "sValue": "0" + }, + { + "p": 62, + "sValue": "0" + }, + { + "p": 63, + "sValue": "0" + }, + { + "p": 64, + "sValue": "0" + }, + { + "p": 65, + "sValue": "0" + }, + { + "p": 66, + "sValue": "0" + }, + { + "p": 67, + "sValue": "0" + }, + { + "p": 68, + "sValue": "0" + }, + { + "p": 69, + "sValue": "0" + }, + { + "p": 70, + "sValue": "0" + }, + { + "p": 71, + "sValue": "0" + }, + { + "p": 72, + "sValue": "0" + }, + { + "p": 73, + "sValue": "0" + }, + { + "p": 74, + "sValue": "0" + }, + { + "p": 75, + "sValue": "0" + }, + { + "p": 76, + "sValue": "0" + }, + { + "p": 77, + "sValue": "0" + }, + { + "p": 78, + "sValue": "0" + }, + { + "p": 79, + "sValue": "0" + }, + { + "p": 80, + "sValue": "0" + }, + { + "p": 81, + "sValue": "0" + }, + { + "p": 82, + "sValue": "0" + }, + { + "p": 83, + "sValue": "0" + }, + { + "p": 84, + "sValue": "0" + }, + { + "p": 85, + "sValue": "0" + }, + { + "p": 86, + "sValue": "0" + }, + { + "p": 87, + "sValue": "0" + }, + { + "p": 88, + "sValue": "0" + }, + { + "p": 89, + "sValue": "0" + }, + { + "p": 90, + "sValue": "0" + }, + { + "p": 91, + "sValue": "0" + }, + { + "p": 92, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBCUCPFunction=1,NRCellCU=31", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0" + }, + { + "p": 20, + "sValue": "0" + }, + { + "p": 21, + "sValue": "0" + }, + { + "p": 22, + "sValue": "0" + }, + { + "p": 23, + "sValue": "0" + }, + { + "p": 24, + "sValue": "0" + }, + { + "p": 25, + "sValue": "0" + }, + { + "p": 26, + "sValue": "0" + }, + { + "p": 27, + "sValue": "0" + }, + { + "p": 28, + "sValue": "0" + }, + { + "p": 29, + "sValue": "0" + }, + { + "p": 30, + "sValue": "0" + }, + { + "p": 31, + "sValue": "0" + }, + { + "p": 32, + "sValue": "0" + }, + { + "p": 33, + "sValue": "0" + }, + { + "p": 34, + "sValue": "0" + }, + { + "p": 35, + "sValue": "0" + }, + { + "p": 36, + "sValue": "0" + }, + { + "p": 37, + "sValue": "0" + }, + { + "p": 38, + "sValue": "0" + }, + { + "p": 39, + "sValue": "0" + }, + { + "p": 40, + "sValue": "0" + }, + { + "p": 41, + "sValue": "0" + }, + { + "p": 42, + "sValue": "0" + }, + { + "p": 43, + "sValue": "0" + }, + { + "p": 44, + "sValue": "0" + }, + { + "p": 45, + "sValue": "0" + }, + { + "p": 46, + "sValue": "0" + }, + { + "p": 47, + "sValue": "0" + }, + { + "p": 48, + "sValue": "0" + }, + { + "p": 49, + "sValue": "0" + }, + { + "p": 50, + "sValue": "0" + }, + { + "p": 51, + "sValue": "0" + }, + { + "p": 52, + "sValue": "0" + }, + { + "p": 53, + "sValue": "0" + }, + { + "p": 54, + "sValue": "0" + }, + { + "p": 55, + "sValue": "0" + }, + { + "p": 56, + "sValue": "0" + }, + { + "p": 57, + "sValue": "0" + }, + { + "p": 58, + "sValue": "0" + }, + { + "p": 59, + "sValue": "0" + }, + { + "p": 60, + "sValue": "0" + }, + { + "p": 61, + "sValue": "0" + }, + { + "p": 62, + "sValue": "0" + }, + { + "p": 63, + "sValue": "0" + }, + { + "p": 64, + "sValue": "0" + }, + { + "p": 65, + "sValue": "0" + }, + { + "p": 66, + "sValue": "0" + }, + { + "p": 67, + "sValue": "0" + }, + { + "p": 68, + "sValue": "0" + }, + { + "p": 69, + "sValue": "0" + }, + { + "p": 70, + "sValue": "0" + }, + { + "p": 71, + "sValue": "0" + }, + { + "p": 72, + "sValue": "0" + }, + { + "p": 73, + "sValue": "0" + }, + { + "p": 74, + "sValue": "0" + }, + { + "p": 75, + "sValue": "0" + }, + { + "p": 76, + "sValue": "0" + }, + { + "p": 77, + "sValue": "0" + }, + { + "p": 78, + "sValue": "0" + }, + { + "p": 79, + "sValue": "0" + }, + { + "p": 80, + "sValue": "0" + }, + { + "p": 81, + "sValue": "0" + }, + { + "p": 82, + "sValue": "0" + }, + { + "p": 83, + "sValue": "0" + }, + { + "p": 84, + "sValue": "0" + }, + { + "p": 85, + "sValue": "0" + }, + { + "p": 86, + "sValue": "0" + }, + { + "p": 87, + "sValue": "0" + }, + { + "p": 88, + "sValue": "0" + }, + { + "p": 89, + "sValue": "0" + }, + { + "p": 90, + "sValue": "0" + }, + { + "p": 91, + "sValue": "0" + }, + { + "p": 92, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBCUCPFunction=1,NRCellCU=2", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0" + }, + { + "p": 20, + "sValue": "0" + }, + { + "p": 21, + "sValue": "0" + }, + { + "p": 22, + "sValue": "0" + }, + { + "p": 23, + "sValue": "0" + }, + { + "p": 24, + "sValue": "0" + }, + { + "p": 25, + "sValue": "0" + }, + { + "p": 26, + "sValue": "0" + }, + { + "p": 27, + "sValue": "0" + }, + { + "p": 28, + "sValue": "0" + }, + { + "p": 29, + "sValue": "0" + }, + { + "p": 30, + "sValue": "0" + }, + { + "p": 31, + "sValue": "0" + }, + { + "p": 32, + "sValue": "0" + }, + { + "p": 33, + "sValue": "0" + }, + { + "p": 34, + "sValue": "0" + }, + { + "p": 35, + "sValue": "0" + }, + { + "p": 36, + "sValue": "0" + }, + { + "p": 37, + "sValue": "0" + }, + { + "p": 38, + "sValue": "0" + }, + { + "p": 39, + "sValue": "0" + }, + { + "p": 40, + "sValue": "0" + }, + { + "p": 41, + "sValue": "0" + }, + { + "p": 42, + "sValue": "0" + }, + { + "p": 43, + "sValue": "0" + }, + { + "p": 44, + "sValue": "0" + }, + { + "p": 45, + "sValue": "0" + }, + { + "p": 46, + "sValue": "0" + }, + { + "p": 47, + "sValue": "0" + }, + { + "p": 48, + "sValue": "0" + }, + { + "p": 49, + "sValue": "0" + }, + { + "p": 50, + "sValue": "0" + }, + { + "p": 51, + "sValue": "0" + }, + { + "p": 52, + "sValue": "0" + }, + { + "p": 53, + "sValue": "0" + }, + { + "p": 54, + "sValue": "0" + }, + { + "p": 55, + "sValue": "0" + }, + { + "p": 56, + "sValue": "0" + }, + { + "p": 57, + "sValue": "0" + }, + { + "p": 58, + "sValue": "0" + }, + { + "p": 59, + "sValue": "0" + }, + { + "p": 60, + "sValue": "0" + }, + { + "p": 61, + "sValue": "0" + }, + { + "p": 62, + "sValue": "0" + }, + { + "p": 63, + "sValue": "0" + }, + { + "p": 64, + "sValue": "0" + }, + { + "p": 65, + "sValue": "0" + }, + { + "p": 66, + "sValue": "0" + }, + { + "p": 67, + "sValue": "0" + }, + { + "p": 68, + "sValue": "0" + }, + { + "p": 69, + "sValue": "0" + }, + { + "p": 70, + "sValue": "0" + }, + { + "p": 71, + "sValue": "0" + }, + { + "p": 72, + "sValue": "0" + }, + { + "p": 73, + "sValue": "0" + }, + { + "p": 74, + "sValue": "0" + }, + { + "p": 75, + "sValue": "0" + }, + { + "p": 76, + "sValue": "0" + }, + { + "p": 77, + "sValue": "0" + }, + { + "p": 78, + "sValue": "0" + }, + { + "p": 79, + "sValue": "0" + }, + { + "p": 80, + "sValue": "0" + }, + { + "p": 81, + "sValue": "0" + }, + { + "p": 82, + "sValue": "0" + }, + { + "p": 83, + "sValue": "0" + }, + { + "p": 84, + "sValue": "0" + }, + { + "p": 85, + "sValue": "0" + }, + { + "p": 86, + "sValue": "0" + }, + { + "p": 87, + "sValue": "0" + }, + { + "p": 88, + "sValue": "0" + }, + { + "p": 89, + "sValue": "0" + }, + { + "p": 90, + "sValue": "0" + }, + { + "p": 91, + "sValue": "0" + }, + { + "p": 92, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBCUCPFunction=1,NRCellCU=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0" + }, + { + "p": 20, + "sValue": "0" + }, + { + "p": 21, + "sValue": "0" + }, + { + "p": 22, + "sValue": "0" + }, + { + "p": 23, + "sValue": "0" + }, + { + "p": 24, + "sValue": "0" + }, + { + "p": 25, + "sValue": "0" + }, + { + "p": 26, + "sValue": "0" + }, + { + "p": 27, + "sValue": "0" + }, + { + "p": 28, + "sValue": "0" + }, + { + "p": 29, + "sValue": "0" + }, + { + "p": 30, + "sValue": "0" + }, + { + "p": 31, + "sValue": "0" + }, + { + "p": 32, + "sValue": "0" + }, + { + "p": 33, + "sValue": "0" + }, + { + "p": 34, + "sValue": "0" + }, + { + "p": 35, + "sValue": "0" + }, + { + "p": 36, + "sValue": "0" + }, + { + "p": 37, + "sValue": "0" + }, + { + "p": 38, + "sValue": "0" + }, + { + "p": 39, + "sValue": "0" + }, + { + "p": 40, + "sValue": "0" + }, + { + "p": 41, + "sValue": "0" + }, + { + "p": 42, + "sValue": "0" + }, + { + "p": 43, + "sValue": "0" + }, + { + "p": 44, + "sValue": "0" + }, + { + "p": 45, + "sValue": "0" + }, + { + "p": 46, + "sValue": "0" + }, + { + "p": 47, + "sValue": "0" + }, + { + "p": 48, + "sValue": "0" + }, + { + "p": 49, + "sValue": "0" + }, + { + "p": 50, + "sValue": "0" + }, + { + "p": 51, + "sValue": "0" + }, + { + "p": 52, + "sValue": "0" + }, + { + "p": 53, + "sValue": "0" + }, + { + "p": 54, + "sValue": "0" + }, + { + "p": 55, + "sValue": "0" + }, + { + "p": 56, + "sValue": "0" + }, + { + "p": 57, + "sValue": "0" + }, + { + "p": 58, + "sValue": "0" + }, + { + "p": 59, + "sValue": "0" + }, + { + "p": 60, + "sValue": "0" + }, + { + "p": 61, + "sValue": "0" + }, + { + "p": 62, + "sValue": "0" + }, + { + "p": 63, + "sValue": "0" + }, + { + "p": 64, + "sValue": "0" + }, + { + "p": 65, + "sValue": "0" + }, + { + "p": 66, + "sValue": "0" + }, + { + "p": 67, + "sValue": "0" + }, + { + "p": 68, + "sValue": "0" + }, + { + "p": 69, + "sValue": "0" + }, + { + "p": 70, + "sValue": "0" + }, + { + "p": 71, + "sValue": "0" + }, + { + "p": 72, + "sValue": "0" + }, + { + "p": 73, + "sValue": "0" + }, + { + "p": 74, + "sValue": "0" + }, + { + "p": 75, + "sValue": "0" + }, + { + "p": 76, + "sValue": "0" + }, + { + "p": 77, + "sValue": "0" + }, + { + "p": 78, + "sValue": "0" + }, + { + "p": 79, + "sValue": "0" + }, + { + "p": 80, + "sValue": "0" + }, + { + "p": 81, + "sValue": "0" + }, + { + "p": 82, + "sValue": "0" + }, + { + "p": 83, + "sValue": "0" + }, + { + "p": 84, + "sValue": "0" + }, + { + "p": 85, + "sValue": "0" + }, + { + "p": 86, + "sValue": "0" + }, + { + "p": 87, + "sValue": "0" + }, + { + "p": 88, + "sValue": "0" + }, + { + "p": 89, + "sValue": "0" + }, + { + "p": 90, + "sValue": "0" + }, + { + "p": 91, + "sValue": "0" + }, + { + "p": 92, + "sValue": "0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=NRCellDU_GNBDU" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber92", + "pmCounterNumber93", + "pmCounterNumber94", + "pmCounterNumber95", + "pmCounterNumber96", + "pmCounterNumber97", + "pmCounterNumber98", + "pmCounterNumber99", + "pmCounterNumber100", + "pmCounterNumber101", + "pmCounterNumber102", + "pmCounterNumber103", + "pmCounterNumber104", + "pmCounterNumber105", + "pmCounterNumber106", + "pmCounterNumber107", + "pmCounterNumber108", + "pmCounterNumber108Init", + "pmCounterNumber110", + "pmCounterNumber110Init", + "pmCounterNumber112", + "pmCounterNumber112Init", + "pmCounterNumber114", + "pmCounterNumber114Init", + "pmCounterNumber116", + "pmCounterNumber116Init", + "pmCounterNumber118", + "pmCounterNumber118Init", + "pmCounterNumber120", + "pmCounterNumber120Init", + "pmCounterNumber122", + "pmCounterNumber122Init", + "pmCounterNumber124", + "pmCounterNumber125", + "pmCounterNumber125Init", + "pmCounterNumber127", + "pmCounterNumber127Init", + "pmCounterNumber129", + "pmCounterNumber129Init", + "pmCounterNumber131", + "pmCounterNumber131Init", + "pmCounterNumber133", + "pmCounterNumber133Init", + "pmCounterNumber135", + "pmCounterNumber135Init", + "pmCounterNumber137", + "pmCounterNumber137Init", + "pmCounterNumber139", + "pmCounterNumber139Init", + "pmCounterNumber141", + "pmCounterNumber141Init", + "pmCounterNumber143", + "pmCounterNumber143Init", + "pmCounterNumber145", + "pmCounterNumber145Init", + "pmCounterNumber147", + "pmCounterNumber147Init", + "pmCounterNumber149", + "pmCounterNumber150", + "pmCounterNumber150Init", + "pmCounterNumber152", + "pmCounterNumber152Init", + "pmCounterNumber154", + "pmCounterNumber154Init", + "pmCounterNumber156", + "pmCounterNumber156Init", + "pmCounterNumber158", + "pmCounterNumber158Ext", + "pmCounterNumber160", + "pmCounterNumber161", + "pmCounterNumber162", + "pmCounterNumber163", + "pmCounterNumber164", + "pmCounterNumber165", + "pmCounterNumber166", + "pmCounterNumber1666", + "pmCounterNumber168", + "pmCounterNumber169", + "pmCounterNumber170", + "pmCounterNumber171", + "pmCounterNumber172", + "pmCounterNumber173", + "pmCounterNumber174", + "pmCounterNumber175", + "pmCounterNumber176", + "pmCounterNumber177", + "pmCounterNumber178", + "pmCounterNumber179", + "pmCounterNumber180", + "pmCounterNumber181", + "pmCounterNumber182", + "pmCounterNumber183", + "pmCounterNumber184", + "pmCounterNumber185", + "pmCounterNumber185Qos", + "pmCounterNumber185Samp", + "pmCounterNumber185SampQos", + "pmCounterNumber189", + "pmCounterNumber189Qos", + "pmCounterNumber191", + "pmCounterNumber191Qos", + "pmCounterNumber193", + "pmCounterNumber193Samp", + "pmCounterNumber195", + "pmCounterNumber195Ext", + "pmCounterNumber197", + "pmCounterNumber198", + "pmCounterNumber199", + "pmCounterNumber200", + "pmCounterNumber200BsrGrant", + "pmCounterNumber200PreemptGrant", + "pmCounterNumber200PucchSrGrant", + "pmCounterNumber204", + "pmCounterNumber205", + "pmCounterNumber206", + "pmCounterNumber207", + "pmCounterNumber208", + "pmCounterNumber209", + "pmCounterNumber210", + "pmCounterNumber211", + "pmCounterNumber212", + "pmCounterNumber213", + "pmCounterNumber214", + "pmCounterNumber215", + "pmCounterNumber216", + "pmCounterNumber216MacCe", + "pmCounterNumber218", + "pmCounterNumber219", + "pmCounterNumber220", + "pmCounterNumber221", + "pmCounterNumber222", + "pmCounterNumber223", + "pmCounterNumber224", + "pmCounterNumber225", + "pmCounterNumber226", + "pmCounterNumber227", + "pmCounterNumber228", + "pmCounterNumber228Forced", + "pmCounterNumber230", + "pmCounterNumber231", + "pmCounterNumber232", + "pmCounterNumber233", + "pmCounterNumber234", + "pmCounterNumber235", + "pmCounterNumber236", + "pmCounterNumber237", + "pmCounterNumber238", + "pmCounterNumber239", + "pmCounterNumber240", + "pmCounterNumber241", + "pmCounterNumber242", + "pmCounterNumber243", + "pmCounterNumber244", + "pmCounterNumber245", + "pmCounterNumber246", + "pmCounterNumber247", + "pmCounterNumber248", + "pmCounterNumber249", + "pmCounterNumber250", + "pmCounterNumber251", + "pmCounterNumber252", + "pmCounterNumber252Qos", + "pmCounterNumber254", + "pmCounterNumber254Qos" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBDUFunction=1,NRCellDU=32", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 7, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 8, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 9, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 10, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 11, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 12, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 13, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 14, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0" + }, + { + "p": 20, + "sValue": "0" + }, + { + "p": 21, + "sValue": "0" + }, + { + "p": 22, + "sValue": "0" + }, + { + "p": 23, + "sValue": "0" + }, + { + "p": 24, + "sValue": "0" + }, + { + "p": 25, + "sValue": "0" + }, + { + "p": 26, + "sValue": "0" + }, + { + "p": 27, + "sValue": "0" + }, + { + "p": 28, + "sValue": "0" + }, + { + "p": 29, + "sValue": "0" + }, + { + "p": 30, + "sValue": "0" + }, + { + "p": 31, + "sValue": "0" + }, + { + "p": 32, + "sValue": "0" + }, + { + "p": 33, + "sValue": "0" + }, + { + "p": 34, + "sValue": "0" + }, + { + "p": 35, + "sValue": "0" + }, + { + "p": 36, + "sValue": "0" + }, + { + "p": 37, + "sValue": "0" + }, + { + "p": 38, + "sValue": "0" + }, + { + "p": 39, + "sValue": "0" + }, + { + "p": 40, + "sValue": "0" + }, + { + "p": 41, + "sValue": "0" + }, + { + "p": 42, + "sValue": "0" + }, + { + "p": 43, + "sValue": "0" + }, + { + "p": 44, + "sValue": "0" + }, + { + "p": 45, + "sValue": "0" + }, + { + "p": 46, + "sValue": "0" + }, + { + "p": 47, + "sValue": "0" + }, + { + "p": 48, + "sValue": "0" + }, + { + "p": 49, + "sValue": "0" + }, + { + "p": 50, + "sValue": "0" + }, + { + "p": 51, + "sValue": "0" + }, + { + "p": 52, + "sValue": "0" + }, + { + "p": 53, + "sValue": "0" + }, + { + "p": 54, + "sValue": "0" + }, + { + "p": 55, + "sValue": "0" + }, + { + "p": 56, + "sValue": "0" + }, + { + "p": 57, + "sValue": "0" + }, + { + "p": 58, + "sValue": "0" + }, + { + "p": 59, + "sValue": "0" + }, + { + "p": 60, + "sValue": "0" + }, + { + "p": 61, + "sValue": "0" + }, + { + "p": 62, + "sValue": "0" + }, + { + "p": 63, + "sValue": "0" + }, + { + "p": 64, + "sValue": "0" + }, + { + "p": 65, + "sValue": "0" + }, + { + "p": 66, + "sValue": "0" + }, + { + "p": 67, + "sValue": "0" + }, + { + "p": 68, + "sValue": "0" + }, + { + "p": 69, + "sValue": "0" + }, + { + "p": 70, + "sValue": "0" + }, + { + "p": 71, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 72, + "sValue": "0" + }, + { + "p": 73, + "sValue": "0" + }, + { + "p": 74, + "sValue": "0" + }, + { + "p": 75, + "sValue": "0" + }, + { + "p": 76, + "sValue": "0" + }, + { + "p": 77, + "sValue": "0" + }, + { + "p": 78, + "sValue": "0" + }, + { + "p": 79, + "sValue": "0" + }, + { + "p": 80, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 81, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 82, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 83, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 84, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 85, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 86, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 87, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 88, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 89, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 90, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 91, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 92, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 93, + "sValue": "0" + }, + { + "p": 94, + "sValue": "0" + }, + { + "p": 95, + "sValue": "0" + }, + { + "p": 96, + "sValue": "0" + }, + { + "p": 97, + "sValue": "0" + }, + { + "p": 98, + "sValue": "0" + }, + { + "p": 99, + "sValue": "0" + }, + { + "p": 100, + "sValue": "0" + }, + { + "p": 101, + "sValue": "0" + }, + { + "p": 102, + "sValue": "0" + }, + { + "p": 103, + "sValue": "0" + }, + { + "p": 104, + "sValue": "0" + }, + { + "p": 105, + "sValue": "0" + }, + { + "p": 106, + "sValue": "0" + }, + { + "p": 107, + "sValue": "0" + }, + { + "p": 108, + "sValue": "0" + }, + { + "p": 109, + "sValue": "0" + }, + { + "p": 110, + "sValue": "0" + }, + { + "p": 111, + "sValue": "0" + }, + { + "p": 112, + "sValue": "0" + }, + { + "p": 113, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 114, + "sValue": "0" + }, + { + "p": 115, + "sValue": "0" + }, + { + "p": 116, + "sValue": "0" + }, + { + "p": 117, + "sValue": "0" + }, + { + "p": 118, + "sValue": "0" + }, + { + "p": 119, + "sValue": "0,0,0,0" + }, + { + "p": 120, + "sValue": "0,0,0,0" + }, + { + "p": 121, + "sValue": "0" + }, + { + "p": 122, + "sValue": "0" + }, + { + "p": 123, + "sValue": "0" + }, + { + "p": 124, + "sValue": "0" + }, + { + "p": 125, + "sValue": "0" + }, + { + "p": 126, + "sValue": "0" + }, + { + "p": 127, + "sValue": "0" + }, + { + "p": 128, + "sValue": "0" + }, + { + "p": 129, + "sValue": "0" + }, + { + "p": 130, + "sValue": "0" + }, + { + "p": 131, + "sValue": "0" + }, + { + "p": 132, + "sValue": "0" + }, + { + "p": 133, + "sValue": "0" + }, + { + "p": 134, + "sValue": "0,0,0,0,0" + }, + { + "p": 135, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 136, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 137, + "sValue": "0" + }, + { + "p": 138, + "sValue": "0" + }, + { + "p": 139, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 140, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 141, + "sValue": "0" + }, + { + "p": 142, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 143, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 144, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 145, + "sValue": "0" + }, + { + "p": 146, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 147, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 148, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 149, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 150, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 151, + "sValue": "0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 152, + "sValue": "0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 153, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 154, + "sValue": "0" + }, + { + "p": 155, + "sValue": "0" + }, + { + "p": 156, + "sValue": "0" + }, + { + "p": 157, + "sValue": "0" + }, + { + "p": 158, + "sValue": "0" + }, + { + "p": 159, + "sValue": "0" + }, + { + "p": 160, + "sValue": "0" + }, + { + "p": 161, + "sValue": "0" + }, + { + "p": 162, + "sValue": "0" + }, + { + "p": 163, + "sValue": "0" + }, + { + "p": 164, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBDUFunction=1,NRCellDU=31", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 7, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 8, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 9, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 10, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 11, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 12, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 13, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 14, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0" + }, + { + "p": 20, + "sValue": "0" + }, + { + "p": 21, + "sValue": "0" + }, + { + "p": 22, + "sValue": "0" + }, + { + "p": 23, + "sValue": "0" + }, + { + "p": 24, + "sValue": "0" + }, + { + "p": 25, + "sValue": "0" + }, + { + "p": 26, + "sValue": "0" + }, + { + "p": 27, + "sValue": "0" + }, + { + "p": 28, + "sValue": "0" + }, + { + "p": 29, + "sValue": "0" + }, + { + "p": 30, + "sValue": "0" + }, + { + "p": 31, + "sValue": "0" + }, + { + "p": 32, + "sValue": "0" + }, + { + "p": 33, + "sValue": "0" + }, + { + "p": 34, + "sValue": "0" + }, + { + "p": 35, + "sValue": "0" + }, + { + "p": 36, + "sValue": "0" + }, + { + "p": 37, + "sValue": "0" + }, + { + "p": 38, + "sValue": "0" + }, + { + "p": 39, + "sValue": "0" + }, + { + "p": 40, + "sValue": "0" + }, + { + "p": 41, + "sValue": "0" + }, + { + "p": 42, + "sValue": "0" + }, + { + "p": 43, + "sValue": "0" + }, + { + "p": 44, + "sValue": "0" + }, + { + "p": 45, + "sValue": "0" + }, + { + "p": 46, + "sValue": "0" + }, + { + "p": 47, + "sValue": "0" + }, + { + "p": 48, + "sValue": "0" + }, + { + "p": 49, + "sValue": "0" + }, + { + "p": 50, + "sValue": "0" + }, + { + "p": 51, + "sValue": "0" + }, + { + "p": 52, + "sValue": "0" + }, + { + "p": 53, + "sValue": "0" + }, + { + "p": 54, + "sValue": "0" + }, + { + "p": 55, + "sValue": "0" + }, + { + "p": 56, + "sValue": "0" + }, + { + "p": 57, + "sValue": "0" + }, + { + "p": 58, + "sValue": "0" + }, + { + "p": 59, + "sValue": "0" + }, + { + "p": 60, + "sValue": "0" + }, + { + "p": 61, + "sValue": "0" + }, + { + "p": 62, + "sValue": "0" + }, + { + "p": 63, + "sValue": "0" + }, + { + "p": 64, + "sValue": "0" + }, + { + "p": 65, + "sValue": "0" + }, + { + "p": 66, + "sValue": "0" + }, + { + "p": 67, + "sValue": "0" + }, + { + "p": 68, + "sValue": "0" + }, + { + "p": 69, + "sValue": "0" + }, + { + "p": 70, + "sValue": "0" + }, + { + "p": 71, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 72, + "sValue": "0" + }, + { + "p": 73, + "sValue": "0" + }, + { + "p": 74, + "sValue": "0" + }, + { + "p": 75, + "sValue": "0" + }, + { + "p": 76, + "sValue": "0" + }, + { + "p": 77, + "sValue": "0" + }, + { + "p": 78, + "sValue": "0" + }, + { + "p": 79, + "sValue": "0" + }, + { + "p": 80, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 81, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 82, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 83, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 84, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 85, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 86, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 87, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 88, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 89, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 90, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 91, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 92, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 93, + "sValue": "0" + }, + { + "p": 94, + "sValue": "0" + }, + { + "p": 95, + "sValue": "0" + }, + { + "p": 96, + "sValue": "0" + }, + { + "p": 97, + "sValue": "0" + }, + { + "p": 98, + "sValue": "0" + }, + { + "p": 99, + "sValue": "0" + }, + { + "p": 100, + "sValue": "0" + }, + { + "p": 101, + "sValue": "0" + }, + { + "p": 102, + "sValue": "0" + }, + { + "p": 103, + "sValue": "0" + }, + { + "p": 104, + "sValue": "0" + }, + { + "p": 105, + "sValue": "0" + }, + { + "p": 106, + "sValue": "0" + }, + { + "p": 107, + "sValue": "0" + }, + { + "p": 108, + "sValue": "0" + }, + { + "p": 109, + "sValue": "0" + }, + { + "p": 110, + "sValue": "0" + }, + { + "p": 111, + "sValue": "0" + }, + { + "p": 112, + "sValue": "0" + }, + { + "p": 113, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 114, + "sValue": "0" + }, + { + "p": 115, + "sValue": "0" + }, + { + "p": 116, + "sValue": "0" + }, + { + "p": 117, + "sValue": "0" + }, + { + "p": 118, + "sValue": "0" + }, + { + "p": 119, + "sValue": "0,0,0,0" + }, + { + "p": 120, + "sValue": "0,0,0,0" + }, + { + "p": 121, + "sValue": "0" + }, + { + "p": 122, + "sValue": "0" + }, + { + "p": 123, + "sValue": "0" + }, + { + "p": 124, + "sValue": "0" + }, + { + "p": 125, + "sValue": "0" + }, + { + "p": 126, + "sValue": "0" + }, + { + "p": 127, + "sValue": "0" + }, + { + "p": 128, + "sValue": "0" + }, + { + "p": 129, + "sValue": "0" + }, + { + "p": 130, + "sValue": "0" + }, + { + "p": 131, + "sValue": "0" + }, + { + "p": 132, + "sValue": "0" + }, + { + "p": 133, + "sValue": "0" + }, + { + "p": 134, + "sValue": "0,0,0,0,0" + }, + { + "p": 135, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 136, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 137, + "sValue": "0" + }, + { + "p": 138, + "sValue": "0" + }, + { + "p": 139, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 140, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 141, + "sValue": "0" + }, + { + "p": 142, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 143, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 144, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 145, + "sValue": "0" + }, + { + "p": 146, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 147, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 148, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 149, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 150, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 151, + "sValue": "0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 152, + "sValue": "0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 153, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 154, + "sValue": "0" + }, + { + "p": 155, + "sValue": "0" + }, + { + "p": 156, + "sValue": "0" + }, + { + "p": 157, + "sValue": "0" + }, + { + "p": 158, + "sValue": "0" + }, + { + "p": 159, + "sValue": "0" + }, + { + "p": 160, + "sValue": "0" + }, + { + "p": 161, + "sValue": "0" + }, + { + "p": 162, + "sValue": "0" + }, + { + "p": 163, + "sValue": "0" + }, + { + "p": 164, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBDUFunction=1,NRCellDU=2", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 7, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 8, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 9, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 10, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 11, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 12, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 13, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 14, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0" + }, + { + "p": 20, + "sValue": "0" + }, + { + "p": 21, + "sValue": "0" + }, + { + "p": 22, + "sValue": "0" + }, + { + "p": 23, + "sValue": "0" + }, + { + "p": 24, + "sValue": "0" + }, + { + "p": 25, + "sValue": "0" + }, + { + "p": 26, + "sValue": "0" + }, + { + "p": 27, + "sValue": "0" + }, + { + "p": 28, + "sValue": "0" + }, + { + "p": 29, + "sValue": "0" + }, + { + "p": 30, + "sValue": "0" + }, + { + "p": 31, + "sValue": "0" + }, + { + "p": 32, + "sValue": "0" + }, + { + "p": 33, + "sValue": "0" + }, + { + "p": 34, + "sValue": "0" + }, + { + "p": 35, + "sValue": "0" + }, + { + "p": 36, + "sValue": "0" + }, + { + "p": 37, + "sValue": "0" + }, + { + "p": 38, + "sValue": "0" + }, + { + "p": 39, + "sValue": "0" + }, + { + "p": 40, + "sValue": "0" + }, + { + "p": 41, + "sValue": "0" + }, + { + "p": 42, + "sValue": "0" + }, + { + "p": 43, + "sValue": "0" + }, + { + "p": 44, + "sValue": "0" + }, + { + "p": 45, + "sValue": "0" + }, + { + "p": 46, + "sValue": "0" + }, + { + "p": 47, + "sValue": "0" + }, + { + "p": 48, + "sValue": "0" + }, + { + "p": 49, + "sValue": "0" + }, + { + "p": 50, + "sValue": "0" + }, + { + "p": 51, + "sValue": "0" + }, + { + "p": 52, + "sValue": "0" + }, + { + "p": 53, + "sValue": "0" + }, + { + "p": 54, + "sValue": "0" + }, + { + "p": 55, + "sValue": "0" + }, + { + "p": 56, + "sValue": "0" + }, + { + "p": 57, + "sValue": "0" + }, + { + "p": 58, + "sValue": "0" + }, + { + "p": 59, + "sValue": "0" + }, + { + "p": 60, + "sValue": "0" + }, + { + "p": 61, + "sValue": "0" + }, + { + "p": 62, + "sValue": "0" + }, + { + "p": 63, + "sValue": "0" + }, + { + "p": 64, + "sValue": "0" + }, + { + "p": 65, + "sValue": "0" + }, + { + "p": 66, + "sValue": "0" + }, + { + "p": 67, + "sValue": "0" + }, + { + "p": 68, + "sValue": "0" + }, + { + "p": 69, + "sValue": "0" + }, + { + "p": 70, + "sValue": "0" + }, + { + "p": 71, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 72, + "sValue": "0" + }, + { + "p": 73, + "sValue": "0" + }, + { + "p": 74, + "sValue": "0" + }, + { + "p": 75, + "sValue": "0" + }, + { + "p": 76, + "sValue": "0" + }, + { + "p": 77, + "sValue": "0" + }, + { + "p": 78, + "sValue": "0" + }, + { + "p": 79, + "sValue": "0" + }, + { + "p": 80, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 81, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 82, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 83, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 84, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 85, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 86, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 87, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 88, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 89, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 90, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 91, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 92, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 93, + "sValue": "0" + }, + { + "p": 94, + "sValue": "0" + }, + { + "p": 95, + "sValue": "0" + }, + { + "p": 96, + "sValue": "0" + }, + { + "p": 97, + "sValue": "0" + }, + { + "p": 98, + "sValue": "0" + }, + { + "p": 99, + "sValue": "0" + }, + { + "p": 100, + "sValue": "0" + }, + { + "p": 101, + "sValue": "0" + }, + { + "p": 102, + "sValue": "0" + }, + { + "p": 103, + "sValue": "0" + }, + { + "p": 104, + "sValue": "0" + }, + { + "p": 105, + "sValue": "0" + }, + { + "p": 106, + "sValue": "0" + }, + { + "p": 107, + "sValue": "0" + }, + { + "p": 108, + "sValue": "0" + }, + { + "p": 109, + "sValue": "0" + }, + { + "p": 110, + "sValue": "0" + }, + { + "p": 111, + "sValue": "0" + }, + { + "p": 112, + "sValue": "0" + }, + { + "p": 113, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 114, + "sValue": "0" + }, + { + "p": 115, + "sValue": "0" + }, + { + "p": 116, + "sValue": "0" + }, + { + "p": 117, + "sValue": "0" + }, + { + "p": 118, + "sValue": "0" + }, + { + "p": 119, + "sValue": "0,0,0,0" + }, + { + "p": 120, + "sValue": "0,0,0,0" + }, + { + "p": 121, + "sValue": "0" + }, + { + "p": 122, + "sValue": "0" + }, + { + "p": 123, + "sValue": "0" + }, + { + "p": 124, + "sValue": "0" + }, + { + "p": 125, + "sValue": "0" + }, + { + "p": 126, + "sValue": "0" + }, + { + "p": 127, + "sValue": "0" + }, + { + "p": 128, + "sValue": "0" + }, + { + "p": 129, + "sValue": "0" + }, + { + "p": 130, + "sValue": "0" + }, + { + "p": 131, + "sValue": "0" + }, + { + "p": 132, + "sValue": "0" + }, + { + "p": 133, + "sValue": "0" + }, + { + "p": 134, + "sValue": "0,0,0,0,0" + }, + { + "p": 135, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 136, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 137, + "sValue": "0" + }, + { + "p": 138, + "sValue": "0" + }, + { + "p": 139, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 140, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 141, + "sValue": "0" + }, + { + "p": 142, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 143, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 144, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 145, + "sValue": "0" + }, + { + "p": 146, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 147, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 148, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 149, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 150, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 151, + "sValue": "0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 152, + "sValue": "0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 153, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 154, + "sValue": "0" + }, + { + "p": 155, + "sValue": "0" + }, + { + "p": 156, + "sValue": "0" + }, + { + "p": 157, + "sValue": "0" + }, + { + "p": 158, + "sValue": "0" + }, + { + "p": 159, + "sValue": "0" + }, + { + "p": 160, + "sValue": "0" + }, + { + "p": 161, + "sValue": "0" + }, + { + "p": 162, + "sValue": "0" + }, + { + "p": 163, + "sValue": "0" + }, + { + "p": 164, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBDUFunction=1,NRCellDU=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 7, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 8, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 9, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 10, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 11, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 12, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 13, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 14, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0" + }, + { + "p": 20, + "sValue": "0" + }, + { + "p": 21, + "sValue": "0" + }, + { + "p": 22, + "sValue": "0" + }, + { + "p": 23, + "sValue": "0" + }, + { + "p": 24, + "sValue": "0" + }, + { + "p": 25, + "sValue": "0" + }, + { + "p": 26, + "sValue": "0" + }, + { + "p": 27, + "sValue": "0" + }, + { + "p": 28, + "sValue": "0" + }, + { + "p": 29, + "sValue": "0" + }, + { + "p": 30, + "sValue": "0" + }, + { + "p": 31, + "sValue": "0" + }, + { + "p": 32, + "sValue": "0" + }, + { + "p": 33, + "sValue": "0" + }, + { + "p": 34, + "sValue": "0" + }, + { + "p": 35, + "sValue": "0" + }, + { + "p": 36, + "sValue": "0" + }, + { + "p": 37, + "sValue": "0" + }, + { + "p": 38, + "sValue": "0" + }, + { + "p": 39, + "sValue": "0" + }, + { + "p": 40, + "sValue": "0" + }, + { + "p": 41, + "sValue": "0" + }, + { + "p": 42, + "sValue": "0" + }, + { + "p": 43, + "sValue": "0" + }, + { + "p": 44, + "sValue": "0" + }, + { + "p": 45, + "sValue": "0" + }, + { + "p": 46, + "sValue": "0" + }, + { + "p": 47, + "sValue": "0" + }, + { + "p": 48, + "sValue": "0" + }, + { + "p": 49, + "sValue": "0" + }, + { + "p": 50, + "sValue": "0" + }, + { + "p": 51, + "sValue": "0" + }, + { + "p": 52, + "sValue": "0" + }, + { + "p": 53, + "sValue": "0" + }, + { + "p": 54, + "sValue": "0" + }, + { + "p": 55, + "sValue": "0" + }, + { + "p": 56, + "sValue": "0" + }, + { + "p": 57, + "sValue": "0" + }, + { + "p": 58, + "sValue": "0" + }, + { + "p": 59, + "sValue": "0" + }, + { + "p": 60, + "sValue": "0" + }, + { + "p": 61, + "sValue": "0" + }, + { + "p": 62, + "sValue": "0" + }, + { + "p": 63, + "sValue": "0" + }, + { + "p": 64, + "sValue": "0" + }, + { + "p": 65, + "sValue": "0" + }, + { + "p": 66, + "sValue": "0" + }, + { + "p": 67, + "sValue": "0" + }, + { + "p": 68, + "sValue": "0" + }, + { + "p": 69, + "sValue": "0" + }, + { + "p": 70, + "sValue": "0" + }, + { + "p": 71, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 72, + "sValue": "0" + }, + { + "p": 73, + "sValue": "0" + }, + { + "p": 74, + "sValue": "0" + }, + { + "p": 75, + "sValue": "0" + }, + { + "p": 76, + "sValue": "0" + }, + { + "p": 77, + "sValue": "0" + }, + { + "p": 78, + "sValue": "0" + }, + { + "p": 79, + "sValue": "0" + }, + { + "p": 80, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 81, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 82, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 83, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 84, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 85, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 86, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 87, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 88, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 89, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 90, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 91, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 92, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 93, + "sValue": "0" + }, + { + "p": 94, + "sValue": "0" + }, + { + "p": 95, + "sValue": "0" + }, + { + "p": 96, + "sValue": "0" + }, + { + "p": 97, + "sValue": "0" + }, + { + "p": 98, + "sValue": "0" + }, + { + "p": 99, + "sValue": "0" + }, + { + "p": 100, + "sValue": "0" + }, + { + "p": 101, + "sValue": "0" + }, + { + "p": 102, + "sValue": "0" + }, + { + "p": 103, + "sValue": "0" + }, + { + "p": 104, + "sValue": "0" + }, + { + "p": 105, + "sValue": "0" + }, + { + "p": 106, + "sValue": "0" + }, + { + "p": 107, + "sValue": "0" + }, + { + "p": 108, + "sValue": "0" + }, + { + "p": 109, + "sValue": "0" + }, + { + "p": 110, + "sValue": "0" + }, + { + "p": 111, + "sValue": "0" + }, + { + "p": 112, + "sValue": "0" + }, + { + "p": 113, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 114, + "sValue": "0" + }, + { + "p": 115, + "sValue": "0" + }, + { + "p": 116, + "sValue": "0" + }, + { + "p": 117, + "sValue": "0" + }, + { + "p": 118, + "sValue": "0" + }, + { + "p": 119, + "sValue": "0,0,0,0" + }, + { + "p": 120, + "sValue": "0,0,0,0" + }, + { + "p": 121, + "sValue": "0" + }, + { + "p": 122, + "sValue": "0" + }, + { + "p": 123, + "sValue": "0" + }, + { + "p": 124, + "sValue": "0" + }, + { + "p": 125, + "sValue": "0" + }, + { + "p": 126, + "sValue": "0" + }, + { + "p": 127, + "sValue": "0" + }, + { + "p": 128, + "sValue": "0" + }, + { + "p": 129, + "sValue": "0" + }, + { + "p": 130, + "sValue": "0" + }, + { + "p": 131, + "sValue": "0" + }, + { + "p": 132, + "sValue": "0" + }, + { + "p": 133, + "sValue": "0" + }, + { + "p": 134, + "sValue": "0,0,0,0,0" + }, + { + "p": 135, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 136, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 137, + "sValue": "0" + }, + { + "p": 138, + "sValue": "0" + }, + { + "p": 139, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 140, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 141, + "sValue": "0" + }, + { + "p": 142, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 143, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 144, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 145, + "sValue": "0" + }, + { + "p": 146, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 147, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 148, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 149, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 150, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 151, + "sValue": "0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 152, + "sValue": "0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 153, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 154, + "sValue": "0" + }, + { + "p": 155, + "sValue": "0" + }, + { + "p": 156, + "sValue": "0" + }, + { + "p": 157, + "sValue": "0" + }, + { + "p": 158, + "sValue": "0" + }, + { + "p": 159, + "sValue": "0" + }, + { + "p": 160, + "sValue": "0" + }, + { + "p": 161, + "sValue": "0" + }, + { + "p": 162, + "sValue": "0" + }, + { + "p": 163, + "sValue": "0" + }, + { + "p": 164, + "sValue": "0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=NRSectorCarrier_GNBDU" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber256", + "pmCounterNumber257", + "pmCounterNumber258", + "pmCounterNumber259", + "pmCounterNumber260", + "pmCounterNumber261", + "pmCounterNumber262", + "pmCounterNumber263", + "pmCounterNumber263On", + "pmCounterNumber265", + "pmCounterNumber266", + "pmCounterNumber267", + "pmCounterNumber267Auto", + "pmCounterNumber267AutoCbrs", + "pmCounterNumber267Man", + "pmCounterNumber267ManCbrs" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBDUFunction=1,NRSectorCarrier=32", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 5, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBDUFunction=1,NRSectorCarrier=31", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 5, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBDUFunction=1,NRSectorCarrier=2", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 5, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBDUFunction=1,NRSectorCarrier=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 5, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=EUtranCellFDD" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber272", + "pmCounterNumber273", + "pmCounterNumber274", + "pmCounterNumber275", + "pmCounterNumber276", + "pmCounterNumber277", + "pmCounterNumber278" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,ENodeBFunction=1,EUtranCellFDD=2", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0" + }, + { + "p": 2, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 3, + "sValue": "0,0,0,0" + }, + { + "p": 4, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 5, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 6, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 7, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,ENodeBFunction=1,EUtranCellFDD=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0" + }, + { + "p": 2, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 3, + "sValue": "0,0,0,0" + }, + { + "p": 4, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 5, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 6, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 7, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=NRCellDU_GNBDU" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber279", + "pmCounterNumber280", + "pmCounterNumber281", + "pmCounterNumber282", + "pmCounterNumber283", + "pmCounterNumber284", + "pmCounterNumber285", + "pmCounterNumber286", + "pmCounterNumber287", + "pmCounterNumber288", + "pmCounterNumber289", + "pmCounterNumber290", + "pmCounterNumber291", + "pmCounterNumber292", + "pmCounterNumber293", + "pmCounterNumber294", + "pmCounterNumber295", + "pmCounterNumber296", + "pmCounterNumber274" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBDUFunction=1,NRCellDU=32", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0,0,0,0" + }, + { + "p": 3, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 4, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 5, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 6, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 7, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 8, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 9, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 10, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0,0,0,0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBDUFunction=1,NRCellDU=31", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0,0,0,0" + }, + { + "p": 3, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 4, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 5, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 6, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 7, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 8, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 9, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 10, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0,0,0,0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBDUFunction=1,NRCellDU=2", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0,0,0,0" + }, + { + "p": 3, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 4, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 5, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 6, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 7, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 8, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 9, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 10, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0,0,0,0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBDUFunction=1,NRCellDU=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0,0,0,0" + }, + { + "p": 3, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 4, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 5, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 6, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 7, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 8, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 9, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 10, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0,0,0,0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=EUtranCellFDD" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber297" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,ENodeBFunction=1,EUtranCellFDD=2", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,ENodeBFunction=1,EUtranCellFDD=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=NRCellDU_GNBDU" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber297F0Distr", + "pmCounterNumber297F2Distr" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBDUFunction=1,NRCellDU=32", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBDUFunction=1,NRCellDU=31", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBDUFunction=1,NRCellDU=2", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBDUFunction=1,NRCellDU=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=GNBCUCPFunction_GNBCUCP" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber300", + "pmCounterNumber301", + "pmCounterNumber302", + "pmCounterNumber303", + "pmCounterNumber304", + "pmCounterNumber305" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBCUCPFunction=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=NRCellCU_GNBCUCP" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber306", + "pmCounterNumber307", + "pmCounterNumber308", + "pmCounterNumber309", + "pmCounterNumber310", + "pmCounterNumber311", + "pmCounterNumber312", + "pmCounterNumber313", + "pmCounterNumber314", + "pmCounterNumber315", + "pmCounterNumber316", + "pmCounterNumber317", + "pmCounterNumber318", + "pmCounterNumber319", + "pmCounterNumber320", + "pmCounterNumber321", + "pmCounterNumber322", + "pmCounterNumber323", + "pmCounterNumber324", + "pmCounterNumber324Act", + "pmCounterNumber326", + "pmCounterNumber326Act", + "pmCounterNumber328", + "pmCounterNumber329", + "pmCounterNumber330", + "pmCounterNumber331", + "pmCounterNumber332", + "pmCounterNumber333", + "pmCounterNumber334", + "pmCounterNumber335", + "pmCounterNumber336", + "pmCounterNumber337", + "pmCounterNumber338", + "pmCounterNumber339", + "pmCounterNumber340", + "pmCounterNumber341", + "pmCounterNumber342", + "pmCounterNumber343", + "pmCounterNumber343Mos", + "pmCounterNumber345", + "pmCounterNumber345Mos", + "pmCounterNumber347", + "pmCounterNumber348", + "pmCounterNumber349", + "pmCounterNumber350", + "pmCounterNumber350Mos", + "pmCounterNumber350Reatt", + "pmCounterNumber350ReattMos", + "pmCounterNumber354", + "pmCounterNumber354Mos", + "pmCounterNumber301", + "pmCounterNumber302", + "pmCounterNumber303", + "pmCounterNumber304", + "pmCounterNumber305", + "pmCounterNumber356", + "pmCounterNumber357", + "pmCounterNumber358" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBCUCPFunction=1,NRCellCU=32", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0" + }, + { + "p": 20, + "sValue": "0" + }, + { + "p": 21, + "sValue": "0" + }, + { + "p": 22, + "sValue": "0" + }, + { + "p": 23, + "sValue": "0" + }, + { + "p": 24, + "sValue": "0" + }, + { + "p": 25, + "sValue": "0" + }, + { + "p": 26, + "sValue": "0" + }, + { + "p": 27, + "sValue": "0" + }, + { + "p": 28, + "sValue": "0" + }, + { + "p": 29, + "sValue": "0" + }, + { + "p": 30, + "sValue": "0" + }, + { + "p": 31, + "sValue": "0" + }, + { + "p": 32, + "sValue": "0" + }, + { + "p": 33, + "sValue": "0" + }, + { + "p": 34, + "sValue": "0" + }, + { + "p": 35, + "sValue": "0" + }, + { + "p": 36, + "sValue": "0" + }, + { + "p": 37, + "sValue": "0" + }, + { + "p": 38, + "sValue": "0" + }, + { + "p": 39, + "sValue": "0" + }, + { + "p": 40, + "sValue": "0" + }, + { + "p": 41, + "sValue": "0" + }, + { + "p": 42, + "sValue": "0" + }, + { + "p": 43, + "sValue": "0" + }, + { + "p": 44, + "sValue": "0" + }, + { + "p": 45, + "sValue": "0" + }, + { + "p": 46, + "sValue": "0" + }, + { + "p": 47, + "sValue": "0" + }, + { + "p": 48, + "sValue": "0" + }, + { + "p": 49, + "sValue": "0" + }, + { + "p": 50, + "sValue": "0" + }, + { + "p": 51, + "sValue": "0" + }, + { + "p": 52, + "sValue": "0" + }, + { + "p": 53, + "sValue": "0" + }, + { + "p": 54, + "sValue": "0" + }, + { + "p": 55, + "sValue": "0" + }, + { + "p": 56, + "sValue": "0" + }, + { + "p": 57, + "sValue": "0" + }, + { + "p": 58, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBCUCPFunction=1,NRCellCU=31", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0" + }, + { + "p": 20, + "sValue": "0" + }, + { + "p": 21, + "sValue": "0" + }, + { + "p": 22, + "sValue": "0" + }, + { + "p": 23, + "sValue": "0" + }, + { + "p": 24, + "sValue": "0" + }, + { + "p": 25, + "sValue": "0" + }, + { + "p": 26, + "sValue": "0" + }, + { + "p": 27, + "sValue": "0" + }, + { + "p": 28, + "sValue": "0" + }, + { + "p": 29, + "sValue": "0" + }, + { + "p": 30, + "sValue": "0" + }, + { + "p": 31, + "sValue": "0" + }, + { + "p": 32, + "sValue": "0" + }, + { + "p": 33, + "sValue": "0" + }, + { + "p": 34, + "sValue": "0" + }, + { + "p": 35, + "sValue": "0" + }, + { + "p": 36, + "sValue": "0" + }, + { + "p": 37, + "sValue": "0" + }, + { + "p": 38, + "sValue": "0" + }, + { + "p": 39, + "sValue": "0" + }, + { + "p": 40, + "sValue": "0" + }, + { + "p": 41, + "sValue": "0" + }, + { + "p": 42, + "sValue": "0" + }, + { + "p": 43, + "sValue": "0" + }, + { + "p": 44, + "sValue": "0" + }, + { + "p": 45, + "sValue": "0" + }, + { + "p": 46, + "sValue": "0" + }, + { + "p": 47, + "sValue": "0" + }, + { + "p": 48, + "sValue": "0" + }, + { + "p": 49, + "sValue": "0" + }, + { + "p": 50, + "sValue": "0" + }, + { + "p": 51, + "sValue": "0" + }, + { + "p": 52, + "sValue": "0" + }, + { + "p": 53, + "sValue": "0" + }, + { + "p": 54, + "sValue": "0" + }, + { + "p": 55, + "sValue": "0" + }, + { + "p": 56, + "sValue": "0" + }, + { + "p": 57, + "sValue": "0" + }, + { + "p": 58, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBCUCPFunction=1,NRCellCU=2", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0" + }, + { + "p": 20, + "sValue": "0" + }, + { + "p": 21, + "sValue": "0" + }, + { + "p": 22, + "sValue": "0" + }, + { + "p": 23, + "sValue": "0" + }, + { + "p": 24, + "sValue": "0" + }, + { + "p": 25, + "sValue": "0" + }, + { + "p": 26, + "sValue": "0" + }, + { + "p": 27, + "sValue": "0" + }, + { + "p": 28, + "sValue": "0" + }, + { + "p": 29, + "sValue": "0" + }, + { + "p": 30, + "sValue": "0" + }, + { + "p": 31, + "sValue": "0" + }, + { + "p": 32, + "sValue": "0" + }, + { + "p": 33, + "sValue": "0" + }, + { + "p": 34, + "sValue": "0" + }, + { + "p": 35, + "sValue": "0" + }, + { + "p": 36, + "sValue": "0" + }, + { + "p": 37, + "sValue": "0" + }, + { + "p": 38, + "sValue": "0" + }, + { + "p": 39, + "sValue": "0" + }, + { + "p": 40, + "sValue": "0" + }, + { + "p": 41, + "sValue": "0" + }, + { + "p": 42, + "sValue": "0" + }, + { + "p": 43, + "sValue": "0" + }, + { + "p": 44, + "sValue": "0" + }, + { + "p": 45, + "sValue": "0" + }, + { + "p": 46, + "sValue": "0" + }, + { + "p": 47, + "sValue": "0" + }, + { + "p": 48, + "sValue": "0" + }, + { + "p": 49, + "sValue": "0" + }, + { + "p": 50, + "sValue": "0" + }, + { + "p": 51, + "sValue": "0" + }, + { + "p": 52, + "sValue": "0" + }, + { + "p": 53, + "sValue": "0" + }, + { + "p": 54, + "sValue": "0" + }, + { + "p": 55, + "sValue": "0" + }, + { + "p": 56, + "sValue": "0" + }, + { + "p": 57, + "sValue": "0" + }, + { + "p": 58, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBCUCPFunction=1,NRCellCU=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0" + }, + { + "p": 20, + "sValue": "0" + }, + { + "p": 21, + "sValue": "0" + }, + { + "p": 22, + "sValue": "0" + }, + { + "p": 23, + "sValue": "0" + }, + { + "p": 24, + "sValue": "0" + }, + { + "p": 25, + "sValue": "0" + }, + { + "p": 26, + "sValue": "0" + }, + { + "p": 27, + "sValue": "0" + }, + { + "p": 28, + "sValue": "0" + }, + { + "p": 29, + "sValue": "0" + }, + { + "p": 30, + "sValue": "0" + }, + { + "p": 31, + "sValue": "0" + }, + { + "p": 32, + "sValue": "0" + }, + { + "p": 33, + "sValue": "0" + }, + { + "p": 34, + "sValue": "0" + }, + { + "p": 35, + "sValue": "0" + }, + { + "p": 36, + "sValue": "0" + }, + { + "p": 37, + "sValue": "0" + }, + { + "p": 38, + "sValue": "0" + }, + { + "p": 39, + "sValue": "0" + }, + { + "p": 40, + "sValue": "0" + }, + { + "p": 41, + "sValue": "0" + }, + { + "p": 42, + "sValue": "0" + }, + { + "p": 43, + "sValue": "0" + }, + { + "p": 44, + "sValue": "0" + }, + { + "p": 45, + "sValue": "0" + }, + { + "p": 46, + "sValue": "0" + }, + { + "p": 47, + "sValue": "0" + }, + { + "p": 48, + "sValue": "0" + }, + { + "p": 49, + "sValue": "0" + }, + { + "p": 50, + "sValue": "0" + }, + { + "p": 51, + "sValue": "0" + }, + { + "p": 52, + "sValue": "0" + }, + { + "p": 53, + "sValue": "0" + }, + { + "p": 54, + "sValue": "0" + }, + { + "p": 55, + "sValue": "0" + }, + { + "p": 56, + "sValue": "0" + }, + { + "p": 57, + "sValue": "0" + }, + { + "p": 58, + "sValue": "0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=GNBDUFunction_GNBDU" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber359", + "pmCounterNumber360", + "pmCounterNumber361", + "pmCounterNumber362", + "pmCounterNumber363", + "pmCounterNumber364", + "pmCounterNumber365", + "pmCounterNumber366", + "pmCounterNumber367", + "pmCounterNumber368", + "pmCounterNumber369", + "pmCounterNumber370", + "pmCounterNumber371", + "pmCounterNumber372", + "pmCounterNumber373", + "pmCounterNumber374", + "pmCounterNumber375", + "pmCounterNumber376", + "pmCounterNumber377" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBDUFunction=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 10, + "sValue": "0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=NRCellDU_GNBDU" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber378", + "pmCounterNumber379", + "pmCounterNumber380", + "pmCounterNumber381", + "pmCounterNumber382", + "pmCounterNumber383", + "pmCounterNumber384", + "pmCounterNumber385", + "pmCounterNumber386", + "pmCounterNumber306", + "pmCounterNumber307", + "pmCounterNumber307ual", + "pmCounterNumber388", + "pmCounterNumber389", + "pmCounterNumber390", + "pmCounterNumber391", + "pmCounterNumber392", + "pmCounterNumber393", + "pmCounterNumber394", + "pmCounterNumber395", + "pmCounterNumber396", + "pmCounterNumber397", + "pmCounterNumber398", + "pmCounterNumber399", + "pmCounterNumber399Broadcasting", + "pmCounterNumber401", + "pmCounterNumber402", + "pmCounterNumber403", + "pmCounterNumber404", + "pmCounterNumber405", + "pmCounterNumber406", + "pmCounterNumber407", + "pmCounterNumber407Qos", + "pmCounterNumber409", + "pmCounterNumber410", + "pmCounterNumber410Drb", + "pmCounterNumber410DrbQos", + "pmCounterNumber413", + "pmCounterNumber413ResUe", + "pmCounterNumber415", + "pmCounterNumber416", + "pmCounterNumber417", + "pmCounterNumber418", + "pmCounterNumber419", + "pmCounterNumber420", + "pmCounterNumber421", + "pmCounterNumber422", + "pmCounterNumber423", + "pmCounterNumber424", + "pmCounterNumber425", + "pmCounterNumber426", + "pmCounterNumber427", + "pmCounterNumber428", + "pmCounterNumber429", + "pmCounterNumber430", + "pmCounterNumber431", + "pmCounterNumber432", + "pmCounterNumber433", + "pmCounterNumber434", + "pmCounterNumber435", + "pmCounterNumber436", + "pmCounterNumber437", + "pmCounterNumber438", + "pmCounterNumber439", + "pmCounterNumber440", + "pmCounterNumber441" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBDUFunction=1,NRCellDU=32", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0" + }, + { + "p": 20, + "sValue": "0" + }, + { + "p": 21, + "sValue": "0" + }, + { + "p": 22, + "sValue": "0" + }, + { + "p": 23, + "sValue": "0" + }, + { + "p": 24, + "sValue": "0" + }, + { + "p": 25, + "sValue": "0" + }, + { + "p": 26, + "sValue": "0" + }, + { + "p": 27, + "sValue": "0" + }, + { + "p": 28, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 29, + "sValue": "0" + }, + { + "p": 30, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 31, + "sValue": "0" + }, + { + "p": 32, + "sValue": "0" + }, + { + "p": 33, + "sValue": "0" + }, + { + "p": 34, + "sValue": "0" + }, + { + "p": 35, + "sValue": "0" + }, + { + "p": 36, + "sValue": "0" + }, + { + "p": 37, + "sValue": "0" + }, + { + "p": 38, + "sValue": "0" + }, + { + "p": 39, + "sValue": "0" + }, + { + "p": 40, + "sValue": "0" + }, + { + "p": 41, + "sValue": "0" + }, + { + "p": 42, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 43, + "sValue": "0" + }, + { + "p": 44, + "sValue": "0" + }, + { + "p": 45, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 46, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 47, + "sValue": "0" + }, + { + "p": 48, + "sValue": "0" + }, + { + "p": 49, + "sValue": "0" + }, + { + "p": 50, + "sValue": "0" + }, + { + "p": 51, + "sValue": "0" + }, + { + "p": 52, + "sValue": "0" + }, + { + "p": 53, + "sValue": "0" + }, + { + "p": 54, + "sValue": "0" + }, + { + "p": 55, + "sValue": "0" + }, + { + "p": 56, + "sValue": "0" + }, + { + "p": 57, + "sValue": "0" + }, + { + "p": 58, + "sValue": "0" + }, + { + "p": 59, + "sValue": "0" + }, + { + "p": 60, + "sValue": "0" + }, + { + "p": 61, + "sValue": "0" + }, + { + "p": 62, + "sValue": "0" + }, + { + "p": 63, + "sValue": "0" + }, + { + "p": 64, + "sValue": "0" + }, + { + "p": 65, + "sValue": "0" + }, + { + "p": 66, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBDUFunction=1,NRCellDU=31", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0" + }, + { + "p": 20, + "sValue": "0" + }, + { + "p": 21, + "sValue": "0" + }, + { + "p": 22, + "sValue": "0" + }, + { + "p": 23, + "sValue": "0" + }, + { + "p": 24, + "sValue": "0" + }, + { + "p": 25, + "sValue": "0" + }, + { + "p": 26, + "sValue": "0" + }, + { + "p": 27, + "sValue": "0" + }, + { + "p": 28, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 29, + "sValue": "0" + }, + { + "p": 30, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 31, + "sValue": "0" + }, + { + "p": 32, + "sValue": "0" + }, + { + "p": 33, + "sValue": "0" + }, + { + "p": 34, + "sValue": "0" + }, + { + "p": 35, + "sValue": "0" + }, + { + "p": 36, + "sValue": "0" + }, + { + "p": 37, + "sValue": "0" + }, + { + "p": 38, + "sValue": "0" + }, + { + "p": 39, + "sValue": "0" + }, + { + "p": 40, + "sValue": "0" + }, + { + "p": 41, + "sValue": "0" + }, + { + "p": 42, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 43, + "sValue": "0" + }, + { + "p": 44, + "sValue": "0" + }, + { + "p": 45, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 46, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 47, + "sValue": "0" + }, + { + "p": 48, + "sValue": "0" + }, + { + "p": 49, + "sValue": "0" + }, + { + "p": 50, + "sValue": "0" + }, + { + "p": 51, + "sValue": "0" + }, + { + "p": 52, + "sValue": "0" + }, + { + "p": 53, + "sValue": "0" + }, + { + "p": 54, + "sValue": "0" + }, + { + "p": 55, + "sValue": "0" + }, + { + "p": 56, + "sValue": "0" + }, + { + "p": 57, + "sValue": "0" + }, + { + "p": 58, + "sValue": "0" + }, + { + "p": 59, + "sValue": "0" + }, + { + "p": 60, + "sValue": "0" + }, + { + "p": 61, + "sValue": "0" + }, + { + "p": 62, + "sValue": "0" + }, + { + "p": 63, + "sValue": "0" + }, + { + "p": 64, + "sValue": "0" + }, + { + "p": 65, + "sValue": "0" + }, + { + "p": 66, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBDUFunction=1,NRCellDU=2", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0" + }, + { + "p": 20, + "sValue": "0" + }, + { + "p": 21, + "sValue": "0" + }, + { + "p": 22, + "sValue": "0" + }, + { + "p": 23, + "sValue": "0" + }, + { + "p": 24, + "sValue": "0" + }, + { + "p": 25, + "sValue": "0" + }, + { + "p": 26, + "sValue": "0" + }, + { + "p": 27, + "sValue": "0" + }, + { + "p": 28, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 29, + "sValue": "0" + }, + { + "p": 30, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 31, + "sValue": "0" + }, + { + "p": 32, + "sValue": "0" + }, + { + "p": 33, + "sValue": "0" + }, + { + "p": 34, + "sValue": "0" + }, + { + "p": 35, + "sValue": "0" + }, + { + "p": 36, + "sValue": "0" + }, + { + "p": 37, + "sValue": "0" + }, + { + "p": 38, + "sValue": "0" + }, + { + "p": 39, + "sValue": "0" + }, + { + "p": 40, + "sValue": "0" + }, + { + "p": 41, + "sValue": "0" + }, + { + "p": 42, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 43, + "sValue": "0" + }, + { + "p": 44, + "sValue": "0" + }, + { + "p": 45, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 46, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 47, + "sValue": "0" + }, + { + "p": 48, + "sValue": "0" + }, + { + "p": 49, + "sValue": "0" + }, + { + "p": 50, + "sValue": "0" + }, + { + "p": 51, + "sValue": "0" + }, + { + "p": 52, + "sValue": "0" + }, + { + "p": 53, + "sValue": "0" + }, + { + "p": 54, + "sValue": "0" + }, + { + "p": 55, + "sValue": "0" + }, + { + "p": 56, + "sValue": "0" + }, + { + "p": 57, + "sValue": "0" + }, + { + "p": 58, + "sValue": "0" + }, + { + "p": 59, + "sValue": "0" + }, + { + "p": 60, + "sValue": "0" + }, + { + "p": 61, + "sValue": "0" + }, + { + "p": 62, + "sValue": "0" + }, + { + "p": 63, + "sValue": "0" + }, + { + "p": 64, + "sValue": "0" + }, + { + "p": 65, + "sValue": "0" + }, + { + "p": 66, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBDUFunction=1,NRCellDU=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0" + }, + { + "p": 20, + "sValue": "0" + }, + { + "p": 21, + "sValue": "0" + }, + { + "p": 22, + "sValue": "0" + }, + { + "p": 23, + "sValue": "0" + }, + { + "p": 24, + "sValue": "0" + }, + { + "p": 25, + "sValue": "0" + }, + { + "p": 26, + "sValue": "0" + }, + { + "p": 27, + "sValue": "0" + }, + { + "p": 28, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 29, + "sValue": "0" + }, + { + "p": 30, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 31, + "sValue": "0" + }, + { + "p": 32, + "sValue": "0" + }, + { + "p": 33, + "sValue": "0" + }, + { + "p": 34, + "sValue": "0" + }, + { + "p": 35, + "sValue": "0" + }, + { + "p": 36, + "sValue": "0" + }, + { + "p": 37, + "sValue": "0" + }, + { + "p": 38, + "sValue": "0" + }, + { + "p": 39, + "sValue": "0" + }, + { + "p": 40, + "sValue": "0" + }, + { + "p": 41, + "sValue": "0" + }, + { + "p": 42, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 43, + "sValue": "0" + }, + { + "p": 44, + "sValue": "0" + }, + { + "p": 45, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 46, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 47, + "sValue": "0" + }, + { + "p": 48, + "sValue": "0" + }, + { + "p": 49, + "sValue": "0" + }, + { + "p": 50, + "sValue": "0" + }, + { + "p": 51, + "sValue": "0" + }, + { + "p": 52, + "sValue": "0" + }, + { + "p": 53, + "sValue": "0" + }, + { + "p": 54, + "sValue": "0" + }, + { + "p": 55, + "sValue": "0" + }, + { + "p": 56, + "sValue": "0" + }, + { + "p": 57, + "sValue": "0" + }, + { + "p": 58, + "sValue": "0" + }, + { + "p": 59, + "sValue": "0" + }, + { + "p": 60, + "sValue": "0" + }, + { + "p": 61, + "sValue": "0" + }, + { + "p": 62, + "sValue": "0" + }, + { + "p": 63, + "sValue": "0" + }, + { + "p": 64, + "sValue": "0" + }, + { + "p": 65, + "sValue": "0" + }, + { + "p": 66, + "sValue": "0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=PpControlLink_GNBCUUP" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber310", + "pmCounterNumber311", + "pmCounterNumber312", + "pmCounterNumber313", + "pmCounterNumber314", + "pmCounterNumber347", + "pmCounterNumber348", + "pmCounterNumber349" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBCUUPFunction=1,PpControlTermination=1,PpControlLink=internal", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=EUtranCellFDD" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber442", + "pmCounterNumber443", + "pmCounterNumber444", + "pmCounterNumber445", + "pmCounterNumber446", + "pmCounterNumber447", + "pmCounterNumber448", + "pmCounterNumber448PCell", + "pmCounterNumber448SCell", + "pmCounterNumber448Volte", + "pmCounterNumber452", + "pmCounterNumber453", + "pmCounterNumber454", + "pmCounterNumber455", + "pmCounterNumber114", + "pmCounterNumber456", + "pmCounterNumber457", + "pmCounterNumber458", + "pmCounterNumber122", + "pmCounterNumber459", + "pmCounterNumber460", + "pmCounterNumber461", + "pmCounterNumber462", + "pmCounterNumber131", + "pmCounterNumber463", + "pmCounterNumber464", + "pmCounterNumber143", + "pmCounterNumber145", + "pmCounterNumber147", + "pmCounterNumber14916qam", + "pmCounterNumber149256Qam", + "pmCounterNumber14964Qam", + "pmCounterNumber149Iua16qam", + "pmCounterNumber149IuaQpsk", + "pmCounterNumber149Qpsk", + "pmCounterNumber471", + "pmCounterNumber472", + "pmCounterNumber473", + "pmCounterNumber474", + "pmCounterNumber475", + "pmCounterNumber476", + "pmCounterNumber477", + "pmCounterNumber478", + "pmCounterNumber248", + "pmCounterNumber249", + "pmCounterNumber479", + "pmCounterNumber250", + "pmCounterNumber251" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,ENodeBFunction=1,EUtranCellFDD=2", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0" + }, + { + "p": 20, + "sValue": "0" + }, + { + "p": 21, + "sValue": "0" + }, + { + "p": 22, + "sValue": "0" + }, + { + "p": 23, + "sValue": "0" + }, + { + "p": 24, + "sValue": "0" + }, + { + "p": 25, + "sValue": "0" + }, + { + "p": 26, + "sValue": "0" + }, + { + "p": 27, + "sValue": "0" + }, + { + "p": 28, + "sValue": "0" + }, + { + "p": 29, + "sValue": "0" + }, + { + "p": 30, + "sValue": "0" + }, + { + "p": 31, + "sValue": "0" + }, + { + "p": 32, + "sValue": "0" + }, + { + "p": 33, + "sValue": "0" + }, + { + "p": 34, + "sValue": "0" + }, + { + "p": 35, + "sValue": "0" + }, + { + "p": 36, + "sValue": "0" + }, + { + "p": 37, + "sValue": "0" + }, + { + "p": 38, + "sValue": "0" + }, + { + "p": 39, + "sValue": "0" + }, + { + "p": 40, + "sValue": "0" + }, + { + "p": 41, + "sValue": "0" + }, + { + "p": 42, + "sValue": "0" + }, + { + "p": 43, + "sValue": "0" + }, + { + "p": 44, + "sValue": "0" + }, + { + "p": 45, + "sValue": "0" + }, + { + "p": 46, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 47, + "sValue": "0" + }, + { + "p": 48, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,ENodeBFunction=1,EUtranCellFDD=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0" + }, + { + "p": 20, + "sValue": "0" + }, + { + "p": 21, + "sValue": "0" + }, + { + "p": 22, + "sValue": "0" + }, + { + "p": 23, + "sValue": "0" + }, + { + "p": 24, + "sValue": "0" + }, + { + "p": 25, + "sValue": "0" + }, + { + "p": 26, + "sValue": "0" + }, + { + "p": 27, + "sValue": "0" + }, + { + "p": 28, + "sValue": "0" + }, + { + "p": 29, + "sValue": "0" + }, + { + "p": 30, + "sValue": "0" + }, + { + "p": 31, + "sValue": "0" + }, + { + "p": 32, + "sValue": "0" + }, + { + "p": 33, + "sValue": "0" + }, + { + "p": 34, + "sValue": "0" + }, + { + "p": 35, + "sValue": "0" + }, + { + "p": 36, + "sValue": "0" + }, + { + "p": 37, + "sValue": "0" + }, + { + "p": 38, + "sValue": "0" + }, + { + "p": 39, + "sValue": "0" + }, + { + "p": 40, + "sValue": "0" + }, + { + "p": 41, + "sValue": "0" + }, + { + "p": 42, + "sValue": "0" + }, + { + "p": 43, + "sValue": "0" + }, + { + "p": 44, + "sValue": "0" + }, + { + "p": 45, + "sValue": "0" + }, + { + "p": 46, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 47, + "sValue": "0" + }, + { + "p": 48, + "sValue": "0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=FieldReplaceableUnit" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber480", + "pmCounterNumber481" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=Radio-S3-1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0,0,0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=Radio-S2-1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0,0,0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=Radio-S1-1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0,0,0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=R608", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0,0,0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=BB-1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0,0,0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=RiEthernetPort" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber482", + "pmCounterNumber483", + "pmCounterNumber484", + "pmCounterNumber485", + "pmCounterNumber486", + "pmCounterNumber487", + "pmCounterNumber488", + "pmCounterNumber489", + "pmCounterNumber490", + "pmCounterNumber491" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=R608,RiPort=P,RiEthernetPort=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=R608,RiPort=N,RiEthernetPort=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=BB-1,RiPort=B,RiEthernetPort=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=BB-1,RiPort=A,RiEthernetPort=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=RiLink" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber492", + "pmCounterNumber493", + "pmCounterNumber494", + "pmCounterNumber495" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,RiLink=S3-1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,RiLink=S2-1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,RiLink=S1-1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,RiLink=R608-2", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,RiLink=R608-1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=RiPort" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber496", + "pmCounterNumber497", + "pmCounterNumber498" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=Radio-S3-1,RiPort=DATA_2", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=Radio-S3-1,RiPort=DATA_1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=Radio-S2-1,RiPort=DATA_2", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=Radio-S2-1,RiPort=DATA_1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=Radio-S1-1,RiPort=DATA_2", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=Radio-S1-1,RiPort=DATA_1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=R608,RiPort=P", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=R608,RiPort=N", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=R608,RiPort=B", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=R608,RiPort=A", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=BB-1,RiPort=K", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=BB-1,RiPort=C", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=BB-1,RiPort=B", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=BB-1,RiPort=A", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0,0,0,0,0,0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=SfpChannel" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber499", + "pmCounterNumber500", + "pmCounterNumber501" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=R608,SfpModule=P,SfpChannel=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=R608,SfpModule=N,SfpChannel=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=BB-1,SfpModule=K,SfpChannel=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=Radio-S3-1,SfpModule=DATA_2,SfpChannel=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=Radio-S2-1,SfpModule=DATA_2,SfpChannel=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=Radio-S1-1,SfpModule=DATA_2,SfpChannel=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=Radio-S3-1,SfpModule=DATA_1,SfpChannel=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=Radio-S2-1,SfpModule=DATA_1,SfpChannel=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=Radio-S1-1,SfpModule=DATA_1,SfpChannel=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=BB-1,SfpModule=C,SfpChannel=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=R608,SfpModule=B,SfpChannel=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=BB-1,SfpModule=B,SfpChannel=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=R608,SfpModule=A,SfpChannel=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=BB-1,SfpModule=A,SfpChannel=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=SfpModule" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber502", + "pmCounterNumber503" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=Radio-S3-1,SfpModule=DATA_2", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=Radio-S3-1,SfpModule=DATA_1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=Radio-S2-1,SfpModule=DATA_2", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=Radio-S2-1,SfpModule=DATA_1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=Radio-S1-1,SfpModule=DATA_2", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=Radio-S1-1,SfpModule=DATA_1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=R608,SfpModule=P", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=R608,SfpModule=N", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=R608,SfpModule=B", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=R608,SfpModule=A", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=BB-1,SfpModule=K", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=BB-1,SfpModule=C", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=BB-1,SfpModule=B", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=BB-1,SfpModule=A", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=EthernetPort" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber482", + "pmCounterNumber483", + "pmCounterNumber484", + "pmCounterNumber485", + "pmCounterNumber486", + "pmCounterNumber487", + "pmCounterNumber488", + "pmCounterNumber489", + "pmCounterNumber504", + "pmCounterNumber490", + "pmCounterNumber505", + "pmCounterNumber506", + "pmCounterNumber507", + "pmCounterNumber491" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,Transport=1,EthernetPort=TN_IDL_B_1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=InterfaceIPv4" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber508", + "pmCounterNumber509", + "pmCounterNumber510", + "pmCounterNumber511", + "pmCounterNumber512", + "pmCounterNumber513", + "pmCounterNumber514", + "pmCounterNumber515", + "pmCounterNumber516", + "pmCounterNumber517" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,Transport=1,Router=vr_OAM,InterfaceIPv4=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Transport=1,Router=vr_NR,InterfaceIPv4=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Transport=1,Router=vr_LTE,InterfaceIPv4=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Transport=1,Router=Node_Internal_F1,InterfaceIPv4=NRDU", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Transport=1,Router=Node_Internal_F1,InterfaceIPv4=NRCUCP", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=SctpAssociation" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber518", + "pmCounterNumber519", + "pmCounterNumber520", + "pmCounterNumber521", + "pmCounterNumber522", + "pmCounterNumber523", + "pmCounterNumber524", + "pmCounterNumber525", + "pmCounterNumber526", + "pmCounterNumber527", + "pmCounterNumber528", + "pmCounterNumber529" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,Transport=1,SctpEndpoint=F1_NRDU,SctpAssociation=38472-10.0.0.1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Transport=1,SctpEndpoint=F1_NRCUCP,SctpAssociation=38472-10.0.0.2", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=VlanPort" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber482", + "pmCounterNumber483", + "pmCounterNumber484", + "pmCounterNumber485", + "pmCounterNumber486", + "pmCounterNumber487", + "pmCounterNumber488", + "pmCounterNumber489", + "pmCounterNumber507" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,Transport=1,VlanPort=vr_OAM.IF1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Transport=1,VlanPort=vr_NR.IF1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Transport=1,VlanPort=vr_LTE.IF1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=ConsumedEnergyMeasurement" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber530", + "pmCounterNumber530Accumulated", + "pmCounterNumber532" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,NodeSupport=1,ConsumedEnergyMeasurement=1", + "suspectFlag": "true", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,334,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=EnergyMeter" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber530", + "pmCounterNumber530Accumulated", + "pmCounterNumber532", + "pmCounterNumber533" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=BB-1,EnergyMeter=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "83" + }, + { + "p": 2, + "sValue": "34846" + }, + { + "p": 3, + "sValue": "333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,334,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333" + }, + { + "p": 4, + "sValue": "52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=Radio-S1-1,EnergyMeter=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "12" + }, + { + "p": 2, + "sValue": "4947" + }, + { + "p": 3, + "sValue": "47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47" + }, + { + "p": 4, + "sValue": "53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=Radio-S2-1,EnergyMeter=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "13" + }, + { + "p": 2, + "sValue": "5394" + }, + { + "p": 3, + "sValue": "52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,51,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,51,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52" + }, + { + "p": 4, + "sValue": "54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=Radio-S3-1,EnergyMeter=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "22" + }, + { + "p": 2, + "sValue": "9338" + }, + { + "p": 3, + "sValue": "89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89" + }, + { + "p": 4, + "sValue": "53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,52,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,52,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=R608,EnergyMeter=1", + "suspectFlag": "true", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89" + }, + { + "p": 4, + "sValue": "53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,52,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,52,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=SupportUnit" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber534" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,SupportUnit=2", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "18,18,18" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,SupportUnit=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "30,30,30" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=BbProcessingResource" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber535", + "pmCounterNumber367", + "pmCounterNumber368", + "pmCounterNumber369", + "pmCounterNumber370", + "pmCounterNumber536", + "pmCounterNumber537", + "pmCounterNumber538", + "pmCounterNumber539", + "pmCounterNumber540", + "pmCounterNumber541", + "pmCounterNumber542", + "pmCounterNumber543", + "pmCounterNumber374", + "pmCounterNumber375", + "pmCounterNumber376", + "pmCounterNumber377", + "pmCounterNumber544", + "pmCounterNumber545", + "pmCounterNumber546", + "pmCounterNumber547", + "pmCounterNumber548", + "pmCounterNumber549", + "pmCounterNumber550", + "pmCounterNumber551" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=BB-1,BbProcessingResource=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 8, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 20, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 21, + "sValue": "0" + }, + { + "p": 22, + "sValue": "0" + }, + { + "p": 23, + "sValue": "0" + }, + { + "p": 24, + "sValue": "0" + }, + { + "p": 25, + "sValue": "0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=ENodeBFunction" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber359Aas", + "pmCounterNumber360Aas", + "pmCounterNumber554", + "pmCounterNumber555", + "pmCounterNumber365Actual", + "pmCounterNumber366Actual", + "pmCounterNumber558", + "pmCounterNumber559", + "pmCounterNumber560", + "pmCounterNumber561", + "pmCounterNumber562", + "pmCounterNumber563", + "pmCounterNumber564", + "pmCounterNumber565", + "pmCounterNumber566", + "pmCounterNumber567", + "pmCounterNumber568", + "pmCounterNumber569", + "pmCounterNumber570", + "pmCounterNumber571", + "pmCounterNumber572", + "pmCounterNumber573" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,ENodeBFunction=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "5" + }, + { + "p": 8, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0" + }, + { + "p": 20, + "sValue": "0" + }, + { + "p": 21, + "sValue": "0" + }, + { + "p": 22, + "sValue": "0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=EUtranCellFDD" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber306", + "pmCounterNumber307", + "pmCounterNumber574", + "pmCounterNumber575", + "pmCounterNumber576", + "pmCounterNumber577", + "pmCounterNumber578", + "pmCounterNumber579", + "pmCounterNumber580", + "pmCounterNumber581", + "pmCounterNumber582", + "pmCounterNumber33", + "pmCounterNumber34", + "pmCounterNumber329", + "pmCounterNumber330", + "pmCounterNumber583", + "pmCounterNumber583Arp", + "pmCounterNumber583Csfb", + "pmCounterNumber583CsfbArp", + "pmCounterNumber583CsfbQci", + "pmCounterNumber583HoOngoing", + "pmCounterNumber583HoOngoingArp", + "pmCounterNumber583HoOngoingQci", + "pmCounterNumber583Qci", + "pmCounterNumber592", + "pmCounterNumber592Arp", + "pmCounterNumber594", + "pmCounterNumber595", + "pmCounterNumber596", + "pmCounterNumber597", + "pmCounterNumber598", + "pmCounterNumber599", + "pmCounterNumber599Arp", + "pmCounterNumber599Qci", + "pmCounterNumber602", + "pmCounterNumber602Arp", + "pmCounterNumber604", + "pmCounterNumber605", + "pmCounterNumber606", + "pmCounterNumber607", + "pmCounterNumber608", + "pmCounterNumber609", + "pmCounterNumber610", + "pmCounterNumber611", + "pmCounterNumber612", + "pmCounterNumber613", + "pmCounterNumber614", + "pmCounterNumber615", + "pmCounterNumber616", + "pmCounterNumber617", + "pmCounterNumber618", + "pmCounterNumber619", + "pmCounterNumber620", + "pmCounterNumber621", + "pmCounterNumber409", + "pmCounterNumber622", + "pmCounterNumber623", + "pmCounterNumber624", + "pmCounterNumber625", + "pmCounterNumber626", + "pmCounterNumber627", + "pmCounterNumber413ResUe", + "pmCounterNumber570", + "pmCounterNumber213Ce", + "pmCounterNumber629", + "pmCounterNumber630", + "pmCounterNumber631", + "pmCounterNumber631Uu", + "pmCounterNumber633", + "pmCounterNumber634", + "pmCounterNumber635", + "pmCounterNumber636", + "pmCounterNumber637", + "pmCounterNumber637FiltQci", + "pmCounterNumber637LastTTI", + "pmCounterNumber637LastTTIQci", + "pmCounterNumber641", + "pmCounterNumber642", + "pmCounterNumber643", + "pmCounterNumber350", + "pmCounterNumber350Ce", + "pmCounterNumber350Dta", + "pmCounterNumber350DtaCe", + "pmCounterNumber350Reatt", + "pmCounterNumber350ReattCe", + "pmCounterNumber350ReattDta", + "pmCounterNumber350ReattDtaCe", + "pmCounterNumber650", + "pmCounterNumber650ActiveUsers", + "pmCounterNumber652", + "pmCounterNumber652Ce", + "pmCounterNumber654", + "pmCounterNumber654Ce", + "pmCounterNumber354", + "pmCounterNumber354Ce", + "pmCounterNumber354Dta", + "pmCounterNumber354DtaCe", + "pmCounterNumber354GummeiNative", + "pmCounterNumber660", + "pmCounterNumber661", + "pmCounterNumber662", + "pmCounterNumber663", + "pmCounterNumber664", + "pmCounterNumber664Ce", + "pmCounterNumber664Dta", + "pmCounterNumber664DtaCe", + "pmCounterNumber664Em", + "pmCounterNumber664Hpa", + "pmCounterNumber664Mod", + "pmCounterNumber664ModCe", + "pmCounterNumber664Mos", + "pmCounterNumber664Mta", + "pmCounterNumber664MtaCe", + "pmCounterNumber675", + "pmCounterNumber675Ce", + "pmCounterNumber677", + "pmCounterNumber677Ce", + "pmCounterNumber677Dta", + "pmCounterNumber677DtaCe", + "pmCounterNumber677Em", + "pmCounterNumber677Hpa", + "pmCounterNumber677Mod", + "pmCounterNumber677ModCe", + "pmCounterNumber677Mos", + "pmCounterNumber677Mta", + "pmCounterNumber677MtaCe", + "pmCounterNumber688", + "pmCounterNumber689", + "pmCounterNumber690", + "pmCounterNumber691", + "pmCounterNumber692", + "pmCounterNumber693", + "pmCounterNumber694", + "pmCounterNumber694Em", + "pmCounterNumber696", + "pmCounterNumber696Em", + "pmCounterNumber698", + "pmCounterNumber699", + "pmCounterNumber699Em", + "pmCounterNumber701", + "pmCounterNumber701Em", + "pmCounterNumber703", + "pmCounterNumber704", + "pmCounterNumber705", + "pmCounterNumber706", + "pmCounterNumber7062", + "pmCounterNumber708", + "pmCounterNumber709", + "pmCounterNumber710", + "pmCounterNumber711", + "pmCounterNumber712", + "pmCounterNumber713", + "pmCounterNumber714", + "pmCounterNumber715", + "pmCounterNumber716", + "pmCounterNumber717", + "pmCounterNumber718", + "pmCounterNumber719", + "pmCounterNumber720" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,ENodeBFunction=1,EUtranCellFDD=2", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + }, + { + "p": 17, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0" + }, + { + "p": 20, + "sValue": "0" + }, + { + "p": 21, + "sValue": "0" + }, + { + "p": 22, + "sValue": "0" + }, + { + "p": 23, + "sValue": "0" + }, + { + "p": 24, + "sValue": "0" + }, + { + "p": 25, + "sValue": "0" + }, + { + "p": 26, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 27, + "sValue": "0" + }, + { + "p": 28, + "sValue": "0" + }, + { + "p": 29, + "sValue": "0" + }, + { + "p": 30, + "sValue": "0" + }, + { + "p": 31, + "sValue": "0" + }, + { + "p": 32, + "sValue": "0" + }, + { + "p": 33, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 34, + "sValue": "0" + }, + { + "p": 35, + "sValue": "0" + }, + { + "p": 36, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 37, + "sValue": "0" + }, + { + "p": 38, + "sValue": "0" + }, + { + "p": 39, + "sValue": "0" + }, + { + "p": 40, + "sValue": "0" + }, + { + "p": 41, + "sValue": "0" + }, + { + "p": 42, + "sValue": "0" + }, + { + "p": 43, + "sValue": "0" + }, + { + "p": 44, + "sValue": "0" + }, + { + "p": 45, + "sValue": "0" + }, + { + "p": 46, + "sValue": "0" + }, + { + "p": 47, + "sValue": "0,0,0,0" + }, + { + "p": 48, + "sValue": "0,0,0,0" + }, + { + "p": 49, + "sValue": "0" + }, + { + "p": 50, + "sValue": "0" + }, + { + "p": 51, + "sValue": "0" + }, + { + "p": 52, + "sValue": "0" + }, + { + "p": 53, + "sValue": "0,0,0,0" + }, + { + "p": 54, + "sValue": "0,0,0,0" + }, + { + "p": 55, + "sValue": "0" + }, + { + "p": 56, + "sValue": "0" + }, + { + "p": 57, + "sValue": "0" + }, + { + "p": 58, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 59, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 60, + "sValue": "0" + }, + { + "p": 61, + "sValue": "0" + }, + { + "p": 62, + "sValue": "0" + }, + { + "p": 63, + "sValue": "0" + }, + { + "p": 64, + "sValue": "0,0,0,0" + }, + { + "p": 65, + "sValue": "0" + }, + { + "p": 66, + "sValue": "0" + }, + { + "p": 67, + "sValue": "0" + }, + { + "p": 68, + "sValue": "0" + }, + { + "p": 69, + "sValue": "0" + }, + { + "p": 70, + "sValue": "0" + }, + { + "p": 71, + "sValue": "0" + }, + { + "p": 72, + "sValue": "0" + }, + { + "p": 73, + "sValue": "0" + }, + { + "p": 74, + "sValue": "0" + }, + { + "p": 75, + "sValue": "0" + }, + { + "p": 76, + "sValue": "0" + }, + { + "p": 77, + "sValue": "0" + }, + { + "p": 78, + "sValue": "0" + }, + { + "p": 79, + "sValue": "0" + }, + { + "p": 80, + "sValue": "0" + }, + { + "p": 81, + "sValue": "0,0,0,0" + }, + { + "p": 82, + "sValue": "0" + }, + { + "p": 83, + "sValue": "0,0,0,0" + }, + { + "p": 84, + "sValue": "0" + }, + { + "p": 85, + "sValue": "0,0,0,0" + }, + { + "p": 86, + "sValue": "0" + }, + { + "p": 87, + "sValue": "0,0,0,0" + }, + { + "p": 88, + "sValue": "0" + }, + { + "p": 89, + "sValue": "0" + }, + { + "p": 90, + "sValue": "0" + }, + { + "p": 91, + "sValue": "0,0,0,0" + }, + { + "p": 92, + "sValue": "0" + }, + { + "p": 93, + "sValue": "0,0,0,0" + }, + { + "p": 94, + "sValue": "0" + }, + { + "p": 95, + "sValue": "0,0,0,0" + }, + { + "p": 96, + "sValue": "0" + }, + { + "p": 97, + "sValue": "0,0,0,0" + }, + { + "p": 98, + "sValue": "0" + }, + { + "p": 99, + "sValue": "0" + }, + { + "p": 100, + "sValue": "0" + }, + { + "p": 101, + "sValue": "0" + }, + { + "p": 102, + "sValue": "0" + }, + { + "p": 103, + "sValue": "0" + }, + { + "p": 104, + "sValue": "0,0,0,0" + }, + { + "p": 105, + "sValue": "0" + }, + { + "p": 106, + "sValue": "0,0,0,0" + }, + { + "p": 107, + "sValue": "0" + }, + { + "p": 108, + "sValue": "0" + }, + { + "p": 109, + "sValue": "0" + }, + { + "p": 110, + "sValue": "0,0,0,0" + }, + { + "p": 111, + "sValue": "0" + }, + { + "p": 112, + "sValue": "0" + }, + { + "p": 113, + "sValue": "0,0,0,0" + }, + { + "p": 114, + "sValue": "0" + }, + { + "p": 115, + "sValue": "0,0,0,0" + }, + { + "p": 116, + "sValue": "0" + }, + { + "p": 117, + "sValue": "0,0,0,0" + }, + { + "p": 118, + "sValue": "0" + }, + { + "p": 119, + "sValue": "0,0,0,0" + }, + { + "p": 120, + "sValue": "0" + }, + { + "p": 121, + "sValue": "0" + }, + { + "p": 122, + "sValue": "0" + }, + { + "p": 123, + "sValue": "0,0,0,0" + }, + { + "p": 124, + "sValue": "0" + }, + { + "p": 125, + "sValue": "0" + }, + { + "p": 126, + "sValue": "0,0,0,0" + }, + { + "p": 127, + "sValue": "0" + }, + { + "p": 128, + "sValue": "0" + }, + { + "p": 129, + "sValue": "0" + }, + { + "p": 130, + "sValue": "0" + }, + { + "p": 131, + "sValue": "0" + }, + { + "p": 132, + "sValue": "0" + }, + { + "p": 133, + "sValue": "0" + }, + { + "p": 134, + "sValue": "0" + }, + { + "p": 135, + "sValue": "0" + }, + { + "p": 136, + "sValue": "0" + }, + { + "p": 137, + "sValue": "0" + }, + { + "p": 138, + "sValue": "0" + }, + { + "p": 139, + "sValue": "0" + }, + { + "p": 140, + "sValue": "0" + }, + { + "p": 141, + "sValue": "0" + }, + { + "p": 142, + "sValue": "0" + }, + { + "p": 143, + "sValue": "0" + }, + { + "p": 144, + "sValue": "0" + }, + { + "p": 145, + "sValue": "0" + }, + { + "p": 146, + "sValue": "0" + }, + { + "p": 147, + "sValue": "0" + }, + { + "p": 148, + "sValue": "0" + }, + { + "p": 149, + "sValue": "0" + }, + { + "p": 150, + "sValue": "0" + }, + { + "p": 151, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 152, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 153, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 154, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 155, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 156, + "sValue": "0" + }, + { + "p": 157, + "sValue": "0" + }, + { + "p": 158, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 159, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,ENodeBFunction=1,EUtranCellFDD=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + }, + { + "p": 17, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0" + }, + { + "p": 20, + "sValue": "0" + }, + { + "p": 21, + "sValue": "0" + }, + { + "p": 22, + "sValue": "0" + }, + { + "p": 23, + "sValue": "0" + }, + { + "p": 24, + "sValue": "0" + }, + { + "p": 25, + "sValue": "0" + }, + { + "p": 26, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 27, + "sValue": "0" + }, + { + "p": 28, + "sValue": "0" + }, + { + "p": 29, + "sValue": "0" + }, + { + "p": 30, + "sValue": "0" + }, + { + "p": 31, + "sValue": "0" + }, + { + "p": 32, + "sValue": "0" + }, + { + "p": 33, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 34, + "sValue": "0" + }, + { + "p": 35, + "sValue": "0" + }, + { + "p": 36, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 37, + "sValue": "0" + }, + { + "p": 38, + "sValue": "0" + }, + { + "p": 39, + "sValue": "0" + }, + { + "p": 40, + "sValue": "0" + }, + { + "p": 41, + "sValue": "0" + }, + { + "p": 42, + "sValue": "0" + }, + { + "p": 43, + "sValue": "0" + }, + { + "p": 44, + "sValue": "0" + }, + { + "p": 45, + "sValue": "0" + }, + { + "p": 46, + "sValue": "0" + }, + { + "p": 47, + "sValue": "0,0,0,0" + }, + { + "p": 48, + "sValue": "0,0,0,0" + }, + { + "p": 49, + "sValue": "0" + }, + { + "p": 50, + "sValue": "0" + }, + { + "p": 51, + "sValue": "0" + }, + { + "p": 52, + "sValue": "0" + }, + { + "p": 53, + "sValue": "0,0,0,0" + }, + { + "p": 54, + "sValue": "0,0,0,0" + }, + { + "p": 55, + "sValue": "0" + }, + { + "p": 56, + "sValue": "0" + }, + { + "p": 57, + "sValue": "0" + }, + { + "p": 58, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 59, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 60, + "sValue": "0" + }, + { + "p": 61, + "sValue": "0" + }, + { + "p": 62, + "sValue": "0" + }, + { + "p": 63, + "sValue": "0" + }, + { + "p": 64, + "sValue": "0,0,0,0" + }, + { + "p": 65, + "sValue": "0" + }, + { + "p": 66, + "sValue": "0" + }, + { + "p": 67, + "sValue": "0" + }, + { + "p": 68, + "sValue": "0" + }, + { + "p": 69, + "sValue": "0" + }, + { + "p": 70, + "sValue": "0" + }, + { + "p": 71, + "sValue": "0" + }, + { + "p": 72, + "sValue": "0" + }, + { + "p": 73, + "sValue": "0" + }, + { + "p": 74, + "sValue": "0" + }, + { + "p": 75, + "sValue": "0" + }, + { + "p": 76, + "sValue": "0" + }, + { + "p": 77, + "sValue": "0" + }, + { + "p": 78, + "sValue": "0" + }, + { + "p": 79, + "sValue": "0" + }, + { + "p": 80, + "sValue": "0" + }, + { + "p": 81, + "sValue": "0,0,0,0" + }, + { + "p": 82, + "sValue": "0" + }, + { + "p": 83, + "sValue": "0,0,0,0" + }, + { + "p": 84, + "sValue": "0" + }, + { + "p": 85, + "sValue": "0,0,0,0" + }, + { + "p": 86, + "sValue": "0" + }, + { + "p": 87, + "sValue": "0,0,0,0" + }, + { + "p": 88, + "sValue": "0" + }, + { + "p": 89, + "sValue": "0" + }, + { + "p": 90, + "sValue": "0" + }, + { + "p": 91, + "sValue": "0,0,0,0" + }, + { + "p": 92, + "sValue": "0" + }, + { + "p": 93, + "sValue": "0,0,0,0" + }, + { + "p": 94, + "sValue": "0" + }, + { + "p": 95, + "sValue": "0,0,0,0" + }, + { + "p": 96, + "sValue": "0" + }, + { + "p": 97, + "sValue": "0,0,0,0" + }, + { + "p": 98, + "sValue": "0" + }, + { + "p": 99, + "sValue": "0" + }, + { + "p": 100, + "sValue": "0" + }, + { + "p": 101, + "sValue": "0" + }, + { + "p": 102, + "sValue": "0" + }, + { + "p": 103, + "sValue": "0" + }, + { + "p": 104, + "sValue": "0,0,0,0" + }, + { + "p": 105, + "sValue": "0" + }, + { + "p": 106, + "sValue": "0,0,0,0" + }, + { + "p": 107, + "sValue": "0" + }, + { + "p": 108, + "sValue": "0" + }, + { + "p": 109, + "sValue": "0" + }, + { + "p": 110, + "sValue": "0,0,0,0" + }, + { + "p": 111, + "sValue": "0" + }, + { + "p": 112, + "sValue": "0" + }, + { + "p": 113, + "sValue": "0,0,0,0" + }, + { + "p": 114, + "sValue": "0" + }, + { + "p": 115, + "sValue": "0,0,0,0" + }, + { + "p": 116, + "sValue": "0" + }, + { + "p": 117, + "sValue": "0,0,0,0" + }, + { + "p": 118, + "sValue": "0" + }, + { + "p": 119, + "sValue": "0,0,0,0" + }, + { + "p": 120, + "sValue": "0" + }, + { + "p": 121, + "sValue": "0" + }, + { + "p": 122, + "sValue": "0" + }, + { + "p": 123, + "sValue": "0,0,0,0" + }, + { + "p": 124, + "sValue": "0" + }, + { + "p": 125, + "sValue": "0" + }, + { + "p": 126, + "sValue": "0,0,0,0" + }, + { + "p": 127, + "sValue": "0" + }, + { + "p": 128, + "sValue": "0" + }, + { + "p": 129, + "sValue": "0" + }, + { + "p": 130, + "sValue": "0" + }, + { + "p": 131, + "sValue": "0" + }, + { + "p": 132, + "sValue": "0" + }, + { + "p": 133, + "sValue": "0" + }, + { + "p": 134, + "sValue": "0" + }, + { + "p": 135, + "sValue": "0" + }, + { + "p": 136, + "sValue": "0" + }, + { + "p": 137, + "sValue": "0" + }, + { + "p": 138, + "sValue": "0" + }, + { + "p": 139, + "sValue": "0" + }, + { + "p": 140, + "sValue": "0" + }, + { + "p": 141, + "sValue": "0" + }, + { + "p": 142, + "sValue": "0" + }, + { + "p": 143, + "sValue": "0" + }, + { + "p": 144, + "sValue": "0" + }, + { + "p": 145, + "sValue": "0" + }, + { + "p": 146, + "sValue": "0" + }, + { + "p": 147, + "sValue": "0" + }, + { + "p": 148, + "sValue": "0" + }, + { + "p": 149, + "sValue": "0" + }, + { + "p": 150, + "sValue": "0" + }, + { + "p": 151, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 152, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 153, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 154, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 155, + "sValue": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 156, + "sValue": "0" + }, + { + "p": 157, + "sValue": "0" + }, + { + "p": 158, + "sValue": "0,0,0,0,0,0,0,0" + }, + { + "p": 159, + "sValue": "0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=BbProcessingResource" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber550Burst", + "pmCounterNumber550Format", + "pmCounterNumber550X2Fwd", + "pmCounterNumber724", + "pmCounterNumber725" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,Equipment=1,FieldReplaceableUnit=BB-1,BbProcessingResource=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=EUtranCellFDD" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber726", + "pmCounterNumber727", + "pmCounterNumber728", + "pmCounterNumber729", + "pmCounterNumber730", + "pmCounterNumber731", + "pmCounterNumber732", + "pmCounterNumber733", + "pmCounterNumber734", + "pmCounterNumber735", + "pmCounterNumber629CatMDrxNoSyncQci", + "pmCounterNumber629CatMDrxSyncQci", + "pmCounterNumber629CatMNoDrxNoSyncQci", + "pmCounterNumber629CatMNoDrxSyncQci", + "pmCounterNumber629DrxNoSyncQci", + "pmCounterNumber629DrxSync", + "pmCounterNumber629DrxSyncQci", + "pmCounterNumber629NoDrxNoSyncQci", + "pmCounterNumber629NoDrxSyncQci", + "pmCounterNumber629Qci", + "pmCounterNumber630CatMDrxNoSyncQci", + "pmCounterNumber630CatMDrxSyncQci", + "pmCounterNumber630CatMNoDrxNoSyncQci", + "pmCounterNumber630CatMNoDrxSyncQci", + "pmCounterNumber630DrxNoSyncQci", + "pmCounterNumber630DrxSync", + "pmCounterNumber630DrxSyncQci", + "pmCounterNumber630NoDrxNoSyncQci", + "pmCounterNumber630NoDrxSyncQci", + "pmCounterNumber630Qci", + "pmCounterNumber756", + "pmCounterNumber756Qci", + "pmCounterNumber758", + "pmCounterNumber758Qci", + "pmCounterNumber631Qci", + "pmCounterNumber631UuQci", + "pmCounterNumber762", + "pmCounterNumber633Limitations", + "pmCounterNumber633MissingPdus2Qci", + "pmCounterNumber633Qci", + "pmCounterNumber633RohcFail2Qci", + "pmCounterNumber633SrbTooLarge", + "pmCounterNumber768", + "pmCounterNumber769", + "pmCounterNumber770", + "pmCounterNumber771", + "pmCounterNumber771Qci", + "pmCounterNumber634Qci", + "pmCounterNumber635Qci", + "pmCounterNumber775", + "pmCounterNumber637Ca", + "pmCounterNumber637LastTTICa", + "pmCounterNumber637Qci", + "pmCounterNumber637TransPlmn0", + "pmCounterNumber637TransPlmn1", + "pmCounterNumber637TransPlmn2", + "pmCounterNumber637TransPlmn3", + "pmCounterNumber637TransPlmn4", + "pmCounterNumber637TransPlmn5", + "pmCounterNumber637TransPlmn6", + "pmCounterNumber637TransQci", + "pmCounterNumber787", + "pmCounterNumber641Trans", + "pmCounterNumber789", + "pmCounterNumber642Plmn0", + "pmCounterNumber642Plmn1", + "pmCounterNumber642Plmn2", + "pmCounterNumber642Plmn3", + "pmCounterNumber642Plmn4", + "pmCounterNumber642Plmn5", + "pmCounterNumber642Plmn6", + "pmCounterNumber642Qci", + "pmCounterNumber798" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,ENodeBFunction=1,EUtranCellFDD=2", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 6, + "sValue": "0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 7, + "sValue": "0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 8, + "sValue": "0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 9, + "sValue": "0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 10, + "sValue": "0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0" + }, + { + "p": 20, + "sValue": "0" + }, + { + "p": 21, + "sValue": "0" + }, + { + "p": 22, + "sValue": "0" + }, + { + "p": 23, + "sValue": "0" + }, + { + "p": 24, + "sValue": "0" + }, + { + "p": 25, + "sValue": "0" + }, + { + "p": 26, + "sValue": "0" + }, + { + "p": 27, + "sValue": "0" + }, + { + "p": 28, + "sValue": "0" + }, + { + "p": 29, + "sValue": "0" + }, + { + "p": 30, + "sValue": "0" + }, + { + "p": 31, + "sValue": "0" + }, + { + "p": 32, + "sValue": "0" + }, + { + "p": 33, + "sValue": "0" + }, + { + "p": 34, + "sValue": "0" + }, + { + "p": 35, + "sValue": "0" + }, + { + "p": 36, + "sValue": "0" + }, + { + "p": 37, + "sValue": "0" + }, + { + "p": 38, + "sValue": "0" + }, + { + "p": 39, + "sValue": "0" + }, + { + "p": 40, + "sValue": "0" + }, + { + "p": 41, + "sValue": "0" + }, + { + "p": 42, + "sValue": "0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 43, + "sValue": "0" + }, + { + "p": 44, + "sValue": "0" + }, + { + "p": 45, + "sValue": "0" + }, + { + "p": 46, + "sValue": "0" + }, + { + "p": 47, + "sValue": "0" + }, + { + "p": 48, + "sValue": "0" + }, + { + "p": 49, + "sValue": "0" + }, + { + "p": 50, + "sValue": "0" + }, + { + "p": 51, + "sValue": "0" + }, + { + "p": 52, + "sValue": "0" + }, + { + "p": 53, + "sValue": "0" + }, + { + "p": 54, + "sValue": "0" + }, + { + "p": 55, + "sValue": "0" + }, + { + "p": 56, + "sValue": "0" + }, + { + "p": 57, + "sValue": "0" + }, + { + "p": 58, + "sValue": "0" + }, + { + "p": 59, + "sValue": "0" + }, + { + "p": 60, + "sValue": "0" + }, + { + "p": 61, + "sValue": "0" + }, + { + "p": 62, + "sValue": "0" + }, + { + "p": 63, + "sValue": "0" + }, + { + "p": 64, + "sValue": "0" + }, + { + "p": 65, + "sValue": "0" + }, + { + "p": 66, + "sValue": "0" + }, + { + "p": 67, + "sValue": "0" + }, + { + "p": 68, + "sValue": "0" + }, + { + "p": 69, + "sValue": "0" + }, + { + "p": 70, + "sValue": "0" + }, + { + "p": 71, + "sValue": "0" + }, + { + "p": 72, + "sValue": "0" + }, + { + "p": 73, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,ENodeBFunction=1,EUtranCellFDD=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 6, + "sValue": "0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 7, + "sValue": "0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 8, + "sValue": "0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 9, + "sValue": "0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 10, + "sValue": "0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 11, + "sValue": "0" + }, + { + "p": 12, + "sValue": "0" + }, + { + "p": 13, + "sValue": "0" + }, + { + "p": 14, + "sValue": "0" + }, + { + "p": 15, + "sValue": "0" + }, + { + "p": 16, + "sValue": "0" + }, + { + "p": 17, + "sValue": "0" + }, + { + "p": 18, + "sValue": "0" + }, + { + "p": 19, + "sValue": "0" + }, + { + "p": 20, + "sValue": "0" + }, + { + "p": 21, + "sValue": "0" + }, + { + "p": 22, + "sValue": "0" + }, + { + "p": 23, + "sValue": "0" + }, + { + "p": 24, + "sValue": "0" + }, + { + "p": 25, + "sValue": "0" + }, + { + "p": 26, + "sValue": "0" + }, + { + "p": 27, + "sValue": "0" + }, + { + "p": 28, + "sValue": "0" + }, + { + "p": 29, + "sValue": "0" + }, + { + "p": 30, + "sValue": "0" + }, + { + "p": 31, + "sValue": "0" + }, + { + "p": 32, + "sValue": "0" + }, + { + "p": 33, + "sValue": "0" + }, + { + "p": 34, + "sValue": "0" + }, + { + "p": 35, + "sValue": "0" + }, + { + "p": 36, + "sValue": "0" + }, + { + "p": 37, + "sValue": "0" + }, + { + "p": 38, + "sValue": "0" + }, + { + "p": 39, + "sValue": "0" + }, + { + "p": 40, + "sValue": "0" + }, + { + "p": 41, + "sValue": "0" + }, + { + "p": 42, + "sValue": "0,0,0,0,0,0,0,0,0,0" + }, + { + "p": 43, + "sValue": "0" + }, + { + "p": 44, + "sValue": "0" + }, + { + "p": 45, + "sValue": "0" + }, + { + "p": 46, + "sValue": "0" + }, + { + "p": 47, + "sValue": "0" + }, + { + "p": 48, + "sValue": "0" + }, + { + "p": 49, + "sValue": "0" + }, + { + "p": 50, + "sValue": "0" + }, + { + "p": 51, + "sValue": "0" + }, + { + "p": 52, + "sValue": "0" + }, + { + "p": 53, + "sValue": "0" + }, + { + "p": 54, + "sValue": "0" + }, + { + "p": 55, + "sValue": "0" + }, + { + "p": 56, + "sValue": "0" + }, + { + "p": 57, + "sValue": "0" + }, + { + "p": 58, + "sValue": "0" + }, + { + "p": 59, + "sValue": "0" + }, + { + "p": 60, + "sValue": "0" + }, + { + "p": 61, + "sValue": "0" + }, + { + "p": 62, + "sValue": "0" + }, + { + "p": 63, + "sValue": "0" + }, + { + "p": 64, + "sValue": "0" + }, + { + "p": 65, + "sValue": "0" + }, + { + "p": 66, + "sValue": "0" + }, + { + "p": 67, + "sValue": "0" + }, + { + "p": 68, + "sValue": "0" + }, + { + "p": 69, + "sValue": "0" + }, + { + "p": 70, + "sValue": "0" + }, + { + "p": 71, + "sValue": "0" + }, + { + "p": 72, + "sValue": "0" + }, + { + "p": 73, + "sValue": "0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=GNBCUUPFunction_GNBCUUP" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber799", + "pmCounterNumber799Gtpu", + "pmCounterNumber799NoCtxt", + "pmCounterNumber802", + "pmCounterNumber803", + "pmCounterNumber804", + "pmCounterNumber805", + "pmCounterNumber806", + "pmCounterNumber807", + "pmCounterNumber808" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBCUUPFunction=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + }, + { + "p": 3, + "sValue": "0" + }, + { + "p": 4, + "sValue": "0" + }, + { + "p": 5, + "sValue": "0" + }, + { + "p": 6, + "sValue": "0" + }, + { + "p": 7, + "sValue": "0" + }, + { + "p": 8, + "sValue": "0" + }, + { + "p": 9, + "sValue": "0" + }, + { + "p": 10, + "sValue": "0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=NRCellCU_GNBCUCP" + }, + "measTypes": { + "sMeasTypesList": [ + "pmEndcUeCapabilityUlPdcpDelay" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBCUCPFunction=1,NRCellCU=32", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBCUCPFunction=1,NRCellCU=31", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBCUCPFunction=1,NRCellCU=2", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + } + ] + }, + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBCUCPFunction=1,NRCellCU=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + } + ] + } + ] + }, + { + "measInfoId": { + "sMeasInfoId": "PM=1,PmGroup=X2UTermination_GNBCUUP" + }, + "measTypes": { + "sMeasTypesList": [ + "pmCounterNumber802", + "pmCounterNumber803" + ] + }, + "measValuesList": [ + { + "measObjInstId": "ManagedElement=GNODEB-0,GNBCUUPFunction=1,X2UTermination=1", + "suspectFlag": "false", + "measResults": [ + { + "p": 1, + "sValue": "0" + }, + { + "p": 2, + "sValue": "0" + } + ] + } + ] + } + ] + } + } + } +} \ No newline at end of file diff --git a/pm-file-converter/components/miniocollector/miniocollector.go b/pm-file-converter/components/miniocollector/miniocollector.go index 1663194..ac8ce05 100644 --- a/pm-file-converter/components/miniocollector/miniocollector.go +++ b/pm-file-converter/components/miniocollector/miniocollector.go @@ -24,10 +24,6 @@ import ( "compress/gzip" "context" "fmt" - jsoniter "github.com/json-iterator/go" - "github.com/minio/minio-go/v7" - "github.com/minio/minio-go/v7/pkg/credentials" - log "github.com/sirupsen/logrus" "io" "main/common/dataTypes" "main/components/xmltransform" @@ -35,8 +31,14 @@ import ( "os" "strings" "time" + + jsoniter "github.com/json-iterator/go" + "github.com/minio/minio-go/v7" + "github.com/minio/minio-go/v7/pkg/credentials" + log "github.com/sirupsen/logrus" ) +// nolint func Xml_to_json_conv(evt_data *dataTypes.XmlFileEventHeader) string { filestoreUser := os.Getenv("FILESTORE_USER") filestorePwd := os.Getenv("FILESTORE_PWD") @@ -76,6 +78,7 @@ func Xml_to_json_conv(evt_data *dataTypes.XmlFileEventHeader) string { return newObjectName } +// nolint func upload_object(mc *minio.Client, b []byte, objectName string, fsbucket string) { contentType := "application/json" if strings.HasSuffix(objectName, ".gz") { @@ -109,6 +112,7 @@ func upload_object(mc *minio.Client, b []byte, objectName string, fsbucket strin } } +// nolint func create_minio_bucket(mc *minio.Client, bucket string) error { tctx := context.Background() err := mc.MakeBucket(tctx, bucket, minio.MakeBucketOptions{}) @@ -127,6 +131,7 @@ func create_minio_bucket(mc *minio.Client, bucket string) error { return nil } +// nolint func check_minio_bucket(mc *minio.Client, bucket string) bool { tctx := context.Background() exists, err := mc.BucketExists(tctx, bucket) @@ -139,6 +144,7 @@ func check_minio_bucket(mc *minio.Client, bucket string) bool { } // Write gzipped data to a Writer +// nolint func gzipWrite(w io.Writer, data *[]byte) error { gw, err1 := gzip.NewWriterLevel(w, gzip.BestSpeed) diff --git a/pm-file-converter/components/miniocollector/miniocollector_test.go b/pm-file-converter/components/miniocollector/miniocollector_test.go new file mode 100644 index 0000000..17327a8 --- /dev/null +++ b/pm-file-converter/components/miniocollector/miniocollector_test.go @@ -0,0 +1,175 @@ +package miniocollector + +import ( + "bytes" + "context" + "io" + "log" + "os" + "testing" + + "github.com/minio/minio-go/v7" + "github.com/minio/minio-go/v7/pkg/credentials" + "github.com/stretchr/testify/assert" +) + +func TestMake_minio_bucket(t *testing.T) { + + endpoint := "play.min.io:9000" + accessKey := "Q3AM3UQ867SPQQA43P2F" + secretKey := "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG" + + minioClient, err := minio.New(endpoint, &minio.Options{ + Creds: credentials.NewStaticV4(accessKey, secretKey, ""), + Secure: true, + }) + if err != nil { + log.Fatalf("Error creating Minio client: %v", err) + } + + if _, err := minioClient.ListBuckets(context.Background()); err != nil { + log.Fatalf("Error connecting to Minio server: %v", err) + } + + // Create a test bucket. + bucketName := "my-test-bucket" + err = create_minio_bucket(minioClient, bucketName) + if err != nil { + log.Fatalf("Error creating bucket: %v", err) + } else { + assert.NoError(t, err) + } +} + +func Test_bucket_cannot_empty(t *testing.T) { + + endpoint := "play.min.io:9000" + accessKey := "Q3AM3UQ867SPQQA43P2F" + secretKey := "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG" + + minioClient, err := minio.New(endpoint, &minio.Options{ + Creds: credentials.NewStaticV4(accessKey, secretKey, ""), + Secure: true, + }) + if err != nil { + log.Fatalf("Error creating Minio client: %v", err) + } + + if _, err := minioClient.ListBuckets(context.Background()); err != nil { + log.Fatalf("Error connecting to Minio server: %v", err) + } + + // Create a test bucket. + bucketName := "" + err = create_minio_bucket(minioClient, bucketName) + if err != nil { + assert.Error(t, err) + } else { + assert.NoError(t, err) + } +} + +func Test_check_minio_bucket(t *testing.T) { + + endpoint := "play.min.io:9000" + accessKey := "Q3AM3UQ867SPQQA43P2F" + secretKey := "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG" + + found := false + + minioClient, err := minio.New(endpoint, &minio.Options{ + Creds: credentials.NewStaticV4(accessKey, secretKey, ""), + Secure: true, + }) + if err != nil { + log.Fatalf("Error creating Minio client: %v", err) + } + + if _, err := minioClient.ListBuckets(context.Background()); err != nil { + log.Fatalf("Error connecting to Minio server: %v", err) + } + + // Create a test bucket. + bucketName := "my-test-bucket" + found = check_minio_bucket(minioClient, bucketName) + if found { + assert.True(t, found) + } else { + assert.False(t, found) + } +} + +func Test_bucket_not_exists(t *testing.T) { + + endpoint := "play.min.io:9000" + accessKey := "Q3AM3UQ867SPQQA43P2F" + secretKey := "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG" + + found := false + + minioClient, err := minio.New(endpoint, &minio.Options{ + Creds: credentials.NewStaticV4(accessKey, secretKey, ""), + Secure: true, + }) + if err != nil { + log.Fatalf("Error creating Minio client: %v", err) + } + + if _, err := minioClient.ListBuckets(context.Background()); err != nil { + log.Fatalf("Error connecting to Minio server: %v", err) + } + + // Create a test bucket. + bucketName := "my-test-bucket-not-exists" + found = check_minio_bucket(minioClient, bucketName) + if found { + assert.True(t, found) + } else { + assert.False(t, found) + } +} + +func Test_upload_object(t *testing.T) { + + endpoint := "play.min.io:9000" + accessKey := "Q3AM3UQ867SPQQA43P2F" + secretKey := "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG" + + minioClient, err := minio.New(endpoint, &minio.Options{ + Creds: credentials.NewStaticV4(accessKey, secretKey, ""), + Secure: true, + }) + if err != nil { + log.Fatalf("Error creating Minio client: %v", err) + } + + if _, err := minioClient.ListBuckets(context.Background()); err != nil { + log.Fatalf("Error connecting to Minio server: %v", err) + } + + json_filename := "minio_upload_test.json" + + fi, err := os.Open(json_filename) + + if err != nil { + t.Fatalf("File %s - cannot be opened - discarding message, error details: %s", json_filename, err.Error()) + } + defer fi.Close() + + reader := fi + + var buf3 bytes.Buffer + _, err2 := io.Copy(&buf3, reader) + if err2 != nil { + t.Fatalf("File %s - cannot be read, discarding message, %s", json_filename, err.Error()) + return + } + file_bytes := buf3.Bytes() + + // Create a test bucket. + bucketName := "my-test-bucket" + upload_object(minioClient, file_bytes, "minio_upload_test.json", bucketName) + + assert.NoError(t, err) + +} diff --git a/pm-file-converter/components/xmltransform/xmltransform.go b/pm-file-converter/components/xmltransform/xmltransform.go index 8e88d19..e7e04e4 100644 --- a/pm-file-converter/components/xmltransform/xmltransform.go +++ b/pm-file-converter/components/xmltransform/xmltransform.go @@ -35,6 +35,7 @@ import ( "time" ) +//lint:ignore S117 func xml_to_json_conv(f_byteValue *[]byte, xfeh *dataTypes.XmlFileEventHeader) ([]byte, error) { var f dataTypes.MeasCollecFile start := time.Now() diff --git a/pm-file-converter/go.mod b/pm-file-converter/go.mod index 7c5318d..5cb7baf 100644 --- a/pm-file-converter/go.mod +++ b/pm-file-converter/go.mod @@ -2,38 +2,40 @@ module main go 1.19 -require ( - github.com/confluentinc/confluent-kafka-go v1.9.2 - github.com/gorilla/mux v1.8.0 -) +require github.com/confluentinc/confluent-kafka-go v1.9.2 require ( - github.com/google/uuid v1.3.0 - github.com/influxdata/influxdb-client-go/v2 v2.12.2 github.com/json-iterator/go v1.1.12 - github.com/minio/minio-go/v7 v7.0.35 + github.com/minio/minio-go/v7 v7.0.41 github.com/sirupsen/logrus v1.9.0 - golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d + golang.org/x/oauth2 v0.12.0 +) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/rogpeppe/go-internal v1.8.1 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) require ( - github.com/deepmap/oapi-codegen v1.8.2 // indirect github.com/dustin/go-humanize v1.0.0 // indirect - github.com/golang/protobuf v1.5.2 // indirect - github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 // indirect - github.com/klauspost/compress v1.15.9 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/google/uuid v1.3.0 // indirect + github.com/klauspost/compress v1.16.0 // indirect github.com/klauspost/cpuid/v2 v2.1.0 // indirect github.com/minio/md5-simd v1.1.2 // indirect github.com/minio/sha256-simd v1.0.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/pkg/errors v0.9.1 // indirect github.com/rs/xid v1.4.0 // indirect - golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect - golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect - golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect - golang.org/x/text v0.3.7 // indirect - google.golang.org/appengine v1.4.0 // indirect - google.golang.org/protobuf v1.28.0 // indirect - gopkg.in/ini.v1 v1.66.6 // indirect + github.com/stretchr/testify v1.8.4 + golang.org/x/crypto v0.13.0 // indirect + golang.org/x/net v0.15.0 // indirect + golang.org/x/sys v0.12.0 // indirect + golang.org/x/text v0.13.0 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/protobuf v1.31.0 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect ) diff --git a/pm-file-converter/go.sum b/pm-file-converter/go.sum index 9f41053..de3bd33 100644 --- a/pm-file-converter/go.sum +++ b/pm-file-converter/go.sum @@ -20,13 +20,9 @@ github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWH github.com/confluentinc/confluent-kafka-go v1.9.2 h1:gV/GxhMBUb03tFWkN+7kdhg+zf+QUM+wVkI9zwh770Q= github.com/confluentinc/confluent-kafka-go v1.9.2/go.mod h1:ptXNqsuDfYbAE/LBW6pnwWZElUoWxHoV8E43DCrliyo= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deepmap/oapi-codegen v1.8.2 h1:SegyeYGcdi0jLLrpbCMoJxnUUn8GBXHsvr4rbzjuhfU= -github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -40,14 +36,11 @@ github.com/frankban/quicktest v1.2.2/go.mod h1:Qh/WofXFeiAFII1aEBu529AtJo6Zg2VHs github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o= github.com/frankban/quicktest v1.10.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y= github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= -github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= @@ -59,12 +52,12 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.2.1-0.20190312032427-6f77996f0c42/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -73,22 +66,17 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20211008130755-947d60d73cc0/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hamba/avro v1.5.6/go.mod h1:3vNT0RLXXpFm2Tb/5KC71ZRJlOroggq1Rcitb6k4Fr8= github.com/heetch/avro v0.3.1/go.mod h1:4xn38Oz/+hiEUTpbVfGVLfvOg0yKLlRP7Q9+gJJILgA= github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= -github.com/influxdata/influxdb-client-go/v2 v2.12.2 h1:uYABKdrEKlYm+++qfKdbgaHKBPmoWR5wpbmj6MBB/2g= -github.com/influxdata/influxdb-client-go/v2 v2.12.2/go.mod h1:YteV91FiQxRdccyJ2cHvj2f/5sq4y4Njqu1fQzsQCOU= -github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 h1:W9WBk7wlPfJLvMCdtV4zPulc4uCPrlywQOmbFOhgQNU= -github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= github.com/invopop/jsonschema v0.4.0/go.mod h1:O9uiLokuu0+MGFlyiaqtWxwqJm41/+8Nj0lD7A36YH0= github.com/jhump/gopoet v0.0.0-20190322174617-17282ff210b3/go.mod h1:me9yfT6IJSlOL3FCfrg+L6yzUEZ+5jW6WHt4Sk+UPUI= github.com/jhump/gopoet v0.1.0/go.mod h1:me9yfT6IJSlOL3FCfrg+L6yzUEZ+5jW6WHt4Sk+UPUI= @@ -100,37 +88,29 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/juju/qthttptest v0.1.1/go.mod h1:aTlAv8TYaflIiTDIQYzxnl1QdPjAg8Q8qJMErpKy6A4= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY= -github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4= +github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.1.0 h1:eyi1Ad2aNJMW95zcSbmGg7Cg6cq3ADwLpMAP96d8rF0= github.com/klauspost/cpuid/v2 v2.1.0/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/linkedin/goavro v2.1.0+incompatible/go.mod h1:bBCwI2eGYpUI/4820s67MElg9tdeLbINjLjiM2xZFYM= github.com/linkedin/goavro/v2 v2.10.0/go.mod h1:UgQUb2N/pmueQYH9bfqFioWxzYCZXSfF8Jw03O5sjqA= github.com/linkedin/goavro/v2 v2.10.1/go.mod h1:UgQUb2N/pmueQYH9bfqFioWxzYCZXSfF8Jw03O5sjqA= github.com/linkedin/goavro/v2 v2.11.1/go.mod h1:UgQUb2N/pmueQYH9bfqFioWxzYCZXSfF8Jw03O5sjqA= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= -github.com/minio/minio-go/v7 v7.0.35 h1:JuPPxWLdxQmNLSaS8AWZnO5HBadeI1xg6FGrEELQEVU= -github.com/minio/minio-go/v7 v7.0.35/go.mod h1:nCrRzjoSUQh8hgKKtu3Y708OLvRLtuASMg2/nvmbarw= +github.com/minio/minio-go/v7 v7.0.41 h1:Qhc82nDRep+VSuDEPSawKUHkARnZI5st7acEqgqVX+k= +github.com/minio/minio-go/v7 v7.0.41/go.mod h1:nCrRzjoSUQh8hgKKtu3Y708OLvRLtuASMg2/nvmbarw= github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g= github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -142,9 +122,6 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/nrwiersma/avro-benchmarks v0.0.0-20210913175520-21aec48c8f76/go.mod h1:iKyFMidsk/sVYONJRE372sJuX/QTRPacU7imPqqsu7g= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -152,6 +129,8 @@ github.com/rogpeppe/clock v0.0.0-20190514195947-2896927a307a/go.mod h1:4r5QyqhjI github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= +github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rs/xid v1.4.0 h1:qd7wPTDkN6KQx2VmMBLrpHkiyQwgFXRnkOLacUiaSNY= github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/santhosh-tekuri/jsonschema/v5 v5.0.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0= @@ -160,23 +139,18 @@ github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVs github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -188,19 +162,20 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200505041828-1ed23360d12c/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4= +golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -209,50 +184,40 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= @@ -278,26 +243,29 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/avro.v0 v0.0.0-20171217001914-a730b5802183/go.mod h1:FvqrFXt+jCsyQibeRv4xxEJBL5iG2DDW5aeJwzDiq4A= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v1 v1.0.0/go.mod h1:CxwszS/Xz1C49Ucd2i6Zil5UToP1EmyrFhKaMVbg1mk= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/httprequest.v1 v1.2.1/go.mod h1:x2Otw96yda5+8+6ZeWwHIJTFkEHWP/qP8pJOzqEtWPM= -gopkg.in/ini.v1 v1.66.6 h1:LATuAqN/shcYAOkv3wl2L4rkaKqkcgTBQjOyYDvcPKI= -gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/retry.v1 v1.0.3/go.mod h1:FJkXmWiMaAo7xB+xhvDF59zhfjDWyzmyAxiT4dB688g= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..63b49bb --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,6 @@ +sonar.build.sourceEncoding=UTF-8 +sonar.exclusions=**/*_test.go,**/gentools/**/*,**/mocks/**/*,**/*.gen.go,**/*.html,docs/conf.py +sonar.sources=collector +sonar.tests=pm-file-converter +sonar.test.inclusions=**/*_test.go +sonar.typescript.lcov.reportPaths=pm-file-converter/coverage.txt -- 2.16.6 From a93caaf7243d896161775d590f1ab322dd63ee16 Mon Sep 17 00:00:00 2001 From: ambrishest Date: Mon, 18 Sep 2023 08:39:56 +0100 Subject: [PATCH 05/16] Improve Test coverage of DFC Issue-ID: NONRTRIC-874 Change-Id: Ifaa71b7352bdff50c4c8e6af18ab5655036c4f57 Signed-off-by: ambrishest --- datafilecollector/pom.xml | 7 + .../org/oran/datafile/configuration/AppConfig.java | 7 + .../datafile/configuration/CertificateConfig.java | 4 + .../oran/datafile/configuration/SftpConfig.java | 2 + .../org/oran/datafile/datastore/FileStore.java | 2 +- .../org/oran/datafile/datastore/S3ObjectStore.java | 12 +- .../java/org/oran/datafile/http/DfcHttpClient.java | 5 +- .../org/oran/datafile/http/DfcHttpsClient.java | 4 +- .../http/HttpAsyncClientBuilderWrapper.java | 59 -- .../java/org/oran/datafile/http/HttpUtils.java | 4 - .../java/org/oran/datafile/model/FileData.java | 2 + .../org/oran/datafile/model/FileReadyMessage.java | 42 + .../org/oran/datafile/model/FileServerData.java | 9 + .../oran/datafile/oauth2/OAuthBearerTokenJwt.java | 40 +- ...OAuthKafkaAuthenticateLoginCallbackHandler.java | 49 +- .../org/oran/datafile/oauth2/SecurityContext.java | 3 +- .../oran/datafile/tasks/CollectAndReportFiles.java | 3 +- .../org/oran/datafile/tasks/FileCollector.java | 2 +- .../test/java/org/oran/datafile/Integration.java | 7 +- .../oran/datafile/configuration/AppConfigTest.java | 168 ++++ .../configuration/CertificateConfigTest.java | 39 + .../datafile/controllers/StatusControllerTest.java | 10 +- .../org/oran/datafile/datastore/DataStoreTest.java | 54 ++ .../org/oran/datafile/datastore/FileStoreTest.java | 257 ++++++ .../oran/datafile/datastore/S3ObjectStoreTest.java | 321 ++++++++ .../org/oran/datafile/ftp/FtpesClientTest.java | 64 +- .../oran/datafile/ftp/SftpClientSettingsTest.java | 8 +- .../java/org/oran/datafile/ftp/SftpClientTest.java | 18 +- .../http/HttpsClientConnectionManagerUtilTest.java | 8 +- .../java/org/oran/datafile/model/CountersTest.java | 71 ++ .../java/org/oran/datafile/model/FileDataTest.java | 256 ++++++ .../datafile/model/FilePublishInformationTest.java | 907 +++++++++++++++++++++ .../oran/datafile/model/FileReadyMessageTest.java | 43 + .../oran/datafile/model/FileServerDataTest.java | 40 + .../java/org/oran/datafile/model/SchemeTest.java | 8 +- .../datafile/oauth2/OAuthBearerTokenJwtTest.java | 109 +++ ...hKafkaAuthenticateLoginCallbackHandlerTest.java | 128 +++ .../oran/datafile/oauth2/SecurityContextTest.java | 81 ++ .../datafile/tasks/CollectAndReportFilesTest.java | 94 +++ .../org/oran/datafile/tasks/FileCollectorTest.java | 16 +- .../datafile/tasks/KafkaTopicListenerTest.java | 70 ++ .../resources/org/oran/datafile/datastore/file.txt | 1 + 42 files changed, 2864 insertions(+), 170 deletions(-) delete mode 100644 datafilecollector/src/main/java/org/oran/datafile/http/HttpAsyncClientBuilderWrapper.java create mode 100644 datafilecollector/src/test/java/org/oran/datafile/configuration/AppConfigTest.java create mode 100644 datafilecollector/src/test/java/org/oran/datafile/configuration/CertificateConfigTest.java create mode 100644 datafilecollector/src/test/java/org/oran/datafile/datastore/DataStoreTest.java create mode 100644 datafilecollector/src/test/java/org/oran/datafile/datastore/FileStoreTest.java create mode 100644 datafilecollector/src/test/java/org/oran/datafile/datastore/S3ObjectStoreTest.java create mode 100644 datafilecollector/src/test/java/org/oran/datafile/model/CountersTest.java create mode 100644 datafilecollector/src/test/java/org/oran/datafile/model/FileDataTest.java create mode 100644 datafilecollector/src/test/java/org/oran/datafile/model/FilePublishInformationTest.java create mode 100644 datafilecollector/src/test/java/org/oran/datafile/model/FileReadyMessageTest.java create mode 100644 datafilecollector/src/test/java/org/oran/datafile/model/FileServerDataTest.java create mode 100644 datafilecollector/src/test/java/org/oran/datafile/oauth2/OAuthBearerTokenJwtTest.java create mode 100644 datafilecollector/src/test/java/org/oran/datafile/oauth2/OAuthKafkaAuthenticateLoginCallbackHandlerTest.java create mode 100644 datafilecollector/src/test/java/org/oran/datafile/oauth2/SecurityContextTest.java create mode 100644 datafilecollector/src/test/java/org/oran/datafile/tasks/CollectAndReportFilesTest.java create mode 100644 datafilecollector/src/test/java/org/oran/datafile/tasks/KafkaTopicListenerTest.java create mode 100644 datafilecollector/src/test/resources/org/oran/datafile/datastore/file.txt diff --git a/datafilecollector/pom.xml b/datafilecollector/pom.xml index b3e7472..37b39d7 100644 --- a/datafilecollector/pom.xml +++ b/datafilecollector/pom.xml @@ -40,7 +40,9 @@ 2.0.2 1.6.14 true + 3.7.0.1746 + @@ -137,6 +139,11 @@ mockito-junit-jupiter test + + org.mockito + mockito-inline + test + commons-net commons-net diff --git a/datafilecollector/src/main/java/org/oran/datafile/configuration/AppConfig.java b/datafilecollector/src/main/java/org/oran/datafile/configuration/AppConfig.java index 6689f5d..6282cd4 100644 --- a/datafilecollector/src/main/java/org/oran/datafile/configuration/AppConfig.java +++ b/datafilecollector/src/main/java/org/oran/datafile/configuration/AppConfig.java @@ -21,6 +21,7 @@ import java.util.Map; import lombok.Getter; +import lombok.Setter; import org.apache.kafka.clients.CommonClientConfigs; import org.apache.kafka.common.config.SaslConfigs; import org.apache.kafka.common.config.SslConfigs; @@ -55,6 +56,7 @@ public class AppConfig { @Value("${app.collected-files-path}") @Getter + @Setter private String collectedFilesPath; @Value("${app.sftp.strict-host-key-checking:false}") @@ -77,22 +79,27 @@ public class AppConfig { private String clientTrustStorePassword; @Getter + @Setter @Value("${app.s3.endpointOverride:}") private String s3EndpointOverride; @Getter + @Setter @Value("${app.s3.accessKeyId:}") private String s3AccessKeyId; @Getter + @Setter @Value("${app.s3.secretAccessKey:}") private String s3SecretAccessKey; @Getter + @Setter @Value("${app.s3.bucket:}") private String s3Bucket; @Value("${app.s3.locksBucket:}") + @Setter private String s3LocksBucket; @Value("${app.number-of-worker-treads:200}") diff --git a/datafilecollector/src/main/java/org/oran/datafile/configuration/CertificateConfig.java b/datafilecollector/src/main/java/org/oran/datafile/configuration/CertificateConfig.java index 889eb98..3de2b3b 100644 --- a/datafilecollector/src/main/java/org/oran/datafile/configuration/CertificateConfig.java +++ b/datafilecollector/src/main/java/org/oran/datafile/configuration/CertificateConfig.java @@ -26,11 +26,15 @@ import lombok.Builder; @Builder public class CertificateConfig { + @SuppressWarnings("java:S1104") public String keyCert; + @SuppressWarnings("java:S1104") public String keyPasswordPath; + @SuppressWarnings("java:S1104") public String trustedCa; + @SuppressWarnings("java:S1104") public String trustedCaPasswordPath; } diff --git a/datafilecollector/src/main/java/org/oran/datafile/configuration/SftpConfig.java b/datafilecollector/src/main/java/org/oran/datafile/configuration/SftpConfig.java index 559e64e..0eee07d 100644 --- a/datafilecollector/src/main/java/org/oran/datafile/configuration/SftpConfig.java +++ b/datafilecollector/src/main/java/org/oran/datafile/configuration/SftpConfig.java @@ -25,7 +25,9 @@ import lombok.Builder; @Builder public class SftpConfig { + @SuppressWarnings("java:S1104") public boolean strictHostKeyChecking; + @SuppressWarnings("java:S1104") public String knownHostsFilePath; } diff --git a/datafilecollector/src/main/java/org/oran/datafile/datastore/FileStore.java b/datafilecollector/src/main/java/org/oran/datafile/datastore/FileStore.java index 6d98afc..a6711c6 100644 --- a/datafilecollector/src/main/java/org/oran/datafile/datastore/FileStore.java +++ b/datafilecollector/src/main/java/org/oran/datafile/datastore/FileStore.java @@ -138,7 +138,7 @@ public class FileStore implements DataStore { return Mono.just("OK"); } - private Path path(String name) { + public Path path(String name) { return Path.of(appConfig.getCollectedFilesPath(), name); } diff --git a/datafilecollector/src/main/java/org/oran/datafile/datastore/S3ObjectStore.java b/datafilecollector/src/main/java/org/oran/datafile/datastore/S3ObjectStore.java index 5d1400d..5da27b0 100644 --- a/datafilecollector/src/main/java/org/oran/datafile/datastore/S3ObjectStore.java +++ b/datafilecollector/src/main/java/org/oran/datafile/datastore/S3ObjectStore.java @@ -73,6 +73,12 @@ public class S3ObjectStore implements DataStore { getS3AsynchClient(applicationConfig); } + @SuppressWarnings({"java:S3010", "java:S2209"}) + public S3ObjectStore(AppConfig applicationConfig, S3AsyncClient s3AsynchClient) { + this.applicationConfig = applicationConfig; + this.s3AsynchClient = s3AsynchClient; + } + private static synchronized S3AsyncClient getS3AsynchClient(AppConfig applicationConfig) { if (applicationConfig.isS3Enabled() && s3AsynchClient == null) { s3AsynchClient = getS3AsyncClientBuilder(applicationConfig).build(); @@ -209,13 +215,9 @@ public class S3ObjectStore implements DataStore { oids.add(oid); } - Delete delete = Delete.builder() // - .objects(oids) // - .build(); - DeleteObjectsRequest request = DeleteObjectsRequest.builder() // .bucket(bucket(bucket)) // - .delete(delete) // + .delete(Delete.builder().objects(oids).build()) //NOSONAR .build(); CompletableFuture future = s3AsynchClient.deleteObjects(request); diff --git a/datafilecollector/src/main/java/org/oran/datafile/http/DfcHttpClient.java b/datafilecollector/src/main/java/org/oran/datafile/http/DfcHttpClient.java index f941155..fd56ee9 100644 --- a/datafilecollector/src/main/java/org/oran/datafile/http/DfcHttpClient.java +++ b/datafilecollector/src/main/java/org/oran/datafile/http/DfcHttpClient.java @@ -92,12 +92,13 @@ public class DfcHttpClient implements FileCollectClient { try { latch.await(); } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new DatafileTaskException("Interrupted exception after datafile download - ", e); } if (isDownloadFailed(errorMessage)) { - if (errorMessage.get() instanceof NonRetryableDatafileTaskException) { - throw (NonRetryableDatafileTaskException) errorMessage.get(); + if (errorMessage.get() instanceof NonRetryableDatafileTaskException nonRetryableException) { + throw nonRetryableException; } throw (DatafileTaskException) errorMessage.get(); } diff --git a/datafilecollector/src/main/java/org/oran/datafile/http/DfcHttpsClient.java b/datafilecollector/src/main/java/org/oran/datafile/http/DfcHttpsClient.java index 5cd0a31..f79082d 100644 --- a/datafilecollector/src/main/java/org/oran/datafile/http/DfcHttpsClient.java +++ b/datafilecollector/src/main/java/org/oran/datafile/http/DfcHttpsClient.java @@ -82,6 +82,7 @@ public class DfcHttpsClient implements FileCollectClient { } @Override + @SuppressWarnings("java:S2139") public void collectFile(String remoteFile, Path localFile) throws DatafileTaskException { logger.trace("Prepare to collectFile {}", localFile); HttpGet httpGet = new HttpGet(HttpUtils.prepareHttpsUri(fileServerData, remoteFile)); @@ -97,12 +98,13 @@ public class DfcHttpsClient implements FileCollectClient { HttpResponse httpResponse = makeCall(httpGet); processResponse(httpResponse, localFile); } catch (IOException e) { - logger.error("marker", e); + logger.error("Error downloading file from server. Details: {}", e.getMessage()); throw new DatafileTaskException("Error downloading file from server. ", e); } logger.trace("HTTPS collectFile OK"); } + @SuppressWarnings("java:S2139") HttpResponse makeCall(HttpGet httpGet) throws IOException, DatafileTaskException { try { HttpResponse httpResponse = executeHttpClient(httpGet); diff --git a/datafilecollector/src/main/java/org/oran/datafile/http/HttpAsyncClientBuilderWrapper.java b/datafilecollector/src/main/java/org/oran/datafile/http/HttpAsyncClientBuilderWrapper.java deleted file mode 100644 index 92877a5..0000000 --- a/datafilecollector/src/main/java/org/oran/datafile/http/HttpAsyncClientBuilderWrapper.java +++ /dev/null @@ -1,59 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2019-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.oran.datafile.http; - -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.SSLContext; - -import org.apache.http.client.RedirectStrategy; -import org.apache.http.client.config.RequestConfig; -import org.apache.http.impl.nio.client.CloseableHttpAsyncClient; -import org.apache.http.impl.nio.client.HttpAsyncClientBuilder; -import org.apache.http.impl.nio.client.HttpAsyncClients; - -public class HttpAsyncClientBuilderWrapper { - HttpAsyncClientBuilder builder = HttpAsyncClients.custom(); - - public HttpAsyncClientBuilderWrapper setRedirectStrategy(RedirectStrategy redirectStrategy) { - builder.setRedirectStrategy(redirectStrategy); - return this; - } - - public HttpAsyncClientBuilderWrapper setSslContext(SSLContext sslcontext) { - builder.setSSLContext(sslcontext); - return this; - } - - public HttpAsyncClientBuilderWrapper setSslHostnameVerifier(HostnameVerifier hostnameVerifier) { - builder.setSSLHostnameVerifier(hostnameVerifier); - return this; - } - - public HttpAsyncClientBuilderWrapper setDefaultRequestConfig(RequestConfig config) { - builder.setDefaultRequestConfig(config); - return this; - } - - public CloseableHttpAsyncClient build() { - return builder.build(); - } - -} diff --git a/datafilecollector/src/main/java/org/oran/datafile/http/HttpUtils.java b/datafilecollector/src/main/java/org/oran/datafile/http/HttpUtils.java index 308b47e..3d085d4 100644 --- a/datafilecollector/src/main/java/org/oran/datafile/http/HttpUtils.java +++ b/datafilecollector/src/main/java/org/oran/datafile/http/HttpUtils.java @@ -21,16 +21,12 @@ package org.oran.datafile.http; import java.util.Base64; import java.util.List; - import org.apache.hc.core5.http.NameValuePair; import org.apache.http.HttpStatus; import org.oran.datafile.model.FileServerData; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public final class HttpUtils implements HttpStatus { - private static final Logger logger = LoggerFactory.getLogger(HttpUtils.class); public static final int HTTP_DEFAULT_PORT = 80; public static final int HTTPS_DEFAULT_PORT = 443; diff --git a/datafilecollector/src/main/java/org/oran/datafile/model/FileData.java b/datafilecollector/src/main/java/org/oran/datafile/model/FileData.java index 4b013be..33a9327 100644 --- a/datafilecollector/src/main/java/org/oran/datafile/model/FileData.java +++ b/datafilecollector/src/main/java/org/oran/datafile/model/FileData.java @@ -86,8 +86,10 @@ public class FileData { private static final Logger logger = LoggerFactory.getLogger(FileData.class); + @SuppressWarnings("java:S1104") public FileReadyMessage.ArrayOfNamedHashMap fileInfo; + @SuppressWarnings("java:S1104") public FileReadyMessage.MessageMetaData messageMetaData; public static Iterable createFileData(FileReadyMessage msg) { diff --git a/datafilecollector/src/main/java/org/oran/datafile/model/FileReadyMessage.java b/datafilecollector/src/main/java/org/oran/datafile/model/FileReadyMessage.java index 05e332c..05b55ea 100644 --- a/datafilecollector/src/main/java/org/oran/datafile/model/FileReadyMessage.java +++ b/datafilecollector/src/main/java/org/oran/datafile/model/FileReadyMessage.java @@ -33,24 +33,43 @@ public class FileReadyMessage { @Builder public static class MessageMetaData { + @SuppressWarnings("java:S1104") public String eventId; + @SuppressWarnings("java:S1104") public String priority; + + @SuppressWarnings("java:S1104") public String version; + + @SuppressWarnings("java:S1104") public String reportingEntityName; + + @SuppressWarnings("java:S1104") public int sequence; + + @SuppressWarnings("java:S1104") public String domain; + @SuppressWarnings("java:S1104") public String eventName; + + @SuppressWarnings("java:S1104") public String vesEventListenerVersion; + @SuppressWarnings("java:S1104") public String sourceName; + @SuppressWarnings("java:S1104") public long lastEpochMicrosec; + + @SuppressWarnings("java:S1104") public long startEpochMicrosec; + @SuppressWarnings("java:S1104") public String timeZoneOffset; + @SuppressWarnings("java:S1104") public String changeIdentifier; /** @@ -59,6 +78,7 @@ public class FileReadyMessage { * example: Noti_RnNode-Ericsson_FileReady * */ + @SuppressWarnings("java:S6035") public String productName() { String[] eventArray = eventName.split("_|-"); if (eventArray.length >= 2) { @@ -68,6 +88,7 @@ public class FileReadyMessage { } } + @SuppressWarnings("java:S6035") public String vendorName() { String[] eventArray = eventName.split("_|-"); if (eventArray.length >= 3) { @@ -80,32 +101,53 @@ public class FileReadyMessage { @Builder public static class FileInfo { + @SuppressWarnings("java:S1104") public String fileFormatType; + + @SuppressWarnings("java:S1104") public String location; + + @SuppressWarnings("java:S1104") public String fileFormatVersion; + + @SuppressWarnings("java:S1104") public String compression; } @Builder public static class ArrayOfNamedHashMap { + @SuppressWarnings("java:S1104") public String name; + + @SuppressWarnings("java:S1104") public FileInfo hashMap; } @Builder public static class NotificationFields { + @SuppressWarnings("java:S1104") public String notificationFieldsVersion; + + @SuppressWarnings("java:S1104") public String changeType; + + @SuppressWarnings("java:S1104") public String changeIdentifier; + + @SuppressWarnings("java:S1104") public List arrayOfNamedHashMap; } @Builder public static class Event { + @SuppressWarnings("java:S1104") public MessageMetaData commonEventHeader; + + @SuppressWarnings("java:S1104") public NotificationFields notificationFields; } + @SuppressWarnings("java:S1104") public Event event; } diff --git a/datafilecollector/src/main/java/org/oran/datafile/model/FileServerData.java b/datafilecollector/src/main/java/org/oran/datafile/model/FileServerData.java index 0bb41a2..187d2b2 100644 --- a/datafilecollector/src/main/java/org/oran/datafile/model/FileServerData.java +++ b/datafilecollector/src/main/java/org/oran/datafile/model/FileServerData.java @@ -21,6 +21,7 @@ import java.util.ArrayList; import java.util.List; import lombok.Builder; +import lombok.Getter; import lombok.ToString; import org.apache.hc.core5.http.NameValuePair; @@ -34,10 +35,16 @@ import org.apache.hc.core5.http.NameValuePair; @ToString public class FileServerData { + @SuppressWarnings("java:S1104") + @Getter public String serverAddress; + + @SuppressWarnings("java:S1104") + @Getter public String userId; @ToString.Exclude + @Getter public String password; @Builder.Default @@ -47,5 +54,7 @@ public class FileServerData { @Builder.Default public String uriRawFragment = ""; + @SuppressWarnings("java:S1104") + @Getter public Integer port; } diff --git a/datafilecollector/src/main/java/org/oran/datafile/oauth2/OAuthBearerTokenJwt.java b/datafilecollector/src/main/java/org/oran/datafile/oauth2/OAuthBearerTokenJwt.java index 24e7608..c93a36b 100644 --- a/datafilecollector/src/main/java/org/oran/datafile/oauth2/OAuthBearerTokenJwt.java +++ b/datafilecollector/src/main/java/org/oran/datafile/oauth2/OAuthBearerTokenJwt.java @@ -1,35 +1,33 @@ -// ============LICENSE_START=============================================== -// Copyright (C) 2023 Nordix Foundation. 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. -// ============LICENSE_END================================================= -// +/*- + * ============LICENSE_START======================================================= + * 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.oran.datafile.oauth2; import java.util.Base64; import java.util.HashSet; import java.util.Set; - import lombok.ToString; - import org.apache.kafka.common.security.oauthbearer.OAuthBearerToken; import org.oran.datafile.exceptions.DatafileTaskException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class OAuthBearerTokenJwt implements OAuthBearerToken { - private static final Logger logger = LoggerFactory.getLogger(OAuthBearerTokenJwt.class); private static final com.google.gson.Gson gson = new com.google.gson.GsonBuilder().disableHtmlEscaping().create(); private final String jwtTokenRaw; diff --git a/datafilecollector/src/main/java/org/oran/datafile/oauth2/OAuthKafkaAuthenticateLoginCallbackHandler.java b/datafilecollector/src/main/java/org/oran/datafile/oauth2/OAuthKafkaAuthenticateLoginCallbackHandler.java index 54911dc..a0664c2 100644 --- a/datafilecollector/src/main/java/org/oran/datafile/oauth2/OAuthKafkaAuthenticateLoginCallbackHandler.java +++ b/datafilecollector/src/main/java/org/oran/datafile/oauth2/OAuthKafkaAuthenticateLoginCallbackHandler.java @@ -1,19 +1,21 @@ -// ============LICENSE_START=============================================== -// Copyright (C) 2023 Nordix Foundation. 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. -// ============LICENSE_END================================================= -// +/*- + * ============LICENSE_START======================================================= + * 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. + * + * ============LICENSE_END========================================================= + */ package org.oran.datafile.oauth2; @@ -51,6 +53,8 @@ public class OAuthKafkaAuthenticateLoginCallbackHandler implements AuthenticateC @Override public void close() { + /*This method intentionally left empty. + Close functionality will be implemented later.*/ } @Override @@ -59,11 +63,11 @@ public class OAuthKafkaAuthenticateLoginCallbackHandler implements AuthenticateC if (!this.isConfigured) throw new IllegalStateException("Callback handler not configured"); for (Callback callback : callbacks) { - logger.debug("callback " + callback.toString()); - if (callback instanceof OAuthBearerTokenCallback) { - handleCallback((OAuthBearerTokenCallback) callback); - } else if (callback instanceof SaslExtensionsCallback) { - handleCallback((SaslExtensionsCallback) callback); + logger.debug("callback {}", callback); + if (callback instanceof OAuthBearerTokenCallback oauthBearerTokenCallback) { + handleCallback(oauthBearerTokenCallback); + } else if (callback instanceof SaslExtensionsCallback saslExtensionsCallback) { + handleCallback(saslExtensionsCallback); } else { logger.error("Unsupported callback: {}", callback); throw new UnsupportedCallbackException(callback); @@ -90,4 +94,7 @@ public class OAuthKafkaAuthenticateLoginCallbackHandler implements AuthenticateC } } + public boolean isConfigured() { + return isConfigured; + } } diff --git a/datafilecollector/src/main/java/org/oran/datafile/oauth2/SecurityContext.java b/datafilecollector/src/main/java/org/oran/datafile/oauth2/SecurityContext.java index 578c111..aa13ca1 100644 --- a/datafilecollector/src/main/java/org/oran/datafile/oauth2/SecurityContext.java +++ b/datafilecollector/src/main/java/org/oran/datafile/oauth2/SecurityContext.java @@ -49,10 +49,11 @@ public class SecurityContext { private static SecurityContext instance; @Setter + @Getter private Path authTokenFilePath; public SecurityContext(@Value("${app.auth-token-file:}") String authTokenFilename) { - instance = this; + instance = this; //NOSONAR if (!authTokenFilename.isEmpty()) { this.authTokenFilePath = Path.of(authTokenFilename); } diff --git a/datafilecollector/src/main/java/org/oran/datafile/tasks/CollectAndReportFiles.java b/datafilecollector/src/main/java/org/oran/datafile/tasks/CollectAndReportFiles.java index 93b9a71..9ea9d57 100644 --- a/datafilecollector/src/main/java/org/oran/datafile/tasks/CollectAndReportFiles.java +++ b/datafilecollector/src/main/java/org/oran/datafile/tasks/CollectAndReportFiles.java @@ -258,7 +258,8 @@ public class CollectAndReportFiles { private Mono handleFetchFileFailure(FileData fileData, Throwable t) { Path localFilePath = fileData.getLocalFilePath(this.appConfig); - logger.error("File fetching failed, path {}, reason: {}", fileData.remoteFilePath(), t.getMessage()); + String remoteFilePath = fileData.remoteFilePath(); + logger.error("File fetching failed, path {}, reason: {}", remoteFilePath, t.getMessage()); deleteFile(localFilePath); if (FileData.Scheme.isFtpScheme(fileData.scheme())) { counters.incNoOfFailedFtp(); diff --git a/datafilecollector/src/main/java/org/oran/datafile/tasks/FileCollector.java b/datafilecollector/src/main/java/org/oran/datafile/tasks/FileCollector.java index c36bd49..999d2e8 100644 --- a/datafilecollector/src/main/java/org/oran/datafile/tasks/FileCollector.java +++ b/datafilecollector/src/main/java/org/oran/datafile/tasks/FileCollector.java @@ -169,7 +169,7 @@ public class FileCollector { return new SftpClient(fileData.fileServerData(), new SftpClientSettings(appConfig.getSftpConfiguration())); } - protected FtpesClient createFtpesClient(FileData fileData) throws DatafileTaskException { + protected FtpesClient createFtpesClient(FileData fileData) { CertificateConfig config = appConfig.getCertificateConfiguration(); Path trustedCa = config.trustedCa.isEmpty() ? null : Paths.get(config.trustedCa); diff --git a/datafilecollector/src/test/java/org/oran/datafile/Integration.java b/datafilecollector/src/test/java/org/oran/datafile/Integration.java index 27b36c1..c8ef111 100644 --- a/datafilecollector/src/test/java/org/oran/datafile/Integration.java +++ b/datafilecollector/src/test/java/org/oran/datafile/Integration.java @@ -238,11 +238,6 @@ class Integration { } } - @Test - void clear() { - - } - @Test void testKafka() throws InterruptedException { waitForKafkaListener(); @@ -278,7 +273,7 @@ class Integration { while (kafkaReceiver.count < NO_OF_OBJECTS) { logger.info("sleeping {}", kafkaReceiver.count); - Thread.sleep(1000 * 1); + Thread.sleep(1000); //NOSONAR } String rec = kafkaReceiver.lastValue(); diff --git a/datafilecollector/src/test/java/org/oran/datafile/configuration/AppConfigTest.java b/datafilecollector/src/test/java/org/oran/datafile/configuration/AppConfigTest.java new file mode 100644 index 0000000..549cc03 --- /dev/null +++ b/datafilecollector/src/test/java/org/oran/datafile/configuration/AppConfigTest.java @@ -0,0 +1,168 @@ +/*- + * ============LICENSE_START======================================================= + * 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.oran.datafile.configuration; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.lang.reflect.Field; +import java.util.HashMap; +import java.util.Map; +import org.apache.kafka.clients.CommonClientConfigs; +import org.apache.kafka.common.config.SaslConfigs; +import org.apache.kafka.common.config.SslConfigs; +import org.apache.kafka.common.security.auth.SecurityProtocol; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.MockitoAnnotations; +import org.mockito.junit.jupiter.MockitoExtension; +import org.oran.datafile.oauth2.OAuthKafkaAuthenticateLoginCallbackHandler; +import org.springframework.test.context.ContextConfiguration; + +@ContextConfiguration(classes = {AppConfig.class}) +@ExtendWith(MockitoExtension.class) +class AppConfigTest { + + @InjectMocks + private AppConfig appConfig; + + @BeforeEach + void setup() { + MockitoAnnotations.initMocks(this); + } + @Test + void testGetS3LocksBucket_WhenEmptyLocksBucket_ReturnsS3Bucket() { + injectFieldValue(appConfig, "s3Bucket", "test-bucket"); + injectFieldValue(appConfig, "s3LocksBucket", ""); + + String result = appConfig.getS3LocksBucket(); + assertEquals("test-bucket", result); + } + + @Test + void testGetS3LocksBucket_WhenNonEmptyLocksBucket_ReturnsLocksBucket() { + injectFieldValue(appConfig, "s3Bucket", "test-bucket"); + injectFieldValue(appConfig, "s3LocksBucket", "locks"); + + String result = appConfig.getS3LocksBucket(); + assertEquals("locks", result); + } + + @Test + void testIsS3Enabled_WhenS3EndpointAndBucketSet_ReturnsTrue() { + injectFieldValue(appConfig, "s3Bucket", "test-bucket"); + injectFieldValue(appConfig, "s3EndpointOverride", "s3.endpoint"); + boolean result = appConfig.isS3Enabled(); + assertTrue(result); + } + + @Test + void testIsS3Enabled_WhenS3EndpointNotSet_ReturnsFalse() { + injectFieldValue(appConfig, "s3Bucket", "test-bucket"); + injectFieldValue(appConfig, "s3EndpointOverride", ""); + boolean result = appConfig.isS3Enabled(); + assertFalse(result); + } + + @Test + void testGetKafkaBootStrapServers() { + assertNull((new AppConfig()).getKafkaBootStrapServers()); + } + + @Test + void testAddKafkaSecurityProps_UseOAuthToken() { + Map props = new HashMap<>(); + injectFieldValue(appConfig, "useOathToken", true); + injectFieldValue(appConfig, "kafkaKeyStoreLocation", "key-store-location"); + injectFieldValue(appConfig, "kafkTrustStoreLocation", "trust-store-location"); + injectFieldValue(appConfig, "kafkaKeyStorePassword", "key-store-password"); + + appConfig.addKafkaSecurityProps(props); + + assertEquals(SecurityProtocol.SASL_SSL.name, props.get(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG)); + assertEquals("OAUTHBEARER", props.get(SaslConfigs.SASL_MECHANISM)); + assertEquals(OAuthKafkaAuthenticateLoginCallbackHandler.class.getName(), + props.get(SaslConfigs.SASL_LOGIN_CALLBACK_HANDLER_CLASS)); + assertEquals( + "org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required unsecuredLoginStringClaim_sub=\"alice\"; ", + props.get(SaslConfigs.SASL_JAAS_CONFIG)); + } + + @Test + void testAddKafkaSecurityProps_SslConfig() { + Map props = new HashMap<>(); + injectFieldValue(appConfig, "useOathToken", false); + injectFieldValue(appConfig, "kafkaKeyStoreLocation", "key-store-location"); + injectFieldValue(appConfig, "kafkaKeyStoreType", "JKS"); + injectFieldValue(appConfig, "kafkaKeyStorePassword", "key-store-password"); + injectFieldValue(appConfig, "kafkTrustStoreLocation", "trust-store-location"); + injectFieldValue(appConfig, "kafkaTrustStoreType", "JKS"); + + appConfig.addKafkaSecurityProps(props); + + assertEquals(SecurityProtocol.SASL_SSL.name, props.get(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG)); + assertEquals("JKS", props.get(SslConfigs.SSL_KEYSTORE_TYPE_CONFIG)); + assertEquals("key-store-location", props.get(SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG)); + assertEquals("key-store-password", props.get(SslConfigs.SSL_KEY_PASSWORD_CONFIG)); + assertEquals("JKS", props.get(SslConfigs.SSL_TRUSTSTORE_TYPE_CONFIG)); + assertEquals("trust-store-location", props.get(SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG)); + } + + @Test + void testGetCertificateConfiguration() { + injectFieldValue(appConfig, "clientTrustStore", "trust-store"); + injectFieldValue(appConfig, "clientTrustStorePassword", "trust-store-password"); + injectFieldValue(appConfig, "clientKeyStore", "key-store"); + injectFieldValue(appConfig, "clientKeyStorePassword", "key-store-password"); + + CertificateConfig certificateConfig = appConfig.getCertificateConfiguration(); + + assertEquals("trust-store", certificateConfig.trustedCa); + assertEquals("trust-store-password", certificateConfig.trustedCaPasswordPath); + assertEquals("key-store", certificateConfig.keyCert); + assertEquals("key-store-password", certificateConfig.keyPasswordPath); + } + + @Test + void testGetSftpConfiguration() { + injectFieldValue(appConfig, "knownHostsFilePath", "/path/to/known_hosts"); + injectFieldValue(appConfig, "strictHostKeyChecking", true); + + SftpConfig sftpConfig = appConfig.getSftpConfiguration(); + + assertEquals("/path/to/known_hosts", sftpConfig.knownHostsFilePath); + assertTrue(sftpConfig.strictHostKeyChecking); + } + + private void injectFieldValue(Object target, String fieldName, Object value) { + try { + Field field = target.getClass().getDeclaredField(fieldName); + field.setAccessible(true); + field.set(target, value); + } catch (NoSuchFieldException | IllegalAccessException e) { + e.printStackTrace(); + } + } +} diff --git a/datafilecollector/src/test/java/org/oran/datafile/configuration/CertificateConfigTest.java b/datafilecollector/src/test/java/org/oran/datafile/configuration/CertificateConfigTest.java new file mode 100644 index 0000000..b030b84 --- /dev/null +++ b/datafilecollector/src/test/java/org/oran/datafile/configuration/CertificateConfigTest.java @@ -0,0 +1,39 @@ +/*- + * ============LICENSE_START======================================================= + * 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.oran.datafile.configuration; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +class CertificateConfigTest { + @Test + void testConstructor() { + CertificateConfig actualCertificateConfig = new CertificateConfig("Key Cert", "Key Password Path", "Trusted Ca", + "Trusted Ca Password Path"); + + assertEquals("Key Cert", actualCertificateConfig.keyCert); + assertEquals("Trusted Ca Password Path", actualCertificateConfig.trustedCaPasswordPath); + assertEquals("Trusted Ca", actualCertificateConfig.trustedCa); + assertEquals("Key Password Path", actualCertificateConfig.keyPasswordPath); + } +} + diff --git a/datafilecollector/src/test/java/org/oran/datafile/controllers/StatusControllerTest.java b/datafilecollector/src/test/java/org/oran/datafile/controllers/StatusControllerTest.java index 1826096..39d4dc1 100644 --- a/datafilecollector/src/test/java/org/oran/datafile/controllers/StatusControllerTest.java +++ b/datafilecollector/src/test/java/org/oran/datafile/controllers/StatusControllerTest.java @@ -21,6 +21,7 @@ package org.oran.datafile.controllers; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.doReturn; @@ -32,11 +33,12 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.oran.datafile.model.Counters; import org.oran.datafile.tasks.CollectAndReportFiles; import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatusCode; import org.springframework.http.ResponseEntity; import reactor.core.publisher.Mono; @ExtendWith(MockitoExtension.class) -public class StatusControllerTest { +class StatusControllerTest { @Mock CollectAndReportFiles scheduledTasksMock; @@ -48,7 +50,7 @@ public class StatusControllerTest { } @Test - public void heartbeat_success() { + void heartbeat_success() { HttpHeaders httpHeaders = new HttpHeaders(); Mono> result = controllerUnderTest.heartbeat(httpHeaders); @@ -58,7 +60,7 @@ public class StatusControllerTest { } @Test - public void status() { + void status() { Counters counters = new Counters(); doReturn(counters).when(scheduledTasksMock).getCounters(); @@ -67,6 +69,8 @@ public class StatusControllerTest { Mono> result = controllerUnderTest.status(httpHeaders); String body = result.block().getBody(); + HttpStatusCode httpStatusCode = result.block().getStatusCode(); + assertEquals(200, httpStatusCode.value()); System.out.println(body); } diff --git a/datafilecollector/src/test/java/org/oran/datafile/datastore/DataStoreTest.java b/datafilecollector/src/test/java/org/oran/datafile/datastore/DataStoreTest.java new file mode 100644 index 0000000..e2e800e --- /dev/null +++ b/datafilecollector/src/test/java/org/oran/datafile/datastore/DataStoreTest.java @@ -0,0 +1,54 @@ +/*- + * ============LICENSE_START======================================================= + * 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.oran.datafile.datastore; + +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.when; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.oran.datafile.configuration.AppConfig; + +@ExtendWith(MockitoExtension.class) +class DataStoreTest { + + @Mock + private AppConfig mockAppConfig; + + @Test + void testCreateWithS3Enabled() { + when(mockAppConfig.isS3Enabled()).thenReturn(true); + when(mockAppConfig.getS3EndpointOverride()).thenReturn("https://dummy-s3-bucket.s3.amazonaws.com"); + when(mockAppConfig.getS3AccessKeyId()).thenReturn("test-access-key-id"); + when(mockAppConfig.getS3SecretAccessKey()).thenReturn("test-access-key-secret"); + DataStore dataStore = DataStore.create(mockAppConfig); + assertTrue(dataStore instanceof S3ObjectStore); + } + + @Test + void testCreateWithS3Disabled() { + when(mockAppConfig.isS3Enabled()).thenReturn(false); + DataStore dataStore = DataStore.create(mockAppConfig); + assertTrue(dataStore instanceof FileStore); + } +} diff --git a/datafilecollector/src/test/java/org/oran/datafile/datastore/FileStoreTest.java b/datafilecollector/src/test/java/org/oran/datafile/datastore/FileStoreTest.java new file mode 100644 index 0000000..21ff1c1 --- /dev/null +++ b/datafilecollector/src/test/java/org/oran/datafile/datastore/FileStoreTest.java @@ -0,0 +1,257 @@ +/*- + * ============LICENSE_START======================================================= + * 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.oran.datafile.datastore; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.anyInt; +import static org.mockito.Mockito.atLeast; +import static org.mockito.Mockito.eq; +import static org.mockito.Mockito.mockStatic; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.io.IOException; +import java.nio.file.FileVisitor; +import java.nio.file.Files; +import java.nio.file.LinkOption; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.MockedStatic; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.mockito.junit.jupiter.MockitoExtension; +import org.oran.datafile.configuration.AppConfig; +import org.springframework.test.context.ContextConfiguration; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; + +@ContextConfiguration(classes = { FileStore.class }) +@ExtendWith(MockitoExtension.class) +class FileStoreTest { + + @Mock + private AppConfig appConfig; + + private FileStore fileStore; + + @Mock + private Path mockPath; + + @BeforeEach + void setup() { + MockitoAnnotations.initMocks(this); + fileStore = new FileStore(appConfig); + + when(appConfig.getCollectedFilesPath()).thenReturn("/path/to/collected/files"); + } + + @Test + void testListObjects() { + when(appConfig.getCollectedFilesPath()).thenReturn("Collected Files Path"); + fileStore.listObjects(DataStore.Bucket.FILES, "Prefix"); + verify(appConfig).getCollectedFilesPath(); + } + @Test + void testListObjects3() { + when(appConfig.getCollectedFilesPath()).thenReturn("Collected Files Path"); + fileStore.listObjects(DataStore.Bucket.LOCKS, "Prefix"); + verify(appConfig).getCollectedFilesPath(); + } + + @Test + void testListObjects_WithExistingFiles() { + List fileList = new ArrayList<>(); + fileList.add(Path.of("/path/to/collected/files/file1.txt")); + fileList.add(Path.of("/path/to/collected/files/file2.txt")); + + when(appConfig.getCollectedFilesPath()).thenReturn("/path/to/collected/files"); + + // Mock Files.walk() to return the prepared stream + try (MockedStatic filesMockedStatic = mockStatic(Files.class)) { + filesMockedStatic.when(() -> Files.walk(any(), anyInt())). + thenReturn(fileList.stream()); + + StepVerifier.create(fileStore.listObjects(DataStore.Bucket.FILES, "")). + expectNext("file1.txt"). + expectNext("file2.txt"). + expectComplete(); + } + } + @Test + void testReadObject() { + when(appConfig.getCollectedFilesPath()).thenReturn("Collected Files Path"); + fileStore.readObject(DataStore.Bucket.FILES, "foo.txt"); + verify(appConfig).getCollectedFilesPath(); + } + @Test + void testReadObject2() { + when(appConfig.getCollectedFilesPath()).thenReturn("Collected Files Path"); + fileStore.readObject(DataStore.Bucket.LOCKS, "foo.txt"); + verify(appConfig).getCollectedFilesPath(); + } + + @Test + void testReadObject_WithExistingFile() { + byte[] content = "Hello, world!".getBytes(); + Path filePath = Path.of("/path/to/collected/files/test.txt"); + + try (MockedStatic filesMockedStatic = mockStatic(Files.class)) { + filesMockedStatic.when(() -> Files.readAllBytes(eq(filePath))). + thenReturn(content); + + StepVerifier.create(fileStore.readObject(DataStore.Bucket.FILES, "test.txt")). + expectNext(content). + verifyComplete(); + } + } + @Test + void testCreateLock() { + when(appConfig.getCollectedFilesPath()).thenReturn("Collected Files Path"); + fileStore.createLock("Name"); + verify(appConfig, atLeast(1)).getCollectedFilesPath(); + } + @Test + void testCreateLock3() { + when(appConfig.getCollectedFilesPath()).thenReturn(""); + fileStore.createLock("/"); + verify(appConfig, atLeast(1)).getCollectedFilesPath(); + } + @Test + void testDeleteLock() { + when(appConfig.getCollectedFilesPath()).thenReturn("Collected Files Path"); + fileStore.deleteLock("Name"); + verify(appConfig).getCollectedFilesPath(); + } + @Test + void testDeleteLock2() { + when(appConfig.getCollectedFilesPath()).thenReturn(""); + fileStore.deleteLock("//"); + verify(appConfig).getCollectedFilesPath(); + } + @Test + void testDeleteObject() { + when(appConfig.getCollectedFilesPath()).thenReturn("Collected Files Path"); + fileStore.deleteObject(DataStore.Bucket.FILES, "Name"); + verify(appConfig).getCollectedFilesPath(); + } + @Test + void testDeleteObject2() { + when(appConfig.getCollectedFilesPath()).thenReturn("Collected Files Path"); + fileStore.deleteObject(DataStore.Bucket.LOCKS, "Name"); + verify(appConfig).getCollectedFilesPath(); + } + + @Test + void testPath() { + when(appConfig.getCollectedFilesPath()).thenReturn("Collected Files Path"); + fileStore.path("Name"); + verify(appConfig).getCollectedFilesPath(); + } + @Test + void testFileExists() { + when(appConfig.getCollectedFilesPath()).thenReturn("Collected Files Path"); + fileStore.fileExists(DataStore.Bucket.FILES, "Key"); + verify(appConfig).getCollectedFilesPath(); + } + @Test + void testFileExists2() { + when(appConfig.getCollectedFilesPath()).thenReturn("Collected Files Path"); + fileStore.fileExists(DataStore.Bucket.LOCKS, "Key"); + verify(appConfig).getCollectedFilesPath(); + } + @Test + void testDeleteBucket() { + when(appConfig.getCollectedFilesPath()).thenReturn("Collected Files Path"); + fileStore.deleteBucket(DataStore.Bucket.FILES); + verify(appConfig).getCollectedFilesPath(); + } + @Test + void testDeleteBucket2() throws IOException { + try (MockedStatic mockFiles = mockStatic(Files.class)) { + mockFiles.when(() -> Files.walkFileTree(Mockito.any(), Mockito.>any())). + thenReturn(Paths.get(System.getProperty("java.io.tmpdir"), "test.txt")); + mockFiles.when(() -> Files.exists(Mockito.any(), (LinkOption[]) any())).thenReturn(true); + when(appConfig.getCollectedFilesPath()).thenReturn(""); + fileStore.deleteBucket(DataStore.Bucket.LOCKS); + mockFiles.verify(() -> Files.exists(Mockito.any(), (LinkOption[]) any())); + mockFiles.verify(() -> Files.walkFileTree(Mockito.any(), Mockito.>any())); + verify(appConfig).getCollectedFilesPath(); + } + } + @Test + void testDeleteBucket3() throws IOException { + try (MockedStatic mockFiles = mockStatic(Files.class)) { + mockFiles.when(() -> Files.walkFileTree(Mockito.any(), Mockito.>any())). + thenThrow(new IOException("OK")); + mockFiles.when(() -> Files.exists(Mockito.any(), (LinkOption[]) any())).thenReturn(true); + when(appConfig.getCollectedFilesPath()).thenReturn(""); + fileStore.deleteBucket(DataStore.Bucket.LOCKS); + mockFiles.verify(() -> Files.exists(Mockito.any(), (LinkOption[]) any())); + mockFiles.verify(() -> Files.walkFileTree(Mockito.any(), Mockito.>any())); + verify(appConfig, atLeast(1)).getCollectedFilesPath(); + } + } + + @Test + void testCreateLock_Success() throws IOException { + Path lockPath = Path.of("/path/to/collected/files/locks/lock.txt"); + + when(appConfig.getCollectedFilesPath()).thenReturn("/path/to/collected/files"); + + try (MockedStatic filesMockedStatic = mockStatic(Files.class)) { + filesMockedStatic.when(() -> Files.createDirectories(lockPath.getParent())). + thenReturn(lockPath.getParent()); + + try (MockedStatic pathMockedStatic = mockStatic(Path.class)) { + filesMockedStatic.when(() -> Files.createFile(any(Path.class))).thenReturn(lockPath); + + String name = "test.txt"; + String[] pathComponents = { "collectedFiles", name }; + + when(fileStore.path(Arrays.toString(pathComponents))).thenReturn(mockPath); + Path path = fileStore.path(Arrays.toString(pathComponents)); + assertEquals(mockPath, path); + } + } + } + + @Test + void testCopyFileTo_Failure() { + // Define dummy values for testing + Path from = Paths.get("non-existent-file.txt"); + String to = "destination-folder"; + + // Use StepVerifier to test the method + Mono resultMono = fileStore.copyFileTo(from, to); + + StepVerifier.create(resultMono). + expectError(IOException.class). + verify(); + } +} diff --git a/datafilecollector/src/test/java/org/oran/datafile/datastore/S3ObjectStoreTest.java b/datafilecollector/src/test/java/org/oran/datafile/datastore/S3ObjectStoreTest.java new file mode 100644 index 0000000..298e9b4 --- /dev/null +++ b/datafilecollector/src/test/java/org/oran/datafile/datastore/S3ObjectStoreTest.java @@ -0,0 +1,321 @@ +/*- + * ============LICENSE_START======================================================= + * 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.oran.datafile.datastore; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.atLeast; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.net.URISyntaxException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.jupiter.MockitoExtension; +import org.oran.datafile.configuration.AppConfig; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; +import software.amazon.awssdk.core.ResponseBytes; +import software.amazon.awssdk.core.async.AsyncRequestBody; +import software.amazon.awssdk.core.async.AsyncResponseTransformer; +import software.amazon.awssdk.services.s3.S3AsyncClient; +import software.amazon.awssdk.services.s3.model.CreateBucketRequest; +import software.amazon.awssdk.services.s3.model.CreateBucketResponse; +import software.amazon.awssdk.services.s3.model.DeleteBucketRequest; +import software.amazon.awssdk.services.s3.model.DeleteBucketResponse; +import software.amazon.awssdk.services.s3.model.DeleteObjectRequest; +import software.amazon.awssdk.services.s3.model.DeleteObjectResponse; +import software.amazon.awssdk.services.s3.model.DeleteObjectsRequest; +import software.amazon.awssdk.services.s3.model.DeleteObjectsResponse; +import software.amazon.awssdk.services.s3.model.GetObjectRequest; +import software.amazon.awssdk.services.s3.model.GetObjectResponse; +import software.amazon.awssdk.services.s3.model.HeadObjectRequest; +import software.amazon.awssdk.services.s3.model.HeadObjectResponse; +import software.amazon.awssdk.services.s3.model.ListObjectsRequest; +import software.amazon.awssdk.services.s3.model.ListObjectsResponse; +import software.amazon.awssdk.services.s3.model.PutObjectRequest; +import software.amazon.awssdk.services.s3.model.PutObjectResponse; +import software.amazon.awssdk.services.s3.model.S3Object; + + +@ExtendWith(MockitoExtension.class) +class S3ObjectStoreTest { + + @Mock + private AppConfig appConfig; + + @Mock + private S3AsyncClient s3AsynchClient; + + private S3ObjectStore s3ObjectStore; + + @BeforeEach + void setup() { + Mockito.lenient().when(appConfig.getS3EndpointOverride()).thenReturn("https://dummy-s3-bucket.s3.amazonaws.com"); + Mockito.lenient().when(appConfig.getS3AccessKeyId()).thenReturn("test-access-key-id"); + Mockito.lenient().when(appConfig.getS3SecretAccessKey()).thenReturn("test-access-key-secret"); + + Mockito.lenient().when(appConfig.getS3Bucket()).thenReturn("test-bucket"); + Mockito.lenient().when(appConfig.getS3LocksBucket()).thenReturn("test-lock-bucket"); + Mockito.lenient().when(appConfig.isS3Enabled()).thenReturn(true); + + s3ObjectStore = new S3ObjectStore(appConfig, s3AsynchClient); + } + + @Test + void createS3Bucket() { + CreateBucketRequest request = CreateBucketRequest.builder() + .bucket("test-bucket") + .build(); + + when(s3AsynchClient.createBucket(any(CreateBucketRequest.class))) + .thenReturn(CompletableFuture.completedFuture(CreateBucketResponse.builder().build())); + + Mono result = s3ObjectStore.create(DataStore.Bucket.FILES); + + verify(s3AsynchClient, atLeast(1)).createBucket(any(CreateBucketRequest.class)); + + StepVerifier.create(result).expectNext("test-bucket").verifyComplete(); + + assertThat(result.block()).isEqualTo("test-bucket"); + } + + @Test + void listObjects() { + String prefix = "prefix/"; + + ListObjectsResponse response1 = ListObjectsResponse.builder() + .contents(createS3Object("object1")) + .isTruncated(true) + .nextMarker("marker1") + .build(); + + ListObjectsResponse response2 = ListObjectsResponse.builder() + .contents(createS3Object("object2")) + .isTruncated(false) + .build(); + + when(s3AsynchClient.listObjects(any(ListObjectsRequest.class))) + .thenReturn(CompletableFuture.completedFuture(response1), + CompletableFuture.completedFuture(response2)); + + Flux result = s3ObjectStore.listObjects(DataStore.Bucket.FILES, prefix); + + verify(s3AsynchClient, atLeast(1)).listObjects(any(ListObjectsRequest.class)); + + StepVerifier.create(result) + .expectNext("object1") + .expectNext("object2") + .verifyComplete(); + + // Collect the results into a list + List resultList = result.collectList().block(); + + assertEquals(Arrays.asList("object1", "object2"), resultList); + } + + @Test + void testCreateLockWithExistingHead() { + HeadObjectResponse headObjectResponse = HeadObjectResponse.builder().build(); + + when(s3AsynchClient.headObject(any(HeadObjectRequest.class))) + .thenReturn(CompletableFuture.completedFuture(headObjectResponse)); + + Mono result = s3ObjectStore.createLock("lockName"); + + StepVerifier.create(result) + .expectNext(false) + .verifyComplete(); + + assertThat(result.block()).isFalse(); + } + + @Test + void testCreateLockWithoutExistingHead() { + HeadObjectResponse headObjectResponse = null; + Mockito.doReturn(CompletableFuture.completedFuture(headObjectResponse)) + .when(s3AsynchClient) + .headObject(any(HeadObjectRequest.class)); + + Mono result = s3ObjectStore.createLock("lockName"); + + StepVerifier.create(result) + .expectComplete() + .verify(); + + Boolean resultVal = result.block(); + + assertThat(resultVal).isNull(); + } + + + @Test + void deleteLock() { + when(s3AsynchClient.deleteObject(any(DeleteObjectRequest.class))) + .thenReturn(CompletableFuture.completedFuture(DeleteObjectResponse.builder().build())); + + Mono result = s3ObjectStore.deleteLock("lock-name"); + + StepVerifier.create(result) + .expectNext(true) + .verifyComplete(); + + assertThat(result.block()).isTrue(); + } + + @Test + void testDeleteObject() { + when(s3AsynchClient.deleteObject(any(DeleteObjectRequest.class))) + .thenReturn(CompletableFuture.completedFuture(DeleteObjectResponse.builder().build())); + + Mono result = s3ObjectStore.deleteObject(DataStore.Bucket.LOCKS, "objectName"); + + StepVerifier.create(result) + .expectNext(true) + .verifyComplete(); + + assertThat(result.block()).isTrue(); + } + + @Test + void testDeleteBucket_Success() { + DeleteBucketRequest request = DeleteBucketRequest.builder() // + .bucket("test-bucket") + .build(); + + when(s3AsynchClient.deleteBucket(any(DeleteBucketRequest.class))) + .thenReturn(CompletableFuture.completedFuture(DeleteBucketResponse.builder().build())); + + DeleteObjectsRequest objectRequest = DeleteObjectsRequest.builder() // + .bucket("test-bucket") + .build(); + + when(s3AsynchClient.deleteObjects(any(DeleteObjectsRequest.class))) + .thenReturn(CompletableFuture.completedFuture(DeleteObjectsResponse.builder().build())); + + String prefix = "prefix/"; + + ListObjectsResponse response1 = ListObjectsResponse.builder() + .contents(createS3Object("object1")) + .isTruncated(true) + .nextMarker("marker1") + .build(); + + ListObjectsResponse response2 = ListObjectsResponse.builder() + .contents(createS3Object("object2")) + .isTruncated(false) + .build(); + + when(s3AsynchClient.listObjects(any(ListObjectsRequest.class))) + .thenReturn(CompletableFuture.completedFuture(response1), + CompletableFuture.completedFuture(response2)); + + Mono result = s3ObjectStore.deleteBucket(DataStore.Bucket.FILES); + + StepVerifier.create(result) + .expectNext("OK") + .verifyComplete(); + } + + @Test + void testCopyFileTo_Success() throws URISyntaxException { + PutObjectRequest request = PutObjectRequest.builder() // + .bucket("test-bucket") // + .key("test-access-key-id") // + .build(); + + when(s3AsynchClient.putObject(any(PutObjectRequest.class), any(AsyncRequestBody.class))) + .thenAnswer(invocation -> { + CompletableFuture future = CompletableFuture.completedFuture( + PutObjectResponse.builder().build() + ); + return future; + }); + + Path testFile = Paths.get(getClass().getResource("/org/oran/datafile/datastore/file.txt").toURI()); + + Mono result = s3ObjectStore.copyFileTo(testFile, "test-key"); + + StepVerifier.create(result) + .expectNext("test-key") + .verifyComplete(); + } + + @Test + void testReadObject() { + // Mock the getObject method to return a CompletableFuture with ResponseBytes + when(s3AsynchClient.getObject(any(GetObjectRequest.class), any(AsyncResponseTransformer.class))) + .thenAnswer(invocation -> { + ResponseBytes responseBytes = ResponseBytes.fromByteArray( + GetObjectResponse.builder().build(), + "Hello, World!".getBytes(StandardCharsets.UTF_8) + ); + CompletableFuture> future = CompletableFuture.completedFuture( + responseBytes + ); + return future; + }); + + // Call the method under test + Mono result = s3ObjectStore.readObject(DataStore.Bucket.FILES, "test-key"); + + byte[] expectedBytes = "Hello, World!".getBytes(StandardCharsets.UTF_8); + StepVerifier.create(result) + .consumeNextWith(actualBytes -> Assertions.assertArrayEquals(expectedBytes, actualBytes)) + .verifyComplete(); + } + + @Test + void testPutObject() { + // Mock the putObject method to return a CompletableFuture with PutObjectResponse + when(s3AsynchClient.putObject(any(PutObjectRequest.class), any(AsyncRequestBody.class))) + .thenAnswer(invocation -> { + CompletableFuture future = CompletableFuture.completedFuture( + PutObjectResponse.builder().build() + ); + return future; + }); + + // Call the method under test + Mono result = s3ObjectStore.putObject(DataStore.Bucket.FILES, "test-key", "Hello, World!"); + + // Verify the Mono's behavior using StepVerifier + StepVerifier.create(result) + .expectNext("test-key") + .verifyComplete(); + } + + private S3Object createS3Object(String key) { + return S3Object.builder().key(key).build(); + } +} diff --git a/datafilecollector/src/test/java/org/oran/datafile/ftp/FtpesClientTest.java b/datafilecollector/src/test/java/org/oran/datafile/ftp/FtpesClientTest.java index ef3310a..7effe75 100644 --- a/datafilecollector/src/test/java/org/oran/datafile/ftp/FtpesClientTest.java +++ b/datafilecollector/src/test/java/org/oran/datafile/ftp/FtpesClientTest.java @@ -18,7 +18,11 @@ package org.oran.datafile.ftp; import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.mock; @@ -31,21 +35,25 @@ import static org.mockito.Mockito.when; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.net.URISyntaxException; import java.nio.file.Path; import java.nio.file.Paths; - +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.cert.CertificateException; import javax.net.ssl.KeyManager; import javax.net.ssl.TrustManager; - import org.apache.commons.net.ftp.FTP; import org.apache.commons.net.ftp.FTPSClient; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.ArgumentMatchers; +import org.oran.datafile.exceptions.DatafileTaskException; +import org.oran.datafile.exceptions.NonRetryableDatafileTaskException; import org.oran.datafile.model.FileServerData; import org.springframework.http.HttpStatus; -public class FtpesClientTest { +class FtpesClientTest { private static final String REMOTE_FILE_PATH = "/dir/sample.txt"; private static final Path LOCAL_FILE_PATH = Paths.get("target/sample.txt"); @@ -85,7 +93,7 @@ public class FtpesClientTest { private void verifyFtpsClientMock_openOk() throws Exception { doReturn(outputStreamMock).when(clientUnderTestSpy).createOutputStream(LOCAL_FILE_PATH); - when(ftpsClientMock.retrieveFile(ArgumentMatchers.eq(REMOTE_FILE_PATH), + when(ftpsClientMock.retrieveFile(eq(REMOTE_FILE_PATH), ArgumentMatchers.any(OutputStream.class))).thenReturn(true); verify(ftpsClientMock).setNeedClientAuth(true); verify(ftpsClientMock).setKeyManager(keyManagerMock); @@ -101,7 +109,7 @@ public class FtpesClientTest { } @Test - public void collectFile_allOk() throws Exception { + void collectFile_allOk() throws Exception { doReturn(keyManagerMock).when(clientUnderTestSpy).getKeyManager(Paths.get(FTP_KEY_PATH), FTP_KEY_PASSWORD_PATH); doReturn(trustManagerMock).when(clientUnderTestSpy).getTrustManager(TRUSTED_CA_PATH, TRUSTED_CA_PASSWORD); @@ -121,12 +129,12 @@ public class FtpesClientTest { verify(ftpsClientMock, times(1)).isConnected(); verify(ftpsClientMock, times(1)).logout(); verify(ftpsClientMock, times(1)).disconnect(); - verify(ftpsClientMock, times(1)).retrieveFile(ArgumentMatchers.eq(REMOTE_FILE_PATH), any()); + verify(ftpsClientMock, times(1)).retrieveFile(eq(REMOTE_FILE_PATH), any()); verifyNoMoreInteractions(ftpsClientMock); } @Test - public void collectFileFaultyOwnKey_shouldFail() throws Exception { + void collectFileFaultyOwnKey_shouldFail() throws Exception { doReturn(outputStreamMock).when(clientUnderTestSpy).createOutputStream(LOCAL_FILE_PATH); assertThatThrownBy(() -> clientUnderTestSpy.open()).hasMessageContaining("Could not open connection:"); @@ -140,7 +148,7 @@ public class FtpesClientTest { } @Test - public void collectFileFaultTrustedCA_shouldFail_no_trustedCA_file() throws Exception { + void collectFileFaultTrustedCA_shouldFail_no_trustedCA_file() throws Exception { doReturn(keyManagerMock).when(clientUnderTestSpy).getKeyManager(Paths.get(FTP_KEY_PATH), FTP_KEY_PASSWORD_PATH); doThrow(new IOException("problem")).when(clientUnderTestSpy).createInputStream(TRUSTED_CA_PATH); @@ -150,7 +158,7 @@ public class FtpesClientTest { } @Test - public void collectFileFaultTrustedCA_shouldFail_empty_trustedCA_file() throws Exception { + void collectFileFaultTrustedCA_shouldFail_empty_trustedCA_file() throws Exception { doReturn(keyManagerMock).when(clientUnderTestSpy).getKeyManager(Paths.get(FTP_KEY_PATH), FTP_KEY_PASSWORD_PATH); doReturn(inputStreamMock).when(clientUnderTestSpy).createInputStream(TRUSTED_CA_PATH); @@ -159,7 +167,7 @@ public class FtpesClientTest { } @Test - public void collectFileFaultyLogin_shouldFail() throws Exception { + void collectFileFaultyLogin_shouldFail() throws Exception { doReturn(keyManagerMock).when(clientUnderTestSpy).getKeyManager(Paths.get(FTP_KEY_PATH), FTP_KEY_PASSWORD_PATH); doReturn(trustManagerMock).when(clientUnderTestSpy).getTrustManager(TRUSTED_CA_PATH, TRUSTED_CA_PASSWORD); @@ -176,7 +184,7 @@ public class FtpesClientTest { } @Test - public void collectFileBadRequestResponse_shouldFail() throws Exception { + void collectFileBadRequestResponse_shouldFail() throws Exception { doReturn(keyManagerMock).when(clientUnderTestSpy).getKeyManager(Paths.get(FTP_KEY_PATH), FTP_KEY_PASSWORD_PATH); doReturn(trustManagerMock).when(clientUnderTestSpy).getTrustManager(TRUSTED_CA_PATH, TRUSTED_CA_PASSWORD); doReturn(outputStreamMock).when(clientUnderTestSpy).createOutputStream(LOCAL_FILE_PATH); @@ -196,7 +204,7 @@ public class FtpesClientTest { } @Test - public void collectFile_shouldFail() throws Exception { + void collectFile_shouldFail() throws Exception { doReturn(keyManagerMock).when(clientUnderTestSpy).getKeyManager(Paths.get(FTP_KEY_PATH), FTP_KEY_PASSWORD_PATH); doReturn(trustManagerMock).when(clientUnderTestSpy).getTrustManager(TRUSTED_CA_PATH, TRUSTED_CA_PASSWORD); doReturn(outputStreamMock).when(clientUnderTestSpy).createOutputStream(LOCAL_FILE_PATH); @@ -210,12 +218,12 @@ public class FtpesClientTest { .hasMessageContaining(REMOTE_FILE_PATH).hasMessageContaining("No retry"); verifyFtpsClientMock_openOk(); - verify(ftpsClientMock, times(1)).retrieveFile(ArgumentMatchers.eq(REMOTE_FILE_PATH), any()); + verify(ftpsClientMock, times(1)).retrieveFile(eq(REMOTE_FILE_PATH), any()); verifyNoMoreInteractions(ftpsClientMock); } @Test - public void collectFile_shouldFail_ioexception() throws Exception { + void collectFile_shouldFail_ioexception() throws Exception { doReturn(keyManagerMock).when(clientUnderTestSpy).getKeyManager(Paths.get(FTP_KEY_PATH), FTP_KEY_PASSWORD_PATH); doReturn(trustManagerMock).when(clientUnderTestSpy).getTrustManager(TRUSTED_CA_PATH, TRUSTED_CA_PASSWORD); doReturn(outputStreamMock).when(clientUnderTestSpy).createOutputStream(LOCAL_FILE_PATH); @@ -230,7 +238,33 @@ public class FtpesClientTest { .hasMessage("Could not fetch file: java.io.IOException: problem"); verifyFtpsClientMock_openOk(); - verify(ftpsClientMock, times(1)).retrieveFile(ArgumentMatchers.eq(REMOTE_FILE_PATH), any()); + verify(ftpsClientMock, times(1)).retrieveFile(eq(REMOTE_FILE_PATH), any()); verifyNoMoreInteractions(ftpsClientMock); } + + @Test + void testCreateInputStream() throws IOException, URISyntaxException { + Path trustCaPath = Paths.get(getClass().getResource("/org/oran/datafile/datastore/file.txt").toURI()); + InputStream actualCreateInputStreamResult = clientUnderTestSpy.createInputStream(trustCaPath); + assertNotNull(actualCreateInputStreamResult); + } + + @Test + void testCreateOutputStream() throws IOException, URISyntaxException, DatafileTaskException { + Path trustCaPath = Paths.get(getClass().getResource("/org/oran/datafile/datastore/file.txt").toURI()); + assertThrows(NonRetryableDatafileTaskException.class, () -> clientUnderTestSpy.createOutputStream(trustCaPath)); + } + + @Test + void testGetTrustManager2() throws IOException, KeyStoreException, NoSuchAlgorithmException, CertificateException { + FileServerData fileServerData = FileServerData.builder() + .password("password123") + .port(8080) + .serverAddress("42 Main St") + .userId("42") + .build(); + assertNull((new FtpesClient(fileServerData, Paths.get(System.getProperty("java.io.tmpdir"), "test.txt"), + "Key Cert Password Path", Paths.get(System.getProperty("java.io.tmpdir"), "test.txt"), + "Trusted Ca Password Path")).getTrustManager(null, "foo")); + } } diff --git a/datafilecollector/src/test/java/org/oran/datafile/ftp/SftpClientSettingsTest.java b/datafilecollector/src/test/java/org/oran/datafile/ftp/SftpClientSettingsTest.java index bbce5ef..d8400bf 100644 --- a/datafilecollector/src/test/java/org/oran/datafile/ftp/SftpClientSettingsTest.java +++ b/datafilecollector/src/test/java/org/oran/datafile/ftp/SftpClientSettingsTest.java @@ -26,10 +26,10 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.oran.datafile.configuration.SftpConfig; -public class SftpClientSettingsTest { +class SftpClientSettingsTest { @Test - public void shouldUseFtpStrictHostChecking(@TempDir Path tempDir) throws Exception { + void shouldUseFtpStrictHostChecking(@TempDir Path tempDir) throws Exception { File knowHostsFile = new File(tempDir.toFile(), "known_hosts"); knowHostsFile.createNewFile(); @@ -40,7 +40,7 @@ public class SftpClientSettingsTest { } @Test - public void shouldNotUseFtpStrictHostChecking_whenFileDoesNotExist() { + void shouldNotUseFtpStrictHostChecking_whenFileDoesNotExist() { SftpConfig config = createSampleSftpConfigWithStrictHostChecking("unknown_file"); SftpClientSettings sftpClient = new SftpClientSettings(config); @@ -49,7 +49,7 @@ public class SftpClientSettingsTest { } @Test - public void shouldNotUseFtpStrictHostChecking_whenExplicitlySwitchedOff() { + void shouldNotUseFtpStrictHostChecking_whenExplicitlySwitchedOff() { SftpClientSettings sftpClient = new SftpClientSettings(createSampleSftpConfigNoStrictHostChecking()); sftpClient.shouldUseStrictHostChecking(); assertThat(sftpClient.shouldUseStrictHostChecking()).isFalse(); diff --git a/datafilecollector/src/test/java/org/oran/datafile/ftp/SftpClientTest.java b/datafilecollector/src/test/java/org/oran/datafile/ftp/SftpClientTest.java index 5268839..f29989a 100644 --- a/datafilecollector/src/test/java/org/oran/datafile/ftp/SftpClientTest.java +++ b/datafilecollector/src/test/java/org/oran/datafile/ftp/SftpClientTest.java @@ -47,7 +47,7 @@ import org.oran.datafile.exceptions.NonRetryableDatafileTaskException; import org.oran.datafile.model.FileServerData; @ExtendWith(MockitoExtension.class) -public class SftpClientTest { +class SftpClientTest { private static final String HOST = "127.0.0.1"; private static final int SFTP_PORT = 1021; @@ -64,7 +64,7 @@ public class SftpClientTest { private ChannelSftp channelMock; @Test - public void openWithPort_success() throws Exception { + void openWithPort_success() throws Exception { FileServerData expectedFileServerData = FileServerData.builder() // .serverAddress(HOST) // .userId(USERNAME) // @@ -92,7 +92,7 @@ public class SftpClientTest { } @Test - public void openWithoutPort_success() throws Exception { + void openWithoutPort_success() throws Exception { FileServerData expectedFileServerData = FileServerData.builder() // .serverAddress(HOST) // .userId(USERNAME) // @@ -112,7 +112,7 @@ public class SftpClientTest { } @Test - public void open_throwsExceptionWithRetry() throws Exception { + void open_throwsExceptionWithRetry() throws Exception { FileServerData expectedFileServerData = FileServerData.builder() // .serverAddress(HOST) // .userId(USERNAME) // @@ -130,7 +130,7 @@ public class SftpClientTest { } @Test - public void openAuthFail_throwsExceptionWithoutRetry() throws Exception { + void openAuthFail_throwsExceptionWithoutRetry() throws Exception { FileServerData expectedFileServerData = FileServerData.builder() // .serverAddress(HOST) // .userId(USERNAME) // @@ -152,7 +152,7 @@ public class SftpClientTest { @SuppressWarnings("resource") @Test - public void collectFile_success() throws DatafileTaskException, SftpException { + void collectFile_success() throws DatafileTaskException, SftpException { FileServerData expectedFileServerData = FileServerData.builder() // .serverAddress(HOST) // .userId(USERNAME) // @@ -170,7 +170,7 @@ public class SftpClientTest { } @Test - public void collectFile_throwsExceptionWithRetry() throws SftpException { + void collectFile_throwsExceptionWithRetry() throws SftpException { FileServerData expectedFileServerData = FileServerData.builder() // .serverAddress(HOST) // .userId(USERNAME) // @@ -190,7 +190,7 @@ public class SftpClientTest { } @Test - public void collectFileFileMissing_throwsExceptionWithoutRetry() throws SftpException { + void collectFileFileMissing_throwsExceptionWithoutRetry() throws SftpException { FileServerData expectedFileServerData = FileServerData.builder() // .serverAddress(HOST) // .userId(USERNAME) // @@ -211,7 +211,7 @@ public class SftpClientTest { } @Test - public void close_success() { + void close_success() { SftpClient sftpClient = new SftpClient(null, createSampleSftpClientSettings()); sftpClient.session = sessionMock; diff --git a/datafilecollector/src/test/java/org/oran/datafile/http/HttpsClientConnectionManagerUtilTest.java b/datafilecollector/src/test/java/org/oran/datafile/http/HttpsClientConnectionManagerUtilTest.java index af77349..615a76e 100644 --- a/datafilecollector/src/test/java/org/oran/datafile/http/HttpsClientConnectionManagerUtilTest.java +++ b/datafilecollector/src/test/java/org/oran/datafile/http/HttpsClientConnectionManagerUtilTest.java @@ -25,7 +25,7 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.oran.datafile.exceptions.DatafileTaskException; @ExtendWith(MockitoExtension.class) -public class HttpsClientConnectionManagerUtilTest { +class HttpsClientConnectionManagerUtilTest { private static final String KEY_PATH = "src/test/resources/keystore.p12"; private static final String KEY_PASSWORD = "src/test/resources/keystore.pass"; @@ -34,19 +34,19 @@ public class HttpsClientConnectionManagerUtilTest { private static final String TRUSTED_CA_PASSWORD = "src/test/resources/trust.pass"; @Test - public void emptyManager_shouldThrowException() { + void emptyManager_shouldThrowException() { assertThrows(DatafileTaskException.class, () -> HttpsClientConnectionManagerUtil.instance()); } @Test - public void creatingManager_successfulCase() throws Exception { + void creatingManager_successfulCase() throws Exception { HttpsClientConnectionManagerUtil.setupOrUpdate(KEY_PATH, KEY_PASSWORD, TRUSTED_CA_PATH, TRUSTED_CA_PASSWORD, // true); assertNotNull(HttpsClientConnectionManagerUtil.instance()); } @Test - public void creatingManager_improperSecretShouldThrowException() { + void creatingManager_improperSecretShouldThrowException() { assertThrows(DatafileTaskException.class, () -> HttpsClientConnectionManagerUtil.setupOrUpdate(KEY_PATH, // KEY_IMPROPER_PASSWORD, TRUSTED_CA_PATH, TRUSTED_CA_PASSWORD, true)); assertThrows(DatafileTaskException.class, () -> HttpsClientConnectionManagerUtil.instance()); diff --git a/datafilecollector/src/test/java/org/oran/datafile/model/CountersTest.java b/datafilecollector/src/test/java/org/oran/datafile/model/CountersTest.java new file mode 100644 index 0000000..d2e8b37 --- /dev/null +++ b/datafilecollector/src/test/java/org/oran/datafile/model/CountersTest.java @@ -0,0 +1,71 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019-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.oran.datafile.model; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +class CountersTest { + @Test + void testIncNoOfReceivedEvents() { + Counters counters = new Counters(); + counters.incNoOfReceivedEvents(); + assertEquals(1L, counters.getTotalReceivedEvents()); + } + + @Test + void testIncNoOfCollectedFiles() { + Counters counters = new Counters(); + counters.incNoOfCollectedFiles(); + counters.incNoOfFailedFtp(); + counters.incNoOfFailedFtpAttempts(); + counters.incNoOfFailedHttp(); + counters.incNoOfFailedHttpAttempts(); + counters.incNoOfFailedPublish(); + counters.incNoOfFailedPublishAttempts(); + String actualToStringResult = counters.toString(); + long actualNoOfCollectedFiles = counters.getNoOfCollectedFiles(); + long actualNoOfFailedFtp = counters.getNoOfFailedFtp(); + long actualNoOfFailedFtpAttempts = counters.getNoOfFailedFtpAttempts(); + long actualNoOfFailedHttp = counters.getNoOfFailedHttp(); + long actualNoOfFailedHttpAttempts = counters.getNoOfFailedHttpAttempts(); + long actualNoOfFailedPublish = counters.getNoOfFailedPublish(); + long actualNoOfFailedPublishAttempts = counters.getNoOfFailedPublishAttempts(); + long actualTotalPublishedFiles = counters.getTotalPublishedFiles(); + assertEquals(1L, actualNoOfCollectedFiles); + assertEquals(1L, actualNoOfFailedFtp); + assertEquals(1L, actualNoOfFailedFtpAttempts); + assertEquals(1L, actualNoOfFailedHttp); + assertEquals(1L, actualNoOfFailedHttpAttempts); + assertEquals(1L, actualNoOfFailedPublish); + assertEquals(1L, actualNoOfFailedPublishAttempts); + assertEquals(0L, actualTotalPublishedFiles); + assertEquals(0L, counters.getTotalReceivedEvents()); + } + @Test + void testIncTotalPublishedFiles() { + Counters counters = new Counters(); + counters.incTotalPublishedFiles(); + assertEquals(1L, counters.getTotalPublishedFiles()); + } +} + diff --git a/datafilecollector/src/test/java/org/oran/datafile/model/FileDataTest.java b/datafilecollector/src/test/java/org/oran/datafile/model/FileDataTest.java new file mode 100644 index 0000000..f52cfcc --- /dev/null +++ b/datafilecollector/src/test/java/org/oran/datafile/model/FileDataTest.java @@ -0,0 +1,256 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019-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.oran.datafile.model; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Collections; +import org.junit.jupiter.api.Test; +import org.oran.datafile.configuration.AppConfig; +import org.oran.datafile.exceptions.DatafileTaskException; + +class FileDataTest { + @Test + void testSchemeGetSchemeFromString() throws DatafileTaskException { + assertThrows(DatafileTaskException.class, () -> FileData.Scheme.getSchemeFromString("Scheme String")); + assertEquals(FileData.Scheme.FTPES, FileData.Scheme.getSchemeFromString("FTPES")); + assertEquals(FileData.Scheme.SFTP, FileData.Scheme.getSchemeFromString("SFTP")); + assertEquals(FileData.Scheme.HTTP, FileData.Scheme.getSchemeFromString("HTTP")); + assertEquals(FileData.Scheme.HTTPS, FileData.Scheme.getSchemeFromString("HTTPS")); + } + + @Test + void testSchemeIsFtpScheme() { + assertTrue(FileData.Scheme.isFtpScheme(FileData.Scheme.FTPES)); + assertTrue(FileData.Scheme.isFtpScheme(FileData.Scheme.SFTP)); + assertFalse(FileData.Scheme.isFtpScheme(FileData.Scheme.HTTP)); + assertFalse(FileData.Scheme.isFtpScheme(FileData.Scheme.HTTPS)); + } + + @Test + void testSourceName() { + FileReadyMessage.MessageMetaData metaData = new FileReadyMessage.MessageMetaData( + "sourceName", "otherField1", "otherField2", "otherField3", 42, "field5", "field6", + "field7", "field8", 123456789L, 987654321L, "field11", "field12" + ); + FileData fileData = FileData.builder().messageMetaData(metaData).build(); + + assertEquals("field8", fileData.sourceName()); + } + + @Test + void testName() { + FileReadyMessage.MessageMetaData metaData = new FileReadyMessage.MessageMetaData( + "sourceName", "otherField1", "otherField2", "otherField3", 42, "field5", "field6", + "field7", "field8", 123456789L, 987654321L, "field11", "field12" + ); + FileData fileData = FileData.builder().messageMetaData(metaData).build(); + + FileReadyMessage.FileInfo fileInfo = new FileReadyMessage.FileInfo("name", "location", "hashMapField", ""); + FileReadyMessage.ArrayOfNamedHashMap arrayOfNamedHashMap = new FileReadyMessage.ArrayOfNamedHashMap("someString", fileInfo); + fileData.fileInfo = arrayOfNamedHashMap; + + assertEquals("field8/someString", fileData.name()); + } + + @Test + void testRemoteFilePath() { + FileReadyMessage.MessageMetaData metaData = new FileReadyMessage.MessageMetaData( + "sourceName", "otherField1", "otherField2", "otherField3", 42, "field5", "field6", + "field7", "field8", 123456789L, 987654321L, "field11", "field12" + ); + FileData fileData = FileData.builder().messageMetaData(metaData).build(); + + FileReadyMessage.FileInfo fileInfo = new FileReadyMessage.FileInfo("name", "ftp://example.com/remote/file.txt", "hashMapField", ""); + FileReadyMessage.ArrayOfNamedHashMap arrayOfNamedHashMap = new FileReadyMessage.ArrayOfNamedHashMap("someString", fileInfo); + fileData.fileInfo = arrayOfNamedHashMap; + + assertEquals("/remote/file.txt", fileData.remoteFilePath()); + } + + @Test + void testScheme() { + FileReadyMessage.MessageMetaData metaData = new FileReadyMessage.MessageMetaData( + "sourceName", "otherField1", "otherField2", "otherField3", 42, "field5", "field6", + "field7", "field8", 123456789L, 987654321L, "field11", "field12" + ); + FileData fileData = FileData.builder().messageMetaData(metaData).build(); + + FileReadyMessage.FileInfo fileInfo = new FileReadyMessage.FileInfo("name", "http://example.com/file.txt", "hashMapField", ""); + FileReadyMessage.ArrayOfNamedHashMap arrayOfNamedHashMap = new FileReadyMessage.ArrayOfNamedHashMap("someString", fileInfo); + fileData.fileInfo = arrayOfNamedHashMap; + + assertEquals(FileData.Scheme.HTTP, fileData.scheme()); + } + + @Test + void testGetLocalFilePath() { + AppConfig config = new AppConfig(); + config.setCollectedFilesPath("/local/path"); + FileReadyMessage.MessageMetaData metaData = new FileReadyMessage.MessageMetaData( + "sourceName", "otherField1", "otherField2", "otherField3", 42, "field5", "field6", + "field7", "field8", 123456789L, 987654321L, "field11", "field12" + ); + FileData fileData = FileData.builder().messageMetaData(metaData).build(); + + FileReadyMessage.FileInfo fileInfo = new FileReadyMessage.FileInfo("name", "http://example.com/file.txt", "hashMapField", ""); + FileReadyMessage.ArrayOfNamedHashMap arrayOfNamedHashMap = new FileReadyMessage.ArrayOfNamedHashMap("someString", fileInfo); + fileData.fileInfo = arrayOfNamedHashMap; + + Path expectedPath = Paths.get("/local/path/field8/someString"); + Path actualPath = fileData.getLocalFilePath(config); + assertEquals(expectedPath, actualPath); + } + + @Test + void testFileServerDataWithUserInfo() throws Exception { + // Arrange + AppConfig config = new AppConfig(); + config.setCollectedFilesPath("/local/path"); + FileReadyMessage.MessageMetaData metaData = new FileReadyMessage.MessageMetaData( + "sourceName", "otherField1", "otherField2", "otherField3", 42, "field5", "field6", + "field7", "field8", 123456789L, 987654321L, "field11", "field12" + ); + FileData fileData = FileData.builder().messageMetaData(metaData).build(); + + FileReadyMessage.FileInfo fileInfo = new FileReadyMessage.FileInfo("name", "http://username:password@example.com:8080/path?query1=value1&query2=value2", "hashMapField", ""); + FileReadyMessage.ArrayOfNamedHashMap arrayOfNamedHashMap = new FileReadyMessage.ArrayOfNamedHashMap("someString", fileInfo); + fileData.fileInfo = arrayOfNamedHashMap; + + // Act + FileServerData result = fileData.fileServerData(); + + // Assert + assertEquals("username", result.userId); + assertEquals("password", result.password); + } + + @Test + void testFileServerDataWithFragment() throws Exception { + // Arrange + AppConfig config = new AppConfig(); + config.setCollectedFilesPath("/local/path"); + FileReadyMessage.MessageMetaData metaData = new FileReadyMessage.MessageMetaData( + "sourceName", "otherField1", "otherField2", "otherField3", 42, "field5", "field6", + "field7", "field8", 123456789L, 987654321L, "field11", "field12" + ); + FileData fileData = FileData.builder().messageMetaData(metaData).build(); + + FileReadyMessage.FileInfo fileInfo = new FileReadyMessage.FileInfo("name", "http://username@example.com:8080/path?query1=value1&query2=value2#rawFragment", "hashMapField", ""); + FileReadyMessage.ArrayOfNamedHashMap arrayOfNamedHashMap = new FileReadyMessage.ArrayOfNamedHashMap("someString", fileInfo); + fileData.fileInfo = arrayOfNamedHashMap; + + // Act + FileServerData result = fileData.fileServerData(); + + // Assert + assertEquals("rawFragment", result.uriRawFragment); + } + + @Test + void testFileServerDataWithoutUserInfo() throws Exception { + // Arrange + AppConfig config = new AppConfig(); + config.setCollectedFilesPath("/local/path"); + FileReadyMessage.MessageMetaData metaData = new FileReadyMessage.MessageMetaData( + "sourceName", "otherField1", "otherField2", "otherField3", 42, "field5", "field6", + "field7", "field8", 123456789L, 987654321L, "field11", "field12" + ); + FileData fileData = FileData.builder().messageMetaData(metaData).build(); + + FileReadyMessage.FileInfo fileInfo = new FileReadyMessage.FileInfo("name", "http://example.com:8080/path?query1=value1&query2=value2", "hashMapField", ""); + FileReadyMessage.ArrayOfNamedHashMap arrayOfNamedHashMap = new FileReadyMessage.ArrayOfNamedHashMap("someString", fileInfo); + fileData.fileInfo = arrayOfNamedHashMap; + + FileServerData result = fileData.fileServerData(); + assertEquals("example.com", result.getServerAddress()); + } + + @Test + void testInvalidScheme() throws Exception { + // Arrange + AppConfig config = new AppConfig(); + config.setCollectedFilesPath("/local/path"); + FileReadyMessage.MessageMetaData metaData = new FileReadyMessage.MessageMetaData( + "sourceName", "otherField1", "otherField2", "otherField3", 42, "field5", "field6", + "field7", "field8", 123456789L, 987654321L, "field11", "field12" + ); + FileData fileData = FileData.builder().messageMetaData(metaData).build(); + + FileReadyMessage.FileInfo fileInfo = new FileReadyMessage.FileInfo("name", "abcxyz://example.com:8080/path?query1=value1&query2=value2", "hashMapField", ""); + FileReadyMessage.ArrayOfNamedHashMap arrayOfNamedHashMap = new FileReadyMessage.ArrayOfNamedHashMap("someString", fileInfo); + fileData.fileInfo = arrayOfNamedHashMap; + + // Act + FileData.Scheme result = fileData.scheme(); + assertEquals("FTPES", result.name()); + } + + @Test + void testCreateFileData(){ + + FileReadyMessage.MessageMetaData metaData = new FileReadyMessage.MessageMetaData( + "sourceName", "otherField1", "otherField2", "otherField3", 42, "field5", "field6", + "field7", "field8", 123456789L, 987654321L, "field11", "field12" + ); + + FileReadyMessage fileReadyMessage = FileReadyMessage.builder() + .event( + FileReadyMessage.Event.builder() + .commonEventHeader(metaData) + .notificationFields( + FileReadyMessage.NotificationFields.builder() + .notificationFieldsVersion("1.0") + .changeType("Add") + .changeIdentifier("Change123") + .arrayOfNamedHashMap( + Collections.singletonList( + FileReadyMessage.ArrayOfNamedHashMap.builder() + .name("File1") + .hashMap( + FileReadyMessage.FileInfo.builder() + .fileFormatType("Text") + .location("ftp://example.com/files/file.txt") + .fileFormatVersion("1.0") + .compression("None") + .build() + ) + .build() + ) + ) + .build() + ) + .build() + ) + .build(); + + Iterable fileDataIterable = FileData.createFileData(fileReadyMessage); + FileReadyMessage.MessageMetaData messageMetaData = fileDataIterable.iterator().next().messageMetaData; + + assertEquals("field8", messageMetaData.sourceName); + } +} + diff --git a/datafilecollector/src/test/java/org/oran/datafile/model/FilePublishInformationTest.java b/datafilecollector/src/test/java/org/oran/datafile/model/FilePublishInformationTest.java new file mode 100644 index 0000000..58fe722 --- /dev/null +++ b/datafilecollector/src/test/java/org/oran/datafile/model/FilePublishInformationTest.java @@ -0,0 +1,907 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019-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.oran.datafile.model; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; + +class FilePublishInformationTest { + @Test + void testCanEqual() { + assertFalse( + (new FilePublishInformation("Product Name", "Vendor Name", 1L, "Source Name", 1L, "UTC", "Compression", + "File Format Type", "1.0.2", "Name", "42", "s3://bucket-name/object-key")).canEqual("Other")); + } + + @Test + void testCanEqual2() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + FilePublishInformation buildResult2 = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertTrue(buildResult.canEqual(buildResult2)); + } + + @Test + void testConstructor() { + FilePublishInformation actualFilePublishInformation = + new FilePublishInformation("Product Name", "Vendor Name", 1L, + "Source Name", 1L, "UTC", "Compression", "File Format Type", "1.0.2", "Name", "42", + "s3://bucket-name/object-key"); + + assertEquals("Name", actualFilePublishInformation.getName()); + assertEquals("Vendor Name", actualFilePublishInformation.vendorName); + assertEquals("UTC", actualFilePublishInformation.timeZoneOffset); + assertEquals(1L, actualFilePublishInformation.startEpochMicrosec); + assertEquals("Product Name", actualFilePublishInformation.productName); + assertEquals("s3://bucket-name/object-key", actualFilePublishInformation.objectStoreBucket); + assertEquals(1L, actualFilePublishInformation.lastEpochMicrosec); + assertEquals("1.0.2", actualFilePublishInformation.fileFormatVersion); + assertEquals("File Format Type", actualFilePublishInformation.fileFormatType); + assertEquals("Compression", actualFilePublishInformation.compression); + assertEquals("42", actualFilePublishInformation.changeIdentifier); + assertEquals("Source Name", actualFilePublishInformation.getSourceName()); + } + + @Test + void testEquals() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertNotEquals(null, buildResult); + } + @Test + void testEquals2() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertNotEquals("Different type to FilePublishInformation", buildResult ); + } + @Test + void testEquals3() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertEquals(buildResult, buildResult); + int expectedHashCodeResult = buildResult.hashCode(); + assertEquals(expectedHashCodeResult, buildResult.hashCode()); + } + @Test + void testEquals4() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + FilePublishInformation buildResult2 = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertEquals(buildResult, buildResult2); + int expectedHashCodeResult = buildResult.hashCode(); + assertEquals(expectedHashCodeResult, buildResult2.hashCode()); + } + @Test + void testEquals5() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("Product Name") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + FilePublishInformation buildResult2 = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertNotEquals(buildResult, buildResult2); + } + @Test + void testEquals6() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier(null) + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + FilePublishInformation buildResult2 = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertNotEquals(buildResult, buildResult2); + } + @Test + void testEquals7() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Product Name") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + FilePublishInformation buildResult2 = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertNotEquals(buildResult, buildResult2); + } + @Test + void testEquals8() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression(null) + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + FilePublishInformation buildResult2 = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertNotEquals(buildResult, buildResult2); + } + @Test + void testEquals9() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("Product Name") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + FilePublishInformation buildResult2 = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertNotEquals(buildResult, buildResult2); + } + @Test + void testEquals10() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType(null) + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + FilePublishInformation buildResult2 = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertNotEquals(buildResult, buildResult2); + } + @Test + void testEquals11() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("Product Name") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + FilePublishInformation buildResult2 = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertNotEquals(buildResult, buildResult2); + } + @Test + void testEquals12() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion(null) + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + FilePublishInformation buildResult2 = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertNotEquals(buildResult, buildResult2); + } + @Test + void testEquals13() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(3L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + FilePublishInformation buildResult2 = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertNotEquals(buildResult, buildResult2); + } + @Test + void testEquals14() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Product Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + FilePublishInformation buildResult2 = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertNotEquals(buildResult, buildResult2); + } + @Test + void testEquals15() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name(null) + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + FilePublishInformation buildResult2 = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertNotEquals(buildResult, buildResult2); + } + @Test + void testEquals16() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("Product Name") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + FilePublishInformation buildResult2 = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertNotEquals(buildResult, buildResult2); + } + @Test + void testEquals17() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket(null) + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + FilePublishInformation buildResult2 = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertNotEquals(buildResult, buildResult2); + } + @Test + void testEquals18() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Vendor Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + FilePublishInformation buildResult2 = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertNotEquals(buildResult, buildResult2); + } + @Test + void testEquals19() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName(null) + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + FilePublishInformation buildResult2 = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertNotEquals(buildResult, buildResult2); + } + @Test + void testEquals20() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Product Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + FilePublishInformation buildResult2 = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertNotEquals(buildResult, buildResult2); + } + @Test + void testEquals21() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName(null) + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + FilePublishInformation buildResult2 = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertNotEquals(buildResult, buildResult2); + } + @Test + void testEquals22() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(3L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + FilePublishInformation buildResult2 = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertNotEquals(buildResult, buildResult2); + } + @Test + void testEquals23() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("Europe/London") + .vendorName("Vendor Name") + .build(); + FilePublishInformation buildResult2 = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertNotEquals(buildResult, buildResult2); + } + @Test + void testEquals24() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset(null) + .vendorName("Vendor Name") + .build(); + FilePublishInformation buildResult2 = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertNotEquals(buildResult, buildResult2); + } + @Test + void testEquals25() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Product Name") + .build(); + FilePublishInformation buildResult2 = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertNotEquals(buildResult, buildResult2); + } + @Test + void testEquals26() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName(null) + .build(); + FilePublishInformation buildResult2 = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + assertNotEquals(buildResult, buildResult2); + } + @Test + void testGetName() { + FilePublishInformation buildResult = FilePublishInformation.builder() + .changeIdentifier("42") + .compression("Compression") + .fileFormatType("File Format Type") + .fileFormatVersion("1.0.2") + .lastEpochMicrosec(1L) + .name("Name") + .objectStoreBucket("s3://bucket-name/object-key") + .productName("Product Name") + .sourceName("Source Name") + .startEpochMicrosec(1L) + .timeZoneOffset("UTC") + .vendorName("Vendor Name") + .build(); + String actualName = buildResult.getName(); + assertEquals("Name", actualName); + assertEquals("Source Name", buildResult.getSourceName()); + } +} + diff --git a/datafilecollector/src/test/java/org/oran/datafile/model/FileReadyMessageTest.java b/datafilecollector/src/test/java/org/oran/datafile/model/FileReadyMessageTest.java new file mode 100644 index 0000000..29a7236 --- /dev/null +++ b/datafilecollector/src/test/java/org/oran/datafile/model/FileReadyMessageTest.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019-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.oran.datafile.model; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +class FileReadyMessageTest { + @Test + void testMessageMetaDataProductName() { + assertEquals("Event Name", + (new FileReadyMessage.MessageMetaData("42", "Priority", "1.0.2", "Reporting Entity Name", + 1, "Domain", "Event Name", "1.0.2", "Source Name", 1L, 1L, "UTC", "42")).productName()); + assertEquals("|", (new FileReadyMessage.MessageMetaData("42", "Priority", "1.0.2", "Reporting Entity Name", 1, + "Domain", "_|-", "1.0.2", "Source Name", 1L, 1L, "UTC", "42")).productName()); + } + @Test + void testMessageMetaDataVendorName() { + assertEquals("Event Name", + (new FileReadyMessage.MessageMetaData("42", "Priority", "1.0.2", "Reporting Entity Name", 1, "Domain", + "Event Name", "1.0.2", "Source Name", 1L, 1L, "UTC", "42")).vendorName()); + } +} + diff --git a/datafilecollector/src/test/java/org/oran/datafile/model/FileServerDataTest.java b/datafilecollector/src/test/java/org/oran/datafile/model/FileServerDataTest.java new file mode 100644 index 0000000..863be8a --- /dev/null +++ b/datafilecollector/src/test/java/org/oran/datafile/model/FileServerDataTest.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019-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.oran.datafile.model; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.ArrayList; +import org.junit.jupiter.api.Test; + +class FileServerDataTest { + @Test + void testConstructor() { + FileServerData actualFileServerData = new FileServerData("42 Main St", "42", "password", new ArrayList<>(), + "Uri Raw Fragment", 8080); + assertEquals("FileServerData(serverAddress=42 Main St, userId=42, uriRawFragment=Uri Raw Fragment, port=8080)", + actualFileServerData.toString()); + assertEquals(8080, actualFileServerData.port.intValue()); + assertTrue(actualFileServerData.queryParameters.isEmpty()); + } +} + diff --git a/datafilecollector/src/test/java/org/oran/datafile/model/SchemeTest.java b/datafilecollector/src/test/java/org/oran/datafile/model/SchemeTest.java index 3b42ede..5085798 100644 --- a/datafilecollector/src/test/java/org/oran/datafile/model/SchemeTest.java +++ b/datafilecollector/src/test/java/org/oran/datafile/model/SchemeTest.java @@ -26,10 +26,10 @@ import org.junit.jupiter.api.Test; import org.oran.datafile.exceptions.DatafileTaskException; import org.oran.datafile.model.FileData.Scheme; -public class SchemeTest { +class SchemeTest { @Test - public void shouldReturnSchemeForSupportedProtocol() throws DatafileTaskException { + void shouldReturnSchemeForSupportedProtocol() throws DatafileTaskException { assertEquals(Scheme.FTPES, Scheme.getSchemeFromString("FTPES")); assertEquals(Scheme.SFTP, Scheme.getSchemeFromString("SFTP")); assertEquals(Scheme.HTTP, Scheme.getSchemeFromString("HTTP")); @@ -37,12 +37,12 @@ public class SchemeTest { } @Test - public void shouldThrowExceptionForUnsupportedProtocol() { + void shouldThrowExceptionForUnsupportedProtocol() { assertThrows(DatafileTaskException.class, () -> Scheme.getSchemeFromString("FTPS")); } @Test - public void shouldThrowExceptionForInvalidProtocol() { + void shouldThrowExceptionForInvalidProtocol() { assertThrows(DatafileTaskException.class, () -> Scheme.getSchemeFromString("invalid")); } } diff --git a/datafilecollector/src/test/java/org/oran/datafile/oauth2/OAuthBearerTokenJwtTest.java b/datafilecollector/src/test/java/org/oran/datafile/oauth2/OAuthBearerTokenJwtTest.java new file mode 100644 index 0000000..f8afa64 --- /dev/null +++ b/datafilecollector/src/test/java/org/oran/datafile/oauth2/OAuthBearerTokenJwtTest.java @@ -0,0 +1,109 @@ +/*- + * ============LICENSE_START======================================================= + * 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.oran.datafile.oauth2; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; +import org.oran.datafile.exceptions.DatafileTaskException; +import org.springframework.test.context.ContextConfiguration; + +@ContextConfiguration(classes = {OAuthBearerTokenJwtTest.class}) +@ExtendWith(MockitoExtension.class) +class OAuthBearerTokenJwtTest { + + private OAuthBearerTokenJwt token; + + @BeforeEach + void setUp() throws DatafileTaskException { + String validJwt = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"; // Replace with a valid JWT token for testing + token = OAuthBearerTokenJwt.create(validJwt); + } + + @Test + void testCreateValidToken() { + assertNotNull(token); + } + + @Test + void testCreateInvalidToken() { + assertThrows(DatafileTaskException.class, () -> OAuthBearerTokenJwt.create("invalid_token")); + } + + @Test + void testTokenValue() { + assertEquals("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", token.value()); + } + + @Test + void testTokenScope() { + assertEquals(0, token.scope().size()); + assertFalse(token.scope().contains("")); + } + + @Test + void testTokenLifetimeMs() { + assertEquals(Long.MAX_VALUE, token.lifetimeMs()); + } + + @Test + void testTokenPrincipalName() { + assertEquals("1234567890", token.principalName()); + } + + @Test + void testTokenStartTimeMs() { + assertEquals(1516239022L, token.startTimeMs()); + } + + @Test + void testCreateTokenFromInvalidPayload() throws DatafileTaskException { + // Create a JWT with an invalid payload (missing fields) + String invalidPayload = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"; + assertThrows(DatafileTaskException.class, () -> OAuthBearerTokenJwt.create(invalidPayload)); + } + + @Test + void testCreateTokenWithValidPayload() throws DatafileTaskException { + // Create a JWT with a valid payload + String validPayload = "eyJzdWIiOiAiVGVzdCIsICJleHAiOiAxNjM1MTUwMDAwLCAiaWF0IjogMTYzNTA5NTAwMCwgInNjb3BlIjogInNjb3BlX3Rva2VuIiwgImp0aSI6ICJmb28ifQ=="; + OAuthBearerTokenJwt jwt = OAuthBearerTokenJwt.create("header." + validPayload + ".signature"); + + assertNotNull(jwt); + assertEquals("header." + validPayload + ".signature", jwt.value()); + assertEquals(1, jwt.scope().size()); + assertEquals("scope_token", jwt.scope().iterator().next()); + assertEquals("Test", jwt.principalName()); + assertEquals(1635095000, jwt.startTimeMs()); + } + + @Test + void testCreateThrowsExceptionWithInvalidToken() throws DatafileTaskException { + String tokenRaw = "your_mocked_token_here"; + assertThrows(DatafileTaskException.class, () -> OAuthBearerTokenJwt.create(tokenRaw)); + } +} diff --git a/datafilecollector/src/test/java/org/oran/datafile/oauth2/OAuthKafkaAuthenticateLoginCallbackHandlerTest.java b/datafilecollector/src/test/java/org/oran/datafile/oauth2/OAuthKafkaAuthenticateLoginCallbackHandlerTest.java new file mode 100644 index 0000000..bba9539 --- /dev/null +++ b/datafilecollector/src/test/java/org/oran/datafile/oauth2/OAuthKafkaAuthenticateLoginCallbackHandlerTest.java @@ -0,0 +1,128 @@ +/*- + * ============LICENSE_START======================================================= + * 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.oran.datafile.oauth2; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import javax.security.auth.callback.Callback; +import javax.security.auth.callback.UnsupportedCallbackException; +import javax.security.auth.login.AppConfigurationEntry; +import org.apache.kafka.common.security.auth.SaslExtensionsCallback; +import org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule; +import org.apache.kafka.common.security.oauthbearer.OAuthBearerTokenCallback; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +class OAuthKafkaAuthenticateLoginCallbackHandlerTest { + + private OAuthKafkaAuthenticateLoginCallbackHandler callbackHandler; + + @BeforeEach + void setUp() { + callbackHandler = new OAuthKafkaAuthenticateLoginCallbackHandler(); + } + + @Test + void testConfigureWithValidSaslMechanismAndConfigEntry() { + String saslMechanism = OAuthBearerLoginModule.OAUTHBEARER_MECHANISM; + List jaasConfigEntries = Collections.singletonList(Mockito.mock(AppConfigurationEntry.class)); + + callbackHandler.configure(new HashMap<>(), saslMechanism, jaasConfigEntries); + + assertTrue(callbackHandler.isConfigured()); + } + + @SuppressWarnings("java:S5778") + @Test + void testConfigureWithInvalidSaslMechanism() { + String invalidSaslMechanism = "InvalidMechanism"; + List jaasConfigEntries = Collections.singletonList(Mockito.mock(AppConfigurationEntry.class)); + + assertThrows(IllegalArgumentException.class, () -> callbackHandler.configure(new HashMap<>(), invalidSaslMechanism, jaasConfigEntries)); + + assertFalse(callbackHandler.isConfigured()); + } + + @SuppressWarnings("java:S5778") + @Test + void testConfigureWithEmptyJaasConfigEntries() { + String saslMechanism = OAuthBearerLoginModule.OAUTHBEARER_MECHANISM; + List emptyJaasConfigEntries = Collections.emptyList(); + + assertThrows(IllegalArgumentException.class, () -> callbackHandler.configure(new HashMap<>(), saslMechanism, emptyJaasConfigEntries)); + + assertFalse(callbackHandler.isConfigured()); + } + + @Test + void testHandleSaslExtensionsCallback() throws IOException, UnsupportedCallbackException { + String saslMechanism = OAuthBearerLoginModule.OAUTHBEARER_MECHANISM; + List jaasConfigEntries = Collections.singletonList(Mockito.mock(AppConfigurationEntry.class)); + + callbackHandler.configure(new HashMap<>(), saslMechanism, jaasConfigEntries); + SaslExtensionsCallback callback = mock(SaslExtensionsCallback.class); + + callbackHandler.handle(new Callback[]{callback}); + verify(callback).extensions(any()); + } + + @Test + void testHandleUnsupportedCallback() { + Callback unsupportedCallback = mock(Callback.class); + String saslMechanism = OAuthBearerLoginModule.OAUTHBEARER_MECHANISM; + List jaasConfigEntries = Collections.singletonList(Mockito.mock(AppConfigurationEntry.class)); + + callbackHandler.configure(new HashMap<>(), saslMechanism, jaasConfigEntries); + assertThrows(UnsupportedCallbackException.class, () -> callbackHandler.handle(new Callback[]{unsupportedCallback})); + } + + @Test + void testHandleOAuthBearerTokenCallback() throws IOException, UnsupportedCallbackException { + + String saslMechanism = OAuthBearerLoginModule.OAUTHBEARER_MECHANISM; + List jaasConfigEntries = Collections.singletonList(Mockito.mock(AppConfigurationEntry.class)); + String validJwt = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"; + + callbackHandler.configure(new HashMap<>(), saslMechanism, jaasConfigEntries); + + OAuthBearerTokenCallback oauthBearerTokenCallback = Mockito.mock(OAuthBearerTokenCallback.class); + SecurityContext securityContextMock = Mockito.mock(SecurityContext.class); + when(oauthBearerTokenCallback.token()).thenReturn(null); // Ensure the callback has no token initially + when(oauthBearerTokenCallback.token()).thenAnswer(invocation -> { + return OAuthBearerTokenJwt.create(validJwt); + }); + + when(securityContextMock.getBearerAuthToken()).thenReturn(validJwt); + callbackHandler.handle(new Callback[]{oauthBearerTokenCallback}); + verify(oauthBearerTokenCallback).token(); + } +} diff --git a/datafilecollector/src/test/java/org/oran/datafile/oauth2/SecurityContextTest.java b/datafilecollector/src/test/java/org/oran/datafile/oauth2/SecurityContextTest.java new file mode 100644 index 0000000..adacd4c --- /dev/null +++ b/datafilecollector/src/test/java/org/oran/datafile/oauth2/SecurityContextTest.java @@ -0,0 +1,81 @@ +/*- + * ============LICENSE_START======================================================= + * 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.oran.datafile.oauth2; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.nio.file.Path; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.MockitoAnnotations; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +class SecurityContextTest { + + @BeforeEach + void setUp() { + MockitoAnnotations.initMocks(this); + } + + @Test + void testConstructorWithAuthTokenFilename() { + SecurityContext securityContext = new SecurityContext("auth-token-file.txt"); + assertNotNull(securityContext.getAuthTokenFilePath()); + assertEquals(Path.of("auth-token-file.txt"), securityContext.getAuthTokenFilePath()); + } + + @Test + void testConstructorWithoutAuthTokenFilename() { + SecurityContext securityContext = new SecurityContext(""); + assertNull(securityContext.getAuthTokenFilePath()); + } + + @Test + void testIsConfigured() { + SecurityContext securityContext = new SecurityContext("auth-token-file.txt"); + assertTrue(securityContext.isConfigured()); + } + + @Test + void testIsNotConfigured() { + SecurityContext securityContext = new SecurityContext(""); + assertFalse(securityContext.isConfigured()); + } + + @Test + void testGetBearerAuthToken() { + assertEquals("", SecurityContext.getInstance().getBearerAuthToken()); + assertEquals("", (new SecurityContext("foo.txt")).getBearerAuthToken()); + } + + @Test + void testGetBearerAuthTokenWhenNotConfigured() { + SecurityContext securityContext = new SecurityContext(""); + assertEquals("", securityContext.getBearerAuthToken()); + } +} + diff --git a/datafilecollector/src/test/java/org/oran/datafile/tasks/CollectAndReportFilesTest.java b/datafilecollector/src/test/java/org/oran/datafile/tasks/CollectAndReportFilesTest.java new file mode 100644 index 0000000..9910382 --- /dev/null +++ b/datafilecollector/src/test/java/org/oran/datafile/tasks/CollectAndReportFilesTest.java @@ -0,0 +1,94 @@ +/*- + * ============LICENSE_START======================================================= + * 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.oran.datafile.tasks; + +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.jupiter.MockitoExtension; +import org.oran.datafile.configuration.AppConfig; +import org.oran.datafile.model.Counters; +import org.oran.datafile.model.FilePublishInformation; +import org.oran.datafile.oauth2.SecurityContext; +import org.springframework.test.context.ContextConfiguration; +import reactor.core.publisher.DirectProcessor; +import reactor.kafka.sender.SenderResult; + +@ContextConfiguration(classes = {CollectAndReportFiles.class}) +@ExtendWith(MockitoExtension.class) +class CollectAndReportFilesTest { + @Mock + private AppConfig appConfig; + + @Mock + private CollectAndReportFiles collectAndReportFilesMock; + + @Mock + private SecurityContext securityContext; + + @Test + void testStart() { + doNothing().when(collectAndReportFilesMock).start(); + collectAndReportFilesMock.start(); + verify(collectAndReportFilesMock).start(); + } + @Test + void testCreateMainTask() { + DirectProcessor createResult = DirectProcessor.create(); + when(collectAndReportFilesMock.createMainTask()).thenReturn(createResult); + assertSame(createResult, collectAndReportFilesMock.createMainTask()); + verify(collectAndReportFilesMock).createMainTask(); + } + @Test + void testSendDataToStream() { + DirectProcessor> createResult = DirectProcessor.create(); + when( + collectAndReportFilesMock.sendDataToStream(Mockito.any(), Mockito.any(), Mockito.any())) + .thenReturn(createResult); + assertSame(createResult, collectAndReportFilesMock.sendDataToStream("Topic", "Source Name", "42")); + verify(collectAndReportFilesMock).sendDataToStream(Mockito.any(), Mockito.any(), + Mockito.any()); + } + @Test + void testCreateFileCollector() { + FileCollector fileCollector = new FileCollector(securityContext, appConfig, new Counters()); + + when(collectAndReportFilesMock.createFileCollector()).thenReturn(fileCollector); + assertSame(fileCollector, collectAndReportFilesMock.createFileCollector()); + verify(collectAndReportFilesMock).createFileCollector(); + } + @Test + void testParseReceivedFileReadyMessage() { + when(collectAndReportFilesMock.parseReceivedFileReadyMessage(Mockito.any())) + .thenReturn(null); + assertNull( + collectAndReportFilesMock.parseReceivedFileReadyMessage(new KafkaTopicListener.DataFromTopic("Key", "42"))); + verify(collectAndReportFilesMock).parseReceivedFileReadyMessage(Mockito.any()); + } +} + diff --git a/datafilecollector/src/test/java/org/oran/datafile/tasks/FileCollectorTest.java b/datafilecollector/src/test/java/org/oran/datafile/tasks/FileCollectorTest.java index 118e9c7..432e045 100644 --- a/datafilecollector/src/test/java/org/oran/datafile/tasks/FileCollectorTest.java +++ b/datafilecollector/src/test/java/org/oran/datafile/tasks/FileCollectorTest.java @@ -52,7 +52,7 @@ import org.oran.datafile.model.FileReadyMessage; import org.oran.datafile.oauth2.SecurityContext; import reactor.test.StepVerifier; -public class FileCollectorTest { +class FileCollectorTest { final static String DATAFILE_TMPDIR = "/tmp/onap_datafile/"; private static final String PRODUCT_NAME = "NrRadio"; @@ -190,7 +190,7 @@ public class FileCollectorTest { } @Test - public void whenFtpesFile_returnCorrectResponse() throws Exception { + void whenFtpesFile_returnCorrectResponse() throws Exception { FileCollector collectorUndetTest = spy(new FileCollector(securityContext, appConfigMock, counters)); doReturn(ftpesClientMock).when(collectorUndetTest).createFtpesClient(any()); @@ -214,7 +214,7 @@ public class FileCollectorTest { } @Test - public void whenSftpFile_returnCorrectResponse() throws Exception { + void whenSftpFile_returnCorrectResponse() throws Exception { FileCollector collectorUndetTest = spy(new FileCollector(securityContext, appConfigMock, counters)); doReturn(sftpClientMock).when(collectorUndetTest).createSftpClient(any()); @@ -243,7 +243,7 @@ public class FileCollectorTest { } @Test - public void whenHttpFile_returnCorrectResponse() throws Exception { + void whenHttpFile_returnCorrectResponse() throws Exception { FileCollector collectorUndetTest = spy(new FileCollector(securityContext, appConfigMock, counters)); doReturn(dfcHttpClientMock).when(collectorUndetTest).createHttpClient(any()); @@ -275,7 +275,7 @@ public class FileCollectorTest { } @Test - public void whenHttpsFile_returnCorrectResponse() throws Exception { + void whenHttpsFile_returnCorrectResponse() throws Exception { FileCollector collectorUndetTest = spy(new FileCollector(securityContext, appConfigMock, counters)); doReturn(dfcHttpsClientMock).when(collectorUndetTest).createHttpsClient(any()); @@ -307,7 +307,7 @@ public class FileCollectorTest { } @Test - public void whenFtpesFileAlwaysFail_retryAndFail() throws Exception { + void whenFtpesFileAlwaysFail_retryAndFail() throws Exception { FileCollector collectorUndetTest = spy(new FileCollector(securityContext, appConfigMock, counters)); doReturn(ftpesClientMock).when(collectorUndetTest).createFtpesClient(any()); @@ -327,7 +327,7 @@ public class FileCollectorTest { } @Test - public void whenFtpesFileAlwaysFail_failWithoutRetry() throws Exception { + void whenFtpesFileAlwaysFail_failWithoutRetry() throws Exception { FileCollector collectorUndetTest = spy(new FileCollector(securityContext, appConfigMock, counters)); doReturn(ftpesClientMock).when(collectorUndetTest).createFtpesClient(any()); @@ -347,7 +347,7 @@ public class FileCollectorTest { } @Test - public void whenFtpesFileFailOnce_retryAndReturnCorrectResponse() throws Exception { + void whenFtpesFileFailOnce_retryAndReturnCorrectResponse() throws Exception { FileCollector collectorUndetTest = spy(new FileCollector(securityContext, appConfigMock, counters)); doReturn(ftpesClientMock).when(collectorUndetTest).createFtpesClient(any()); doThrow(new DatafileTaskException("Unable to collect file.")).doNothing().when(ftpesClientMock) diff --git a/datafilecollector/src/test/java/org/oran/datafile/tasks/KafkaTopicListenerTest.java b/datafilecollector/src/test/java/org/oran/datafile/tasks/KafkaTopicListenerTest.java new file mode 100644 index 0000000..00f4f43 --- /dev/null +++ b/datafilecollector/src/test/java/org/oran/datafile/tasks/KafkaTopicListenerTest.java @@ -0,0 +1,70 @@ +/*- + * ============LICENSE_START======================================================= + * 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.oran.datafile.tasks; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.util.Collections; +import org.apache.kafka.clients.consumer.ConsumerConfig; +import org.apache.kafka.clients.consumer.OffsetResetStrategy; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.oran.datafile.configuration.AppConfig; +import reactor.core.publisher.Flux; +import reactor.kafka.receiver.KafkaReceiver; +import reactor.kafka.receiver.ReceiverOptions; + +class KafkaTopicListenerTest { + + @Mock + private AppConfig appConfig; + + @Mock + private KafkaTopicListener kafkaTopicListener; + + @BeforeEach + void setUp() { + MockitoAnnotations.initMocks(this); + when(appConfig.getInputTopic()).thenReturn("testTopic"); + when(appConfig.getKafkaClientId()).thenReturn("testClientId"); + when(appConfig.getKafkaBootStrapServers()).thenReturn("localhost:9092"); + kafkaTopicListener = new KafkaTopicListener(appConfig); + } + + @Test + void testStartReceiveFromTopic() { + KafkaReceiver mockKafkaReceiver = mock(KafkaReceiver.class); + + when(mockKafkaReceiver.receive()).thenReturn(Flux.just(new KafkaTopicListener.DataFromTopic("key", "value"))); + + ReceiverOptions receiverOptions = mock(ReceiverOptions.class); + when(receiverOptions.subscription(Collections.singleton("testTopic"))).thenReturn(receiverOptions); + when(receiverOptions.consumerProperty(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, OffsetResetStrategy.EARLIEST.name())) + .thenReturn(receiverOptions); + + assertEquals("testTopic", appConfig.getInputTopic()); + + } +} \ No newline at end of file diff --git a/datafilecollector/src/test/resources/org/oran/datafile/datastore/file.txt b/datafilecollector/src/test/resources/org/oran/datafile/datastore/file.txt new file mode 100644 index 0000000..c95df2d --- /dev/null +++ b/datafilecollector/src/test/resources/org/oran/datafile/datastore/file.txt @@ -0,0 +1 @@ +Hi, How are you? \ No newline at end of file -- 2.16.6 From 331535e4fea69fbdcf3c74cc1cdfe8b05c9080f4 Mon Sep 17 00:00:00 2001 From: ambrishest Date: Mon, 18 Sep 2023 09:26:05 +0100 Subject: [PATCH 06/16] Improve Test coverage of InfluxLogger Issue-ID: NONRTRIC-875 Change-Id: I1147932b9019f857ddbede4c47e9defac81d39b6 Signed-off-by: ambrishest --- influxlogger/pom.xml | 1 + .../org/oran/pmlog/ConsumerRegstrationTask.java | 7 +- .../java/org/oran/pmlog/DataFromKafkaTopic.java | 4 + .../src/main/java/org/oran/pmlog/InfluxStore.java | 4 +- .../java/org/oran/pmlog/KafkaTopicListener.java | 1 - .../org/oran/pmlog/clients/AsyncRestClient.java | 3 +- .../oran/pmlog/clients/AsyncRestClientFactory.java | 1 + .../oran/pmlog/configuration/ConsumerJobInfo.java | 3 + .../org/oran/pmlog/oauth2/OAuthBearerTokenJwt.java | 44 +++--- ...OAuthKafkaAuthenticateLoginCallbackHandler.java | 53 ++++--- .../org/oran/pmlog/oauth2/SecurityContext.java | 3 +- .../test/java/org/oran/pmlog/ApplicationTest.java | 12 -- .../test/java/org/oran/pmlog/BeanFactoryTest.java | 60 ++++++++ .../org/oran/pmlog/DataFromKafkaTopicTest.java | 162 +++++++++++++++++++++ .../src/test/java/org/oran/pmlog/Integration.java | 17 +-- .../pmlog/configuration/ApplicationConfigTest.java | 110 ++++++++++++++ .../pmlog/configuration/ConsumerJobInfoTest.java | 142 ++++++++++++++++++ .../oran/pmlog/oauth2/OAuthBearerTokenJwtTest.java | 91 ++++++++++++ ...hKafkaAuthenticateLoginCallbackHandlerTest.java | 109 ++++++++++++++ .../org/oran/pmlog/oauth2/SecurityContextTest.java | 61 ++++++++ 20 files changed, 806 insertions(+), 82 deletions(-) create mode 100644 influxlogger/src/test/java/org/oran/pmlog/BeanFactoryTest.java create mode 100644 influxlogger/src/test/java/org/oran/pmlog/DataFromKafkaTopicTest.java create mode 100644 influxlogger/src/test/java/org/oran/pmlog/configuration/ApplicationConfigTest.java create mode 100644 influxlogger/src/test/java/org/oran/pmlog/configuration/ConsumerJobInfoTest.java create mode 100644 influxlogger/src/test/java/org/oran/pmlog/oauth2/OAuthBearerTokenJwtTest.java create mode 100644 influxlogger/src/test/java/org/oran/pmlog/oauth2/OAuthKafkaAuthenticateLoginCallbackHandlerTest.java create mode 100644 influxlogger/src/test/java/org/oran/pmlog/oauth2/SecurityContextTest.java diff --git a/influxlogger/pom.xml b/influxlogger/pom.xml index 89c17f4..04c1b63 100644 --- a/influxlogger/pom.xml +++ b/influxlogger/pom.xml @@ -61,6 +61,7 @@ 2.0.2 1.6.14 true + diff --git a/influxlogger/src/main/java/org/oran/pmlog/ConsumerRegstrationTask.java b/influxlogger/src/main/java/org/oran/pmlog/ConsumerRegstrationTask.java index be16a20..ec6ddf3 100644 --- a/influxlogger/src/main/java/org/oran/pmlog/ConsumerRegstrationTask.java +++ b/influxlogger/src/main/java/org/oran/pmlog/ConsumerRegstrationTask.java @@ -49,11 +49,6 @@ public class ConsumerRegstrationTask { private final AsyncRestClient restClient; private final ApplicationConfig applicationConfig; - private static com.google.gson.Gson gson = new com.google.gson.GsonBuilder() // - .disableHtmlEscaping() // - .excludeFieldsWithoutExposeAnnotation() // - .create(); - @Getter private boolean isRegisteredInIcs = false; @@ -74,7 +69,7 @@ public class ConsumerRegstrationTask { private void createSubscription() { putInfoJob() // .doOnError(this::handleRegistrationFailure) - .retryWhen(Retry.fixedDelay(100, Duration.ofMillis(5 * 1000))) // + .retryWhen(Retry.fixedDelay(100, Duration.ofMillis(5L * 1000))) // .subscribe( // null, // this::handleRegistrationFailure, // diff --git a/influxlogger/src/main/java/org/oran/pmlog/DataFromKafkaTopic.java b/influxlogger/src/main/java/org/oran/pmlog/DataFromKafkaTopic.java index 2d08cde..16f5f2a 100644 --- a/influxlogger/src/main/java/org/oran/pmlog/DataFromKafkaTopic.java +++ b/influxlogger/src/main/java/org/oran/pmlog/DataFromKafkaTopic.java @@ -23,6 +23,7 @@ package org.oran.pmlog; import java.io.ByteArrayInputStream; import java.util.zip.GZIPInputStream; +import lombok.Getter; import lombok.ToString; import org.apache.kafka.common.header.Header; @@ -31,8 +32,11 @@ import org.slf4j.LoggerFactory; @ToString public class DataFromKafkaTopic { + @Getter private final byte[] key; + @Getter private final byte[] value; + @Getter private String stringValue = null; private static final Logger logger = LoggerFactory.getLogger(DataFromKafkaTopic.class); diff --git a/influxlogger/src/main/java/org/oran/pmlog/InfluxStore.java b/influxlogger/src/main/java/org/oran/pmlog/InfluxStore.java index ba9f21c..b25a4ca 100644 --- a/influxlogger/src/main/java/org/oran/pmlog/InfluxStore.java +++ b/influxlogger/src/main/java/org/oran/pmlog/InfluxStore.java @@ -51,7 +51,6 @@ public class InfluxStore { @Getter private Disposable subscription; - private static com.google.gson.Gson gson = new com.google.gson.GsonBuilder().disableHtmlEscaping().create(); private final ApplicationConfig applConfig; private final InfluxDBClient influxClient; @@ -97,7 +96,7 @@ public class InfluxStore { this.subscription = input.flatMap(this::storeInInflux) // .subscribe(this::handleSentOk, // this::handleExceptionInStream, // - () -> stop()); + this::stop); } @@ -105,6 +104,7 @@ public class InfluxStore { return measInfoList.getMeasTypes().getMeasType(measResult.getP()); } + @SuppressWarnings("java:S1172") private void addCounterFieldToPoint(Point point, PmReport.MeasInfoList measInfoList, PmReport.MeasValuesList measValueList, PmReport.MeasResult measResult) { String measType = measType(measResult, measInfoList); diff --git a/influxlogger/src/main/java/org/oran/pmlog/KafkaTopicListener.java b/influxlogger/src/main/java/org/oran/pmlog/KafkaTopicListener.java index 1617f1d..274a53f 100644 --- a/influxlogger/src/main/java/org/oran/pmlog/KafkaTopicListener.java +++ b/influxlogger/src/main/java/org/oran/pmlog/KafkaTopicListener.java @@ -45,7 +45,6 @@ public class KafkaTopicListener { private static final Logger logger = LoggerFactory.getLogger(KafkaTopicListener.class); private final ApplicationConfig applicationConfig; private Flux dataFromTopic; - private static com.google.gson.Gson gson = new com.google.gson.GsonBuilder().disableHtmlEscaping().create(); public KafkaTopicListener(ApplicationConfig applConfig) { this.applicationConfig = applConfig; diff --git a/influxlogger/src/main/java/org/oran/pmlog/clients/AsyncRestClient.java b/influxlogger/src/main/java/org/oran/pmlog/clients/AsyncRestClient.java index 43961e8..078b073 100644 --- a/influxlogger/src/main/java/org/oran/pmlog/clients/AsyncRestClient.java +++ b/influxlogger/src/main/java/org/oran/pmlog/clients/AsyncRestClient.java @@ -145,8 +145,7 @@ public class AsyncRestClient { } private void onError(Throwable t) { - if (t instanceof WebClientResponseException) { - WebClientResponseException e = (WebClientResponseException) t; + if (t instanceof WebClientResponseException e) { logger.debug("Response error: {}", e.getResponseBodyAsString()); } } diff --git a/influxlogger/src/main/java/org/oran/pmlog/clients/AsyncRestClientFactory.java b/influxlogger/src/main/java/org/oran/pmlog/clients/AsyncRestClientFactory.java index a1d1c12..a1c5d53 100644 --- a/influxlogger/src/main/java/org/oran/pmlog/clients/AsyncRestClientFactory.java +++ b/influxlogger/src/main/java/org/oran/pmlog/clients/AsyncRestClientFactory.java @@ -117,6 +117,7 @@ public class AsyncRestClientFactory { } } + @SuppressWarnings("java:S6204") private SslContext createSslContextRejectingUntrustedPeers(String trustStorePath, String trustStorePass, KeyManagerFactory keyManager) throws NoSuchAlgorithmException, CertificateException, IOException, KeyStoreException { diff --git a/influxlogger/src/main/java/org/oran/pmlog/configuration/ConsumerJobInfo.java b/influxlogger/src/main/java/org/oran/pmlog/configuration/ConsumerJobInfo.java index be3b23c..4bd3a7b 100644 --- a/influxlogger/src/main/java/org/oran/pmlog/configuration/ConsumerJobInfo.java +++ b/influxlogger/src/main/java/org/oran/pmlog/configuration/ConsumerJobInfo.java @@ -94,14 +94,17 @@ public class ConsumerJobInfo { @SerializedName("info_type_id") @Expose + @Getter public String infoTypeId = ""; @SerializedName("job_owner") @Expose + @Getter public String owner = ""; @SerializedName("job_definition") @Expose + @Getter public PmJobParameters jobDefinition; public ConsumerJobInfo() {} diff --git a/influxlogger/src/main/java/org/oran/pmlog/oauth2/OAuthBearerTokenJwt.java b/influxlogger/src/main/java/org/oran/pmlog/oauth2/OAuthBearerTokenJwt.java index 311a2bd..8f020e8 100644 --- a/influxlogger/src/main/java/org/oran/pmlog/oauth2/OAuthBearerTokenJwt.java +++ b/influxlogger/src/main/java/org/oran/pmlog/oauth2/OAuthBearerTokenJwt.java @@ -1,38 +1,32 @@ -// ============LICENSE_START=============================================== -// Copyright (C) 2023 Nordix Foundation. 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. -// ============LICENSE_END================================================= -// +/*- + * ========================LICENSE_START================================= + * O-RAN-SC + * 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. + * ========================LICENSE_END=================================== + */ package org.oran.pmlog.oauth2; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonMappingException; - import java.util.Base64; import java.util.HashSet; import java.util.Set; - import lombok.ToString; - import org.apache.kafka.common.security.oauthbearer.OAuthBearerToken; import org.oran.pmlog.exceptions.ServiceException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class OAuthBearerTokenJwt implements OAuthBearerToken { - private static final Logger logger = LoggerFactory.getLogger(OAuthBearerTokenJwt.class); private static final com.google.gson.Gson gson = new com.google.gson.GsonBuilder().disableHtmlEscaping().create(); private final String jwtTokenRaw; @@ -47,7 +41,7 @@ public class OAuthBearerTokenJwt implements OAuthBearerToken { } public static OAuthBearerTokenJwt create(String tokenRaw) - throws ServiceException, JsonMappingException, JsonProcessingException { + throws ServiceException { String[] chunks = tokenRaw.split("\\."); Base64.Decoder decoder = Base64.getUrlDecoder(); if (chunks.length < 2) { diff --git a/influxlogger/src/main/java/org/oran/pmlog/oauth2/OAuthKafkaAuthenticateLoginCallbackHandler.java b/influxlogger/src/main/java/org/oran/pmlog/oauth2/OAuthKafkaAuthenticateLoginCallbackHandler.java index b48f222..5eb4162 100644 --- a/influxlogger/src/main/java/org/oran/pmlog/oauth2/OAuthKafkaAuthenticateLoginCallbackHandler.java +++ b/influxlogger/src/main/java/org/oran/pmlog/oauth2/OAuthKafkaAuthenticateLoginCallbackHandler.java @@ -1,19 +1,21 @@ -// ============LICENSE_START=============================================== -// Copyright (C) 2023 Nordix Foundation. 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. -// ============LICENSE_END================================================= -// +/*- + * ========================LICENSE_START================================= + * O-RAN-SC + * 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. + * ========================LICENSE_END=================================== + */ package org.oran.pmlog.oauth2; @@ -51,7 +53,10 @@ public class OAuthKafkaAuthenticateLoginCallbackHandler implements AuthenticateC } @Override - public void close() {} + public void close() { + /*This method intentionally left empty. + Close functionality will be implemented later.*/ + } @Override public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { @@ -59,11 +64,11 @@ public class OAuthKafkaAuthenticateLoginCallbackHandler implements AuthenticateC if (!this.isConfigured) throw new IllegalStateException("Callback handler not configured"); for (Callback callback : callbacks) { - logger.debug("callback " + callback.toString()); - if (callback instanceof OAuthBearerTokenCallback) { - handleCallback((OAuthBearerTokenCallback) callback); - } else if (callback instanceof SaslExtensionsCallback) { - handleCallback((SaslExtensionsCallback) callback); + logger.debug("callback {}", callback); + if (callback instanceof OAuthBearerTokenCallback oAuthBearerTokenCallback) { + handleCallback(oAuthBearerTokenCallback); + } else if (callback instanceof SaslExtensionsCallback saslExtensionsCallback) { + handleCallback(saslExtensionsCallback); } else { logger.error("Unsupported callback: {}", callback); throw new UnsupportedCallbackException(callback); @@ -90,4 +95,8 @@ public class OAuthKafkaAuthenticateLoginCallbackHandler implements AuthenticateC } } + public boolean isConfigured() { + return isConfigured; + } + } diff --git a/influxlogger/src/main/java/org/oran/pmlog/oauth2/SecurityContext.java b/influxlogger/src/main/java/org/oran/pmlog/oauth2/SecurityContext.java index 82d44a7..5de4252 100644 --- a/influxlogger/src/main/java/org/oran/pmlog/oauth2/SecurityContext.java +++ b/influxlogger/src/main/java/org/oran/pmlog/oauth2/SecurityContext.java @@ -49,10 +49,11 @@ public class SecurityContext { private static SecurityContext instance; @Setter + @Getter private Path authTokenFilePath; public SecurityContext(@Value("${app.auth-token-file:}") String authTokenFilename) { - instance = this; + instance = this; //NOSONAR if (!authTokenFilename.isEmpty()) { this.authTokenFilePath = Path.of(authTokenFilename); } diff --git a/influxlogger/src/test/java/org/oran/pmlog/ApplicationTest.java b/influxlogger/src/test/java/org/oran/pmlog/ApplicationTest.java index 46de821..e8d69e6 100644 --- a/influxlogger/src/test/java/org/oran/pmlog/ApplicationTest.java +++ b/influxlogger/src/test/java/org/oran/pmlog/ApplicationTest.java @@ -21,7 +21,6 @@ package org.oran.pmlog; import static org.assertj.core.api.Assertions.assertThat; -import static org.awaitility.Awaitility.await; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.spy; @@ -33,7 +32,6 @@ import java.lang.invoke.MethodHandles; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; - import org.json.JSONObject; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -44,7 +42,6 @@ import org.mockito.Mockito; import org.oran.pmlog.clients.AsyncRestClient; import org.oran.pmlog.clients.AsyncRestClientFactory; import org.oran.pmlog.configuration.ApplicationConfig; -import org.oran.pmlog.configuration.ConsumerJobInfo; import org.oran.pmlog.configuration.WebClientConfig; import org.oran.pmlog.configuration.WebClientConfig.HttpProxyConfig; import org.oran.pmlog.oauth2.SecurityContext; @@ -174,15 +171,6 @@ class ApplicationTest { Mockito.verify(TestBeanFactory.influxStore, Mockito.times(1)).store(any(), any()); } - @Test - void testJobCreation() throws Exception { - await().untilAsserted(() -> assertThat(consumerRegstrationTask.isRegisteredInIcs()).isTrue()); - ConsumerJobInfo createdJob = this.icsSimulatorController.testResults.createdJob; - assertThat(createdJob).isNotNull(); - assertThat(createdJob.jobDefinition.getDeliveryInfo().getTopic()) - .isEqualTo(applicationConfig.getKafkaInputTopic()); - } - private AsyncRestClient restClient() { return restClient(false); } diff --git a/influxlogger/src/test/java/org/oran/pmlog/BeanFactoryTest.java b/influxlogger/src/test/java/org/oran/pmlog/BeanFactoryTest.java new file mode 100644 index 0000000..6c684df --- /dev/null +++ b/influxlogger/src/test/java/org/oran/pmlog/BeanFactoryTest.java @@ -0,0 +1,60 @@ +/*- + * ========================LICENSE_START================================= + * O-RAN-SC + * %% + * 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. + * ========================LICENSE_END=================================== + */ + +package org.oran.pmlog; + +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.TestPropertySource; + +@SpringBootTest +@TestPropertySource(properties = { "server.http-port=8080" }) // Set the http-port property +class BeanFactoryTest { + + @Autowired + private BeanFactory beanFactory; + + @Test + void testApplicationConfigBean() { + // Ensure that the ApplicationConfig bean is created + assertNotNull(beanFactory.getApplicationConfig()); + } + + @Test + void testServletContainerBean() { + // Ensure that the ServletWebServerFactory bean is created + assertNotNull(beanFactory.servletContainer()); + } + + @Test + void testKafkaTopicListenerBean() { + // Ensure that the KafkaTopicListener bean is created with ApplicationConfig dependency + assertNotNull(beanFactory.getKafkaTopicListener(beanFactory.getApplicationConfig())); + } + + @Test + void testInfluxStoreBean() { + // Ensure that the InfluxStore bean is created with ApplicationConfig and KafkaTopicListener dependencies + assertNotNull(beanFactory.getInfluxStore(beanFactory.getApplicationConfig(), beanFactory.getKafkaTopicListener(beanFactory.getApplicationConfig()))); + } +} diff --git a/influxlogger/src/test/java/org/oran/pmlog/DataFromKafkaTopicTest.java b/influxlogger/src/test/java/org/oran/pmlog/DataFromKafkaTopicTest.java new file mode 100644 index 0000000..598b51b --- /dev/null +++ b/influxlogger/src/test/java/org/oran/pmlog/DataFromKafkaTopicTest.java @@ -0,0 +1,162 @@ +/*- + * ========================LICENSE_START================================= + * O-RAN-SC + * %% + * 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. + * ========================LICENSE_END=================================== + */ + +package org.oran.pmlog; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.when; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.apache.kafka.common.header.Header; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +class DataFromKafkaTopicTest { + + private DataFromKafkaTopic data; + private List
headers; + + @BeforeEach + void setUp() { + headers = new ArrayList<>(); + data = new DataFromKafkaTopic(headers, null, null); + } + + @Test + void testConstructor_NullKeyAndValue() { + assertNotNull(data); + assertArrayEquals(new byte[0], data.getKey()); + assertArrayEquals(new byte[0], data.getValue()); + assertEquals(headers, data.headers); + } + + @Test + void testValueAsString_Unzipped() { + data.valueAsString(); + assertEquals("", data.valueAsString()); + assertFalse(data.isZipped()); // Not zipped + + // Ensure that calling valueAsString again does not recompute the value + data.valueAsString(); + assertEquals("", data.valueAsString()); + } + + @Test + void testValueAsString_Zipped() { + headers.add(new Header() { + @Override + public String key() { + return DataFromKafkaTopic.ZIPPED_PROPERTY; + } + + @Override + public byte[] value() { + return new byte[]{1}; + } + }); + + // Mock GZIPInputStream behavior + ByteArrayInputStream inputStream = Mockito.mock(ByteArrayInputStream.class); + when(inputStream.readAllBytes()).thenReturn("ZippedValue".getBytes()); + + // Mock the unzip method + DataFromKafkaTopic spyData = spy(data); + + // Call valueAsString to trigger unzipping + String result = spyData.valueAsString(); + + // Ensure that the value is correctly unzipped + assertEquals("", result); + assertEquals("", spyData.getStringValue()); + assertTrue(spyData.isZipped()); + } + + @Test + void testUnzip_Exception() throws IOException { + byte[] zippedBytes = "ZippedValue".getBytes(); + + // Mock GZIPInputStream to throw an exception + ByteArrayInputStream inputStream = Mockito.mock(ByteArrayInputStream.class); + when(inputStream.readAllBytes()).thenThrow(new IOException("Mocked exception")); + + // Mock the unzip method + DataFromKafkaTopic spyData = spy(data); + + // Call unzip method + String result = spyData.valueAsString(); + + // Ensure that an empty string is returned and the error is logged + assertEquals("", result); + } + + @Test + void testIsZipped_True() { + headers.add(new Header() { + @Override + public String key() { + return DataFromKafkaTopic.ZIPPED_PROPERTY; + } + + @Override + public byte[] value() { + return new byte[0]; + } + }); + + assertTrue(data.isZipped()); + } + + @Test + void testIsZipped_False() { + assertFalse(data.isZipped()); + } + + @Test + void testGetTypeIdFromHeaders() { + headers.add(new Header() { + @Override + public String key() { + return DataFromKafkaTopic.TYPE_ID_PROPERTY; + } + + @Override + public byte[] value() { + return "Type123".getBytes(); + } + }); + + assertEquals("Type123", data.getTypeIdFromHeaders()); + } + + @Test + void testGetTypeIdFromHeaders_Null() { + assertEquals("", data.getTypeIdFromHeaders()); + } +} + diff --git a/influxlogger/src/test/java/org/oran/pmlog/Integration.java b/influxlogger/src/test/java/org/oran/pmlog/Integration.java index ea932b6..c57e4dc 100644 --- a/influxlogger/src/test/java/org/oran/pmlog/Integration.java +++ b/influxlogger/src/test/java/org/oran/pmlog/Integration.java @@ -20,6 +20,8 @@ package org.oran.pmlog; +import static org.junit.jupiter.api.Assertions.assertEquals; + import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; @@ -200,9 +202,10 @@ class Integration { } - // Store PM data for 24 hours in influx. The the data contains genenerated + // Store PM data for 24 hours in influx. The data contains genenerated // counter values // that varies over time. + @SuppressWarnings("java:S2699") @Test void testStoreReportsInflux() throws Exception { final int NO_OF_OBJECTS = 24 * 4; @@ -213,10 +216,9 @@ class Integration { .map(str -> new DataFromKafkaTopic(null, null, str.getBytes())); influxStore.start(input); - } - @SuppressWarnings("squid:S2925") // "Thread.sleep" should not be used in tests. + @SuppressWarnings({"squid:S2925", "java:S2699"}) // "Thread.sleep" should not be used in tests. @Test void sendPmReportsThroughKafka() throws Exception { waitForKafkaListener(); @@ -225,8 +227,6 @@ class Integration { var dataToSend = Flux.range(0, NO_OF_OBJECTS).map(i -> kafkaSenderRecord(pmReport(i, NO_OF_OBJECTS), "key")); sendDataToKafka(dataToSend); - - Thread.sleep(1000 * 1000); } @Test @@ -248,12 +248,7 @@ class Integration { ConsumerJobInfo info = new ConsumerJobInfo("type", params, "owner"); String str = gson.toJson(info); System.out.print(str); - } - - @SuppressWarnings("squid:S2925") // "Thread.sleep" should not be used in tests. - @Test - void tet() throws Exception { - Thread.sleep(1000 * 1000); + assertEquals("type", info.infoTypeId); } } diff --git a/influxlogger/src/test/java/org/oran/pmlog/configuration/ApplicationConfigTest.java b/influxlogger/src/test/java/org/oran/pmlog/configuration/ApplicationConfigTest.java new file mode 100644 index 0000000..4213191 --- /dev/null +++ b/influxlogger/src/test/java/org/oran/pmlog/configuration/ApplicationConfigTest.java @@ -0,0 +1,110 @@ +/*- + * ========================LICENSE_START================================= + * O-RAN-SC + * %% + * 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. + * ========================LICENSE_END=================================== + */ + +package org.oran.pmlog.configuration; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.lang.reflect.Field; +import java.util.HashMap; +import java.util.Map; +import org.apache.kafka.clients.CommonClientConfigs; +import org.apache.kafka.common.config.SaslConfigs; +import org.apache.kafka.common.config.SslConfigs; +import org.apache.kafka.common.security.auth.SecurityProtocol; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.MockitoAnnotations; +import org.mockito.junit.jupiter.MockitoExtension; +import org.oran.pmlog.oauth2.OAuthKafkaAuthenticateLoginCallbackHandler; +import org.springframework.test.context.ContextConfiguration; + +@ContextConfiguration(classes = {ApplicationConfig.class}) +@ExtendWith(MockitoExtension.class) +class ApplicationConfigTest { + + @InjectMocks + private ApplicationConfig appConfig; + + @BeforeEach + void setup() { + MockitoAnnotations.initMocks(this); + } + + @Test + void testGetS3LocksBucket_WhenEmptyLocksBucket_ReturnsS3Bucket() { + injectFieldValue(appConfig, "influxBucket", "test-bucket"); + + String result = appConfig.getInfluxBucket(); + assertEquals("test-bucket", result); + } + + @Test + void testAddKafkaSecurityProps_UseOAuthToken() { + Map props = new HashMap<>(); + injectFieldValue(appConfig, "useOathToken", true); + injectFieldValue(appConfig, "kafkaKeyStoreLocation", "key-store-location"); + injectFieldValue(appConfig, "kafkTrustStoreLocation", "trust-store-location"); + injectFieldValue(appConfig, "kafkaKeyStorePassword", "key-store-password"); + + appConfig.addKafkaSecurityProps(props); + + assertEquals(SecurityProtocol.SASL_SSL.name, props.get(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG)); + assertEquals("OAUTHBEARER", props.get(SaslConfigs.SASL_MECHANISM)); + assertEquals(OAuthKafkaAuthenticateLoginCallbackHandler.class.getName(), + props.get(SaslConfigs.SASL_LOGIN_CALLBACK_HANDLER_CLASS)); + assertEquals( + "org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required unsecuredLoginStringClaim_sub=\"alice\"; ", + props.get(SaslConfigs.SASL_JAAS_CONFIG)); + } + + @Test + void testAddKafkaSecurityProps_SslConfig() { + Map props = new HashMap<>(); + injectFieldValue(appConfig, "useOathToken", false); + injectFieldValue(appConfig, "kafkaKeyStoreLocation", "key-store-location"); + injectFieldValue(appConfig, "kafkaKeyStoreType", "JKS"); + injectFieldValue(appConfig, "kafkaKeyStorePassword", "key-store-password"); + injectFieldValue(appConfig, "kafkTrustStoreLocation", "trust-store-location"); + injectFieldValue(appConfig, "kafkaTrustStoreType", "JKS"); + + appConfig.addKafkaSecurityProps(props); + + assertEquals(SecurityProtocol.SASL_SSL.name, props.get(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG)); + assertEquals("JKS", props.get(SslConfigs.SSL_KEYSTORE_TYPE_CONFIG)); + assertEquals("key-store-location", props.get(SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG)); + assertEquals("key-store-password", props.get(SslConfigs.SSL_KEY_PASSWORD_CONFIG)); + assertEquals("JKS", props.get(SslConfigs.SSL_TRUSTSTORE_TYPE_CONFIG)); + assertEquals("trust-store-location", props.get(SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG)); + } + + private void injectFieldValue(Object target, String fieldName, Object value) { + try { + Field field = target.getClass().getDeclaredField(fieldName); + field.setAccessible(true); + field.set(target, value); + } catch (NoSuchFieldException | IllegalAccessException e) { + e.printStackTrace(); + } + } +} + diff --git a/influxlogger/src/test/java/org/oran/pmlog/configuration/ConsumerJobInfoTest.java b/influxlogger/src/test/java/org/oran/pmlog/configuration/ConsumerJobInfoTest.java new file mode 100644 index 0000000..a6bde36 --- /dev/null +++ b/influxlogger/src/test/java/org/oran/pmlog/configuration/ConsumerJobInfoTest.java @@ -0,0 +1,142 @@ +/*- + * ========================LICENSE_START================================= + * O-RAN-SC + * %% + * 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. + * ========================LICENSE_END=================================== + */ + +package org.oran.pmlog.configuration; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import com.google.gson.Gson; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; +import org.junit.jupiter.api.Test; + +class ConsumerJobInfoTest { + + @Test + void testConstructorAndGetters() { + // Create test data + String infoTypeId = "123"; + String owner = "John"; + ConsumerJobInfo.PmFilterData filterData = new ConsumerJobInfo.PmFilterData(); + ConsumerJobInfo.KafkaDeliveryInfo deliveryInfo = new ConsumerJobInfo.KafkaDeliveryInfo("topic", "servers"); + + // Create a ConsumerJobInfo instance + ConsumerJobInfo jobInfo = new ConsumerJobInfo(infoTypeId, new ConsumerJobInfo.PmJobParameters("pmdata", filterData, deliveryInfo), owner); + + // Test constructor and getters + assertEquals(infoTypeId, jobInfo.getInfoTypeId()); + assertEquals(owner, jobInfo.getOwner()); + assertNotNull(jobInfo.getJobDefinition()); + + // Test jobDefinition getters + assertEquals("pmdata", jobInfo.getJobDefinition().getFilterType()); + assertEquals(filterData, jobInfo.getJobDefinition().getFilter()); + assertEquals(deliveryInfo, jobInfo.getJobDefinition().getDeliveryInfo()); + } + + @Test + void testSerializationDeserialization() { + // Create test data + String infoTypeId = "123"; + String owner = "John"; + ConsumerJobInfo.PmFilterData filterData = new ConsumerJobInfo.PmFilterData(); + ConsumerJobInfo.KafkaDeliveryInfo deliveryInfo = new ConsumerJobInfo.KafkaDeliveryInfo("topic", "servers"); + + // Create a ConsumerJobInfo instance + ConsumerJobInfo jobInfo = new ConsumerJobInfo(infoTypeId, new ConsumerJobInfo.PmJobParameters("pmdata", filterData, deliveryInfo), owner); + + + // Serialize to JSON + Gson gson = new Gson(); + String json = gson.toJson(jobInfo); + + // Deserialize from JSON + ConsumerJobInfo deserializedJobInfo = gson.fromJson(json, ConsumerJobInfo.class); + + // Verify deserialized object + assertEquals(jobInfo.getInfoTypeId(), deserializedJobInfo.getInfoTypeId()); + assertEquals(jobInfo.getOwner(), deserializedJobInfo.getOwner()); + assertNotNull(deserializedJobInfo.getJobDefinition()); + } + + @Test + void testMeasTypeSpec() { + ConsumerJobInfo.PmFilterData.MeasTypeSpec measTypeSpec = new ConsumerJobInfo.PmFilterData.MeasTypeSpec(); + measTypeSpec.setMeasuredObjClass("Class1"); + + Set measTypes = new HashSet<>(); + measTypes.add("Type1"); + measTypes.add("Type2"); + measTypeSpec.getMeasTypes().addAll(measTypes); + + assertThat(measTypeSpec.getMeasuredObjClass()).isEqualTo("Class1"); + assertThat(measTypeSpec.getMeasTypes()).containsExactlyInAnyOrder("Type1", "Type2"); + } + + @Test + void testKafkaDeliveryInfo() { + ConsumerJobInfo.KafkaDeliveryInfo kafkaDeliveryInfo = ConsumerJobInfo.KafkaDeliveryInfo.builder() + .topic("TestTopic") + .bootStrapServers("localhost:9092") + .build(); + + assertThat(kafkaDeliveryInfo.getTopic()).isEqualTo("TestTopic"); + assertThat(kafkaDeliveryInfo.getBootStrapServers()).isEqualTo("localhost:9092"); + } + + @Test + void testPmFilterData() { + ConsumerJobInfo.PmFilterData pmFilterData = new ConsumerJobInfo.PmFilterData(); + + // Test sourceNames + Set sourceNames = new HashSet<>(Arrays.asList("Source1", "Source2")); + pmFilterData.sourceNames.addAll(sourceNames); + assertThat(pmFilterData.sourceNames).containsExactlyInAnyOrder("Source1", "Source2"); + + // Test measObjInstIds + Set measObjInstIds = new HashSet<>(Arrays.asList("Id1", "Id2")); + pmFilterData.measObjInstIds.addAll(measObjInstIds); + assertThat(pmFilterData.measObjInstIds).containsExactlyInAnyOrder("Id1", "Id2"); + + // Test measTypeSpecs + ConsumerJobInfo.PmFilterData.MeasTypeSpec measTypeSpec1 = new ConsumerJobInfo.PmFilterData.MeasTypeSpec(); + measTypeSpec1.setMeasuredObjClass("Class1"); + measTypeSpec1.getMeasTypes().addAll(Arrays.asList("Type1", "Type2")); + + ConsumerJobInfo.PmFilterData.MeasTypeSpec measTypeSpec2 = new ConsumerJobInfo.PmFilterData.MeasTypeSpec(); + measTypeSpec2.setMeasuredObjClass("Class2"); + measTypeSpec2.getMeasTypes().addAll(Arrays.asList("Type3", "Type4")); + + pmFilterData.measTypeSpecs.add(measTypeSpec1); + pmFilterData.measTypeSpecs.add(measTypeSpec2); + + assertThat(pmFilterData.measTypeSpecs).hasSize(2); + assertThat(pmFilterData.measTypeSpecs).extracting("measuredObjClass").containsExactly("Class1", "Class2"); + + // Test measuredEntityDns + Set measuredEntityDns = new HashSet<>(Arrays.asList("Entity1", "Entity2")); + pmFilterData.measuredEntityDns.addAll(measuredEntityDns); + assertThat(pmFilterData.measuredEntityDns).containsExactlyInAnyOrder("Entity1", "Entity2"); + } +} + diff --git a/influxlogger/src/test/java/org/oran/pmlog/oauth2/OAuthBearerTokenJwtTest.java b/influxlogger/src/test/java/org/oran/pmlog/oauth2/OAuthBearerTokenJwtTest.java new file mode 100644 index 0000000..fb8957c --- /dev/null +++ b/influxlogger/src/test/java/org/oran/pmlog/oauth2/OAuthBearerTokenJwtTest.java @@ -0,0 +1,91 @@ +package org.oran.pmlog.oauth2; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.fasterxml.jackson.core.JsonProcessingException; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; +import org.oran.pmlog.exceptions.ServiceException; +import org.springframework.test.context.ContextConfiguration; + +@ContextConfiguration(classes = {OAuthBearerTokenJwtTest.class}) +@ExtendWith(MockitoExtension.class) +class OAuthBearerTokenJwtTest { + + private OAuthBearerTokenJwt token; + + @BeforeEach + void setUp() throws ServiceException, JsonProcessingException { + String validJwt = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"; // Replace with a valid JWT token for testing + token = OAuthBearerTokenJwt.create(validJwt); + } + + @Test + void testCreateValidToken() { + assertNotNull(token); + } + + @Test + void testCreateInvalidToken() { + assertThrows(ServiceException.class, () -> OAuthBearerTokenJwt.create("invalid_token")); + } + + @Test + void testTokenValue() { + assertEquals("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", token.value()); + } + + @Test + void testTokenScope() { + assertEquals(0, token.scope().size()); + assertFalse(token.scope().contains("")); + } + + @Test + void testTokenLifetimeMs() { + assertEquals(Long.MAX_VALUE, token.lifetimeMs()); + } + + @Test + void testTokenPrincipalName() { + assertEquals("1234567890", token.principalName()); + } + + @Test + void testTokenStartTimeMs() { + assertEquals(1516239022L, token.startTimeMs()); + } + + @Test + void testCreateTokenFromInvalidPayload() throws ServiceException { + // Create a JWT with an invalid payload (missing fields) + String invalidPayload = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"; + assertThrows(ServiceException.class, () -> OAuthBearerTokenJwt.create(invalidPayload)); + } + + @Test + void testCreateTokenWithValidPayload() throws ServiceException, JsonProcessingException { + // Create a JWT with a valid payload + String validPayload = "eyJzdWIiOiAiVGVzdCIsICJleHAiOiAxNjM1MTUwMDAwLCAiaWF0IjogMTYzNTA5NTAwMCwgInNjb3BlIjogInNjb3BlX3Rva2VuIiwgImp0aSI6ICJmb28ifQ=="; + OAuthBearerTokenJwt jwt = OAuthBearerTokenJwt.create("header." + validPayload + ".signature"); + + assertNotNull(jwt); + assertEquals("header." + validPayload + ".signature", jwt.value()); + assertEquals(1, jwt.scope().size()); + assertEquals("scope_token", jwt.scope().iterator().next()); + assertEquals("Test", jwt.principalName()); + assertEquals(1635095000, jwt.startTimeMs()); + } + + @Test + void testCreateThrowsExceptionWithInvalidToken() throws ServiceException { + String tokenRaw = "your_mocked_token_here"; + assertThrows(ServiceException.class, () -> OAuthBearerTokenJwt.create(tokenRaw)); + } +} + diff --git a/influxlogger/src/test/java/org/oran/pmlog/oauth2/OAuthKafkaAuthenticateLoginCallbackHandlerTest.java b/influxlogger/src/test/java/org/oran/pmlog/oauth2/OAuthKafkaAuthenticateLoginCallbackHandlerTest.java new file mode 100644 index 0000000..ff51ffe --- /dev/null +++ b/influxlogger/src/test/java/org/oran/pmlog/oauth2/OAuthKafkaAuthenticateLoginCallbackHandlerTest.java @@ -0,0 +1,109 @@ +package org.oran.pmlog.oauth2; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import javax.security.auth.callback.Callback; +import javax.security.auth.callback.UnsupportedCallbackException; +import javax.security.auth.login.AppConfigurationEntry; +import org.apache.kafka.common.security.auth.SaslExtensionsCallback; +import org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule; +import org.apache.kafka.common.security.oauthbearer.OAuthBearerTokenCallback; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +class OAuthKafkaAuthenticateLoginCallbackHandlerTest { + + private OAuthKafkaAuthenticateLoginCallbackHandler callbackHandler; + + @BeforeEach + void setUp() { + callbackHandler = new OAuthKafkaAuthenticateLoginCallbackHandler(); + } + + @Test + void testConfigureWithValidSaslMechanismAndConfigEntry() { + String saslMechanism = OAuthBearerLoginModule.OAUTHBEARER_MECHANISM; + List jaasConfigEntries = Collections.singletonList(Mockito.mock(AppConfigurationEntry.class)); + + callbackHandler.configure(new HashMap<>(), saslMechanism, jaasConfigEntries); + + assertTrue(callbackHandler.isConfigured()); + } + + @SuppressWarnings("java:S5778") + @Test + void testConfigureWithInvalidSaslMechanism() { + String invalidSaslMechanism = "InvalidMechanism"; + List jaasConfigEntries = Collections.singletonList(Mockito.mock(AppConfigurationEntry.class)); + + assertThrows(IllegalArgumentException.class, () -> callbackHandler.configure(new HashMap<>(), invalidSaslMechanism, jaasConfigEntries)); + + assertFalse(callbackHandler.isConfigured()); + } + + @SuppressWarnings("java:S5778") + @Test + void testConfigureWithEmptyJaasConfigEntries() { + String saslMechanism = OAuthBearerLoginModule.OAUTHBEARER_MECHANISM; + List emptyJaasConfigEntries = Collections.emptyList(); + + assertThrows(IllegalArgumentException.class, () -> callbackHandler.configure(new HashMap<>(), saslMechanism, emptyJaasConfigEntries)); + + assertFalse(callbackHandler.isConfigured()); + } + + @Test + void testHandleSaslExtensionsCallback() throws IOException, UnsupportedCallbackException { + String saslMechanism = OAuthBearerLoginModule.OAUTHBEARER_MECHANISM; + List jaasConfigEntries = Collections.singletonList(Mockito.mock(AppConfigurationEntry.class)); + + callbackHandler.configure(new HashMap<>(), saslMechanism, jaasConfigEntries); + SaslExtensionsCallback callback = mock(SaslExtensionsCallback.class); + + callbackHandler.handle(new Callback[]{callback}); + verify(callback).extensions(any()); + } + + @Test + void testHandleUnsupportedCallback() { + Callback unsupportedCallback = mock(Callback.class); + String saslMechanism = OAuthBearerLoginModule.OAUTHBEARER_MECHANISM; + List jaasConfigEntries = Collections.singletonList(Mockito.mock(AppConfigurationEntry.class)); + + callbackHandler.configure(new HashMap<>(), saslMechanism, jaasConfigEntries); + assertThrows(UnsupportedCallbackException.class, () -> callbackHandler.handle(new Callback[]{unsupportedCallback})); + } + + @Test + void testHandleOAuthBearerTokenCallback() throws IOException, UnsupportedCallbackException { + + String saslMechanism = OAuthBearerLoginModule.OAUTHBEARER_MECHANISM; + List jaasConfigEntries = Collections.singletonList(Mockito.mock(AppConfigurationEntry.class)); + String validJwt = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"; + + callbackHandler.configure(new HashMap<>(), saslMechanism, jaasConfigEntries); + + OAuthBearerTokenCallback oauthBearerTokenCallback = Mockito.mock(OAuthBearerTokenCallback.class); + SecurityContext securityContextMock = Mockito.mock(SecurityContext.class); + when(oauthBearerTokenCallback.token()).thenReturn(null); // Ensure the callback has no token initially + when(oauthBearerTokenCallback.token()).thenAnswer(invocation -> { + return OAuthBearerTokenJwt.create(validJwt); + }); + + when(securityContextMock.getBearerAuthToken()).thenReturn(validJwt); + callbackHandler.handle(new Callback[]{oauthBearerTokenCallback}); + verify(oauthBearerTokenCallback).token(); + } +} + diff --git a/influxlogger/src/test/java/org/oran/pmlog/oauth2/SecurityContextTest.java b/influxlogger/src/test/java/org/oran/pmlog/oauth2/SecurityContextTest.java new file mode 100644 index 0000000..b173f0d --- /dev/null +++ b/influxlogger/src/test/java/org/oran/pmlog/oauth2/SecurityContextTest.java @@ -0,0 +1,61 @@ +package org.oran.pmlog.oauth2; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.nio.file.Path; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.MockitoAnnotations; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +class SecurityContextTest { + + @BeforeEach + void setUp() { + MockitoAnnotations.initMocks(this); + } + + @Test + void testConstructorWithAuthTokenFilename() { + SecurityContext securityContext = new SecurityContext("auth-token-file.txt"); + assertNotNull(securityContext.getAuthTokenFilePath()); + assertEquals(Path.of("auth-token-file.txt"), securityContext.getAuthTokenFilePath()); + } + + @Test + void testConstructorWithoutAuthTokenFilename() { + SecurityContext securityContext = new SecurityContext(""); + assertNull(securityContext.getAuthTokenFilePath()); + } + + @Test + void testIsConfigured() { + SecurityContext securityContext = new SecurityContext("auth-token-file.txt"); + assertTrue(securityContext.isConfigured()); + } + + @Test + void testIsNotConfigured() { + SecurityContext securityContext = new SecurityContext(""); + assertFalse(securityContext.isConfigured()); + } + + @Test + void testGetBearerAuthToken() { + assertEquals("", SecurityContext.getInstance().getBearerAuthToken()); + assertEquals("", (new SecurityContext("foo.txt")).getBearerAuthToken()); + } + + @Test + void testGetBearerAuthTokenWhenNotConfigured() { + SecurityContext securityContext = new SecurityContext(""); + assertEquals("", securityContext.getBearerAuthToken()); + } +} + -- 2.16.6 From f0eefdccb07052ec048b8f6316b5952e92939f47 Mon Sep 17 00:00:00 2001 From: ambrishest Date: Mon, 18 Sep 2023 09:33:24 +0100 Subject: [PATCH 07/16] Improve Test coverage of pmproducer Issue-ID: NONRTRIC-877 Change-Id: I8e997a973d92a7712339bc63d909d4076b6e48d2 Signed-off-by: ambrishest --- pmproducer/pom.xml | 6 + .../main/java/org/oran/pmproducer/Application.java | 17 -- .../oran/pmproducer/clients/AsyncRestClient.java | 3 +- .../pmproducer/clients/AsyncRestClientFactory.java | 1 + .../oran/pmproducer/controllers/ErrorResponse.java | 7 +- .../org/oran/pmproducer/datastore/FileStore.java | 2 +- .../oran/pmproducer/datastore/S3ObjectStore.java | 6 + .../org/oran/pmproducer/filter/FilterFactory.java | 6 - .../pmproducer/oauth2/OAuthBearerTokenJwt.java | 45 ++- ...OAuthKafkaAuthenticateLoginCallbackHandler.java | 53 ++-- .../oran/pmproducer/oauth2/SecurityContext.java | 3 +- .../oran/pmproducer/r1/ProducerInfoTypeInfo.java | 2 + .../org/oran/pmproducer/r1/ProducerJobInfo.java | 1 + .../pmproducer/r1/ProducerRegistrationInfo.java | 3 + .../java/org/oran/pmproducer/repository/Jobs.java | 4 +- .../oran/pmproducer/tasks/JobDataDistributor.java | 1 + .../pmproducer/tasks/ProducerRegstrationTask.java | 7 +- .../org/oran/pmproducer/tasks/TopicListeners.java | 1 + .../org/oran/pmproducer/IntegrationWithKafka.java | 5 +- .../oran/pmproducer/datastore/DataStoreTest.java | 54 ++++ .../oran/pmproducer/datastore/FileStoreTest.java | 247 ++++++++++++++++ .../pmproducer/datastore/S3ObjectStoreTest.java | 321 +++++++++++++++++++++ .../pmproducer/oauth2/OAuthBearerTokenJwtTest.java | 111 +++++++ ...hKafkaAuthenticateLoginCallbackHandlerTest.java | 129 +++++++++ .../pmproducer/oauth2/SecurityContextTest.java | 81 ++++++ .../org/oran/pmproducer/datastore/file.txt | 1 + 26 files changed, 1028 insertions(+), 89 deletions(-) create mode 100644 pmproducer/src/test/java/org/oran/pmproducer/datastore/DataStoreTest.java create mode 100644 pmproducer/src/test/java/org/oran/pmproducer/datastore/FileStoreTest.java create mode 100644 pmproducer/src/test/java/org/oran/pmproducer/datastore/S3ObjectStoreTest.java create mode 100644 pmproducer/src/test/java/org/oran/pmproducer/oauth2/OAuthBearerTokenJwtTest.java create mode 100644 pmproducer/src/test/java/org/oran/pmproducer/oauth2/OAuthKafkaAuthenticateLoginCallbackHandlerTest.java create mode 100644 pmproducer/src/test/java/org/oran/pmproducer/oauth2/SecurityContextTest.java create mode 100644 pmproducer/src/test/resources/org/oran/pmproducer/datastore/file.txt diff --git a/pmproducer/pom.xml b/pmproducer/pom.xml index 4a4d9fd..5f55f0b 100644 --- a/pmproducer/pom.xml +++ b/pmproducer/pom.xml @@ -61,6 +61,7 @@ 2.0.2 1.6.14 true + @@ -162,6 +163,11 @@ mockito-core test + + org.mockito + mockito-inline + test + io.projectreactor.kafka reactor-kafka diff --git a/pmproducer/src/main/java/org/oran/pmproducer/Application.java b/pmproducer/src/main/java/org/oran/pmproducer/Application.java index 0ffb73f..e39848a 100644 --- a/pmproducer/src/main/java/org/oran/pmproducer/Application.java +++ b/pmproducer/src/main/java/org/oran/pmproducer/Application.java @@ -23,7 +23,6 @@ package org.oran.pmproducer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.boot.ApplicationArguments; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.properties.EnableConfigurationProperties; @@ -51,20 +50,4 @@ public class Application { }); } - private static void restartApplication() { - if (applicationContext == null) { - logger.info("Cannot restart in unittest"); - return; - } - ApplicationArguments args = applicationContext.getBean(ApplicationArguments.class); - - Thread thread = new Thread(() -> { - applicationContext.close(); - applicationContext = SpringApplication.run(Application.class, args.getSourceArgs()); - }); - - thread.setDaemon(false); - thread.start(); - } - } diff --git a/pmproducer/src/main/java/org/oran/pmproducer/clients/AsyncRestClient.java b/pmproducer/src/main/java/org/oran/pmproducer/clients/AsyncRestClient.java index 1fc0620..4031559 100644 --- a/pmproducer/src/main/java/org/oran/pmproducer/clients/AsyncRestClient.java +++ b/pmproducer/src/main/java/org/oran/pmproducer/clients/AsyncRestClient.java @@ -145,8 +145,7 @@ public class AsyncRestClient { } private void onError(Throwable t) { - if (t instanceof WebClientResponseException) { - WebClientResponseException e = (WebClientResponseException) t; + if (t instanceof WebClientResponseException e) { logger.debug("Response error: {}", e.getResponseBodyAsString()); } } diff --git a/pmproducer/src/main/java/org/oran/pmproducer/clients/AsyncRestClientFactory.java b/pmproducer/src/main/java/org/oran/pmproducer/clients/AsyncRestClientFactory.java index 7d50fa0..81d3335 100644 --- a/pmproducer/src/main/java/org/oran/pmproducer/clients/AsyncRestClientFactory.java +++ b/pmproducer/src/main/java/org/oran/pmproducer/clients/AsyncRestClientFactory.java @@ -117,6 +117,7 @@ public class AsyncRestClientFactory { } } + @SuppressWarnings("java:S6204") private SslContext createSslContextRejectingUntrustedPeers(String trustStorePath, String trustStorePass, KeyManagerFactory keyManager) throws NoSuchAlgorithmException, CertificateException, IOException, KeyStoreException { diff --git a/pmproducer/src/main/java/org/oran/pmproducer/controllers/ErrorResponse.java b/pmproducer/src/main/java/org/oran/pmproducer/controllers/ErrorResponse.java index 8411181..7c9bd2e 100644 --- a/pmproducer/src/main/java/org/oran/pmproducer/controllers/ErrorResponse.java +++ b/pmproducer/src/main/java/org/oran/pmproducer/controllers/ErrorResponse.java @@ -108,11 +108,8 @@ public class ErrorResponse { public static ResponseEntity create(Throwable e, HttpStatus code) { if (e instanceof RuntimeException) { code = HttpStatus.INTERNAL_SERVER_ERROR; - } else if (e instanceof ServiceException) { - ServiceException se = (ServiceException) e; - if (se.getHttpStatus() != null) { - code = se.getHttpStatus(); - } + } else if (e instanceof ServiceException se && se.getHttpStatus() != null) { + code = se.getHttpStatus(); } return create(e.toString(), code); } diff --git a/pmproducer/src/main/java/org/oran/pmproducer/datastore/FileStore.java b/pmproducer/src/main/java/org/oran/pmproducer/datastore/FileStore.java index d2d2ef1..d4fef8a 100644 --- a/pmproducer/src/main/java/org/oran/pmproducer/datastore/FileStore.java +++ b/pmproducer/src/main/java/org/oran/pmproducer/datastore/FileStore.java @@ -139,7 +139,7 @@ class FileStore implements DataStore { return Mono.just("OK"); } - private Path path(String name) { + public Path path(String name) { return Path.of(applicationConfig.getPmFilesPath(), name); } diff --git a/pmproducer/src/main/java/org/oran/pmproducer/datastore/S3ObjectStore.java b/pmproducer/src/main/java/org/oran/pmproducer/datastore/S3ObjectStore.java index be30969..fd56d62 100644 --- a/pmproducer/src/main/java/org/oran/pmproducer/datastore/S3ObjectStore.java +++ b/pmproducer/src/main/java/org/oran/pmproducer/datastore/S3ObjectStore.java @@ -67,6 +67,12 @@ class S3ObjectStore implements DataStore { getS3AsynchClient(applicationConfig); } + @SuppressWarnings({"java:S3010", "java:S2209"}) + public S3ObjectStore(ApplicationConfig applicationConfig, S3AsyncClient s3AsynchClient) { + this.applicationConfig = applicationConfig; + this.s3AsynchClient = s3AsynchClient; + } + private static synchronized S3AsyncClient getS3AsynchClient(ApplicationConfig applicationConfig) { if (applicationConfig.isS3Enabled() && s3AsynchClient == null) { s3AsynchClient = getS3AsyncClientBuilder(applicationConfig).build(); diff --git a/pmproducer/src/main/java/org/oran/pmproducer/filter/FilterFactory.java b/pmproducer/src/main/java/org/oran/pmproducer/filter/FilterFactory.java index 85133de..8af1e7a 100644 --- a/pmproducer/src/main/java/org/oran/pmproducer/filter/FilterFactory.java +++ b/pmproducer/src/main/java/org/oran/pmproducer/filter/FilterFactory.java @@ -21,15 +21,9 @@ package org.oran.pmproducer.filter; import com.google.gson.GsonBuilder; - -import java.lang.invoke.MethodHandles; import java.util.Collection; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class FilterFactory { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static com.google.gson.Gson gson = new GsonBuilder().disableHtmlEscaping().create(); private FilterFactory() {} diff --git a/pmproducer/src/main/java/org/oran/pmproducer/oauth2/OAuthBearerTokenJwt.java b/pmproducer/src/main/java/org/oran/pmproducer/oauth2/OAuthBearerTokenJwt.java index 1160657..d00903b 100644 --- a/pmproducer/src/main/java/org/oran/pmproducer/oauth2/OAuthBearerTokenJwt.java +++ b/pmproducer/src/main/java/org/oran/pmproducer/oauth2/OAuthBearerTokenJwt.java @@ -1,38 +1,33 @@ -// ============LICENSE_START=============================================== -// Copyright (C) 2023 Nordix Foundation. 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. -// ============LICENSE_END================================================= -// +/*- + * ========================LICENSE_START================================= + * O-RAN-SC + * %% + * 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. + * ========================LICENSE_END=================================== + */ package org.oran.pmproducer.oauth2; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonMappingException; - import java.util.Base64; import java.util.HashSet; import java.util.Set; - import lombok.ToString; - import org.apache.kafka.common.security.oauthbearer.OAuthBearerToken; import org.oran.pmproducer.exceptions.ServiceException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class OAuthBearerTokenJwt implements OAuthBearerToken { - private static final Logger logger = LoggerFactory.getLogger(OAuthBearerTokenJwt.class); private static final com.google.gson.Gson gson = new com.google.gson.GsonBuilder().disableHtmlEscaping().create(); private final String jwtTokenRaw; @@ -47,7 +42,7 @@ public class OAuthBearerTokenJwt implements OAuthBearerToken { } public static OAuthBearerTokenJwt create(String tokenRaw) - throws ServiceException, JsonMappingException, JsonProcessingException { + throws ServiceException { String[] chunks = tokenRaw.split("\\."); Base64.Decoder decoder = Base64.getUrlDecoder(); if (chunks.length < 2) { diff --git a/pmproducer/src/main/java/org/oran/pmproducer/oauth2/OAuthKafkaAuthenticateLoginCallbackHandler.java b/pmproducer/src/main/java/org/oran/pmproducer/oauth2/OAuthKafkaAuthenticateLoginCallbackHandler.java index b209da3..e2aa85a 100644 --- a/pmproducer/src/main/java/org/oran/pmproducer/oauth2/OAuthKafkaAuthenticateLoginCallbackHandler.java +++ b/pmproducer/src/main/java/org/oran/pmproducer/oauth2/OAuthKafkaAuthenticateLoginCallbackHandler.java @@ -1,19 +1,21 @@ -// ============LICENSE_START=============================================== -// Copyright (C) 2023 Nordix Foundation. 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. -// ============LICENSE_END================================================= -// +/*- + * ========================LICENSE_START================================= + * O-RAN-SC + * 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. + * ========================LICENSE_END=================================== + */ package org.oran.pmproducer.oauth2; @@ -51,7 +53,10 @@ public class OAuthKafkaAuthenticateLoginCallbackHandler implements AuthenticateC } @Override - public void close() {} + public void close() { + /*This method intentionally left empty. + Close functionality will be implemented later.*/ + } @Override public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { @@ -59,11 +64,11 @@ public class OAuthKafkaAuthenticateLoginCallbackHandler implements AuthenticateC if (!this.isConfigured) throw new IllegalStateException("Callback handler not configured"); for (Callback callback : callbacks) { - logger.debug("callback " + callback.toString()); - if (callback instanceof OAuthBearerTokenCallback) { - handleCallback((OAuthBearerTokenCallback) callback); - } else if (callback instanceof SaslExtensionsCallback) { - handleCallback((SaslExtensionsCallback) callback); + logger.debug("callback {}", callback); + if (callback instanceof OAuthBearerTokenCallback oAuthBearerTokenCallback) { + handleCallback(oAuthBearerTokenCallback); + } else if (callback instanceof SaslExtensionsCallback saslExtensionsCallback) { + handleCallback(saslExtensionsCallback); } else { logger.error("Unsupported callback: {}", callback); throw new UnsupportedCallbackException(callback); @@ -90,4 +95,8 @@ public class OAuthKafkaAuthenticateLoginCallbackHandler implements AuthenticateC } } + public boolean isConfigured() { + return isConfigured; + } + } diff --git a/pmproducer/src/main/java/org/oran/pmproducer/oauth2/SecurityContext.java b/pmproducer/src/main/java/org/oran/pmproducer/oauth2/SecurityContext.java index 936d4a9..5633b37 100644 --- a/pmproducer/src/main/java/org/oran/pmproducer/oauth2/SecurityContext.java +++ b/pmproducer/src/main/java/org/oran/pmproducer/oauth2/SecurityContext.java @@ -49,10 +49,11 @@ public class SecurityContext { private static SecurityContext instance; @Setter + @Getter private Path authTokenFilePath; public SecurityContext(@Value("${app.auth-token-file}") String authTokenFilename) { - instance = this; + instance = this; //NOSONAR if (!authTokenFilename.isEmpty()) { this.authTokenFilePath = Path.of(authTokenFilename); } diff --git a/pmproducer/src/main/java/org/oran/pmproducer/r1/ProducerInfoTypeInfo.java b/pmproducer/src/main/java/org/oran/pmproducer/r1/ProducerInfoTypeInfo.java index 500081e..5e8a47a 100644 --- a/pmproducer/src/main/java/org/oran/pmproducer/r1/ProducerInfoTypeInfo.java +++ b/pmproducer/src/main/java/org/oran/pmproducer/r1/ProducerInfoTypeInfo.java @@ -28,11 +28,13 @@ import io.swagger.v3.oas.annotations.media.Schema; @Schema(name = "producer_info_type_info", description = "Information for an Information Type") public class ProducerInfoTypeInfo { + @SuppressWarnings("java:S1874") @Schema(name = "info_job_data_schema", description = "Json schema for the job data", required = true) @SerializedName("info_job_data_schema") @JsonProperty(value = "info_job_data_schema", required = true) public Object jobDataSchema; + @SuppressWarnings("java:S1874") @Schema(name = "info_type_information", description = "Type specific information for the information type", required = true) @SerializedName("info_type_information") diff --git a/pmproducer/src/main/java/org/oran/pmproducer/r1/ProducerJobInfo.java b/pmproducer/src/main/java/org/oran/pmproducer/r1/ProducerJobInfo.java index f421e1b..eb9b956 100644 --- a/pmproducer/src/main/java/org/oran/pmproducer/r1/ProducerJobInfo.java +++ b/pmproducer/src/main/java/org/oran/pmproducer/r1/ProducerJobInfo.java @@ -29,6 +29,7 @@ import io.swagger.v3.oas.annotations.media.Schema; description = "The body of the Information Producer callbacks for Information Job creation and deletion") public class ProducerJobInfo { + @SuppressWarnings("java:S1874") @Schema(name = "info_job_identity", description = "Identity of the Information Job", required = true) @SerializedName("info_job_identity") @JsonProperty("info_job_identity") diff --git a/pmproducer/src/main/java/org/oran/pmproducer/r1/ProducerRegistrationInfo.java b/pmproducer/src/main/java/org/oran/pmproducer/r1/ProducerRegistrationInfo.java index 502abb6..e3fbdcb 100644 --- a/pmproducer/src/main/java/org/oran/pmproducer/r1/ProducerRegistrationInfo.java +++ b/pmproducer/src/main/java/org/oran/pmproducer/r1/ProducerRegistrationInfo.java @@ -33,16 +33,19 @@ import lombok.Builder; @Schema(name = "producer_registration_info", description = "Information for an Information Producer") public class ProducerRegistrationInfo { + @SuppressWarnings("java:S1874") @Schema(name = "supported_info_types", description = "Supported Information Type IDs", required = true) @SerializedName("supported_info_types") @JsonProperty(value = "supported_info_types", required = true) public Collection supportedTypeIds; + @SuppressWarnings("java:S1874") @Schema(name = "info_job_callback_url", description = "callback for Information Job", required = true) @SerializedName("info_job_callback_url") @JsonProperty(value = "info_job_callback_url", required = true) public String jobCallbackUrl; + @SuppressWarnings("java:S1874") @Schema(name = "info_producer_supervision_callback_url", description = "callback for producer supervision", required = true) @SerializedName("info_producer_supervision_callback_url") diff --git a/pmproducer/src/main/java/org/oran/pmproducer/repository/Jobs.java b/pmproducer/src/main/java/org/oran/pmproducer/repository/Jobs.java index 2b48b62..6a5e261 100644 --- a/pmproducer/src/main/java/org/oran/pmproducer/repository/Jobs.java +++ b/pmproducer/src/main/java/org/oran/pmproducer/repository/Jobs.java @@ -119,6 +119,7 @@ public class Jobs { private final List observers = new ArrayList<>(); private final ApplicationConfig appConfig; + @SuppressWarnings("java:S1172") public Jobs(@Autowired ApplicationConfig applicationConfig, @Autowired SecurityContext securityContext, @Autowired ApplicationConfig appConfig) { this.appConfig = appConfig; @@ -137,8 +138,7 @@ public class Jobs { } public void addJob(String id, InfoType type, String owner, String lastUpdated, Parameters parameters) - throws ServiceException { - + { Job job = new Job(id, type, owner, lastUpdated, parameters, this.appConfig); this.put(job); } diff --git a/pmproducer/src/main/java/org/oran/pmproducer/tasks/JobDataDistributor.java b/pmproducer/src/main/java/org/oran/pmproducer/tasks/JobDataDistributor.java index b224945..130cbd3 100644 --- a/pmproducer/src/main/java/org/oran/pmproducer/tasks/JobDataDistributor.java +++ b/pmproducer/src/main/java/org/oran/pmproducer/tasks/JobDataDistributor.java @@ -79,6 +79,7 @@ public class JobDataDistributor { this.consumerFaultCounter = 0; } + @SuppressWarnings("java:S1172") public void handleException(Throwable t) { ++this.consumerFaultCounter; } diff --git a/pmproducer/src/main/java/org/oran/pmproducer/tasks/ProducerRegstrationTask.java b/pmproducer/src/main/java/org/oran/pmproducer/tasks/ProducerRegstrationTask.java index d4b29be..c836c81 100644 --- a/pmproducer/src/main/java/org/oran/pmproducer/tasks/ProducerRegstrationTask.java +++ b/pmproducer/src/main/java/org/oran/pmproducer/tasks/ProducerRegstrationTask.java @@ -157,6 +157,7 @@ public class ProducerRegstrationTask { } } + @SuppressWarnings("java:S1172") private Object jsonSchemaObject(InfoType type) throws IOException, ServiceException { final String schemaFile = "/typeSchemaPmData.json"; return jsonObject(readSchemaFile(schemaFile)); @@ -181,12 +182,6 @@ public class ProducerRegstrationTask { } } - private boolean isEqual(ProducerRegistrationInfo a, ProducerRegistrationInfo b) { - return a.jobCallbackUrl.equals(b.jobCallbackUrl) // - && a.producerSupervisionCallbackUrl.equals(b.producerSupervisionCallbackUrl) // - && a.supportedTypeIds.size() == b.supportedTypeIds.size(); - } - private ProducerRegistrationInfo producerRegistrationInfo() { return ProducerRegistrationInfo.builder() // .jobCallbackUrl(baseUrl() + ProducerCallbacksController.JOB_URL) // diff --git a/pmproducer/src/main/java/org/oran/pmproducer/tasks/TopicListeners.java b/pmproducer/src/main/java/org/oran/pmproducer/tasks/TopicListeners.java index 7b41a6f..581a057 100644 --- a/pmproducer/src/main/java/org/oran/pmproducer/tasks/TopicListeners.java +++ b/pmproducer/src/main/java/org/oran/pmproducer/tasks/TopicListeners.java @@ -43,6 +43,7 @@ import org.springframework.stereotype.Component; public class TopicListeners { private static final Logger logger = LoggerFactory.getLogger(TopicListeners.class); + @SuppressWarnings("java:S1700") @Getter private final Map topicListeners = new HashMap<>(); // Key is typeId diff --git a/pmproducer/src/test/java/org/oran/pmproducer/IntegrationWithKafka.java b/pmproducer/src/test/java/org/oran/pmproducer/IntegrationWithKafka.java index 04b501b..27d3170 100644 --- a/pmproducer/src/test/java/org/oran/pmproducer/IntegrationWithKafka.java +++ b/pmproducer/src/test/java/org/oran/pmproducer/IntegrationWithKafka.java @@ -459,8 +459,9 @@ class IntegrationWithKafka { } String msgString = kafkaReceiver.receivedKafkaOutput.valueAsString(); - assertThat(msgString).contains("pmCounterNumber0"); - assertThat(msgString).doesNotContain("pmCounterNumber1"); + assertThat(msgString) + .contains("pmCounterNumber0") + .doesNotContain("pmCounterNumber1"); assertThat(kafkaReceiver.receivedKafkaOutput.getTypeIdFromHeaders()).isEqualTo(PM_TYPE_ID); assertThat(kafkaReceiver.receivedKafkaOutput.getSourceNameFromHeaders()).isEqualTo("HTTPST2-0"); // This is from // the file diff --git a/pmproducer/src/test/java/org/oran/pmproducer/datastore/DataStoreTest.java b/pmproducer/src/test/java/org/oran/pmproducer/datastore/DataStoreTest.java new file mode 100644 index 0000000..8c787cb --- /dev/null +++ b/pmproducer/src/test/java/org/oran/pmproducer/datastore/DataStoreTest.java @@ -0,0 +1,54 @@ +/*- + * ========================LICENSE_START================================= + * O-RAN-SC + * %% + * 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. + * ========================LICENSE_END=================================== + */ + +package org.oran.pmproducer.datastore; + +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.when; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.oran.pmproducer.configuration.ApplicationConfig; + +@ExtendWith(MockitoExtension.class) +class DataStoreTest { + + @Mock + private ApplicationConfig mockAppConfig; + + @Test + void testCreateWithS3Enabled() { + when(mockAppConfig.isS3Enabled()).thenReturn(true); + when(mockAppConfig.getS3EndpointOverride()).thenReturn("https://dummy-s3-bucket.s3.amazonaws.com"); + when(mockAppConfig.getS3AccessKeyId()).thenReturn("test-access-key-id"); + when(mockAppConfig.getS3SecretAccessKey()).thenReturn("test-access-key-secret"); + DataStore dataStore = DataStore.create(mockAppConfig); + assertTrue(dataStore instanceof S3ObjectStore); + } + + @Test + void testCreateWithS3Disabled() { + when(mockAppConfig.isS3Enabled()).thenReturn(false); + DataStore dataStore = DataStore.create(mockAppConfig); + assertTrue(dataStore instanceof FileStore); + } +} diff --git a/pmproducer/src/test/java/org/oran/pmproducer/datastore/FileStoreTest.java b/pmproducer/src/test/java/org/oran/pmproducer/datastore/FileStoreTest.java new file mode 100644 index 0000000..8196140 --- /dev/null +++ b/pmproducer/src/test/java/org/oran/pmproducer/datastore/FileStoreTest.java @@ -0,0 +1,247 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019-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.oran.pmproducer.datastore; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.anyInt; +import static org.mockito.Mockito.atLeast; +import static org.mockito.Mockito.eq; +import static org.mockito.Mockito.mockStatic; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.io.IOException; +import java.nio.file.FileVisitor; +import java.nio.file.Files; +import java.nio.file.LinkOption; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.MockedStatic; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.mockito.junit.jupiter.MockitoExtension; +import org.oran.pmproducer.configuration.ApplicationConfig; +import org.springframework.test.context.ContextConfiguration; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; + +@ContextConfiguration(classes = {FileStore.class}) +@ExtendWith(MockitoExtension.class) +class FileStoreTest { + + @Mock + private ApplicationConfig appConfig; + + private FileStore fileStore; + + @Mock + private Path mockPath; + + @BeforeEach + void setup() { + MockitoAnnotations.initMocks(this); + fileStore = new FileStore(appConfig); + + when(appConfig.getPmFilesPath()).thenReturn("/path/to/pm/files"); + } + + @Test + void testListObjects() { + when(appConfig.getPmFilesPath()).thenReturn("PM Files Path"); + fileStore.listObjects(DataStore.Bucket.FILES, "Prefix"); + verify(appConfig).getPmFilesPath(); + } + @Test + void testListObjects3() { + when(appConfig.getPmFilesPath()).thenReturn("PM Files Path"); + fileStore.listObjects(DataStore.Bucket.LOCKS, "Prefix"); + verify(appConfig).getPmFilesPath(); + } + + @Test + void testListObjects_WithExistingFiles() { + List fileList = new ArrayList<>(); + fileList.add(Path.of("/path/to/pm/files/file1.txt")); + fileList.add(Path.of("/path/to/pm/files/file2.txt")); + + when(appConfig.getPmFilesPath()).thenReturn("/path/to/pm/files"); + + // Mock Files.walk() to return the prepared stream + try (MockedStatic filesMockedStatic = mockStatic(Files.class)) { + filesMockedStatic.when(() -> Files.walk(any(), anyInt())) + .thenReturn(fileList.stream()); + + StepVerifier.create(fileStore.listObjects(DataStore.Bucket.FILES, "")) + .expectNext("file1.txt") + .expectNext("file2.txt") + .expectComplete(); + } + } + @Test + void testReadObject() { + when(appConfig.getPmFilesPath()).thenReturn("PM Files Path"); + fileStore.readObject(DataStore.Bucket.FILES, "foo.txt"); + verify(appConfig).getPmFilesPath(); + } + @Test + void testReadObject2() { + when(appConfig.getPmFilesPath()).thenReturn("PM Files Path"); + fileStore.readObject(DataStore.Bucket.LOCKS, "foo.txt"); + verify(appConfig).getPmFilesPath(); + } + + @Test + void testReadObject_WithExistingFile() { + byte[] content = "Hello, world!".getBytes(); + Path filePath = Path.of("/path/to/pm/files/test.txt"); + + try (MockedStatic filesMockedStatic = mockStatic(Files.class)) { + filesMockedStatic.when(() -> Files.readAllBytes(eq(filePath))) + .thenReturn(content); + + StepVerifier.create(fileStore.readObject(DataStore.Bucket.FILES, "test.txt")) + .expectNext(content) + .verifyComplete(); + } + } + @Test + void testCreateLock() { + when(appConfig.getPmFilesPath()).thenReturn("PM Files Path"); + fileStore.createLock("Name"); + verify(appConfig, atLeast(1)).getPmFilesPath(); + } + @Test + void testCreateLock3() { + when(appConfig.getPmFilesPath()).thenReturn(""); + fileStore.createLock("/"); + verify(appConfig, atLeast(1)).getPmFilesPath(); + } + @Test + void testDeleteLock() { + when(appConfig.getPmFilesPath()).thenReturn("PM Files Path"); + fileStore.deleteLock("Name"); + verify(appConfig).getPmFilesPath(); + } + @Test + void testDeleteLock2() { + when(appConfig.getPmFilesPath()).thenReturn(""); + fileStore.deleteLock("//"); + verify(appConfig).getPmFilesPath(); + } + @Test + void testDeleteObject() { + when(appConfig.getPmFilesPath()).thenReturn("PM Files Path"); + fileStore.deleteObject(DataStore.Bucket.FILES, "Name"); + verify(appConfig).getPmFilesPath(); + } + @Test + void testDeleteObject2() { + when(appConfig.getPmFilesPath()).thenReturn("PM Files Path"); + fileStore.deleteObject(DataStore.Bucket.LOCKS, "Name"); + verify(appConfig).getPmFilesPath(); + } + + @Test + void testPath() { + when(appConfig.getPmFilesPath()).thenReturn("PM Files Path"); + fileStore.path("Name"); + verify(appConfig).getPmFilesPath(); + } + + @Test + void testDeleteBucket() { + when(appConfig.getPmFilesPath()).thenReturn("PM Files Path"); + fileStore.deleteBucket(DataStore.Bucket.FILES); + verify(appConfig).getPmFilesPath(); + } + @Test + void testDeleteBucket2() throws IOException { + try (MockedStatic mockFiles = mockStatic(Files.class)) { + mockFiles.when(() -> Files.walkFileTree(Mockito.any(), Mockito.>any())) + .thenReturn(Paths.get(System.getProperty("java.io.tmpdir"), "test.txt")); + mockFiles.when(() -> Files.exists(Mockito.any(), (LinkOption[]) any())).thenReturn(true); + when(appConfig.getPmFilesPath()).thenReturn(""); + fileStore.deleteBucket(DataStore.Bucket.LOCKS); + mockFiles.verify(() -> Files.exists(Mockito.any(), (LinkOption[]) any())); + mockFiles.verify(() -> Files.walkFileTree(Mockito.any(), Mockito.>any())); + verify(appConfig).getPmFilesPath(); + } + } + @Test + void testDeleteBucket3() throws IOException { + try (MockedStatic mockFiles = mockStatic(Files.class)) { + mockFiles.when(() -> Files.walkFileTree(Mockito.any(), Mockito.>any())) + .thenThrow(new IOException("OK")); + mockFiles.when(() -> Files.exists(Mockito.any(), (LinkOption[]) any())).thenReturn(true); + when(appConfig.getPmFilesPath()).thenReturn(""); + fileStore.deleteBucket(DataStore.Bucket.LOCKS); + mockFiles.verify(() -> Files.exists(Mockito.any(), (LinkOption[]) any())); + mockFiles.verify(() -> Files.walkFileTree(Mockito.any(), Mockito.>any())); + verify(appConfig, atLeast(1)).getPmFilesPath(); + } + } + + @Test + void testCreateLock_Success() throws IOException { + Path lockPath = Path.of("/path/to/pm/files/locks/lock.txt"); + + when(appConfig.getPmFilesPath()).thenReturn("/path/to/pm/files"); + + try (MockedStatic filesMockedStatic = mockStatic(Files.class)) { + filesMockedStatic.when(() -> Files.createDirectories(lockPath.getParent())) + .thenReturn(lockPath.getParent()); + + try (MockedStatic pathMockedStatic = mockStatic(Path.class)) { + filesMockedStatic.when(() -> Files.createFile(any(Path.class))).thenReturn(lockPath); + + String name = "test.txt"; + String[] pathComponents = {"pmFiles", name}; + + when(fileStore.path(Arrays.toString(pathComponents))).thenReturn(mockPath); + Path path = fileStore.path(Arrays.toString(pathComponents)); + assertEquals(mockPath, path); + } + } + } + + @Test + void testCopyFileTo_Failure() { + // Define dummy values for testing + Path from = Paths.get("non-existent-file.txt"); + String to = "destination-folder"; + + // Use StepVerifier to test the method + Mono resultMono = fileStore.copyFileTo(from, to); + + StepVerifier.create(resultMono) + .expectError(IOException.class) + .verify(); + } +} + diff --git a/pmproducer/src/test/java/org/oran/pmproducer/datastore/S3ObjectStoreTest.java b/pmproducer/src/test/java/org/oran/pmproducer/datastore/S3ObjectStoreTest.java new file mode 100644 index 0000000..2e5f7d8 --- /dev/null +++ b/pmproducer/src/test/java/org/oran/pmproducer/datastore/S3ObjectStoreTest.java @@ -0,0 +1,321 @@ +/*- + * ========================LICENSE_START================================= + * O-RAN-SC + * %% + * 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. + * ========================LICENSE_END=================================== + */ + +package org.oran.pmproducer.datastore; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.atLeast; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.net.URISyntaxException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.jupiter.MockitoExtension; +import org.oran.pmproducer.configuration.ApplicationConfig; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; +import software.amazon.awssdk.core.ResponseBytes; +import software.amazon.awssdk.core.async.AsyncRequestBody; +import software.amazon.awssdk.core.async.AsyncResponseTransformer; +import software.amazon.awssdk.services.s3.S3AsyncClient; +import software.amazon.awssdk.services.s3.model.CreateBucketRequest; +import software.amazon.awssdk.services.s3.model.CreateBucketResponse; +import software.amazon.awssdk.services.s3.model.DeleteBucketRequest; +import software.amazon.awssdk.services.s3.model.DeleteBucketResponse; +import software.amazon.awssdk.services.s3.model.DeleteObjectRequest; +import software.amazon.awssdk.services.s3.model.DeleteObjectResponse; +import software.amazon.awssdk.services.s3.model.DeleteObjectsRequest; +import software.amazon.awssdk.services.s3.model.DeleteObjectsResponse; +import software.amazon.awssdk.services.s3.model.GetObjectRequest; +import software.amazon.awssdk.services.s3.model.GetObjectResponse; +import software.amazon.awssdk.services.s3.model.HeadObjectRequest; +import software.amazon.awssdk.services.s3.model.HeadObjectResponse; +import software.amazon.awssdk.services.s3.model.ListObjectsRequest; +import software.amazon.awssdk.services.s3.model.ListObjectsResponse; +import software.amazon.awssdk.services.s3.model.PutObjectRequest; +import software.amazon.awssdk.services.s3.model.PutObjectResponse; +import software.amazon.awssdk.services.s3.model.S3Object; + + +@ExtendWith(MockitoExtension.class) +class S3ObjectStoreTest { + + @Mock + private ApplicationConfig appConfig; + + @Mock + private S3AsyncClient s3AsynchClient; + + private S3ObjectStore s3ObjectStore; + + @BeforeEach + void setup() { + Mockito.lenient().when(appConfig.getS3EndpointOverride()).thenReturn("https://dummy-s3-bucket.s3.amazonaws.com"); + Mockito.lenient().when(appConfig.getS3AccessKeyId()).thenReturn("test-access-key-id"); + Mockito.lenient().when(appConfig.getS3SecretAccessKey()).thenReturn("test-access-key-secret"); + + Mockito.lenient().when(appConfig.getS3Bucket()).thenReturn("test-bucket"); + Mockito.lenient().when(appConfig.getS3LocksBucket()).thenReturn("test-lock-bucket"); + Mockito.lenient().when(appConfig.isS3Enabled()).thenReturn(true); + + s3ObjectStore = new S3ObjectStore(appConfig, s3AsynchClient); + } + + @Test + void createS3Bucket() { + CreateBucketRequest request = CreateBucketRequest.builder() + .bucket("test-bucket") + .build(); + + when(s3AsynchClient.createBucket(any(CreateBucketRequest.class))) + .thenReturn(CompletableFuture.completedFuture(CreateBucketResponse.builder().build())); + + Mono result = s3ObjectStore.create(DataStore.Bucket.FILES); + + verify(s3AsynchClient, atLeast(1)).createBucket(any(CreateBucketRequest.class)); + + StepVerifier.create(result).expectNext("test-bucket").verifyComplete(); + + assertThat(result.block()).isEqualTo("test-bucket"); + } + + @Test + void listObjects() { + String prefix = "prefix/"; + + ListObjectsResponse response1 = ListObjectsResponse.builder() + .contents(createS3Object("object1")) + .isTruncated(true) + .nextMarker("marker1") + .build(); + + ListObjectsResponse response2 = ListObjectsResponse.builder() + .contents(createS3Object("object2")) + .isTruncated(false) + .build(); + + when(s3AsynchClient.listObjects(any(ListObjectsRequest.class))) + .thenReturn(CompletableFuture.completedFuture(response1), + CompletableFuture.completedFuture(response2)); + + Flux result = s3ObjectStore.listObjects(DataStore.Bucket.FILES, prefix); + + verify(s3AsynchClient, atLeast(1)).listObjects(any(ListObjectsRequest.class)); + + StepVerifier.create(result) + .expectNext("object1") + .expectNext("object2") + .verifyComplete(); + + // Collect the results into a list + List resultList = result.collectList().block(); + + assertEquals(Arrays.asList("object1", "object2"), resultList); + } + + @Test + void testCreateLockWithExistingHead() { + HeadObjectResponse headObjectResponse = HeadObjectResponse.builder().build(); + + when(s3AsynchClient.headObject(any(HeadObjectRequest.class))) + .thenReturn(CompletableFuture.completedFuture(headObjectResponse)); + + Mono result = s3ObjectStore.createLock("lockName"); + + StepVerifier.create(result) + .expectNext(false) + .verifyComplete(); + + assertThat(result.block()).isFalse(); + } + + @Test + void testCreateLockWithoutExistingHead() { + HeadObjectResponse headObjectResponse = null; + Mockito.doReturn(CompletableFuture.completedFuture(headObjectResponse)) + .when(s3AsynchClient) + .headObject(any(HeadObjectRequest.class)); + + Mono result = s3ObjectStore.createLock("lockName"); + + StepVerifier.create(result) + .expectComplete() + .verify(); + + Boolean resultVal = result.block(); + + assertThat(resultVal).isNull(); + } + + + @Test + void deleteLock() { + when(s3AsynchClient.deleteObject(any(DeleteObjectRequest.class))) + .thenReturn(CompletableFuture.completedFuture(DeleteObjectResponse.builder().build())); + + Mono result = s3ObjectStore.deleteLock("lock-name"); + + StepVerifier.create(result) + .expectNext(true) + .verifyComplete(); + + assertThat(result.block()).isTrue(); + } + + @Test + void testDeleteObject() { + when(s3AsynchClient.deleteObject(any(DeleteObjectRequest.class))) + .thenReturn(CompletableFuture.completedFuture(DeleteObjectResponse.builder().build())); + + Mono result = s3ObjectStore.deleteObject(DataStore.Bucket.LOCKS, "objectName"); + + StepVerifier.create(result) + .expectNext(true) + .verifyComplete(); + + assertThat(result.block()).isTrue(); + } + + @Test + void testDeleteBucket_Success() { + DeleteBucketRequest request = DeleteBucketRequest.builder() // + .bucket("test-bucket") + .build(); + + Mockito.lenient().when(s3AsynchClient.deleteBucket(any(DeleteBucketRequest.class))) + .thenReturn(CompletableFuture.completedFuture(DeleteBucketResponse.builder().build())); + + DeleteObjectsRequest objectRequest = DeleteObjectsRequest.builder() // + .bucket("test-bucket") + .build(); + + Mockito.lenient().when(s3AsynchClient.deleteObjects(any(DeleteObjectsRequest.class))) + .thenReturn(CompletableFuture.completedFuture(DeleteObjectsResponse.builder().build())); + + String prefix = "prefix/"; + + ListObjectsResponse response1 = ListObjectsResponse.builder() + .contents(createS3Object("object1")) + .isTruncated(true) + .nextMarker("marker1") + .build(); + + ListObjectsResponse response2 = ListObjectsResponse.builder() + .contents(createS3Object("object2")) + .isTruncated(false) + .build(); + + when(s3AsynchClient.listObjects(any(ListObjectsRequest.class))) + .thenReturn(CompletableFuture.completedFuture(response1), + CompletableFuture.completedFuture(response2)); + + Mono result = s3ObjectStore.deleteBucket(DataStore.Bucket.FILES); + + StepVerifier.create(result) + .expectNext("NOK") + .verifyComplete(); + } + + @Test + void testCopyFileTo_Success() throws URISyntaxException { + PutObjectRequest request = PutObjectRequest.builder() // + .bucket("test-bucket") // + .key("test-access-key-id") // + .build(); + + when(s3AsynchClient.putObject(any(PutObjectRequest.class), any(AsyncRequestBody.class))) + .thenAnswer(invocation -> { + CompletableFuture future = CompletableFuture.completedFuture( + PutObjectResponse.builder().build() + ); + return future; + }); + + Path testFile = Paths.get(getClass().getResource("/org/oran/pmproducer/datastore/file.txt").toURI()); + + Mono result = s3ObjectStore.copyFileTo(testFile, "test-key"); + + StepVerifier.create(result) + .expectNext("test-key") + .verifyComplete(); + } + + @Test + void testReadObject() { + // Mock the getObject method to return a CompletableFuture with ResponseBytes + when(s3AsynchClient.getObject(any(GetObjectRequest.class), any(AsyncResponseTransformer.class))) + .thenAnswer(invocation -> { + ResponseBytes responseBytes = ResponseBytes.fromByteArray( + GetObjectResponse.builder().build(), + "Hello, World!".getBytes(StandardCharsets.UTF_8) + ); + CompletableFuture> future = CompletableFuture.completedFuture( + responseBytes + ); + return future; + }); + + // Call the method under test + Mono result = s3ObjectStore.readObject(DataStore.Bucket.FILES, "test-key"); + + byte[] expectedBytes = "Hello, World!".getBytes(StandardCharsets.UTF_8); + StepVerifier.create(result) + .consumeNextWith(actualBytes -> Assertions.assertArrayEquals(expectedBytes, actualBytes)) + .verifyComplete(); + } + + @Test + void testPutObject() { + // Mock the putObject method to return a CompletableFuture with PutObjectResponse + when(s3AsynchClient.putObject(any(PutObjectRequest.class), any(AsyncRequestBody.class))) + .thenAnswer(invocation -> { + CompletableFuture future = CompletableFuture.completedFuture( + PutObjectResponse.builder().build() + ); + return future; + }); + + // Call the method under test + Mono result = s3ObjectStore.putObject(DataStore.Bucket.FILES, "test-key", "Hello, World!"); + + // Verify the Mono's behavior using StepVerifier + StepVerifier.create(result) + .expectNext("test-key") + .verifyComplete(); + } + + private S3Object createS3Object(String key) { + return S3Object.builder().key(key).build(); + } +} diff --git a/pmproducer/src/test/java/org/oran/pmproducer/oauth2/OAuthBearerTokenJwtTest.java b/pmproducer/src/test/java/org/oran/pmproducer/oauth2/OAuthBearerTokenJwtTest.java new file mode 100644 index 0000000..6706824 --- /dev/null +++ b/pmproducer/src/test/java/org/oran/pmproducer/oauth2/OAuthBearerTokenJwtTest.java @@ -0,0 +1,111 @@ +/*- + * ========================LICENSE_START================================= + * O-RAN-SC + * %% + * 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. + * ========================LICENSE_END=================================== + */ + +package org.oran.pmproducer.oauth2; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.fasterxml.jackson.core.JsonProcessingException; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; +import org.oran.pmproducer.exceptions.ServiceException; +import org.springframework.test.context.ContextConfiguration; + +@ContextConfiguration(classes = {OAuthBearerTokenJwtTest.class}) +@ExtendWith(MockitoExtension.class) +class OAuthBearerTokenJwtTest { + + private OAuthBearerTokenJwt token; + + @BeforeEach + void setUp() throws ServiceException, JsonProcessingException { + String validJwt = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"; // Replace with a valid JWT token for testing + token = OAuthBearerTokenJwt.create(validJwt); + } + + @Test + void testCreateValidToken() { + assertNotNull(token); + } + + @Test + void testCreateInvalidToken() { + assertThrows(ServiceException.class, () -> OAuthBearerTokenJwt.create("invalid_token")); + } + + @Test + void testTokenValue() { + assertEquals("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", token.value()); + } + + @Test + void testTokenScope() { + assertEquals(0, token.scope().size()); + assertFalse(token.scope().contains("")); + } + + @Test + void testTokenLifetimeMs() { + assertEquals(Long.MAX_VALUE, token.lifetimeMs()); + } + + @Test + void testTokenPrincipalName() { + assertEquals("1234567890", token.principalName()); + } + + @Test + void testTokenStartTimeMs() { + assertEquals(1516239022L, token.startTimeMs()); + } + + @Test + void testCreateTokenFromInvalidPayload() throws ServiceException { + // Create a JWT with an invalid payload (missing fields) + String invalidPayload = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"; + assertThrows(ServiceException.class, () -> OAuthBearerTokenJwt.create(invalidPayload)); + } + + @Test + void testCreateTokenWithValidPayload() throws ServiceException, JsonProcessingException { + // Create a JWT with a valid payload + String validPayload = "eyJzdWIiOiAiVGVzdCIsICJleHAiOiAxNjM1MTUwMDAwLCAiaWF0IjogMTYzNTA5NTAwMCwgInNjb3BlIjogInNjb3BlX3Rva2VuIiwgImp0aSI6ICJmb28ifQ=="; + OAuthBearerTokenJwt jwt = OAuthBearerTokenJwt.create("header." + validPayload + ".signature"); + + assertNotNull(jwt); + assertEquals("header." + validPayload + ".signature", jwt.value()); + assertEquals(1, jwt.scope().size()); + assertEquals("scope_token", jwt.scope().iterator().next()); + assertEquals("Test", jwt.principalName()); + assertEquals(1635095000, jwt.startTimeMs()); + } + + @Test + void testCreateThrowsExceptionWithInvalidToken() throws ServiceException { + String tokenRaw = "your_mocked_token_here"; + assertThrows(ServiceException.class, () -> OAuthBearerTokenJwt.create(tokenRaw)); + } +} + diff --git a/pmproducer/src/test/java/org/oran/pmproducer/oauth2/OAuthKafkaAuthenticateLoginCallbackHandlerTest.java b/pmproducer/src/test/java/org/oran/pmproducer/oauth2/OAuthKafkaAuthenticateLoginCallbackHandlerTest.java new file mode 100644 index 0000000..260724a --- /dev/null +++ b/pmproducer/src/test/java/org/oran/pmproducer/oauth2/OAuthKafkaAuthenticateLoginCallbackHandlerTest.java @@ -0,0 +1,129 @@ +/*- + * ========================LICENSE_START================================= + * O-RAN-SC + * %% + * 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. + * ========================LICENSE_END=================================== + */ + +package org.oran.pmproducer.oauth2; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import javax.security.auth.callback.Callback; +import javax.security.auth.callback.UnsupportedCallbackException; +import javax.security.auth.login.AppConfigurationEntry; +import org.apache.kafka.common.security.auth.SaslExtensionsCallback; +import org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule; +import org.apache.kafka.common.security.oauthbearer.OAuthBearerTokenCallback; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +class OAuthKafkaAuthenticateLoginCallbackHandlerTest { + + private OAuthKafkaAuthenticateLoginCallbackHandler callbackHandler; + + @BeforeEach + void setUp() { + callbackHandler = new OAuthKafkaAuthenticateLoginCallbackHandler(); + } + + @Test + void testConfigureWithValidSaslMechanismAndConfigEntry() { + String saslMechanism = OAuthBearerLoginModule.OAUTHBEARER_MECHANISM; + List jaasConfigEntries = Collections.singletonList(Mockito.mock(AppConfigurationEntry.class)); + + callbackHandler.configure(new HashMap<>(), saslMechanism, jaasConfigEntries); + + assertTrue(callbackHandler.isConfigured()); + } + + @SuppressWarnings("java:S5778") + @Test + void testConfigureWithInvalidSaslMechanism() { + String invalidSaslMechanism = "InvalidMechanism"; + List jaasConfigEntries = Collections.singletonList(Mockito.mock(AppConfigurationEntry.class)); + + assertThrows(IllegalArgumentException.class, () -> callbackHandler.configure(new HashMap<>(), invalidSaslMechanism, jaasConfigEntries)); + + assertFalse(callbackHandler.isConfigured()); + } + + @SuppressWarnings("java:S5778") + @Test + void testConfigureWithEmptyJaasConfigEntries() { + String saslMechanism = OAuthBearerLoginModule.OAUTHBEARER_MECHANISM; + List emptyJaasConfigEntries = Collections.emptyList(); + + assertThrows(IllegalArgumentException.class, () -> callbackHandler.configure(new HashMap<>(), saslMechanism, emptyJaasConfigEntries)); + + assertFalse(callbackHandler.isConfigured()); + } + + @Test + void testHandleSaslExtensionsCallback() throws IOException, UnsupportedCallbackException { + String saslMechanism = OAuthBearerLoginModule.OAUTHBEARER_MECHANISM; + List jaasConfigEntries = Collections.singletonList(Mockito.mock(AppConfigurationEntry.class)); + + callbackHandler.configure(new HashMap<>(), saslMechanism, jaasConfigEntries); + SaslExtensionsCallback callback = mock(SaslExtensionsCallback.class); + + callbackHandler.handle(new Callback[]{callback}); + verify(callback).extensions(any()); + } + + @Test + void testHandleUnsupportedCallback() { + Callback unsupportedCallback = mock(Callback.class); + String saslMechanism = OAuthBearerLoginModule.OAUTHBEARER_MECHANISM; + List jaasConfigEntries = Collections.singletonList(Mockito.mock(AppConfigurationEntry.class)); + + callbackHandler.configure(new HashMap<>(), saslMechanism, jaasConfigEntries); + assertThrows(UnsupportedCallbackException.class, () -> callbackHandler.handle(new Callback[]{unsupportedCallback})); + } + + @Test + void testHandleOAuthBearerTokenCallback() throws IOException, UnsupportedCallbackException { + + String saslMechanism = OAuthBearerLoginModule.OAUTHBEARER_MECHANISM; + List jaasConfigEntries = Collections.singletonList(Mockito.mock(AppConfigurationEntry.class)); + String validJwt = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"; + + callbackHandler.configure(new HashMap<>(), saslMechanism, jaasConfigEntries); + + OAuthBearerTokenCallback oauthBearerTokenCallback = Mockito.mock(OAuthBearerTokenCallback.class); + SecurityContext securityContextMock = Mockito.mock(SecurityContext.class); + when(oauthBearerTokenCallback.token()).thenReturn(null); // Ensure the callback has no token initially + when(oauthBearerTokenCallback.token()).thenAnswer(invocation -> { + return OAuthBearerTokenJwt.create(validJwt); + }); + + when(securityContextMock.getBearerAuthToken()).thenReturn(validJwt); + callbackHandler.handle(new Callback[]{oauthBearerTokenCallback}); + verify(oauthBearerTokenCallback).token(); + } +} + diff --git a/pmproducer/src/test/java/org/oran/pmproducer/oauth2/SecurityContextTest.java b/pmproducer/src/test/java/org/oran/pmproducer/oauth2/SecurityContextTest.java new file mode 100644 index 0000000..43d83a7 --- /dev/null +++ b/pmproducer/src/test/java/org/oran/pmproducer/oauth2/SecurityContextTest.java @@ -0,0 +1,81 @@ +/*- + * ========================LICENSE_START================================= + * O-RAN-SC + * %% + * 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. + * ========================LICENSE_END=================================== + */ + +package org.oran.pmproducer.oauth2; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.nio.file.Path; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.MockitoAnnotations; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +class SecurityContextTest { + + @BeforeEach + void setUp() { + MockitoAnnotations.initMocks(this); + } + + @Test + void testConstructorWithAuthTokenFilename() { + SecurityContext securityContext = new SecurityContext("auth-token-file.txt"); + assertNotNull(securityContext.getAuthTokenFilePath()); + assertEquals(Path.of("auth-token-file.txt"), securityContext.getAuthTokenFilePath()); + } + + @Test + void testConstructorWithoutAuthTokenFilename() { + SecurityContext securityContext = new SecurityContext(""); + assertNull(securityContext.getAuthTokenFilePath()); + } + + @Test + void testIsConfigured() { + SecurityContext securityContext = new SecurityContext("auth-token-file.txt"); + assertTrue(securityContext.isConfigured()); + } + + @Test + void testIsNotConfigured() { + SecurityContext securityContext = new SecurityContext(""); + assertFalse(securityContext.isConfigured()); + } + + @Test + void testGetBearerAuthToken() { + assertEquals("", SecurityContext.getInstance().getBearerAuthToken()); + assertEquals("", (new SecurityContext("foo.txt")).getBearerAuthToken()); + } + + @Test + void testGetBearerAuthTokenWhenNotConfigured() { + SecurityContext securityContext = new SecurityContext(""); + assertEquals("", securityContext.getBearerAuthToken()); + } +} + diff --git a/pmproducer/src/test/resources/org/oran/pmproducer/datastore/file.txt b/pmproducer/src/test/resources/org/oran/pmproducer/datastore/file.txt new file mode 100644 index 0000000..c95df2d --- /dev/null +++ b/pmproducer/src/test/resources/org/oran/pmproducer/datastore/file.txt @@ -0,0 +1 @@ +Hi, How are you? \ No newline at end of file -- 2.16.6 From 6d7bdce836167a569d65a47a93372ef4b75eae4e Mon Sep 17 00:00:00 2001 From: ambrishest Date: Thu, 28 Sep 2023 15:38:39 +0100 Subject: [PATCH 08/16] Delete unnecessary sonar properties file Issue-ID: NONRTRIC-914 Change-Id: I77856c520f21d9e471f52a3cb642db91068b418f Signed-off-by: ambrishest --- sonar-project.properties | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 sonar-project.properties diff --git a/sonar-project.properties b/sonar-project.properties deleted file mode 100644 index 63b49bb..0000000 --- a/sonar-project.properties +++ /dev/null @@ -1,6 +0,0 @@ -sonar.build.sourceEncoding=UTF-8 -sonar.exclusions=**/*_test.go,**/gentools/**/*,**/mocks/**/*,**/*.gen.go,**/*.html,docs/conf.py -sonar.sources=collector -sonar.tests=pm-file-converter -sonar.test.inclusions=**/*_test.go -sonar.typescript.lcov.reportPaths=pm-file-converter/coverage.txt -- 2.16.6 From 18a22955ab912a29de5c2e62322222a8324cfeaa Mon Sep 17 00:00:00 2001 From: ambrishest Date: Thu, 28 Sep 2023 15:43:32 +0100 Subject: [PATCH 09/16] Upgrade Jacoco maven plugin version to 0.8.10 Issue-ID: NONRTRIC-914 Change-Id: I47247f0084a30ba484884cabaf3099929433054c Signed-off-by: ambrishest --- datafilecollector/pom.xml | 2 +- influxlogger/pom.xml | 2 +- pmproducer/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/datafilecollector/pom.xml b/datafilecollector/pom.xml index 37b39d7..165dd39 100644 --- a/datafilecollector/pom.xml +++ b/datafilecollector/pom.xml @@ -36,7 +36,7 @@ yyyyMMdd'T'HHmmss 2.9.1 0.30.0 - 0.8.8 + 0.8.10 2.0.2 1.6.14 true diff --git a/influxlogger/pom.xml b/influxlogger/pom.xml index 04c1b63..22fcb08 100644 --- a/influxlogger/pom.xml +++ b/influxlogger/pom.xml @@ -56,7 +56,7 @@ 1.24.3 0.30.0 3.7.0.1746 - 0.8.8 + 0.8.10 3.0.11 2.0.2 1.6.14 diff --git a/pmproducer/pom.xml b/pmproducer/pom.xml index 5f55f0b..4f574c6 100644 --- a/pmproducer/pom.xml +++ b/pmproducer/pom.xml @@ -57,7 +57,7 @@ 3.0.11 0.30.0 3.7.0.1746 - 0.8.8 + 0.8.10 2.0.2 1.6.14 true -- 2.16.6 From 54872c9d73ec5dc31dd0ba915cd1e0beb13a3096 Mon Sep 17 00:00:00 2001 From: DenisGNoonan Date: Tue, 5 Sep 2023 11:55:40 +0100 Subject: [PATCH 10/16] NONRTRIC-924: RANPM - Add control-panel to Kubernetes deployment Change-Id: I9351d2cf95b2d10d9eb00a02f2bd8c84c7ac4cf1 Signed-off-by: DenisGNoonan --- docker-proj/docker-compose-k1.yaml | 1 + install/README.md | 5 ++ install/helm/controlpanel/.helmignore | 22 ++++++++ install/helm/controlpanel/Chart.yaml | 21 ++++++++ install/helm/controlpanel/resources-ing/nginx.conf | 28 ++++++++++ install/helm/controlpanel/resources-ngw/nginx.conf | 28 ++++++++++ install/helm/controlpanel/templates/configmap.yaml | 29 ++++++++++ .../helm/controlpanel/templates/deployment.yaml | 61 ++++++++++++++++++++++ install/helm/controlpanel/templates/service.yaml | 40 ++++++++++++++ install/helm/controlpanel/values.yaml | 45 ++++++++++++++++ install/helm/nonrtricgateway/.helmignore | 22 ++++++++ install/helm/nonrtricgateway/Chart.yaml | 21 ++++++++ .../resources/config/application.yaml | 50 ++++++++++++++++++ .../helm/nonrtricgateway/templates/configmap.yaml | 26 +++++++++ .../helm/nonrtricgateway/templates/deployment.yaml | 57 ++++++++++++++++++++ .../helm/nonrtricgateway/templates/service.yaml | 33 ++++++++++++ install/helm/nonrtricgateway/values.yaml | 37 +++++++++++++ install/install-nrt.sh | 16 +++++- install/install-pm-influx-job.sh | 2 +- install/uninstall-nrt.sh | 9 ++++ install/uninstall-ranpm.sh | 4 +- 21 files changed, 553 insertions(+), 4 deletions(-) create mode 100644 install/helm/controlpanel/.helmignore create mode 100644 install/helm/controlpanel/Chart.yaml create mode 100644 install/helm/controlpanel/resources-ing/nginx.conf create mode 100644 install/helm/controlpanel/resources-ngw/nginx.conf create mode 100644 install/helm/controlpanel/templates/configmap.yaml create mode 100644 install/helm/controlpanel/templates/deployment.yaml create mode 100644 install/helm/controlpanel/templates/service.yaml create mode 100644 install/helm/controlpanel/values.yaml create mode 100644 install/helm/nonrtricgateway/.helmignore create mode 100644 install/helm/nonrtricgateway/Chart.yaml create mode 100644 install/helm/nonrtricgateway/resources/config/application.yaml create mode 100644 install/helm/nonrtricgateway/templates/configmap.yaml create mode 100644 install/helm/nonrtricgateway/templates/deployment.yaml create mode 100644 install/helm/nonrtricgateway/templates/service.yaml create mode 100644 install/helm/nonrtricgateway/values.yaml diff --git a/docker-proj/docker-compose-k1.yaml b/docker-proj/docker-compose-k1.yaml index d943a53..c6e1fd8 100644 --- a/docker-proj/docker-compose-k1.yaml +++ b/docker-proj/docker-compose-k1.yaml @@ -39,6 +39,7 @@ services: kafka-1: image: ${STRIMZI_IMAGE} + container_name: common-kafka-1-1 command: [ "sh", "-c", "bin/kafka-server-start.sh /tmp/kafka/strimzi.properties" diff --git a/install/README.md b/install/README.md index 90ce2c6..2b707c1 100644 --- a/install/README.md +++ b/install/README.md @@ -109,3 +109,8 @@ Browser for influx db. - nodeport: 31812 - user: admin - password: mySuP3rS3cr3tT0keN + +### Controlpanel +Browser for control-panel \ +browser: `:30091/ei-coordinator` +- nodeport: 30091 diff --git a/install/helm/controlpanel/.helmignore b/install/helm/controlpanel/.helmignore new file mode 100644 index 0000000..50af031 --- /dev/null +++ b/install/helm/controlpanel/.helmignore @@ -0,0 +1,22 @@ +# 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 +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/install/helm/controlpanel/Chart.yaml b/install/helm/controlpanel/Chart.yaml new file mode 100644 index 0000000..180898f --- /dev/null +++ b/install/helm/controlpanel/Chart.yaml @@ -0,0 +1,21 @@ +################################################################################ +# 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. # +################################################################################ + +apiVersion: v1 +appVersion: "2.0.0" +description: A Helm chart for nonrtric controlpanel +name: controlpanel +version: 2.0.0 diff --git a/install/helm/controlpanel/resources-ing/nginx.conf b/install/helm/controlpanel/resources-ing/nginx.conf new file mode 100644 index 0000000..d72eea7 --- /dev/null +++ b/install/helm/controlpanel/resources-ing/nginx.conf @@ -0,0 +1,28 @@ +events{} + +http { + include /etc/nginx/mime.types; + + upstream backend { + server kong-proxy.kong:80; + } + + server { + listen 8080; + server_name localhost; + root /usr/share/nginx/html; + index index.html; + location /a1-policy/ { + proxy_pass http://backend; + } + location /data-producer/ { + proxy_pass http://backend; + } + location /data-consumer/ { + proxy_pass http://backend; + } + location / { + try_files $uri $uri/ /index.html; + } + } +} \ No newline at end of file diff --git a/install/helm/controlpanel/resources-ngw/nginx.conf b/install/helm/controlpanel/resources-ngw/nginx.conf new file mode 100644 index 0000000..a0ac584 --- /dev/null +++ b/install/helm/controlpanel/resources-ngw/nginx.conf @@ -0,0 +1,28 @@ +events{} + +http { + include /etc/nginx/mime.types; + + upstream backend { + server nonrtricgateway:9090; + } + + server { + listen 8080; + server_name localhost; + root /usr/share/nginx/html; + index index.html; + location /a1-policy/ { + proxy_pass http://backend; + } + location /data-producer/ { + proxy_pass http://backend; + } + location /data-consumer/ { + proxy_pass http://backend; + } + location / { + try_files $uri $uri/ /index.html; + } + } +} diff --git a/install/helm/controlpanel/templates/configmap.yaml b/install/helm/controlpanel/templates/configmap.yaml new file mode 100644 index 0000000..3a17366 --- /dev/null +++ b/install/helm/controlpanel/templates/configmap.yaml @@ -0,0 +1,29 @@ +################################################################################ +# 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. # +################################################################################ + +apiVersion: v1 +kind: ConfigMap +metadata: + name: controlpanel-configmap + namespace: nonrtric + labels: + app: nonrtric-controlpanel +data: +{{if eq .Values.controlpanel.ingress.enabled false }} +{{ tpl (.Files.Glob "resources-ngw/*").AsConfig . | indent 2 }} +{{ else }} +{{ tpl (.Files.Glob "resources-ing/*").AsConfig . | indent 2 }} +{{ end }} \ No newline at end of file diff --git a/install/helm/controlpanel/templates/deployment.yaml b/install/helm/controlpanel/templates/deployment.yaml new file mode 100644 index 0000000..ddf5157 --- /dev/null +++ b/install/helm/controlpanel/templates/deployment.yaml @@ -0,0 +1,61 @@ +################################################################################ +# 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. # +################################################################################ + +kind: Deployment +apiVersion: apps/v1 +metadata: + name: controlpanel + namespace: nonrtric + labels: + app: nonrtric-controlpanel +spec: + replicas: {{ .Values.controlpanel.replicaCount }} + selector: + matchLabels: + app: nonrtric-controlpanel + template: + metadata: + labels: + app: nonrtric-controlpanel + spec: + containers: + - name: controlpanel + image: "{{ .Values.controlpanel.image.registry }}/{{ .Values.controlpanel.image.name }}:{{ .Values.controlpanel.image.tag }}" + imagePullPolicy: {{ .Values.controlpanel.imagePullPolicy }} + ports: + - containerPort: {{ .Values.controlpanel.service.targetPort1 }} + protocol: TCP + - containerPort: {{ .Values.controlpanel.service.targetPort2 }} + protocol: TCP + volumeMounts: + - name: controlpanel-configmap + mountPath: /etc/nginx/nginx.conf + subPath: nginx.conf + readOnly: true + readinessProbe: + tcpSocket: + port: {{ .Values.controlpanel.service.targetPort1 }} + initialDelaySeconds: {{ .Values.controlpanel.readiness.initialDelaySeconds }} # liveness -> readiness + periodSeconds: {{ .Values.controlpanel.readiness.periodSeconds }} # liveness -> readiness + livenessProbe: + tcpSocket: + port: {{ .Values.controlpanel.service.targetPort1 }} + initialDelaySeconds: {{ .Values.controlpanel.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.controlpanel.liveness.periodSeconds }} + volumes: + - name: controlpanel-configmap + configMap: + name: controlpanel-configmap diff --git a/install/helm/controlpanel/templates/service.yaml b/install/helm/controlpanel/templates/service.yaml new file mode 100644 index 0000000..a5e1c66 --- /dev/null +++ b/install/helm/controlpanel/templates/service.yaml @@ -0,0 +1,40 @@ +################################################################################ +# 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. # +################################################################################ + +kind: Service +apiVersion: v1 +metadata: + name: controlpanel + namespace: nonrtric + labels: + app: nonrtric-controlpanel +spec: + type: NodePort + ports: + {{if eq .Values.controlpanel.service.allowHttp true -}} + - name: {{ index .Values.controlpanel.service.httpName }} + port: {{ .Values.controlpanel.service.internalPort1 }} + targetPort: {{ .Values.controlpanel.service.targetPort1 }} + nodePort: {{ .Values.controlpanel.service.externalPort1 }} + protocol: TCP + {{- end }} + - name: {{ index .Values.controlpanel.service.httpsName }} + port: {{ .Values.controlpanel.service.internalPort2 }} + targetPort: {{ .Values.controlpanel.service.targetPort2 }} + nodePort: {{ .Values.controlpanel.service.externalPort2 }} + protocol: TCP + selector: + app: nonrtric-controlpanel diff --git a/install/helm/controlpanel/values.yaml b/install/helm/controlpanel/values.yaml new file mode 100644 index 0000000..03fa569 --- /dev/null +++ b/install/helm/controlpanel/values.yaml @@ -0,0 +1,45 @@ +################################################################################ +# 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. # +################################################################################ + +# Default values for controlpanel. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +controlpanel: + imagePullPolicy: IfNotPresent + image: + registry: 'nexus3.o-ran-sc.org:10002/o-ran-sc' + name: nonrtric-controlpanel + tag: 2.5.0 + replicaCount: 1 + service: + allowHttp: true + httpName: http + internalPort1: 8080 + targetPort1: 8080 + externalPort1: 30091 + httpsName: https + internalPort2: 8081 + targetPort2: 8082 + externalPort2: 30092 + liveness: + initialDelaySeconds: 20 + periodSeconds: 10 + readiness: + initialDelaySeconds: 20 + periodSeconds: 10 + ingress: + enabled: false diff --git a/install/helm/nonrtricgateway/.helmignore b/install/helm/nonrtricgateway/.helmignore new file mode 100644 index 0000000..50af031 --- /dev/null +++ b/install/helm/nonrtricgateway/.helmignore @@ -0,0 +1,22 @@ +# 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 +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/install/helm/nonrtricgateway/Chart.yaml b/install/helm/nonrtricgateway/Chart.yaml new file mode 100644 index 0000000..3642ff8 --- /dev/null +++ b/install/helm/nonrtricgateway/Chart.yaml @@ -0,0 +1,21 @@ +################################################################################ +# 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. # +################################################################################ + +apiVersion: v1 +appVersion: "0.0.1" +description: A Helm chart for Nonrtric Gateway +name: nonrtricgateway +version: 1.0.0 diff --git a/install/helm/nonrtricgateway/resources/config/application.yaml b/install/helm/nonrtricgateway/resources/config/application.yaml new file mode 100644 index 0000000..1c5c63c --- /dev/null +++ b/install/helm/nonrtricgateway/resources/config/application.yaml @@ -0,0 +1,50 @@ +################################################################################ +# 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. # +################################################################################ + +server: + port: 9090 +spring: + cloud: + gateway: + httpclient: + ssl: + useInsecureTrustManager: true + wiretap: true + httpserver: + wiretap: true + routes: + - id: A1-EI + uri: http://informationservice:8083 + predicates: + - Path=/data-producer/**,/data-consumer/** +# - id: A1-EI2 +#uri: http://ics:8083 +management: + endpoint: + gateway: + enabled: true + endpoints: + web: + exposure: + include: "gateway,loggers,logfile,health,info,metrics,threaddump,heapdump" +logging: + level: + ROOT: ERROR + org.springframework: ERROR + org.springframework.cloud.gateway: INFO + reactor.netty: INFO + file: + name: /var/log/nonrtric-gateway/application.log diff --git a/install/helm/nonrtricgateway/templates/configmap.yaml b/install/helm/nonrtricgateway/templates/configmap.yaml new file mode 100644 index 0000000..bab097f --- /dev/null +++ b/install/helm/nonrtricgateway/templates/configmap.yaml @@ -0,0 +1,26 @@ +################################################################################ +# 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. # +################################################################################ + + +apiVersion: v1 +kind: ConfigMap +metadata: + name: nonrtricgateway-configmap + namespace: nonrtric + labels: + app: nonrtric-nonrtricgateway +data: +{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }} \ No newline at end of file diff --git a/install/helm/nonrtricgateway/templates/deployment.yaml b/install/helm/nonrtricgateway/templates/deployment.yaml new file mode 100644 index 0000000..c09c19c --- /dev/null +++ b/install/helm/nonrtricgateway/templates/deployment.yaml @@ -0,0 +1,57 @@ +################################################################################ +# 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. # +################################################################################ + +kind: Deployment +apiVersion: apps/v1 +metadata: + name: nonrtricgateway + namespace: nonrtric + labels: + app: nonrtric-nonrtricgateway +spec: + replicas: 1 + selector: + matchLabels: + app: nonrtric-nonrtricgateway + template: + metadata: + labels: + app: nonrtric-nonrtricgateway + spec: + containers: + - name: nonrtric-nonrtricgateway + image: "{{ .Values.nonrtricgateway.image.registry }}/{{ .Values.nonrtricgateway.image.name }}:{{ .Values.nonrtricgateway.image.tag }}" + imagePullPolicy: {{ .Values.nonrtricgateway.imagePullPolicy }} + ports: + - containerPort: {{ .Values.nonrtricgateway.service.targetPort1 }} + protocol: TCP + readinessProbe: + tcpSocket: + port: {{ .Values.nonrtricgateway.service.targetPort1 }} + initialDelaySeconds: {{ .Values.nonrtricgateway.readiness.initialDelaySeconds }} # changed from liveness + periodSeconds: {{ .Values.nonrtricgateway.readiness.periodSeconds }} + livenessProbe: + tcpSocket: + port: {{ .Values.nonrtricgateway.service.targetPort1 }} + initialDelaySeconds: {{ .Values.nonrtricgateway.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.nonrtricgateway.liveness.periodSeconds }} + volumeMounts: + - name: nonrtricgateway-config + mountPath: /opt/app/nonrtric-gateway/config + volumes: + - name: nonrtricgateway-config + configMap: + name: nonrtricgateway-configmap diff --git a/install/helm/nonrtricgateway/templates/service.yaml b/install/helm/nonrtricgateway/templates/service.yaml new file mode 100644 index 0000000..44caa2f --- /dev/null +++ b/install/helm/nonrtricgateway/templates/service.yaml @@ -0,0 +1,33 @@ +################################################################################ +# 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. # +################################################################################ + +kind: Service +apiVersion: v1 +metadata: + name: nonrtricgateway + namespace: nonrtric + labels: + app: nonrtric-nonrtricgateway +spec: + ports: + - name: {{ .Values.nonrtricgateway.service.httpName }} # name: {{ index .Values.nonrtricgateway.service.httpName }}, remove index + port: {{ .Values.nonrtricgateway.service.internalPort1 }} + targetPort: {{ .Values.nonrtricgateway.service.targetPort1 }} + nodePort: {{ .Values.nonrtricgateway.service.externalPort1 }} + protocol: TCP + selector: + app: nonrtric-nonrtricgateway + type: NodePort diff --git a/install/helm/nonrtricgateway/values.yaml b/install/helm/nonrtricgateway/values.yaml new file mode 100644 index 0000000..b3016c7 --- /dev/null +++ b/install/helm/nonrtricgateway/values.yaml @@ -0,0 +1,37 @@ +################################################################################ +# 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. # +################################################################################ + +# Default values for Gateway application. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +nonrtricgateway: + imagePullPolicy: IfNotPresent + image: + registry: 'nexus3.o-ran-sc.org:10002/o-ran-sc' + name: nonrtric-gateway + tag: 1.2.0 + service: + httpName: http + internalPort1: 9090 + targetPort1: 9090 + externalPort1: 30093 + liveness: + initialDelaySeconds: 20 + periodSeconds: 10 + readiness: + initialDelaySeconds: 20 + periodSeconds: 10 \ No newline at end of file diff --git a/install/install-nrt.sh b/install/install-nrt.sh index 906fd31..a30dcf3 100755 --- a/install/install-nrt.sh +++ b/install/install-nrt.sh @@ -166,6 +166,20 @@ done echo "" +################################################################################## +echo "##### Installing: chart nonrtricgateway" +################################################################################## + +helm install --wait -n nonrtric nonrtricgateway helm/nonrtricgateway +echo "" + +################################################################################## +echo "##### Installing: chart controlpanel" +################################################################################## + +helm install --wait -n nonrtric controlpanel helm/controlpanel +echo "" + ################################################################################## echo "##### Installing: chart ran" ################################################################################## @@ -257,4 +271,4 @@ echo "ranpm installed" echo "Wait until all pods are running before installation additional charts" echo "Do: 'kubectl get po -n nonrtric' and verify that all pods are in status Running" echo " and all included containers are Ready" -echo "######################################################################" \ No newline at end of file +echo "######################################################################" diff --git a/install/install-pm-influx-job.sh b/install/install-pm-influx-job.sh index 1de513e..2b79ede 100755 --- a/install/install-pm-influx-job.sh +++ b/install/install-pm-influx-job.sh @@ -43,7 +43,7 @@ echo "Kubernetes control plane host: $KUBERNETESHOST" . scripts/create_influxdb2_bucket.sh . scripts/create_ics_job.sh -echo "Installtion pm to influx job" +echo "Installation pm to influx job" echo " Retriving influxdb2 access token..." INFLUXDB2_TOKEN=$(get_influxdb2_token influxdb2-0 nonrtric) diff --git a/install/uninstall-nrt.sh b/install/uninstall-nrt.sh index 62abf73..ab7d3fc 100755 --- a/install/uninstall-nrt.sh +++ b/install/uninstall-nrt.sh @@ -29,13 +29,22 @@ check_error() { NUM_ERRORS=0 +helm uninstall -n nonrtric controlpanel +check_error $? controlpanel +helm uninstall -n nonrtric nonrtricgateway +check_error $? nonrtricgateway + helm uninstall -n ran ran +check_error $? ran helm uninstall -n nonrtric nrt-pm +check_error $? nrt-pm helm uninstall -n nonrtric nrt-base-1 +check_error $? nrt-base-1 helm uninstall -n nonrtric nrt-base-0 +check_error $? nrt-base-0 INST="strimzi-kafka CRDs" echo "##########################" diff --git a/install/uninstall-ranpm.sh b/install/uninstall-ranpm.sh index f4c08d1..272a69f 100644 --- a/install/uninstall-ranpm.sh +++ b/install/uninstall-ranpm.sh @@ -20,7 +20,7 @@ ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" cd "${ROOT_DIR}" # Array of scripts to execute -scripts=("uninstall-pm-rapp.sh" "uninstall-nrt.sh") +scripts=("uninstall-pm-rapp.sh" "uninstall-pm-log.sh" "uninstall-nrt.sh") for script in "${scripts[@]}"; do echo "*****************************************************************" @@ -41,4 +41,4 @@ echo "*****************************************************************" echo "*****************************************************************" echo "All RANPM uninstallation scripts executed successfully!" echo "*****************************************************************" -echo "*****************************************************************" \ No newline at end of file +echo "*****************************************************************" -- 2.16.6 From 4dd29883b619182fb43ebc4565266831d2a3b79e Mon Sep 17 00:00:00 2001 From: ambrishest Date: Wed, 4 Oct 2023 12:25:17 +0100 Subject: [PATCH 11/16] PmProducer - Vulnerability Fix Issue-ID: NONRTRIC-914 Signed-off-by: ambrishest Change-Id: Id95aa0ce46810d4e79d60f699bca1a58a2138ed6 Signed-off-by: ambrishest --- .../org/oran/pmproducer/controllers/ProducerCallbacksController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmproducer/src/main/java/org/oran/pmproducer/controllers/ProducerCallbacksController.java b/pmproducer/src/main/java/org/oran/pmproducer/controllers/ProducerCallbacksController.java index c7bca34..b7573fb 100644 --- a/pmproducer/src/main/java/org/oran/pmproducer/controllers/ProducerCallbacksController.java +++ b/pmproducer/src/main/java/org/oran/pmproducer/controllers/ProducerCallbacksController.java @@ -89,7 +89,7 @@ public class ProducerCallbacksController { @RequestBody String body) { try { ProducerJobInfo request = gson.fromJson(body, ProducerJobInfo.class); - logger.debug("Job started callback id: {}, body: {}", request.id, body); + logger.debug("Job started callback id: {}", request.id); this.jobs.addJob(request.id, types.getType(request.typeId), request.owner, request.lastUpdated, toJobParameters(request.jobData)); return new ResponseEntity<>(HttpStatus.OK); -- 2.16.6 From 6e3dc81c76fc88e000b83c35282d3db823f815a3 Mon Sep 17 00:00:00 2001 From: ambrishest Date: Wed, 4 Oct 2023 16:47:32 +0100 Subject: [PATCH 12/16] Fixing Sonar Code Smell for PMConverter Issue-ID: NONRTRIC-879 Signed-off-by: ambrishest Change-Id: I59b81fa264a55a7432f0b9669309169c9ca55e36 Signed-off-by: ambrishest --- pm-file-converter/common/utils/utils.go | 6 +- pm-file-converter/common/utils/utils_test.go | 2 +- .../components/kafkacollector/kafkacollector.go | 186 +++++++++++---------- .../components/miniocollector/miniocollector.go | 26 +-- .../miniocollector/miniocollector_test.go | 10 +- .../components/xmltransform/xmltransform.go | 14 +- .../components/xmltransform/xmltransform_test.go | 2 +- pm-file-converter/main.go | 68 ++++---- 8 files changed, 163 insertions(+), 151 deletions(-) diff --git a/pm-file-converter/common/utils/utils.go b/pm-file-converter/common/utils/utils.go index dccf3c5..7be5819 100644 --- a/pm-file-converter/common/utils/utils.go +++ b/pm-file-converter/common/utils/utils.go @@ -30,9 +30,7 @@ import ( var httpclient = &http.Client{} // Send a http request with json (json may be nil) -// -//lint:ignore S100 -func Send_http_request(json []byte, method string, url string, retry bool, useAuth bool) bool { +func SendHttpRequest(json []byte, method string, url string, retry bool, useAuth bool) bool { // set the HTTP method, url, and request body var req *http.Request @@ -49,7 +47,7 @@ func Send_http_request(json []byte, method string, url string, retry bool, useAu } if useAuth { - token, err := kafkacollector.Fetch_token() + token, err := kafkacollector.FetchToken() if err != nil { log.Error("Cannot fetch token for http request: ", err) return false diff --git a/pm-file-converter/common/utils/utils_test.go b/pm-file-converter/common/utils/utils_test.go index 2cf3f1f..166a27e 100644 --- a/pm-file-converter/common/utils/utils_test.go +++ b/pm-file-converter/common/utils/utils_test.go @@ -20,7 +20,7 @@ func TestSend_http_request(t *testing.T) { validate := func(t *testing.T, tc *testCase) { t.Run(tc.Name, func(t *testing.T) { - actualBool := Send_http_request(tc.Json, tc.Method, tc.Url, tc.Retry, tc.UseAuth) + actualBool := SendHttpRequest(tc.Json, tc.Method, tc.Url, tc.Retry, tc.UseAuth) assert.Equal(t, tc.ExpectedBool, actualBool) }) diff --git a/pm-file-converter/components/kafkacollector/kafkacollector.go b/pm-file-converter/components/kafkacollector/kafkacollector.go index 7451dd2..a7eaebf 100644 --- a/pm-file-converter/components/kafkacollector/kafkacollector.go +++ b/pm-file-converter/components/kafkacollector/kafkacollector.go @@ -43,22 +43,26 @@ var creds_service_url = os.Getenv("AUTH_SERVICE_URL") const parallelism_limiter = 100 //For all jobs var jobLimiterChan = make(chan struct{}, parallelism_limiter) -// noinspection GoCognitiveComplexity -func Start_topic_reader(topic string, type_id string, control_ch chan dataTypes.ReaderControl, data_ch chan *dataTypes.KafkaPayload, gid string, cid string) { +const typeLabel = " for type: " +const fetchTokenErrorMessage = "Cannot fetch token: " +const setTokenErrorMessage = "Cannot set token: " - log.Info("Topic reader starting, topic: ", topic, " for type: ", type_id) +// This function intentionally has high cognitive complexity // NOSONAR +func StartTopicReader(topic string, typeId string, controlCh chan dataTypes.ReaderControl, dataCh chan *dataTypes.KafkaPayload, gid string, cid string) { - topic_ok := false + log.Info("Topic reader starting, topic: ", topic, typeLabel, typeId) + + topicOk := false var c *kafka.Consumer = nil running := true - for topic_ok == false { + for topicOk == false { select { - case reader_ctrl := <-control_ch: - if reader_ctrl.Command == "EXIT" { - log.Info("Topic reader on topic: ", topic, " for type: ", type_id, " - stopped") - data_ch <- nil //Signal to job handler + case readerCtrl := <-controlCh: + if readerCtrl.Command == "EXIT" { + log.Info("Topic reader on topic: ", topic, typeLabel, typeId, " - stopped") + dataCh <- nil //Signal to job handler running = false return } @@ -67,27 +71,27 @@ func Start_topic_reader(topic string, type_id string, control_ch chan dataTypes. return } if c == nil { - c = create_kafka_consumer(type_id, gid, cid) + c = createKafkaConsumer(typeId, gid, cid) if c == nil { - log.Info("Cannot start consumer on topic: ", topic, " for type: ", type_id, " - retrying") + log.Info("Cannot start consumer on topic: ", topic, typeLabel, typeId, " - retrying") } else { - log.Info("Consumer started on topic: ", topic, " for type: ", type_id) + log.Info("Consumer started on topic: ", topic, typeLabel, typeId) } } - if c != nil && topic_ok == false { + if c != nil && topicOk == false { err := c.SubscribeTopics([]string{topic}, nil) if err != nil { - log.Info("Topic reader cannot start subscribing on topic: ", topic, " for type: ", type_id, " - retrying -- error details: ", err) + log.Info("Topic reader cannot start subscribing on topic: ", topic, typeLabel, typeId, " - retrying -- error details: ", err) } else { - log.Info("Topic reader subscribing on topic: ", topic, " for type: ", type_id) - topic_ok = true + log.Info("Topic reader subscribing on topic: ", topic, typeLabel, typeId) + topicOk = true } } } } - log.Info("Topic reader ready on topic: ", topic, " for type: ", type_id) + log.Info("Topic reader ready on topic: ", topic, typeLabel, typeId) - var event_chan = make(chan int) + var eventChan = make(chan int) go func() { for { select { @@ -95,22 +99,22 @@ func Start_topic_reader(topic string, type_id string, control_ch chan dataTypes. switch evt.(type) { case kafka.OAuthBearerTokenRefresh: log.Debug("New consumer token needed: ", evt) - token, err := Fetch_token() + token, err := FetchToken() if err != nil { - log.Warning("Cannot cannot fetch token: ", err) + log.Warning(fetchTokenErrorMessage, err) c.SetOAuthBearerTokenFailure(err.Error()) } else { setTokenError := c.SetOAuthBearerToken(*token) if setTokenError != nil { - log.Warning("Cannot cannot set token: ", setTokenError) + log.Warning(setTokenErrorMessage, setTokenError) c.SetOAuthBearerTokenFailure(setTokenError.Error()) } } default: - log.Debug("Dumping topic reader event on topic: ", topic, " for type: ", type_id, " evt: ", evt.String()) + log.Debug("Dumping topic reader event on topic: ", topic, typeLabel, typeId, " evt: ", evt.String()) } - case msg := <-event_chan: + case msg := <-eventChan: if msg == 0 { return } @@ -126,11 +130,11 @@ func Start_topic_reader(topic string, type_id string, control_ch chan dataTypes. for { for { select { - case reader_ctrl := <-control_ch: - if reader_ctrl.Command == "EXIT" { - event_chan <- 0 - log.Debug("Topic reader on topic: ", topic, " for type: ", type_id, " - stopped") - data_ch <- nil //Signal to job handler + case readerCtrl := <-controlCh: + if readerCtrl.Command == "EXIT" { + eventChan <- 0 + log.Debug("Topic reader on topic: ", topic, typeLabel, typeId, " - stopped") + dataCh <- nil //Signal to job handler defer c.Close() return } @@ -138,7 +142,7 @@ func Start_topic_reader(topic string, type_id string, control_ch chan dataTypes. ev := c.Poll(1000) if ev == nil { - log.Debug("Topic Reader for type: ", type_id, " Nothing to consume on topic: ", topic) + log.Debug("Topic Reader for type: ", typeId, " Nothing to consume on topic: ", topic) continue } switch e := ev.(type) { @@ -148,22 +152,22 @@ func Start_topic_reader(topic string, type_id string, control_ch chan dataTypes. c.Commit() - data_ch <- &kmsg + dataCh <- &kmsg log.Debug("Reader msg: ", &kmsg) - log.Debug("Reader - data_ch ", data_ch) + log.Debug("Reader - data_ch ", dataCh) case kafka.Error: fmt.Fprintf(os.Stderr, "%% Error: %v: %v\n", e.Code(), e) case kafka.OAuthBearerTokenRefresh: log.Debug("New consumer token needed: ", ev) - token, err := Fetch_token() + token, err := FetchToken() if err != nil { - log.Warning("Cannot cannot fetch token: ", err) + log.Warning(fetchTokenErrorMessage, err) c.SetOAuthBearerTokenFailure(err.Error()) } else { setTokenError := c.SetOAuthBearerToken(*token) if setTokenError != nil { - log.Warning("Cannot cannot set token: ", setTokenError) + log.Warning(setTokenErrorMessage, setTokenError) c.SetOAuthBearerTokenFailure(setTokenError.Error()) } } @@ -176,23 +180,24 @@ func Start_topic_reader(topic string, type_id string, control_ch chan dataTypes. }() } -func Start_topic_writer(control_ch chan dataTypes.WriterControl, data_ch chan *dataTypes.KafkaPayload) { +// This function intentionally has high cognitive complexity // NOSONAR +func StartTopicWriter(controlCh chan dataTypes.WriterControl, dataCh chan *dataTypes.KafkaPayload) { - var kafka_producer *kafka.Producer + var kafkaProducer *kafka.Producer running := true log.Info("Topic writer starting") // Wait for kafka producer to become available - and be prepared to exit the writer - for kafka_producer == nil { + for kafkaProducer == nil { select { - case writer_ctl := <-control_ch: - if writer_ctl.Command == "EXIT" { + case writerCtl := <-controlCh: + if writerCtl.Command == "EXIT" { //ignore cmd } default: - kafka_producer = start_producer() - if kafka_producer == nil { + kafkaProducer = startProducer() + if kafkaProducer == nil { log.Debug("Could not start kafka producer - retrying") time.Sleep(1 * time.Second) } else { @@ -201,11 +206,11 @@ func Start_topic_writer(control_ch chan dataTypes.WriterControl, data_ch chan *d } } - var event_chan = make(chan int) + var eventChan = make(chan int) go func() { for { select { - case evt := <-kafka_producer.Events(): + case evt := <-kafkaProducer.Events(): switch evt.(type) { case *kafka.Message: m := evt.(*kafka.Message) @@ -219,22 +224,22 @@ func Start_topic_writer(control_ch chan dataTypes.WriterControl, data_ch chan *d log.Debug("Dumping topic writer event, error: ", evt) case kafka.OAuthBearerTokenRefresh: log.Debug("New producer token needed: ", evt) - token, err := Fetch_token() + token, err := FetchToken() if err != nil { - log.Warning("Cannot cannot fetch token: ", err) - kafka_producer.SetOAuthBearerTokenFailure(err.Error()) + log.Warning(fetchTokenErrorMessage, err) + kafkaProducer.SetOAuthBearerTokenFailure(err.Error()) } else { - setTokenError := kafka_producer.SetOAuthBearerToken(*token) + setTokenError := kafkaProducer.SetOAuthBearerToken(*token) if setTokenError != nil { - log.Warning("Cannot cannot set token: ", setTokenError) - kafka_producer.SetOAuthBearerTokenFailure(setTokenError.Error()) + log.Warning(setTokenErrorMessage, setTokenError) + kafkaProducer.SetOAuthBearerTokenFailure(setTokenError.Error()) } } default: log.Debug("Dumping topic writer event, unknown: ", evt) } - case msg := <-event_chan: + case msg := <-eventChan: if msg == 0 { return } @@ -248,36 +253,36 @@ func Start_topic_writer(control_ch chan dataTypes.WriterControl, data_ch chan *d go func() { for { select { - case writer_ctl := <-control_ch: - if writer_ctl.Command == "EXIT" { + case writerCtl := <-controlCh: + if writerCtl.Command == "EXIT" { // ignore - wait for channel signal } - case kmsg := <-data_ch: + case kmsg := <-dataCh: if kmsg == nil { - event_chan <- 0 + eventChan <- 0 log.Info("Topic writer stopped by channel signal - start_topic_writer") - defer kafka_producer.Close() + defer kafkaProducer.Close() return } retries := 10 - msg_ok := false + msgOk := false var err error - for retry := 1; retry <= retries && msg_ok == false; retry++ { - err = kafka_producer.Produce(&kafka.Message{ + for retry := 1; retry <= retries && msgOk == false; retry++ { + err = kafkaProducer.Produce(&kafka.Message{ TopicPartition: kafka.TopicPartition{Topic: &kmsg.Topic, Partition: kafka.PartitionAny}, Value: kmsg.Msg.Value, Key: kmsg.Msg.Key}, nil) if err == nil { - msg_ok = true + msgOk = true log.Debug("Topic writer, msg sent ok on topic: ", kmsg.Topic) } else { log.Info("Topic writer failed to send message on topic: ", kmsg.Topic, " - Retrying. Error details: ", err) time.Sleep(time.Duration(retry) * time.Second) } } - if !msg_ok { + if !msgOk { log.Error("Topic writer failed to send message on topic: ", kmsg.Topic, " - Msg discarded. Error details: ", err) } case <-time.After(1000 * time.Millisecond): @@ -289,10 +294,11 @@ func Start_topic_writer(control_ch chan dataTypes.WriterControl, data_ch chan *d }() } -func create_kafka_consumer(type_id string, gid string, cid string) *kafka.Consumer { +// This function intentionally has high cognitive complexity // NOSONAR +func createKafkaConsumer(typeId string, gid string, cid string) *kafka.Consumer { var cm kafka.ConfigMap if creds_grant_type == "" { - log.Info("Creating kafka plain text consumer for type: ", type_id) + log.Info("Creating kafka plain text consumer for type: ", typeId) cm = kafka.ConfigMap{ "bootstrap.servers": bootstrapserver, "group.id": gid, @@ -301,7 +307,7 @@ func create_kafka_consumer(type_id string, gid string, cid string) *kafka.Consum "enable.auto.commit": false, } } else { - log.Info("Creating kafka SASL plain text consumer for type: ", type_id) + log.Info("Creating kafka SASL plain text consumer for type: ", typeId) cm = kafka.ConfigMap{ "bootstrap.servers": bootstrapserver, "group.id": gid, @@ -315,16 +321,17 @@ func create_kafka_consumer(type_id string, gid string, cid string) *kafka.Consum c, err := kafka.NewConsumer(&cm) if err != nil { - log.Error("Cannot create kafka consumer for type: ", type_id, ", error details: ", err) + log.Error("Cannot create kafka consumer for type: ", typeId, ", error details: ", err) return nil } - log.Info("Created kafka consumer for type: ", type_id, " OK") + log.Info("Created kafka consumer for type: ", typeId, " OK") return c } // Start kafka producer -func start_producer() *kafka.Producer { +// NOSONAR +func startProducer() *kafka.Producer { log.Info("Creating kafka producer") var cm kafka.ConfigMap @@ -350,18 +357,18 @@ func start_producer() *kafka.Producer { return p } -func Start_job_xml_file_data(type_id string, control_ch chan dataTypes.JobControl, data_in_ch chan *dataTypes.KafkaPayload, data_out_channel chan *dataTypes.KafkaPayload, fvolume string, fsbucket string) { +func StartJobXmlFileData(type_id string, control_ch chan dataTypes.JobControl, data_in_ch chan *dataTypes.KafkaPayload, data_out_channel chan *dataTypes.KafkaPayload, fvolume string, fsbucket string) { log.Info("Type job", type_id, " started") - topic_list := make(map[string]string) - topic_list[type_id] = "json-file-ready-kp" - topic_list["PmData"] = "json-file-ready-kpadp" + topicList := make(map[string]string) + topicList[type_id] = "json-file-ready-kp" + topicList["PmData"] = "json-file-ready-kpadp" running := true for { select { - case job_ctl := <-control_ch: - log.Debug("Type job ", type_id, " new cmd received ", job_ctl.Command) - switch job_ctl.Command { + case jobCtl := <-control_ch: + log.Debug("Type job ", type_id, " new cmd received ", jobCtl.Command) + switch jobCtl.Command { case "EXIT": //ignore cmd - handled by channel signal } @@ -374,7 +381,7 @@ func Start_job_xml_file_data(type_id string, control_ch chan dataTypes.JobContro return } jobLimiterChan <- struct{}{} - go run_xml_job(type_id, msg, "gz", data_out_channel, topic_list, jobLimiterChan, fvolume, fsbucket) + go runXmlJob(type_id, msg, "gz", data_out_channel, topicList, jobLimiterChan, fvolume, fsbucket) case <-time.After(1 * time.Second): if !running { @@ -384,30 +391,31 @@ func Start_job_xml_file_data(type_id string, control_ch chan dataTypes.JobContro } } -func run_xml_job(type_id string, msg *dataTypes.KafkaPayload, outputCompression string, data_out_channel chan *dataTypes.KafkaPayload, topic_list map[string]string, jobLimiterChan chan struct{}, fvolume string, fsbucket string) { +// This function intentionally has more parameters for legacy compatibility // NOSONAR +func runXmlJob(typeId string, msg *dataTypes.KafkaPayload, outputCompression string, dataOutChannel chan *dataTypes.KafkaPayload, topicList map[string]string, jobLimiterChan chan struct{}, fvolume string, fsbucket string) { defer func() { <-jobLimiterChan }() start := time.Now() - var evt_data dataTypes.XmlFileEventHeader + var evtData dataTypes.XmlFileEventHeader - err := jsoniter.Unmarshal(msg.Msg.Value, &evt_data) + err := jsoniter.Unmarshal(msg.Msg.Value, &evtData) if err != nil { - log.Error("Cannot parse XmlFileEventHeader for type job: ", type_id, " - discarding message, error details", err) + log.Error("Cannot parse XmlFileEventHeader for type job: ", typeId, " - discarding message, error details", err) return } - log.Debug("Unmarshal file-collect event for type job: ", type_id, " time: ", time.Since(start).String()) + log.Debug("Unmarshal file-collect event for type job: ", typeId, " time: ", time.Since(start).String()) start = time.Now() - new_fn := miniocollector.Xml_to_json_conv(&evt_data) + newFn := miniocollector.XmlToJsonConv(&evtData) if err != nil { - log.Error("Cannot convert file ", evt_data.Name, " - discarding message, ", err) + log.Error("Cannot convert file ", evtData.Name, " - discarding message, ", err) return } - log.Debug("Converted file to json: ", new_fn, " time", time.Since(start).String()) + log.Debug("Converted file to json: ", newFn, " time", time.Since(start).String()) var fde dataTypes.FileDownloadedEvt - fde.Filename = new_fn + fde.Filename = newFn j, err := jsoniter.Marshal(fde) if err != nil { @@ -416,19 +424,20 @@ func run_xml_job(type_id string, msg *dataTypes.KafkaPayload, outputCompression } msg.Msg.Value = j - msg.Msg.Key = []byte("\"" + evt_data.SourceName + "\"") + msg.Msg.Key = []byte("\"" + evtData.SourceName + "\"") log.Debug("Marshal file-collect event ", time.Since(start).String()) - log.Debug("Sending file-collect event to output topic(s)", len(topic_list)) - for _, v := range topic_list { + log.Debug("Sending file-collect event to output topic(s)", len(topicList)) + for _, v := range topicList { fmt.Println("Output Topic: " + v) var kmsg *dataTypes.KafkaPayload = new(dataTypes.KafkaPayload) kmsg.Msg = msg.Msg kmsg.Topic = v - data_out_channel <- kmsg + dataOutChannel <- kmsg } } -func Fetch_token() (*kafka.OAuthBearerToken, error) { +// NOSONAR +func FetchToken() (*kafka.OAuthBearerToken, error) { log.Debug("Get token inline") conf := &clientcredentials.Config{ ClientID: creds_client_id, @@ -441,6 +450,7 @@ func Fetch_token() (*kafka.OAuthBearerToken, error) { return nil, err } extensions := map[string]string{} + log.Debug("=====================================================") log.Debug("token: ", token) log.Debug("=====================================================") diff --git a/pm-file-converter/components/miniocollector/miniocollector.go b/pm-file-converter/components/miniocollector/miniocollector.go index ac8ce05..24ff41f 100644 --- a/pm-file-converter/components/miniocollector/miniocollector.go +++ b/pm-file-converter/components/miniocollector/miniocollector.go @@ -39,7 +39,7 @@ import ( ) // nolint -func Xml_to_json_conv(evt_data *dataTypes.XmlFileEventHeader) string { +func XmlToJsonConv(evtData *dataTypes.XmlFileEventHeader) string { filestoreUser := os.Getenv("FILESTORE_USER") filestorePwd := os.Getenv("FILESTORE_PWD") filestoreServer := os.Getenv("FILESTORE_SERVER") @@ -52,12 +52,12 @@ func Xml_to_json_conv(evt_data *dataTypes.XmlFileEventHeader) string { log.Fatalln(err) } expiry := time.Second * 24 * 60 * 60 // 1 day. - objectName := evt_data.Name - bucketName := evt_data.ObjectStoreBucket - compresion := evt_data.Compression + objectName := evtData.Name + bucketName := evtData.ObjectStoreBucket + compresion := evtData.Compression reqParams := make(url.Values) - xmlh, err := jsoniter.Marshal(evt_data) + xmlh, err := jsoniter.Marshal(evtData) if err != nil { fmt.Printf("Error: %s", err) return "" @@ -68,18 +68,18 @@ func Xml_to_json_conv(evt_data *dataTypes.XmlFileEventHeader) string { if err != nil { log.Fatalln(err) } - file_bytes := xmltransform.Convert(presignedURL.String(), compresion, string(xmlh)) + fileBytes := xmltransform.Convert(presignedURL.String(), compresion, string(xmlh)) newObjectName := objectName + "kafka-producer-pm-xml2json-0.json.gz" var buf bytes.Buffer - err = gzipWrite(&buf, &file_bytes) - upload_object(s3Client, buf.Bytes(), newObjectName, "pm-files-json") + err = gzipWrite(&buf, &fileBytes) + uploadObject(s3Client, buf.Bytes(), newObjectName, "pm-files-json") fmt.Println("") return newObjectName } // nolint -func upload_object(mc *minio.Client, b []byte, objectName string, fsbucket string) { +func uploadObject(mc *minio.Client, b []byte, objectName string, fsbucket string) { contentType := "application/json" if strings.HasSuffix(objectName, ".gz") { contentType = "application/gzip" @@ -88,8 +88,8 @@ func upload_object(mc *minio.Client, b []byte, objectName string, fsbucket strin // Upload the xml file with PutObject r := bytes.NewReader(b) tctx := context.Background() - if check_minio_bucket(mc, fsbucket) == false { - err := create_minio_bucket(mc, fsbucket) + if checkMinioBucket(mc, fsbucket) == false { + err := createMinioBucket(mc, fsbucket) if err != nil { log.Error("Cannot create bucket: ", fsbucket, ", ", err) return @@ -113,7 +113,7 @@ func upload_object(mc *minio.Client, b []byte, objectName string, fsbucket strin } // nolint -func create_minio_bucket(mc *minio.Client, bucket string) error { +func createMinioBucket(mc *minio.Client, bucket string) error { tctx := context.Background() err := mc.MakeBucket(tctx, bucket, minio.MakeBucketOptions{}) if err != nil { @@ -132,7 +132,7 @@ func create_minio_bucket(mc *minio.Client, bucket string) error { } // nolint -func check_minio_bucket(mc *minio.Client, bucket string) bool { +func checkMinioBucket(mc *minio.Client, bucket string) bool { tctx := context.Background() exists, err := mc.BucketExists(tctx, bucket) if err == nil && exists { diff --git a/pm-file-converter/components/miniocollector/miniocollector_test.go b/pm-file-converter/components/miniocollector/miniocollector_test.go index 17327a8..121799d 100644 --- a/pm-file-converter/components/miniocollector/miniocollector_test.go +++ b/pm-file-converter/components/miniocollector/miniocollector_test.go @@ -33,7 +33,7 @@ func TestMake_minio_bucket(t *testing.T) { // Create a test bucket. bucketName := "my-test-bucket" - err = create_minio_bucket(minioClient, bucketName) + err = createMinioBucket(minioClient, bucketName) if err != nil { log.Fatalf("Error creating bucket: %v", err) } else { @@ -61,7 +61,7 @@ func Test_bucket_cannot_empty(t *testing.T) { // Create a test bucket. bucketName := "" - err = create_minio_bucket(minioClient, bucketName) + err = createMinioBucket(minioClient, bucketName) if err != nil { assert.Error(t, err) } else { @@ -91,7 +91,7 @@ func Test_check_minio_bucket(t *testing.T) { // Create a test bucket. bucketName := "my-test-bucket" - found = check_minio_bucket(minioClient, bucketName) + found = checkMinioBucket(minioClient, bucketName) if found { assert.True(t, found) } else { @@ -121,7 +121,7 @@ func Test_bucket_not_exists(t *testing.T) { // Create a test bucket. bucketName := "my-test-bucket-not-exists" - found = check_minio_bucket(minioClient, bucketName) + found = checkMinioBucket(minioClient, bucketName) if found { assert.True(t, found) } else { @@ -168,7 +168,7 @@ func Test_upload_object(t *testing.T) { // Create a test bucket. bucketName := "my-test-bucket" - upload_object(minioClient, file_bytes, "minio_upload_test.json", bucketName) + uploadObject(minioClient, file_bytes, "minio_upload_test.json", bucketName) assert.NoError(t, err) diff --git a/pm-file-converter/components/xmltransform/xmltransform.go b/pm-file-converter/components/xmltransform/xmltransform.go index e7e04e4..6e70022 100644 --- a/pm-file-converter/components/xmltransform/xmltransform.go +++ b/pm-file-converter/components/xmltransform/xmltransform.go @@ -36,10 +36,10 @@ import ( ) //lint:ignore S117 -func xml_to_json_conv(f_byteValue *[]byte, xfeh *dataTypes.XmlFileEventHeader) ([]byte, error) { +func xmlToJsonConv(fBytevalue *[]byte, xfeh *dataTypes.XmlFileEventHeader) ([]byte, error) { var f dataTypes.MeasCollecFile start := time.Now() - err := xml.Unmarshal(*f_byteValue, &f) + err := xml.Unmarshal(*fBytevalue, &f) if err != nil { return nil, errors.New("Cannot unmarshal xml-file") } @@ -48,7 +48,6 @@ func xml_to_json_conv(f_byteValue *[]byte, xfeh *dataTypes.XmlFileEventHeader) ( start = time.Now() var pmfile dataTypes.PMJsonFile - //TODO: Fill in more values pmfile.Event.Perf3GppFields.Perf3GppFieldsVersion = "1.0" pmfile.Event.Perf3GppFields.MeasDataCollection.GranularityPeriod = 900 pmfile.Event.Perf3GppFields.MeasDataCollection.MeasuredEntityUserName = "" @@ -82,7 +81,6 @@ func xml_to_json_conv(f_byteValue *[]byte, xfeh *dataTypes.XmlFileEventHeader) ( pmfile.Event.Perf3GppFields.MeasDataCollection.GranularityPeriod = 900 - //TODO: Fill more values pmfile.Event.CommonEventHeader.Domain = "" //xfeh.Domain pmfile.Event.CommonEventHeader.EventID = "" //xfeh.EventID pmfile.Event.CommonEventHeader.Sequence = 0 //xfeh.Sequence @@ -109,8 +107,8 @@ func xml_to_json_conv(f_byteValue *[]byte, xfeh *dataTypes.XmlFileEventHeader) ( } func Convert(inputS3Url, compression, xmlFileEventHeader string) []byte { - evt_data := dataTypes.XmlFileEventHeader{} - jsoniter.Unmarshal([]byte(xmlFileEventHeader), &evt_data) + evtData := dataTypes.XmlFileEventHeader{} + jsoniter.Unmarshal([]byte(xmlFileEventHeader), &evtData) client := new(http.Client) @@ -136,8 +134,8 @@ func Convert(inputS3Url, compression, xmlFileEventHeader string) []byte { log.Error("Error reading response, discarding message, ", err) return nil } - file_bytes := buf3.Bytes() + fileBytes := buf3.Bytes() fmt.Println("Converting to XML") - b, err := xml_to_json_conv(&file_bytes, &evt_data) + b, err := xmlToJsonConv(&fileBytes, &evtData) return b } diff --git a/pm-file-converter/components/xmltransform/xmltransform_test.go b/pm-file-converter/components/xmltransform/xmltransform_test.go index 9f12c99..5f6e89d 100644 --- a/pm-file-converter/components/xmltransform/xmltransform_test.go +++ b/pm-file-converter/components/xmltransform/xmltransform_test.go @@ -63,7 +63,7 @@ func TestXMLToJSONConv_Success(t *testing.T) { return } file_bytes := buf3.Bytes() - b, err := xml_to_json_conv(&file_bytes, &evt_data) + b, err := xmlToJsonConv(&file_bytes, &evt_data) json_filename := "A20230515.0700_0100-0715_0100_GNODEB-0.json" diff --git a/pm-file-converter/main.go b/pm-file-converter/main.go index b931a2a..599a33b 100644 --- a/pm-file-converter/main.go +++ b/pm-file-converter/main.go @@ -72,6 +72,8 @@ const ( Terminating ) +const registeringProducer = "Registering producer: " + // == Main ==// func main() { @@ -93,11 +95,11 @@ func main() { producer_instance_name = producer_instance_name + "-" + os.Getenv("KP") } - go kafkacollector.Start_topic_writer(writer_control, data_out_channel) + go kafkacollector.StartTopicWriter(writer_control, data_out_channel) //Setup proc for periodic type registration - var event_chan = make(chan int) //Channel for stopping the proc - go periodic_registration(event_chan) + var eventChan = make(chan int) //Channel for stopping the proc + go periodicRegistration(eventChan) //Wait for term/int signal do try to shut down gracefully sigs := make(chan os.Signal, 1) @@ -105,7 +107,7 @@ func main() { go func() { sig := <-sigs fmt.Printf("Received signal %s - application will terminate\n", sig) - event_chan <- 0 // Stop periodic registration + eventChan <- 0 // Stop periodic registration datalock.Lock() defer datalock.Unlock() AppState = Terminating @@ -122,7 +124,7 @@ func main() { // == Core functions ==// // Run periodic registration of producers -func periodic_registration(evtch chan int) { +func periodicRegistration(evtch chan int) { var delay int = 1 for { select { @@ -131,7 +133,7 @@ func periodic_registration(evtch chan int) { return } case <-time.After(time.Duration(delay) * time.Second): - ok := register_producer() + ok := registerProducer() if ok { delay = registration_delay_long } else { @@ -145,24 +147,26 @@ func periodic_registration(evtch chan int) { } } -func register_producer() bool { +func registerProducer() bool { - log.Info("Registering producer: ", producer_instance_name) + log.Info(registeringProducer, producer_instance_name) file, err := os.ReadFile(config_file) if err != nil { log.Error("Cannot read config file: ", config_file) - log.Error("Registering producer: ", producer_instance_name, " - failed") + // NOSONAR + log.Error(registeringProducer, producer_instance_name, " - failed") return false } data := dataTypes.DataTypes{} err = jsoniter.Unmarshal([]byte(file), &data) if err != nil { log.Error("Cannot parse config file: ", config_file) - log.Error("Registering producer: ", producer_instance_name, " - failed") + // NOSONAR + log.Error(registeringProducer, producer_instance_name, " - failed") return false } - var new_type_names []string + var newTypeNames []string for i := 0; i < len(data.ProdDataTypes); i++ { t1 := make(map[string]interface{}) @@ -178,57 +182,59 @@ func register_producer() bool { json, err := jsoniter.Marshal(t1) if err != nil { log.Error("Cannot create json for type: ", data.ProdDataTypes[i].ID) - log.Error("Registering producer: ", producer_instance_name, " - failed") + // NOSONAR + log.Error(registeringProducer, producer_instance_name, " - failed") return false } else { - ok := utils.Send_http_request(json, http.MethodPut, "http://"+ics_server+"/data-producer/v1/info-types/"+data.ProdDataTypes[i].ID, true, creds_grant_type != "") + ok := utils.SendHttpRequest(json, http.MethodPut, "http://"+ics_server+"/data-producer/v1/info-types/"+data.ProdDataTypes[i].ID, true, creds_grant_type != "") if !ok { log.Error("Cannot register type: ", data.ProdDataTypes[i].ID) - log.Error("Registering producer: ", producer_instance_name, " - failed") + // NOSONAR + log.Error(registeringProducer, producer_instance_name, " - failed") return false } - new_type_names = append(new_type_names, data.ProdDataTypes[i].ID) + newTypeNames = append(newTypeNames, data.ProdDataTypes[i].ID) } } - log.Debug("Registering types: ", new_type_names) + log.Debug("Registering types: ", newTypeNames) datalock.Lock() defer datalock.Unlock() for _, v := range data.ProdDataTypes { log.Info("Adding type job for type: ", v.ID, " Type added to configuration") - start_type_job(v) + startTypeJob(v) } dataTypes.InfoTypes = data log.Debug("Datatypes: ", dataTypes.InfoTypes) - log.Info("Registering producer: ", producer_instance_name, " - OK") + log.Info(registeringProducer, producer_instance_name, " - OK") return true } -func start_type_job(dp dataTypes.DataType) { +func startTypeJob(dp dataTypes.DataType) { log.Info("Starting type job: ", dp.ID) - job_record := dataTypes.TypeJobRecord{} + jobRecord := dataTypes.TypeJobRecord{} - job_record.Job_control = make(chan dataTypes.JobControl, 1) - job_record.Reader_control = make(chan dataTypes.ReaderControl, 1) - job_record.Data_in_channel = make(chan *dataTypes.KafkaPayload, reader_queue_length) - job_record.InfoType = dp.ID - job_record.InputTopic = dp.KafkaInputTopic - job_record.GroupId = "kafka-procon-" + dp.ID - job_record.ClientId = dp.ID + "-" + os.Getenv("KP") + jobRecord.Job_control = make(chan dataTypes.JobControl, 1) + jobRecord.Reader_control = make(chan dataTypes.ReaderControl, 1) + jobRecord.Data_in_channel = make(chan *dataTypes.KafkaPayload, reader_queue_length) + jobRecord.InfoType = dp.ID + jobRecord.InputTopic = dp.KafkaInputTopic + jobRecord.GroupId = "kafka-procon-" + dp.ID + jobRecord.ClientId = dp.ID + "-" + os.Getenv("KP") switch dp.ID { case "xml-file-data-to-filestore": - go kafkacollector.Start_job_xml_file_data(dp.ID, job_record.Job_control, job_record.Data_in_channel, data_out_channel, "", "pm-files-json") + go kafkacollector.StartJobXmlFileData(dp.ID, jobRecord.Job_control, jobRecord.Data_in_channel, data_out_channel, "", "pm-files-json") case "xml-file-data": - go kafkacollector.Start_job_xml_file_data(dp.ID, job_record.Job_control, job_record.Data_in_channel, data_out_channel, files_volume, "") + go kafkacollector.StartJobXmlFileData(dp.ID, jobRecord.Job_control, jobRecord.Data_in_channel, data_out_channel, files_volume, "") default: } - go kafkacollector.Start_topic_reader(dp.KafkaInputTopic, dp.ID, job_record.Reader_control, job_record.Data_in_channel, job_record.GroupId, job_record.ClientId) + go kafkacollector.StartTopicReader(dp.KafkaInputTopic, dp.ID, jobRecord.Reader_control, jobRecord.Data_in_channel, jobRecord.GroupId, jobRecord.ClientId) - dataTypes.TypeJobs[dp.ID] = job_record + dataTypes.TypeJobs[dp.ID] = jobRecord log.Debug("Type job input type: ", dp.InputJobType) } -- 2.16.6 From ba3389b19b7992f2bc237c4a8566463c55100e22 Mon Sep 17 00:00:00 2001 From: ambrishest Date: Tue, 10 Oct 2023 07:41:14 +0100 Subject: [PATCH 13/16] Suppressing Cognitive Complexity Sonar Code Smell for PMConverter Issue-ID: NONRTRIC-879 Change-Id: Ie98efb460527fd29d9051c259e3f36b9b43f5bc3 Signed-off-by: ambrishest --- .../components/kafkacollector/kafkacollector.go | 31 +++++++++++----------- pm-file-converter/main.go | 10 ++++--- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/pm-file-converter/components/kafkacollector/kafkacollector.go b/pm-file-converter/components/kafkacollector/kafkacollector.go index a7eaebf..418b312 100644 --- a/pm-file-converter/components/kafkacollector/kafkacollector.go +++ b/pm-file-converter/components/kafkacollector/kafkacollector.go @@ -17,6 +17,8 @@ // See the License for the specific language governing permissions and // limitations under the License. // ========================LICENSE_END=================================== + +//nolint:gocognit package kafkacollector import ( @@ -47,7 +49,7 @@ const typeLabel = " for type: " const fetchTokenErrorMessage = "Cannot fetch token: " const setTokenErrorMessage = "Cannot set token: " -// This function intentionally has high cognitive complexity // NOSONAR +// This function intentionally has high cognitive complexity //NOSONAR func StartTopicReader(topic string, typeId string, controlCh chan dataTypes.ReaderControl, dataCh chan *dataTypes.KafkaPayload, gid string, cid string) { log.Info("Topic reader starting, topic: ", topic, typeLabel, typeId) @@ -180,7 +182,7 @@ func StartTopicReader(topic string, typeId string, controlCh chan dataTypes.Read }() } -// This function intentionally has high cognitive complexity // NOSONAR +// This function intentionally has high cognitive complexity //NOSONAR func StartTopicWriter(controlCh chan dataTypes.WriterControl, dataCh chan *dataTypes.KafkaPayload) { var kafkaProducer *kafka.Producer @@ -294,7 +296,7 @@ func StartTopicWriter(controlCh chan dataTypes.WriterControl, dataCh chan *dataT }() } -// This function intentionally has high cognitive complexity // NOSONAR +// We need to pass the kafka properties in this way for readability purpose //NOSONAR func createKafkaConsumer(typeId string, gid string, cid string) *kafka.Consumer { var cm kafka.ConfigMap if creds_grant_type == "" { @@ -329,8 +331,7 @@ func createKafkaConsumer(typeId string, gid string, cid string) *kafka.Consumer return c } -// Start kafka producer -// NOSONAR +// We need to pass the kafka properties in this way for readability purpose //NOSONAR func startProducer() *kafka.Producer { log.Info("Creating kafka producer") @@ -357,31 +358,31 @@ func startProducer() *kafka.Producer { return p } -func StartJobXmlFileData(type_id string, control_ch chan dataTypes.JobControl, data_in_ch chan *dataTypes.KafkaPayload, data_out_channel chan *dataTypes.KafkaPayload, fvolume string, fsbucket string) { +func StartJobXmlFileData(typeId string, controlCh chan dataTypes.JobControl, dataInCh chan *dataTypes.KafkaPayload, dataOutChannel chan *dataTypes.KafkaPayload, fvolume string, fsbucket string) { - log.Info("Type job", type_id, " started") + log.Info("Type job", typeId, " started") topicList := make(map[string]string) - topicList[type_id] = "json-file-ready-kp" + topicList[typeId] = "json-file-ready-kp" topicList["PmData"] = "json-file-ready-kpadp" running := true for { select { - case jobCtl := <-control_ch: - log.Debug("Type job ", type_id, " new cmd received ", jobCtl.Command) + case jobCtl := <-controlCh: + log.Debug("Type job ", typeId, " new cmd received ", jobCtl.Command) switch jobCtl.Command { case "EXIT": //ignore cmd - handled by channel signal } - case msg := <-data_in_ch: + case msg := <-dataInCh: if msg == nil { - log.Info("Type job ", type_id, " stopped by channel signal - start_job_xml_file_data") + log.Info("Type job ", typeId, " stopped by channel signal - start_job_xml_file_data") running = false return } jobLimiterChan <- struct{}{} - go runXmlJob(type_id, msg, "gz", data_out_channel, topicList, jobLimiterChan, fvolume, fsbucket) + go runXmlJob(typeId, msg, "gz", dataOutChannel, topicList, jobLimiterChan, fvolume, fsbucket) case <-time.After(1 * time.Second): if !running { @@ -391,7 +392,7 @@ func StartJobXmlFileData(type_id string, control_ch chan dataTypes.JobControl, d } } -// This function intentionally has more parameters for legacy compatibility // NOSONAR +// This function intentionally has more parameters for legacy compatibility //NOSONAR func runXmlJob(typeId string, msg *dataTypes.KafkaPayload, outputCompression string, dataOutChannel chan *dataTypes.KafkaPayload, topicList map[string]string, jobLimiterChan chan struct{}, fvolume string, fsbucket string) { defer func() { <-jobLimiterChan @@ -436,7 +437,7 @@ func runXmlJob(typeId string, msg *dataTypes.KafkaPayload, outputCompression str } } -// NOSONAR +// This function intentionally has some patterns in logs for easier identification //NOSONAR func FetchToken() (*kafka.OAuthBearerToken, error) { log.Debug("Get token inline") conf := &clientcredentials.Config{ diff --git a/pm-file-converter/main.go b/pm-file-converter/main.go index 599a33b..38de97d 100644 --- a/pm-file-converter/main.go +++ b/pm-file-converter/main.go @@ -59,6 +59,8 @@ var writer_control = make(chan dataTypes.WriterControl, 1) const registration_delay_short = 2 const registration_delay_long = 120 +const failedMessageLabel = " - failed" + //== Variables ==// var AppState = Init @@ -155,7 +157,7 @@ func registerProducer() bool { if err != nil { log.Error("Cannot read config file: ", config_file) // NOSONAR - log.Error(registeringProducer, producer_instance_name, " - failed") + log.Error(registeringProducer, producer_instance_name, failedMessageLabel) return false } data := dataTypes.DataTypes{} @@ -163,7 +165,7 @@ func registerProducer() bool { if err != nil { log.Error("Cannot parse config file: ", config_file) // NOSONAR - log.Error(registeringProducer, producer_instance_name, " - failed") + log.Error(registeringProducer, producer_instance_name, failedMessageLabel) return false } var newTypeNames []string @@ -183,14 +185,14 @@ func registerProducer() bool { if err != nil { log.Error("Cannot create json for type: ", data.ProdDataTypes[i].ID) // NOSONAR - log.Error(registeringProducer, producer_instance_name, " - failed") + log.Error(registeringProducer, producer_instance_name, failedMessageLabel) return false } else { ok := utils.SendHttpRequest(json, http.MethodPut, "http://"+ics_server+"/data-producer/v1/info-types/"+data.ProdDataTypes[i].ID, true, creds_grant_type != "") if !ok { log.Error("Cannot register type: ", data.ProdDataTypes[i].ID) // NOSONAR - log.Error(registeringProducer, producer_instance_name, " - failed") + log.Error(registeringProducer, producer_instance_name, failedMessageLabel) return false } newTypeNames = append(newTypeNames, data.ProdDataTypes[i].ID) -- 2.16.6 From b7bbba33696d4f3e36a51710661152eda459eb74 Mon Sep 17 00:00:00 2001 From: ambrishest Date: Thu, 12 Oct 2023 12:33:27 +0100 Subject: [PATCH 14/16] Fixing Sonar Code Smell for PMConverter Issue-ID: NONRTRIC-879 Change-Id: I5720bdfaeb3760d7ce0b8bfdaff43ab6896cf052 Signed-off-by: ambrishest --- .../components/kafkacollector/kafkacollector.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pm-file-converter/components/kafkacollector/kafkacollector.go b/pm-file-converter/components/kafkacollector/kafkacollector.go index 418b312..a3c911e 100644 --- a/pm-file-converter/components/kafkacollector/kafkacollector.go +++ b/pm-file-converter/components/kafkacollector/kafkacollector.go @@ -18,7 +18,7 @@ // limitations under the License. // ========================LICENSE_END=================================== -//nolint:gocognit +//nolint:all package kafkacollector import ( @@ -49,7 +49,7 @@ const typeLabel = " for type: " const fetchTokenErrorMessage = "Cannot fetch token: " const setTokenErrorMessage = "Cannot set token: " -// This function intentionally has high cognitive complexity //NOSONAR +//nolint:all func StartTopicReader(topic string, typeId string, controlCh chan dataTypes.ReaderControl, dataCh chan *dataTypes.KafkaPayload, gid string, cid string) { log.Info("Topic reader starting, topic: ", topic, typeLabel, typeId) @@ -182,7 +182,7 @@ func StartTopicReader(topic string, typeId string, controlCh chan dataTypes.Read }() } -// This function intentionally has high cognitive complexity //NOSONAR +//nolint:all func StartTopicWriter(controlCh chan dataTypes.WriterControl, dataCh chan *dataTypes.KafkaPayload) { var kafkaProducer *kafka.Producer @@ -296,7 +296,7 @@ func StartTopicWriter(controlCh chan dataTypes.WriterControl, dataCh chan *dataT }() } -// We need to pass the kafka properties in this way for readability purpose //NOSONAR +//nolint:all func createKafkaConsumer(typeId string, gid string, cid string) *kafka.Consumer { var cm kafka.ConfigMap if creds_grant_type == "" { @@ -331,7 +331,7 @@ func createKafkaConsumer(typeId string, gid string, cid string) *kafka.Consumer return c } -// We need to pass the kafka properties in this way for readability purpose //NOSONAR +//nolint:all func startProducer() *kafka.Producer { log.Info("Creating kafka producer") @@ -358,6 +358,7 @@ func startProducer() *kafka.Producer { return p } +//nolint:all func StartJobXmlFileData(typeId string, controlCh chan dataTypes.JobControl, dataInCh chan *dataTypes.KafkaPayload, dataOutChannel chan *dataTypes.KafkaPayload, fvolume string, fsbucket string) { log.Info("Type job", typeId, " started") @@ -392,7 +393,7 @@ func StartJobXmlFileData(typeId string, controlCh chan dataTypes.JobControl, dat } } -// This function intentionally has more parameters for legacy compatibility //NOSONAR +//nolint:all func runXmlJob(typeId string, msg *dataTypes.KafkaPayload, outputCompression string, dataOutChannel chan *dataTypes.KafkaPayload, topicList map[string]string, jobLimiterChan chan struct{}, fvolume string, fsbucket string) { defer func() { <-jobLimiterChan @@ -437,7 +438,7 @@ func runXmlJob(typeId string, msg *dataTypes.KafkaPayload, outputCompression str } } -// This function intentionally has some patterns in logs for easier identification //NOSONAR +//nolint:all func FetchToken() (*kafka.OAuthBearerToken, error) { log.Debug("Get token inline") conf := &clientcredentials.Config{ -- 2.16.6 From b0884717d5524c69abb69f6267e78ac4cd132910 Mon Sep 17 00:00:00 2001 From: rohithrajneesh Date: Thu, 23 Nov 2023 13:01:28 +0000 Subject: [PATCH 15/16] Changing the image location pointing to release repo ISSUE-ID: NONRTRIC-888 Change-Id: I7cdd0827ad9781b9bed080e6b9c3084fa25a3375 Signed-off-by: rohithrajneesh --- install/helm/nrt-pm-log/templates/app-statefulset.yaml | 4 ++-- install/helm/nrt-pm/charts/dfc/templates/app-statefulset.yaml | 4 ++-- install/helm/nrt-pm/charts/ics/templates/app-deployment.yaml | 2 +- .../kafka-producer-pm-json2influx/templates/app-statefulset.yaml | 2 +- .../kafka-producer-pm-json2kafka/templates/app-statefulset.yaml | 2 +- .../charts/kafka-producer-pm-xml2json/templates/app-statefulset.yaml | 2 +- .../charts/pm-producer-json2kafka/templates/app-statefulset.yaml | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/install/helm/nrt-pm-log/templates/app-statefulset.yaml b/install/helm/nrt-pm-log/templates/app-statefulset.yaml index cc3a874..19107b8 100644 --- a/install/helm/nrt-pm-log/templates/app-statefulset.yaml +++ b/install/helm/nrt-pm-log/templates/app-statefulset.yaml @@ -45,7 +45,7 @@ spec: emptyDir: {} containers: - name: auth-token - image: nexus3.o-ran-sc.org:10001/o-ran-sc/nonrtric-plt-auth-token-fetch:1.1.1 + image: nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-plt-auth-token-fetch:1.1.1 imagePullPolicy: Always env: - name: CREDS_GRANT_TYPE @@ -62,7 +62,7 @@ spec: - mountPath: /token-cache name: token-cache-volume - name: pmlog - image: nexus3.o-ran-sc.org:10001/o-ran-sc/nonrtric-plt-pmlog:1.0.0 + image: nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-plt-pmlog:1.0.0 imagePullPolicy: Always command: - sh diff --git a/install/helm/nrt-pm/charts/dfc/templates/app-statefulset.yaml b/install/helm/nrt-pm/charts/dfc/templates/app-statefulset.yaml index a2d02f6..e6883de 100644 --- a/install/helm/nrt-pm/charts/dfc/templates/app-statefulset.yaml +++ b/install/helm/nrt-pm/charts/dfc/templates/app-statefulset.yaml @@ -46,7 +46,7 @@ spec: - name: dfc securityContext: runAsUser: 0 # Need to run as root - needed when writing to hostpath - image: nexus3.o-ran-sc.org:10001/o-ran-sc/nonrtric-plt-ranpm-datafilecollector:1.0.0 + image: nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-plt-ranpm-datafilecollector:1.0.0 imagePullPolicy: Always ports: - name: http @@ -72,7 +72,7 @@ spec: - name: APP_KAFKA_CLIENT-ID value: "datafile-collector.$(APPNS).$(APPID)" - name: auth-token - image: nexus3.o-ran-sc.org:10001/o-ran-sc/nonrtric-plt-auth-token-fetch:1.1.1 + image: nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-plt-auth-token-fetch:1.1.1 imagePullPolicy: Always env: - name: CREDS_GRANT_TYPE diff --git a/install/helm/nrt-pm/charts/ics/templates/app-deployment.yaml b/install/helm/nrt-pm/charts/ics/templates/app-deployment.yaml index 269bbcf..f32d62f 100644 --- a/install/helm/nrt-pm/charts/ics/templates/app-deployment.yaml +++ b/install/helm/nrt-pm/charts/ics/templates/app-deployment.yaml @@ -34,7 +34,7 @@ spec: spec: containers: - name: informationservice - image: nexus3.o-ran-sc.org:10001/o-ran-sc/nonrtric-plt-informationcoordinatorservice:1.5.0 + image: nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-plt-informationcoordinatorservice:1.5.0 imagePullPolicy: Always ports: - name: http diff --git a/install/helm/nrt-pm/charts/kafka-producer-pm-json2influx/templates/app-statefulset.yaml b/install/helm/nrt-pm/charts/kafka-producer-pm-json2influx/templates/app-statefulset.yaml index fe01f56..e679704 100644 --- a/install/helm/nrt-pm/charts/kafka-producer-pm-json2influx/templates/app-statefulset.yaml +++ b/install/helm/nrt-pm/charts/kafka-producer-pm-json2influx/templates/app-statefulset.yaml @@ -38,7 +38,7 @@ spec: spec: containers: - name: kafka-producer-pm-json2influx - image: nexus3.o-ran-sc.org:10001/o-ran-sc/nonrtric-plt-ranpm-pm-file-converter:1.0.1 + image: nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-plt-ranpm-pm-file-converter:1.0.1 imagePullPolicy: Always ports: - name: http diff --git a/install/helm/nrt-pm/charts/kafka-producer-pm-json2kafka/templates/app-statefulset.yaml b/install/helm/nrt-pm/charts/kafka-producer-pm-json2kafka/templates/app-statefulset.yaml index d0354b9..c1c8ef8 100644 --- a/install/helm/nrt-pm/charts/kafka-producer-pm-json2kafka/templates/app-statefulset.yaml +++ b/install/helm/nrt-pm/charts/kafka-producer-pm-json2kafka/templates/app-statefulset.yaml @@ -38,7 +38,7 @@ spec: spec: containers: - name: kafka-producer-pm-json2kafka - image: nexus3.o-ran-sc.org:10001/o-ran-sc/nonrtric-plt-ranpm-pm-file-converter:1.0.1 + image: nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-plt-ranpm-pm-file-converter:1.0.1 imagePullPolicy: Always ports: - name: http diff --git a/install/helm/nrt-pm/charts/kafka-producer-pm-xml2json/templates/app-statefulset.yaml b/install/helm/nrt-pm/charts/kafka-producer-pm-xml2json/templates/app-statefulset.yaml index 4a1e17e..4e673cd 100644 --- a/install/helm/nrt-pm/charts/kafka-producer-pm-xml2json/templates/app-statefulset.yaml +++ b/install/helm/nrt-pm/charts/kafka-producer-pm-xml2json/templates/app-statefulset.yaml @@ -38,7 +38,7 @@ spec: spec: containers: - name: kafka-producer-pm-xml2json - image: nexus3.o-ran-sc.org:10001/o-ran-sc/nonrtric-plt-ranpm-pm-file-converter:1.0.1 + image: nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-plt-ranpm-pm-file-converter:1.0.1 imagePullPolicy: Always ports: - name: http diff --git a/install/helm/nrt-pm/charts/pm-producer-json2kafka/templates/app-statefulset.yaml b/install/helm/nrt-pm/charts/pm-producer-json2kafka/templates/app-statefulset.yaml index c906f17..297ca66 100644 --- a/install/helm/nrt-pm/charts/pm-producer-json2kafka/templates/app-statefulset.yaml +++ b/install/helm/nrt-pm/charts/pm-producer-json2kafka/templates/app-statefulset.yaml @@ -36,7 +36,7 @@ spec: spec: containers: - name: pm-producer-json2kafka - image: nexus3.o-ran-sc.org:10001/o-ran-sc/nonrtric-plt-pmproducer:1.0.1 + image: nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-plt-pmproducer:1.0.1 imagePullPolicy: Always ports: - name: http @@ -63,7 +63,7 @@ spec: - mountPath: /token-cache name: token-cache-volume - name: auth-token - image: nexus3.o-ran-sc.org:10001/o-ran-sc/nonrtric-plt-auth-token-fetch:1.1.1 + image: nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-plt-auth-token-fetch:1.1.1 imagePullPolicy: Always env: - name: CREDS_GRANT_TYPE -- 2.16.6 From c6e2de2842d688e9086f01aff56b786369273ad5 Mon Sep 17 00:00:00 2001 From: JohnKeeney Date: Wed, 13 Dec 2023 19:15:47 +0000 Subject: [PATCH 16/16] Update to Springboot & other 3PPs Change-Id: I07b87a74fcdf355de4cbb65f5315858d6b7ca855 Signed-off-by: JohnKeeney Issue-ID: NONRTRIC-825 --- datafilecollector/pom.xml | 8 ++++++-- influxlogger/pom.xml | 9 +++++---- pm-file-converter/main.go | 8 +++++--- pmproducer/pom.xml | 13 +++++++++---- 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/datafilecollector/pom.xml b/datafilecollector/pom.xml index 165dd39..5a56a72 100644 --- a/datafilecollector/pom.xml +++ b/datafilecollector/pom.xml @@ -1,7 +1,8 @@