From 2c6c06ebb4e672ffa74690dc2fc35554011d4e28 Mon Sep 17 00:00:00 2001 From: "raviteja.karumuri" Date: Mon, 27 May 2024 10:58:44 +0100 Subject: [PATCH] Test FTC100 fails since A1-SIM update Issue-ID: NONRTRIC-1002 Change-Id: I40245a273b4af57599c91899166ea092b3ec4330 Signed-off-by: Raviteja Karumuri --- test/auto-test/FTC100.sh | 16 +++++++++++++--- test/auto-test/FTC150.sh | 2 +- test/auto-test/FTC2002.sh | 2 +- test/auto-test/ONAP_UC.sh | 12 +++++++++--- test/auto-test/verify-jobs-nonrtric.sh | 7 ++++++- test/common/a1pms_api_functions.sh | 17 ++++++++++++----- test/common/sdnc_api_functions.sh | 2 +- 7 files changed, 43 insertions(+), 15 deletions(-) diff --git a/test/auto-test/FTC100.sh b/test/auto-test/FTC100.sh index a4733387..04ff8d22 100755 --- a/test/auto-test/FTC100.sh +++ b/test/auto-test/FTC100.sh @@ -492,10 +492,20 @@ for __httpx in $TESTED_PROTOCOLS ; do a1pms_api_get_policy_status 404 1 a1pms_api_get_policy_status 404 2 - VAL='NOT IN EFFECT' - a1pms_api_get_policy_status 200 5000 OSC "$VAL" "false" + if [[ $TEST_ENV_PROFILE =~ ^ORAN-[A-H] ]] || [[ $TEST_ENV_PROFILE =~ ^ONAP-[A-L] ]]; then + VAL='NOT IN EFFECT' + VAL2="false" + VAL3=EMPTY + VAL4=EMPTY + else + VAL="NOT_ENFORCED" + VAL2="OTHER_REASON" + VAL3="NOT_ENFORCED" + VAL4="OTHER_REASON" + fi + a1pms_api_get_policy_status 200 5000 OSC "$VAL" "$VAL2" a1pms_api_get_policy_status 200 5100 STD "UNDEFINED" - a1pms_api_get_policy_status 200 5200 STD2 EMPTY EMPTY + a1pms_api_get_policy_status 200 5200 STD2 $VAL3 $VAL4 deviation "TR10 - a1pms allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx" diff --git a/test/auto-test/FTC150.sh b/test/auto-test/FTC150.sh index 2ce07505..103d74c7 100755 --- a/test/auto-test/FTC150.sh +++ b/test/auto-test/FTC150.sh @@ -128,7 +128,7 @@ for __nb_httpx in $NB_TESTED_PROTOCOLS ; do controller_api_get_A1_policy_status 200 OSC ricsim_g1_1 1 4000 controller_api_get_A1_policy_status 200 STD ricsim_g2_1 5000 - if [[ $TEST_ENV_PROFILE =~ ^ORAN-[A-I] ]] || [[ $TEST_ENV_PROFILE =~ ^ONAP-[A-M] ]]; then + if [[ $TEST_ENV_PROFILE =~ ^ORAN-[A-H] ]] || [[ $TEST_ENV_PROFILE =~ ^ONAP-[A-L] ]]; then VAL='NOT IN EFFECT' VAL2="false" else diff --git a/test/auto-test/FTC2002.sh b/test/auto-test/FTC2002.sh index e34b56cb..c8d3f6e7 100755 --- a/test/auto-test/FTC2002.sh +++ b/test/auto-test/FTC2002.sh @@ -143,7 +143,7 @@ for __nb_httpx in $NB_TESTED_PROTOCOLS ; do controller_api_get_A1_policy_status 200 OSC ricsim_g1_1 1 4000 controller_api_get_A1_policy_status 200 STD ricsim_g2_1 5000 - if [[ $TEST_ENV_PROFILE =~ ^ORAN-[A-I]$ || $TEST_ENV_PROFILE =~ ^ONAP-[A-M]$ ]]; then + if [[ $TEST_ENV_PROFILE =~ ^ORAN-[A-H]$ || $TEST_ENV_PROFILE =~ ^ONAP-[A-L]$ ]]; then VAL='NOT IN EFFECT' VAL2="false" else diff --git a/test/auto-test/ONAP_UC.sh b/test/auto-test/ONAP_UC.sh index 6c699d12..3dc724d9 100755 --- a/test/auto-test/ONAP_UC.sh +++ b/test/auto-test/ONAP_UC.sh @@ -283,11 +283,17 @@ for interface in $TESTED_VARIANTS ; do done # Check status OSC - VAL='NOT IN EFFECT' + if [[ $TEST_ENV_PROFILE =~ ^ORAN-[A-H] ]] || [[ $TEST_ENV_PROFILE =~ ^ONAP-[A-L] ]]; then + VAL='NOT IN EFFECT' + VAL2="false" + else + VAL='NOT_ENFORCED' + VAL2="OTHER_REASON" + fi for ((i=1; i<=$OSC_NUM_RICS; i++)) do - a1pms_api_get_policy_status 200 $((3000+$i)) OSC "$VAL" "false" - a1pms_api_get_policy_status 200 $((4000+$i)) OSC "$VAL" "false" + a1pms_api_get_policy_status 200 $((3000+$i)) OSC "$VAL" "$VAL2" + a1pms_api_get_policy_status 200 $((4000+$i)) OSC "$VAL" "$VAL2" done # Note: Status callback is not tested since this callback (http POST) is made from the diff --git a/test/auto-test/verify-jobs-nonrtric.sh b/test/auto-test/verify-jobs-nonrtric.sh index 625eff41..e93e1a70 100644 --- a/test/auto-test/verify-jobs-nonrtric.sh +++ b/test/auto-test/verify-jobs-nonrtric.sh @@ -21,6 +21,11 @@ TEST_DIRECTORY="test/auto-test" TEST_SCRIPT="./Suite-Verify-jobs.sh" DOCKER_COMPOSE_VERSION="v2.21.0" +PULL_IMAGE_TYPE="remote-remove" +RUN_MODE="docker" +IMAGE_VERSION="release" +ENV_FLAG="--env-file" +ENV_FILE="../common/test_env-oran-h-release.sh" # Check if jq is installed, and install it if not if ! command -v jq &> /dev/null; then @@ -50,7 +55,7 @@ fi cd "$TEST_DIRECTORY" sudo chmod 775 "$TEST_SCRIPT" -"$TEST_SCRIPT" remote-remove docker release --env-file ../common/test_env-oran-h-release.sh +"$TEST_SCRIPT" $PULL_IMAGE_TYPE $RUN_MODE $IMAGE_VERSION $ENV_FLAG $ENV_FILE exit_val=$? # Remove docker-compose after tests are done diff --git a/test/common/a1pms_api_functions.sh b/test/common/a1pms_api_functions.sh index b80bb25e..a0062ac1 100644 --- a/test/common/a1pms_api_functions.sh +++ b/test/common/a1pms_api_functions.sh @@ -1830,11 +1830,18 @@ a1pms_api_get_policy_status() { fi targetJson=$targetJson"}" elif [ "$3" == "OSC" ]; then - targetJson="{\"instance_status\":\"$4\"" - if [ $# -eq 5 ]; then - targetJson=$targetJson",\"has_been_deleted\":\"$5\"" - fi - targetJson=$targetJson",\"created_at\":\"????\"}" + if [[ $TEST_ENV_PROFILE =~ ^ORAN-[A-H] ]] || [[ $TEST_ENV_PROFILE =~ ^ONAP-[A-L] ]]; then + targetJson="{\"instance_status\":\"$4\"" + if [ $# -eq 5 ]; then + targetJson=$targetJson",\"has_been_deleted\":\"$5\"" + fi + targetJson=$targetJson",\"created_at\":\"????\"}" + else + targetJson="{\"enforceStatus\":\"$4\"" + if [ $# -eq 5 ]; then + targetJson=$targetJson",\"enforceReason\":\"$5\"}" + fi + fi else __print_err " (STD [])|(OSC )" $@ return 1 diff --git a/test/common/sdnc_api_functions.sh b/test/common/sdnc_api_functions.sh index eb80d400..a18afe39 100644 --- a/test/common/sdnc_api_functions.sh +++ b/test/common/sdnc_api_functions.sh @@ -588,7 +588,7 @@ controller_api_get_A1_policy_status() { if [ $# -ge 5 ] && [ $2 == "OSC" ]; then url="$ric_id/a1-p/policytypes/$4/policies/$UUID$5/status" if [ $# -gt 5 ]; then - if [[ $TEST_ENV_PROFILE =~ ^ORAN-[A-I] ]] || [[ $TEST_ENV_PROFILE =~ ^ONAP-[A-M] ]]; then + if [[ $TEST_ENV_PROFILE =~ ^ORAN-[A-H] ]] || [[ $TEST_ENV_PROFILE =~ ^ONAP-[A-L] ]]; then targetJson="{\"instance_status\":\"$6\"" targetJson=$targetJson",\"has_been_deleted\":\"$7\"" targetJson=$targetJson",\"created_at\":\"????\"}" -- 2.16.6