From ce4b14cdfcd3a2e131c7364776452a67ee858f72 Mon Sep 17 00:00:00 2001 From: BjornMagnussonXA Date: Tue, 11 May 2021 15:40:03 +0200 Subject: [PATCH] Updated tests for changed ECS NBI Issue-ID: NONRTRIC-513 Signed-off-by: BjornMagnussonXA Change-Id: Ia39d650a8f549be200cfcd3dff4bec58d74cb2ca --- test/auto-test/FTC1100.sh | 100 ++++++++++++----- test/auto-test/FTC1800.sh | 79 +++++++++---- test/auto-test/FTC2001.sh | 19 +++- test/auto-test/FTC_HELM_RECIPE_D_RELEASE.sh | 6 +- test/auto-test/PM_EI_DEMO.sh | 17 ++- test/common/README.md | 167 ++++++++++++++++++++++++++-- test/common/ecs_api_functions.sh | 141 +++++++++++++++++------ test/common/prodstub_api_functions.sh | 26 +++++ test/prodstub/app/prodstub.py | 21 +++- test/simulator-group/ngw/application.yaml | 4 + 10 files changed, 482 insertions(+), 98 deletions(-) diff --git a/test/auto-test/FTC1100.sh b/test/auto-test/FTC1100.sh index c5f23540..c2104172 100755 --- a/test/auto-test/FTC1100.sh +++ b/test/auto-test/FTC1100.sh @@ -267,8 +267,6 @@ else ecs_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 ecs_api_edp_put_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 - - ecs_api_edp_delete_type_2 406 type1 fi @@ -332,7 +330,11 @@ fi if [ $ECS_VERSION == "V1-1" ]; then prodstub_check_jobdata 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json else - prodstub_check_jobdata_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json + if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then + prodstub_check_jobdata_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json + else + prodstub_check_jobdata_3 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json + fi fi ecs_api_a1_get_job_ids 200 type1 NOWNER job1 @@ -372,7 +374,11 @@ fi if [ $ECS_VERSION == "V1-1" ]; then prodstub_check_jobdata 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json else - prodstub_check_jobdata_2 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json + if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then + prodstub_check_jobdata_2 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json + else + prodstub_check_jobdata_3 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json + fi fi ecs_api_a1_get_job_ids 200 type1 NOWNER job1 job2 ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1 @@ -456,7 +462,11 @@ prodstub_equal create/prod-b/job3 1 if [ $ECS_VERSION == "V1-1" ]; then prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json else - prodstub_check_jobdata_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json + if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then + prodstub_check_jobdata_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json + else + prodstub_check_jobdata_3 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json + fi fi ecs_api_a1_get_job_ids 200 type1 NOWNER job1 job2 @@ -580,7 +590,11 @@ fi if [ $ECS_VERSION == "V1-1" ]; then prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json else - prodstub_check_jobdata_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json + if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then + prodstub_check_jobdata_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json + else + prodstub_check_jobdata_3 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json + fi fi ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 @@ -641,7 +655,11 @@ cr_api_check_all_ecs_events 200 job3-status ENABLED if [ $ECS_VERSION == "V1-1" ]; then prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json else - prodstub_check_jobdata_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json + if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then + prodstub_check_jobdata_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json + else + prodstub_check_jobdata_3 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json + fi fi ## Setup prod-d @@ -663,7 +681,11 @@ fi if [ $ECS_VERSION == "V1-1" ]; then prodstub_check_jobdata 200 prod-d job8 type4 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json else - prodstub_check_jobdata_2 200 prod-d job8 type4 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json + if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then + prodstub_check_jobdata_2 200 prod-d job8 type4 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json + else + prodstub_check_jobdata_3 200 prod-d job8 type4 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json + fi fi prodstub_equal create/prod-d/job8 1 @@ -757,7 +779,11 @@ fi if [ $ECS_VERSION == "V1-1" ]; then prodstub_check_jobdata 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json else - prodstub_check_jobdata_2 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json + if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then + prodstub_check_jobdata_2 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json + else + prodstub_check_jobdata_3 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json + fi fi prodstub_equal create/prod-e/job10 1 @@ -784,7 +810,11 @@ ecs_api_a1_get_job_ids 200 type6 NOWNER job10 if [ $ECS_VERSION == "V1-1" ]; then prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json else - prodstub_check_jobdata_2 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json + if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then + prodstub_check_jobdata_2 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json + else + prodstub_check_jobdata_3 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json + fi fi prodstub_equal create/prod-f/job10 1 @@ -914,7 +944,11 @@ else fi # Wait for producer prod-a to be removed -ecs_equal json:ei-producer/v1/eiproducers 5 1000 +if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then + ecs_equal json:data-producer/v1/info-producers 5 1000 +else + ecs_equal json:ei-producer/v1/eiproducers 5 1000 +fi if [ $ECS_VERSION == "V1-1" ]; then ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f @@ -1011,14 +1045,22 @@ sleep_wait 120 if [ $ECS_VERSION == "V1-1" ]; then prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json else - prodstub_check_jobdata_2 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json + if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then + prodstub_check_jobdata_2 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json + else + prodstub_check_jobdata_3 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json + fi fi prodstub_arm_producer 200 prod-f 400 ecs_api_edp_get_producer_status 200 prod-f DISABLED 360 -ecs_equal json:ei-producer/v1/eiproducers 4 1000 +if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then + ecs_equal json:data-producer/v1/info-producers 4 1000 +else + ecs_equal json:ei-producer/v1/eiproducers 4 1000 +fi if [ $ECS_VERSION == "V1-1" ]; then ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e @@ -1209,7 +1251,7 @@ ecs_api_edp_get_producer_jobs_2 200 prod-ia EMPTY ecs_api_idc_put_job 201 job101 type101 $TARGET101 info-owner-1 $INFOSTATUS101 testdata/ecs/job-template.json VALIDATE # Check the job data in the producer -prodstub_check_jobdata_2 200 prod-ia job101 type101 $TARGET101 info-owner-1 testdata/ecs/job-template.json +prodstub_check_jobdata_3 200 prod-ia job101 type101 $TARGET101 info-owner-1 testdata/ecs/job-template.json ecs_api_idc_get_job_ids 200 type101 NOWNER job101 ecs_api_idc_get_job_ids 200 type101 info-owner-1 job101 @@ -1229,7 +1271,7 @@ ecs_api_edp_get_producer_jobs_2 200 prod-ia job101 type101 $TARGET101 info-owner ecs_api_idc_put_job 201 job102 type101 $TARGET102 info-owner-2 $INFOSTATUS102 testdata/ecs/job-template.json VALIDATE # Check the job data in the producer -prodstub_check_jobdata_2 200 prod-ia job102 type101 $TARGET102 info-owner-2 testdata/ecs/job-template.json +prodstub_check_jobdata_3 200 prod-ia job102 type101 $TARGET102 info-owner-2 testdata/ecs/job-template.json ecs_api_idc_get_job_ids 200 type101 NOWNER job101 job102 ecs_api_idc_get_job_ids 200 type101 info-owner-1 job101 ecs_api_idc_get_job_ids 200 type101 info-owner-2 job102 @@ -1273,7 +1315,7 @@ ecs_api_idc_put_job 201 job103 type102 $TARGET103 info-owner-3 $INFOSTATUS103 te prodstub_equal create/prod-ib/job103 1 # Check the job data in the producer -prodstub_check_jobdata_2 200 prod-ib job103 type102 $TARGET103 info-owner-3 testdata/ecs/job-template.json +prodstub_check_jobdata_3 200 prod-ib job103 type102 $TARGET103 info-owner-3 testdata/ecs/job-template.json ecs_api_idc_get_job_ids 200 type101 NOWNER job101 job102 ecs_api_idc_get_job_ids 200 type102 NOWNER job103 @@ -1331,7 +1373,7 @@ ecs_api_edp_get_producer_status 200 prod-ib ENABLED ecs_api_idc_put_job 200 job103 type102 $TARGET103 info-owner-3 $INFOSTATUS103 testdata/ecs/job-template2.json VALIDATE ecs_api_idc_get_job_status 200 job103 ENABLED -prodstub_check_jobdata_2 200 prod-ib job103 type102 $TARGET103 info-owner-3 testdata/ecs/job-template2.json +prodstub_check_jobdata_3 200 prod-ib job103 type102 $TARGET103 info-owner-3 testdata/ecs/job-template2.json ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job1 job2 job3 job8 job10 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-ic prod-b prod-c prod-d prod-e @@ -1364,7 +1406,7 @@ cr_equal received_callbacks 8 30 cr_equal received_callbacks?id=info-job103-status 2 cr_api_check_all_ecs_events 200 info-job103-status ENABLED -prodstub_check_jobdata_2 200 prod-ib job103 type102 $TARGET103 info-owner-3 testdata/ecs/job-template2.json +prodstub_check_jobdata_3 200 prod-ib job103 type102 $TARGET103 info-owner-3 testdata/ecs/job-template2.json ## Setup prod-id ecs_api_edp_put_type_2 201 type104 testdata/ecs/info-type-4.json @@ -1374,7 +1416,7 @@ ecs_api_idc_get_job_ids 200 type104 NOWNER EMPTY ecs_api_idc_put_job 201 job108 type104 $TARGET108 info-owner-4 $INFOSTATUS108 testdata/ecs/job-template.json VALIDATE -prodstub_check_jobdata_2 200 prod-id job108 type104 $TARGET108 info-owner-4 testdata/ecs/job-template.json +prodstub_check_jobdata_3 200 prod-id job108 type104 $TARGET108 info-owner-4 testdata/ecs/job-template.json prodstub_equal create/prod-id/job108 1 prodstub_equal delete/prod-id/job108 0 @@ -1428,7 +1470,7 @@ ecs_api_idc_get_job_ids 200 type106 NOWNER EMPTY ecs_api_idc_put_job 201 job110 type106 $TARGET110 info-owner-4 $INFOSTATUS110 testdata/ecs/job-template.json VALIDATE -prodstub_check_jobdata_2 200 prod-ie job110 type106 $TARGET110 info-owner-4 testdata/ecs/job-template.json +prodstub_check_jobdata_3 200 prod-ie job110 type106 $TARGET110 info-owner-4 testdata/ecs/job-template.json prodstub_equal create/prod-ie/job110 1 prodstub_equal delete/prod-ie/job110 0 @@ -1443,7 +1485,7 @@ ecs_api_edp_put_producer_2 201 prod-if $CB_JOB/prod-if $CB_SV/prod-if type106 ecs_api_idc_get_job_ids 200 type106 NOWNER job110 -prodstub_check_jobdata_2 200 prod-if job110 type106 $TARGET110 info-owner-4 testdata/ecs/job-template.json +prodstub_check_jobdata_3 200 prod-if job110 type106 $TARGET110 info-owner-4 testdata/ecs/job-template.json prodstub_equal create/prod-if/job110 1 prodstub_equal delete/prod-if/job110 0 @@ -1528,7 +1570,11 @@ ecs_api_idc_get_job_status 200 job108 ENABLED ecs_api_idc_get_job_status 200 job110 ENABLED # Wait for producer prod-ia to be removed -ecs_equal json:ei-producer/v1/eiproducers 9 1000 +if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then + ecs_equal json:data-producer/v1/info-producers 9 1000 +else + ecs_equal json:ei-producer/v1/eiproducers 9 1000 +fi ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ib prod-ic prod-id prod-ie prod-if prod-b prod-c prod-d prod-e @@ -1590,13 +1636,17 @@ ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ib prod-ic prod-id prod-ie prod-i #Wait for job to be updated sleep_wait 120 -prodstub_check_jobdata_2 200 prod-if job110 type106 $TARGET110 info-owner-4 testdata/ecs/job-template2.json +prodstub_check_jobdata_3 200 prod-if job110 type106 $TARGET110 info-owner-4 testdata/ecs/job-template2.json prodstub_arm_producer 200 prod-if 400 ecs_api_edp_get_producer_status 200 prod-if DISABLED 360 -ecs_equal json:ei-producer/v1/eiproducers 8 1000 +if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then + ecs_equal json:data-producer/v1/info-producers 8 1000 +else + ecs_equal json:ei-producer/v1/eiproducers 8 1000 +fi ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ib prod-ic prod-id prod-ie prod-b prod-c prod-d prod-e @@ -1650,7 +1700,7 @@ ecs_api_idc_put_job 404 job150 type150 $TARGET150 info-owner-1 $INFOSTATUS150 te ecs_api_idc_get_job_status 404 job150 ecs_api_idc_get_job_status 200 job160 ENABLED 60 -prodstub_check_jobdata_2 200 prod-ig job160 type160 $TARGET160 info-owner-1 testdata/ecs/job-template.json +prodstub_check_jobdata_3 200 prod-ig job160 type160 $TARGET160 info-owner-1 testdata/ecs/job-template.json prodstub_equal create/prod-ig/job160 1 prodstub_equal delete/prod-ig/job160 0 diff --git a/test/auto-test/FTC1800.sh b/test/auto-test/FTC1800.sh index 3b2b0da8..fd50bc9b 100755 --- a/test/auto-test/FTC1800.sh +++ b/test/auto-test/FTC1800.sh @@ -83,6 +83,12 @@ TARGET="http://localhost:80/target" # Dummy target NUM_JOBS=10000 +use_info_jobs=false #Set flag if interface supporting info-types is used +if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then + use_info_jobs=true + NUM_JOBS=5000 # 5K ei jobs and 5K info jobs +fi + # Setup prodstub sim to accept calls for producers, types and jobs prodstub_arm_producer 200 prod-a prodstub_arm_producer 200 prod-b @@ -208,7 +214,11 @@ else fi fi -ecs_equal json:ei-producer/v1/eiproducers 4 +if [ $use_info_jobs ]; then + ecs_equal json:data-producer/v1/info-producers 4 +else + ecs_equal json:ei-producer/v1/eiproducers 4 +fi ecs_api_edp_get_producer_status 200 prod-a ENABLED ecs_api_edp_get_producer_status 200 prod-b ENABLED @@ -436,7 +446,11 @@ else fi -ecs_equal json:ei-producer/v1/eiproducers 4 +if [ $use_info_jobs ]; then + ecs_equal json:data-producer/v1/info-producers 4 +else + ecs_equal json:ei-producer/v1/eiproducers 4 +fi ecs_api_edp_get_producer_status 200 prod-a ENABLED ecs_api_edp_get_producer_status 200 prod-b ENABLED @@ -528,14 +542,20 @@ do prodstub_check_jobdata 200 prod-b job$i type1 $TARGET ric1 testdata/ecs/job-template.json prodstub_check_jobdata 200 prod-c job$i type1 $TARGET ric1 testdata/ecs/job-template.json else - prodstub_check_jobdata_2 200 prod-a job$i type1 $TARGET ric1 testdata/ecs/job-template.json - prodstub_check_jobdata_2 200 prod-b job$i type1 $TARGET ric1 testdata/ecs/job-template.json - prodstub_check_jobdata_2 200 prod-c job$i type1 $TARGET ric1 testdata/ecs/job-template.json + if [ $use_info_jobs ]; then + prodstub_check_jobdata_3 200 prod-a job$i type1 $TARGET ric1 testdata/ecs/job-template.json + prodstub_check_jobdata_3 200 prod-b job$i type1 $TARGET ric1 testdata/ecs/job-template.json + prodstub_check_jobdata_3 200 prod-c job$i type1 $TARGET ric1 testdata/ecs/job-template.json + else + prodstub_check_jobdata_2 200 prod-a job$i type1 $TARGET ric1 testdata/ecs/job-template.json + prodstub_check_jobdata_2 200 prod-b job$i type1 $TARGET ric1 testdata/ecs/job-template.json + prodstub_check_jobdata_2 200 prod-c job$i type1 $TARGET ric1 testdata/ecs/job-template.json + fi fi if [ $use_info_jobs ]; then - prodstub_check_jobdata_2 200 prod-a job$(($i+$NUM_JOBS)) type101 $TARGET info-owner testdata/ecs/job-template.json - prodstub_check_jobdata_2 200 prod-b job$(($i+$NUM_JOBS)) type101 $TARGET info-owner testdata/ecs/job-template.json - prodstub_check_jobdata_2 200 prod-c job$(($i+$NUM_JOBS)) type101 $TARGET info-owner testdata/ecs/job-template.json + prodstub_check_jobdata_3 200 prod-a job$(($i+$NUM_JOBS)) type101 $TARGET info-owner testdata/ecs/job-template.json + prodstub_check_jobdata_3 200 prod-b job$(($i+$NUM_JOBS)) type101 $TARGET info-owner testdata/ecs/job-template.json + prodstub_check_jobdata_3 200 prod-c job$(($i+$NUM_JOBS)) type101 $TARGET info-owner testdata/ecs/job-template.json fi fi @@ -544,42 +564,59 @@ do prodstub_check_jobdata 200 prod-b job$i type2 $TARGET ric1 testdata/ecs/job-template.json prodstub_check_jobdata 200 prod-c job$i type2 $TARGET ric1 testdata/ecs/job-template.json else - prodstub_check_jobdata_2 200 prod-b job$i type2 $TARGET ric1 testdata/ecs/job-template.json - prodstub_check_jobdata_2 200 prod-c job$i type2 $TARGET ric1 testdata/ecs/job-template.json + if [ $use_info_jobs ]; then + prodstub_check_jobdata_3 200 prod-b job$i type2 $TARGET ric1 testdata/ecs/job-template.json + prodstub_check_jobdata_3 200 prod-c job$i type2 $TARGET ric1 testdata/ecs/job-template.json + else + prodstub_check_jobdata_2 200 prod-b job$i type2 $TARGET ric1 testdata/ecs/job-template.json + prodstub_check_jobdata_2 200 prod-c job$i type2 $TARGET ric1 testdata/ecs/job-template.json + fi fi if [ $use_info_jobs ]; then - prodstub_check_jobdata_2 200 prod-b job$(($i+$NUM_JOBS)) type102 $TARGET info-owner testdata/ecs/job-template.json - prodstub_check_jobdata_2 200 prod-c job$(($i+$NUM_JOBS)) type102 $TARGET info-owner testdata/ecs/job-template.json + prodstub_check_jobdata_3 200 prod-b job$(($i+$NUM_JOBS)) type102 $TARGET info-owner testdata/ecs/job-template.json + prodstub_check_jobdata_3 200 prod-c job$(($i+$NUM_JOBS)) type102 $TARGET info-owner testdata/ecs/job-template.json fi fi if [ $(($i%5)) -eq 2 ]; then if [ $ECS_VERSION == "V1-1" ]; then prodstub_check_jobdata 200 prod-c job$i type3 $TARGET ric1 testdata/ecs/job-template.json else - prodstub_check_jobdata_2 200 prod-c job$i type3 $TARGET ric1 testdata/ecs/job-template.json + if [ $use_info_jobs ]; then + prodstub_check_jobdata_3 200 prod-c job$i type3 $TARGET ric1 testdata/ecs/job-template.json + else + prodstub_check_jobdata_2 200 prod-c job$i type3 $TARGET ric1 testdata/ecs/job-template.json + fi fi if [ $use_info_jobs ]; then - prodstub_check_jobdata_2 200 prod-c job$(($i+$NUM_JOBS)) type103 $TARGET info-owner testdata/ecs/job-template.json + prodstub_check_jobdata_3 200 prod-c job$(($i+$NUM_JOBS)) type103 $TARGET info-owner testdata/ecs/job-template.json fi fi if [ $(($i%5)) -eq 3 ]; then if [ $ECS_VERSION == "V1-1" ]; then prodstub_check_jobdata 200 prod-d job$i type4 $TARGET ric1 testdata/ecs/job-template.json else - prodstub_check_jobdata_2 200 prod-d job$i type4 $TARGET ric1 testdata/ecs/job-template.json + if [ $use_info_jobs ]; then + prodstub_check_jobdata_3 200 prod-d job$i type4 $TARGET ric1 testdata/ecs/job-template.json + else + prodstub_check_jobdata_2 200 prod-d job$i type4 $TARGET ric1 testdata/ecs/job-template.json + fi fi if [ $use_info_jobs ]; then - prodstub_check_jobdata_2 200 prod-d job$(($i+$NUM_JOBS)) type104 $TARGET info-owner testdata/ecs/job-template.json + prodstub_check_jobdata_3 200 prod-d job$(($i+$NUM_JOBS)) type104 $TARGET info-owner testdata/ecs/job-template.json fi fi if [ $(($i%5)) -eq 4 ]; then if [ $ECS_VERSION == "V1-1" ]; then prodstub_check_jobdata 200 prod-d job$i type5 $TARGET ric1 testdata/ecs/job-template.json else - prodstub_check_jobdata_2 200 prod-d job$i type5 $TARGET ric1 testdata/ecs/job-template.json + if [ $use_info_jobs ]; then + prodstub_check_jobdata_3 200 prod-d job$i type5 $TARGET ric1 testdata/ecs/job-template.json + else + prodstub_check_jobdata_2 200 prod-d job$i type5 $TARGET ric1 testdata/ecs/job-template.json + fi fi if [ $use_info_jobs ]; then - prodstub_check_jobdata_2 200 prod-d job$(($i+$NUM_JOBS)) type105 $TARGET info-owner testdata/ecs/job-template.json + prodstub_check_jobdata_3 200 prod-d job$(($i+$NUM_JOBS)) type105 $TARGET info-owner testdata/ecs/job-template.json fi fi done @@ -619,7 +656,11 @@ do fi done -ecs_equal json:ei-producer/v1/eiproducers 4 +if [ $use_info_jobs ]; then + ecs_equal json:data-producer/v1/info-producers 4 +else + ecs_equal json:ei-producer/v1/eiproducers 4 +fi ecs_api_edp_get_producer_status 200 prod-a ENABLED ecs_api_edp_get_producer_status 200 prod-b ENABLED diff --git a/test/auto-test/FTC2001.sh b/test/auto-test/FTC2001.sh index ab48c6ea..28926cb2 100755 --- a/test/auto-test/FTC2001.sh +++ b/test/auto-test/FTC2001.sh @@ -223,7 +223,11 @@ fi if [ $ECS_VERSION == "V1-1" ]; then prodstub_check_jobdata 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json else - prodstub_check_jobdata_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json + if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then + prodstub_check_jobdata_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json + else + prodstub_check_jobdata_3 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json + fi fi @@ -239,7 +243,11 @@ fi if [ $ECS_VERSION == "V1-1" ]; then prodstub_check_jobdata 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json else - prodstub_check_jobdata_2 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json + if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then + prodstub_check_jobdata_2 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json + else + prodstub_check_jobdata_3 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json + fi fi # Arm producer prod-a for supervision failure @@ -248,7 +256,12 @@ prodstub_arm_producer 200 prod-a 400 # Wait for producer prod-a to go disabled ecs_api_edp_get_producer_status 200 prod-a DISABLED 360 -ecs_equal json:ei-producer/v1/eiproducers 0 1000 +if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then + ecs_equal json:data-producer/v1/info-producers 0 1000 +else + ecs_equal json:ei-producer/v1/eiproducers 0 1000 +fi + echo -e $YELLOW"Verify that ECS has send status notification to the callback recevier"$EYELLOW echo -e $YELLOW"and check the source of the call in the log to be from the httpproxy"$EYELLOW diff --git a/test/auto-test/FTC_HELM_RECIPE_D_RELEASE.sh b/test/auto-test/FTC_HELM_RECIPE_D_RELEASE.sh index 4343beae..d1910d2b 100755 --- a/test/auto-test/FTC_HELM_RECIPE_D_RELEASE.sh +++ b/test/auto-test/FTC_HELM_RECIPE_D_RELEASE.sh @@ -373,7 +373,11 @@ fi if [ $ECS_VERSION == "V1-1" ]; then prodstub_check_jobdata 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json else - prodstub_check_jobdata_2 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json + if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then + prodstub_check_jobdata_2 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json + else + prodstub_check_jobdata_3 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json + fi fi stop_ecs diff --git a/test/auto-test/PM_EI_DEMO.sh b/test/auto-test/PM_EI_DEMO.sh index 6f866fbe..d770bfb7 100755 --- a/test/auto-test/PM_EI_DEMO.sh +++ b/test/auto-test/PM_EI_DEMO.sh @@ -127,6 +127,11 @@ set_agent_trace set_ecs_trace +use_info_jobs=false #Set flag if interface supporting info-types is used +if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then + use_info_jobs=true +fi + rapp_cat_api_get_services 200 EMPTY rapp_cat_api_put_service 201 "Emergency-response-app" v1 "Emergency-response-app" "Emergency-response-app" @@ -241,7 +246,11 @@ fi if [ $ECS_VERSION == "V1-1" ]; then prodstub_check_jobdata 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json else - prodstub_check_jobdata_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json + if [ $use_info_jobs ]; then + prodstub_check_jobdata_3 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json + else + prodstub_check_jobdata_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json + fi fi @@ -257,7 +266,11 @@ fi if [ $ECS_VERSION == "V1-1" ]; then prodstub_check_jobdata 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json else - prodstub_check_jobdata_2 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json + if [ $use_info_jobs ]; then + prodstub_check_jobdata_3 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json + else + prodstub_check_jobdata_2 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json + fi fi check_policy_agent_logs diff --git a/test/common/README.md b/test/common/README.md index bdb2f0dc..65f20cc8 100644 --- a/test/common/README.md +++ b/test/common/README.md @@ -1165,7 +1165,7 @@ To test, provide all the specified parameters. | `` | Path to a job template for job parameters of the job | ## Function: ecs_api_edp_get_type_ids() ## -Test of GET '/ei-producer/v1/eitypes' and an optional check of the returned list of type ids. +Test of GET '/ei-producer/v1/eitypes' or '/data-producer/v1/info-types' depending on ecs version and an optional check of the returned list of type ids. To test the response code only, provide the response code. To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty). @@ -1176,11 +1176,11 @@ To also test the response payload add list of expected type ids (or EMPTY if the | parameter | description | | --------- | ----------- | | `` | Expected http response code | -| `` | Id of the EI type | +| `` | Id of the type | | `EMPTY` | The expected list of type ids shall be empty | ## Function: ecs_api_edp_get_producer_status() ## -Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/status' and optional check of the returned status. +Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/status' or '/data-producer/v1/info-producers/{infoProducerId}/status' depending on ecs version and optional check of the returned status. To test the response code only, provide the response code and producer id. To also test the response payload add the expected status. @@ -1209,6 +1209,23 @@ To also test the response payload add the list of expected producer-ids (or EMPT | `` | Id of the producer | | `EMPTY` | The expected list of type ids shall be empty | +## Function: ecs_api_edp_get_producer_ids_2() ## +Test of GET '/ei-producer/v1/eiproducers' or '/data-producer/v1/info-producers' depending on ecs version and optional check of the returned producer ids. +To test the response code only, provide the response. +To also test the response payload add the type (if any) and a list of expected producer-ids (or EMPTY if the list of ids is expected to be empty). + +| arg list | +|--| +| ` [ ( NOTYPE | ) [ EMPTY | +]` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Id of the type | +| `EMPTY` | No type given | +| `` | Id of the producer | +| `EMPTY` | The expected list of type ids shall be empty | + ## Function: ecs_api_edp_get_type() ## Test of GET '/ei-producer/v1/eitypes/{eiTypeId}' and optional check of the returned type. To test the response code only, provide the response and the type-id. @@ -1221,11 +1238,53 @@ To also test the response payload add a path to a job schema file and a list exp | parameter | description | | --------- | ----------- | | `` | Expected http response code | -| `` | Id of the EI type | +| `` | Id of the type | | `` | Path to a job schema file | | `` | Id of the producer | | `EMPTY` | The expected list of type ids shall be empty | +## Function: ecs_api_edp_get_type_2() ## +Test of GET '/ei-producer/v1/eitypes/{eiTypeId}' or '/data-producer/v1/info-types/{infoTypeId}' depending on ecs version and optional check of the returned type. +To test the response code only, provide the response and the type-id. +To also test the response payload add a path to a job schema file. + +| arg list | +|--| +| ` []` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Id of the type | +| `` | Path to a job schema file | +| `EMPTY` | The expected list of type ids shall be empty | + +## Function: ecs_api_edp_put_type_2() ## +Test of PUT '/ei-producer/v1/eitypes/{eiTypeId}' or '/data-producer/v1/info-types/{infoTypeId}' depending on ecs version and optional check of the returned type. + +| arg list | +|--| +| ` []` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Id of the type | +| `` | Path to a job schema file | +| `EMPTY` | The expected list of type ids shall be empty | + +## Function: ecs_api_edp_delete_type_2() ## +Test of DELETE '/ei-producer/v1/eitypes/{eiTypeId}' or '/data-producer/v1/info-types/{infoTypeId}' depending on ecs version and optional check of the returned type. + +| arg list | +|--| +| ` ` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Id of the type | + ## Function: ecs_api_edp_get_producer() ## Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}' and optional check of the returned producer. To test the response code only, provide the response and the producer-id. @@ -1242,12 +1301,31 @@ To also test the response payload add the remaining parameters defining thee pro | `` | Callback for create job | | `` | Callback for delete job | | `` | Callback for producer supervision | -| `` | Id of the EI type | +| `` | Id of the type | | `` | Path to a schema file | | `EMPTY` | The expected list of type schema pairs shall be empty | + +## Function: ecs_api_edp_get_producer_2() ## +Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ecs version and optional check of the returned producer. +To test the response code only, provide the response and the producer-id. +To also test the response payload add the remaining parameters defining thee producer. + +| arg list | +|--| +| ` [ (EMPTY | +) ]` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Id of the producer | +| `` | Callback for the url | +| `` | Callback for producer supervision | +| `` | Id of the type | +| `EMPTY` | The expected list of types shall be empty | + ## Function: ecs_api_edp_delete_producer() ## -Test of DELETE '/ei-producer/v1/eiproducers/{eiProducerId}'. +Test of DELETE '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ecs version. To test, provide all parameters. | arg list | @@ -1273,10 +1351,27 @@ To test, provide all parameters. The list of type/schema pair may be empty. | `` | Id of the producer | | `` | Callback for create/delete job | | `` | Callback for producer supervision | -| `` | Id of the EI type | +| `` | Id of the type | | `` | Path to a schema file | | `EMPTY` | The list of type/schema pairs is empty | +## Function: ecs_api_edp_put_producer_2() ## +Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ecs version. +To test, provide all parameters. The list of type/schema pair may be empty. + +| arg list | +|--| +| ` NOTYPE|[+]` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Id of the producer | +| `` | Callback for create/delete job | +| `` | Callback for producer supervision | +| `` | Id of the type | +| `NOTYPE` | The list of types is empty | + ## Function: ecs_api_edp_get_producer_jobs() ## Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/eijobs' and optional check of the returned producer job. To test the response code only, provide the response and the producer-id. @@ -1297,6 +1392,26 @@ To also test the response payload add the remaining parameters. | `` | Path to a job template file | | `EMPTY` | The list of job/type/target/job-file tuples is empty | +## Function: ecs_api_edp_get_producer_jobs_2() ## +Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/eijobs' or '/data-producer/v1/info-producers/{infoProducerId}/info-jobs' depending on ecs version and optional check of the returned producer job. +To test the response code only, provide the response and the producer-id. +To also test the response payload add the remaining parameters. + +| arg list | +|--| +| ` (EMPTY | [ ]+)` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Id of the producer | +| `` | Id of the job | +| `` | Id of the type | +| `` | Target url for data delivery | +| `` | Id of the job owner | +| `` | Path to a job template file | +| `EMPTY` | The list of job/type/target/job-file tuples is empty | + ## Function: ecs_api_service_status() ## Test of GET '/status'. @@ -1388,7 +1503,7 @@ To test, provide all the specified parameters. | parameter | description | | --------- | ----------- | | `` | Expected http response code | -| `` | Id of the EI type | +| `` | Id of the type | | `` | Id of the job | ## Function: ecs_api_idc_get_type() ## @@ -1479,7 +1594,7 @@ Sample test of pms api (status) | `` | Expected http response code | ## Function: gateway_ecs_get_types ## -Sample test of ecs api (get ei type) +Sample test of ecs api (get types) Only response code tested - not payload | arg list | |--| @@ -1706,6 +1821,40 @@ Check a job in the prodstub towards the list of provided parameters. | `` | Id of the job owner | | `` | Path to a job template file | +## Function: prodstub_check_jobdata_2() ## +Check a job in the prodstub towards the list of provided parameters. + +| arg list | +|--| +| ` ` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Id of the producer | +| `` | Id of the job | +| `` | Id of the type | +| `` | Target url for data delivery | +| `` | Id of the job owner | +| `` | Path to a job template file | + +## Function: prodstub_check_jobdata_3() ## +Check a job in the prodstub towards the list of provided parameters. + +| arg list | +|--| +| ` ` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Id of the producer | +| `` | Id of the job | +| `` | Id of the type | +| `` | Target url for data delivery | +| `` | Id of the job owner | +| `` | Path to a job template file | + ## Function: prodstub_delete_jobdata() ## Delete the job parameters, job data, for a job. diff --git a/test/common/ecs_api_functions.sh b/test/common/ecs_api_functions.sh index 56167b60..3edb88d2 100644 --- a/test/common/ecs_api_functions.sh +++ b/test/common/ecs_api_functions.sh @@ -943,6 +943,7 @@ ecs_api_a1_put_job() { # Function prefix: ecs_api_edp # API Test function: GET /ei-producer/v1/eitypes +# API Test function: GET /data-producer/v1/info-types # args: [ EMPTY | +] # (Function for test scripts) ecs_api_edp_get_type_ids() { @@ -952,8 +953,11 @@ ecs_api_edp_get_type_ids() { __print_err " [ EMPTY | +]" $@ return 1 fi - - query="/ei-producer/v1/eitypes" + if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then + query="/data-producer/v1/info-types" + else + query="/ei-producer/v1/eitypes" + fi res="$(__do_curl_to_api ECS GET $query)" status=${res:${#res}-3} @@ -988,6 +992,7 @@ ecs_api_edp_get_type_ids() { } # API Test function: GET /ei-producer/v1/eiproducers/{eiProducerId}/status +# API Test function: GET /data-producer/v1/info-producers/{infoProducerId}/status # args: [ []] # (Function for test scripts) ecs_api_edp_get_producer_status() { @@ -997,8 +1002,11 @@ ecs_api_edp_get_producer_status() { __print_err " [ []]" $@ return 1 fi - - query="/ei-producer/v1/eiproducers/$2/status" + if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then + query="/data-producer/v1/info-producers/$2/status" + else + query="/ei-producer/v1/eiproducers/$2/status" + fi start=$SECONDS for (( ; ; )); do res="$(__do_curl_to_api ECS GET $query)" @@ -1097,6 +1105,7 @@ ecs_api_edp_get_producer_ids() { } # API Test function: GET /ei-producer/v1/eiproducers +# API Test function: GET /data-producer/v1/info-producers # args (v1_2): [ ( NOTYPE | ) [ EMPTY | +] ] # (Function for test scripts) ecs_api_edp_get_producer_ids_2() { @@ -1106,10 +1115,16 @@ ecs_api_edp_get_producer_ids_2() { __print_err " [ ( NOTYPE | ) [ EMPTY | +] ]" $@ return 1 fi - - query="/ei-producer/v1/eiproducers" - if [ $# -gt 1 ] && [ $2 != "NOTYPE" ]; then - query=$query"?ei_type_id=$2" + if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then + query="/data-producer/v1/info-producers" + if [ $# -gt 1 ] && [ $2 != "NOTYPE" ]; then + query=$query"?info_type_id=$2" + fi + else + query="/ei-producer/v1/eiproducers" + if [ $# -gt 1 ] && [ $2 != "NOTYPE" ]; then + query=$query"?ei_type_id=$2" + fi fi res="$(__do_curl_to_api ECS GET $query)" status=${res:${#res}-3} @@ -1206,6 +1221,7 @@ ecs_api_edp_get_type() { } # API Test function: GET /ei-producer/v1/eitypes/{eiTypeId} +# API Test function: GET /data-producer/v1/info-types/{infoTypeId} # args: (v1_2) [ ] # (Function for test scripts) ecs_api_edp_get_type_2() { @@ -1222,8 +1238,12 @@ ecs_api_edp_get_type_2() { __print_err " [ ]" $@ return 1 fi + if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then + query="/data-producer/v1/info-types/$2" + else + query="/ei-producer/v1/eitypes/$2" + fi - query="/ei-producer/v1/eitypes/$2" res="$(__do_curl_to_api ECS GET $query)" status=${res:${#res}-3} @@ -1240,8 +1260,11 @@ ecs_api_edp_get_type_2() { __log_test_fail_general "Job template file "$3", does not exist" return 1 fi - - targetJson="{\"ei_job_data_schema\":$schema}" + if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then + targetJson="{\"info_job_data_schema\":$schema}" + else + targetJson="{\"ei_job_data_schema\":$schema}" + fi echo " TARGET JSON: $targetJson" >> $HTTPLOG res=$(python3 ../common/compare_json.py "$targetJson" "$body") @@ -1256,6 +1279,7 @@ ecs_api_edp_get_type_2() { } # API Test function: PUT /ei-producer/v1/eitypes/{eiTypeId} +# API Test function: PUT /data-producer/v1/info-types/{infoTypeId} # args: (v1_2) # (Function for test scripts) ecs_api_edp_put_type_2() { @@ -1270,12 +1294,21 @@ ecs_api_edp_put_type_2() { __log_test_fail_general "Job schema file "$3", does not exist" return 1 fi - schema=$(cat $3) - input_json="{\"ei_job_data_schema\":$schema}" - file="./tmp/put_type.json" - echo $input_json > $file + if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then + schema=$(cat $3) + input_json="{\"info_job_data_schema\":$schema}" + file="./tmp/put_type.json" + echo $input_json > $file - query="/ei-producer/v1/eitypes/$2" + query="/data-producer/v1/info-types/$2" + else + schema=$(cat $3) + input_json="{\"ei_job_data_schema\":$schema}" + file="./tmp/put_type.json" + echo $input_json > $file + + query="/ei-producer/v1/eitypes/$2" + fi res="$(__do_curl_to_api ECS PUT $query $file)" status=${res:${#res}-3} @@ -1289,6 +1322,7 @@ ecs_api_edp_put_type_2() { } # API Test function: DELETE /ei-producer/v1/eitypes/{eiTypeId} +# API Test function: DELETE /data-producer/v1/info-types/{infoTypeId} # args: (v1_2) # (Function for test scripts) ecs_api_edp_delete_type_2() { @@ -1299,7 +1333,11 @@ ecs_api_edp_delete_type_2() { return 1 fi - query="/ei-producer/v1/eitypes/$2" + if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then + query="/data-producer/v1/info-types/$2" + else + query="/ei-producer/v1/eitypes/$2" + fi res="$(__do_curl_to_api ECS DELETE $query)" status=${res:${#res}-3} @@ -1382,6 +1420,7 @@ ecs_api_edp_get_producer() { } # API Test function: GET /ei-producer/v1/eiproducers/{eiProducerId} +# API Test function: GET /data-producer/v1/info-producers/{infoProducerId} # args (v1_2): [ (EMPTY | +) ] # (Function for test scripts) ecs_api_edp_get_producer_2() { @@ -1403,8 +1442,11 @@ ecs_api_edp_get_producer_2() { __print_err " [ (EMPTY | +) ]" $@ return 1 fi - - query="/ei-producer/v1/eiproducers/$2" + if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then + query="/data-producer/v1/info-producers/$2" + else + query="/ei-producer/v1/eiproducers/$2" + fi res="$(__do_curl_to_api ECS GET $query)" status=${res:${#res}-3} @@ -1427,7 +1469,11 @@ ecs_api_edp_get_producer_2() { fi targetJson=$targetJson"]" if [ $# -gt 4 ]; then - targetJson="{\"supported_ei_types\":$targetJson,\"ei_job_callback_url\": \"$3\",\"ei_producer_supervision_callback_url\": \"$4\"}" + if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then + targetJson="{\"supported_info_types\":$targetJson,\"info_job_callback_url\": \"$3\",\"info_producer_supervision_callback_url\": \"$4\"}" + else + targetJson="{\"supported_ei_types\":$targetJson,\"ei_job_callback_url\": \"$3\",\"ei_producer_supervision_callback_url\": \"$4\"}" + fi fi echo " TARGET JSON: $targetJson" >> $HTTPLOG res=$(python3 ../common/compare_json.py "$targetJson" "$body") @@ -1443,6 +1489,7 @@ ecs_api_edp_get_producer_2() { } # API Test function: DELETE /ei-producer/v1/eiproducers/{eiProducerId} +# API Test function: DELETE /data-producer/v1/info-producers/{infoProducerId} # args: # (Function for test scripts) ecs_api_edp_delete_producer() { @@ -1452,8 +1499,11 @@ ecs_api_edp_delete_producer() { __print_err " " $@ return 1 fi - - query="/ei-producer/v1/eiproducers/$2" + if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then + query="/data-producer/v1/info-producers/$2" + else + query="/ei-producer/v1/eiproducers/$2" + fi res="$(__do_curl_to_api ECS DELETE $query)" status=${res:${#res}-3} @@ -1522,6 +1572,7 @@ ecs_api_edp_put_producer() { } # API Test function: PUT /ei-producer/v1/eiproducers/{eiProducerId} +# API Test function: PUT /data-producer/v1/info-producers/{infoProducerId} # args: (v1_2) NOTYPE|[+] # (Function for test scripts) ecs_api_edp_put_producer_2() { @@ -1549,15 +1600,27 @@ ecs_api_edp_put_producer_2() { inputJson=$inputJson"\""${arr[$i]}"\"" done fi - inputJson="\"supported_ei_types\":"$inputJson"]" + if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then + inputJson="\"supported_info_types\":"$inputJson"]" - inputJson=$inputJson",\"ei_job_callback_url\": \"$3\",\"ei_producer_supervision_callback_url\": \"$4\"" + inputJson=$inputJson",\"info_job_callback_url\": \"$3\",\"info_producer_supervision_callback_url\": \"$4\"" - inputJson="{"$inputJson"}" + inputJson="{"$inputJson"}" - file="./tmp/.p.json" - echo "$inputJson" > $file - query="/ei-producer/v1/eiproducers/$2" + file="./tmp/.p.json" + echo "$inputJson" > $file + query="/data-producer/v1/info-producers/$2" + else + inputJson="\"supported_ei_types\":"$inputJson"]" + + inputJson=$inputJson",\"ei_job_callback_url\": \"$3\",\"ei_producer_supervision_callback_url\": \"$4\"" + + inputJson="{"$inputJson"}" + + file="./tmp/.p.json" + echo "$inputJson" > $file + query="/ei-producer/v1/eiproducers/$2" + fi res="$(__do_curl_to_api ECS PUT $query $file)" status=${res:${#res}-3} @@ -1635,6 +1698,7 @@ ecs_api_edp_get_producer_jobs() { } # API Test function: GET /ei-producer/v1/eiproducers/{eiProducerId}/eijobs +# API Test function: GET /data-producer/v1/info-producers/{infoProducerId}/info-jobs # args: (V1-2) (EMPTY | [ ]+) # (Function for test scripts) ecs_api_edp_get_producer_jobs_2() { @@ -1656,8 +1720,11 @@ ecs_api_edp_get_producer_jobs_2() { __print_err " (EMPTY | [ ]+)" $@ return 1 fi - - query="/ei-producer/v1/eiproducers/$2/eijobs" + if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then + query="/data-producer/v1/info-producers/$2/info-jobs" + else + query="/ei-producer/v1/eiproducers/$2/eijobs" + fi res="$(__do_curl_to_api ECS GET $query)" status=${res:${#res}-3} if [ $status -ne $1 ]; then @@ -1680,7 +1747,11 @@ ecs_api_edp_get_producer_jobs_2() { __log_test_fail_general "Job template file "${arr[$i+4]}", does not exist" return 1 fi - targetJson=$targetJson"{\"ei_job_identity\":\"${arr[$i]}\",\"ei_type_identity\":\"${arr[$i+1]}\",\"target_uri\":\"${arr[$i+2]}\",\"owner\":\"${arr[$i+3]}\",\"ei_job_data\":$jobfile, \"last_updated\":\"????\"}" + if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then + targetJson=$targetJson"{\"info_job_identity\":\"${arr[$i]}\",\"info_type_identity\":\"${arr[$i+1]}\",\"target_uri\":\"${arr[$i+2]}\",\"owner\":\"${arr[$i+3]}\",\"info_job_data\":$jobfile, \"last_updated\":\"????\"}" + else + targetJson=$targetJson"{\"ei_job_identity\":\"${arr[$i]}\",\"ei_type_identity\":\"${arr[$i+1]}\",\"target_uri\":\"${arr[$i+2]}\",\"owner\":\"${arr[$i+3]}\",\"ei_job_data\":$jobfile, \"last_updated\":\"????\"}" + fi done fi targetJson=$targetJson"]" @@ -1862,7 +1933,7 @@ ecs_api_idc_get_job() { __log_test_fail_general "Job template file "$6", does not exist" return 1 fi - targetJson="{\"infoTypeId\": \"$3\", \"jobResultUri\": \"$4\",\"jobOwner\": \"$5\",\"jobStatusNotificationUri\": \"$6\",\"jobDefinition\": $jobfile}" + targetJson="{\"info_type_id\": \"$3\", \"job_result_uri\": \"$4\",\"job_owner\": \"$5\",\"status_notification_uri\": \"$6\",\"job_definition\": $jobfile}" echo " TARGET JSON: $targetJson" >> $HTTPLOG res=$(python3 ../common/compare_json.py "$targetJson" "$body") @@ -1895,7 +1966,7 @@ ecs_api_idc_put_job() { return 1 fi - inputJson="{\"infoTypeId\": \"$3\", \"jobResultUri\": \"$4\",\"jobOwner\": \"$5\",\"jobStatusNotificationUri\": \"$6\",\"jobDefinition\": $jobfile}" + inputJson="{\"info_type_id\": \"$3\", \"job_result_uri\": \"$4\",\"job_owner\": \"$5\",\"status_notification_uri\": \"$6\",\"job_definition\": $jobfile}" file="./tmp/.p.json" echo "$inputJson" > $file @@ -1970,7 +2041,7 @@ ecs_api_idc_get_type() { __log_test_fail_general "Schema file "$3", does not exist" return 1 fi - targetJson="{\"consumer_job_data_schema\":$schema}" + targetJson="{\"job_data_schema\":$schema}" echo " TARGET JSON: $targetJson" >> $HTTPLOG res=$(python3 ../common/compare_json.py "$targetJson" "$body") @@ -2021,7 +2092,7 @@ ecs_api_idc_get_job_status() { fi if [ $# -ge 3 ] && [ $status -eq $1 ]; then body=${res:0:${#res}-3} - targetJson="{\"eiJobStatus\": \"$3\"}" + targetJson="{\"info_job_status\": \"$3\"}" echo " TARGET JSON: $targetJson" >> $HTTPLOG res=$(python3 ../common/compare_json.py "$targetJson" "$body") diff --git a/test/common/prodstub_api_functions.sh b/test/common/prodstub_api_functions.sh index 6b7a3d88..54e59e30 100644 --- a/test/common/prodstub_api_functions.sh +++ b/test/common/prodstub_api_functions.sh @@ -457,6 +457,32 @@ prodstub_check_jobdata_2() { return $? } +# Prodstub API: Get job data for a job and compare with a target job json (info-jobs) +# +# (Function for test scripts) +prodstub_check_jobdata_3() { + __log_test_start $@ + if [ $# -ne 7 ]; then + __print_err " " $@ + return 1 + fi + if [ -f $7 ]; then + jobfile=$(cat $7) + jobfile=$(echo "$jobfile" | sed "s/XXXX/$3/g") + else + __log_test_fail_general "Template file "$7" for jobdata, does not exist" + return 1 + fi + targetJson="{\"info_job_identity\":\"$3\",\"info_type_identity\":\"$4\",\"target_uri\":\"$5\",\"owner\":\"$6\", \"info_job_data\":$jobfile,\"last_updated\":\"????\"}" + file="./tmp/.p.json" + echo "$targetJson" > $file + + curlString="curl -X GET -skw %{http_code} $PROD_STUB_PATH/jobdata/$2/$3" + + __execute_curl_to_prodstub TEST $1 "$curlString" $file + return $? +} + # Prodstub API: Delete the job data # # (Function for test scripts) diff --git a/test/prodstub/app/prodstub.py b/test/prodstub/app/prodstub.py index ea8b914d..f4f14881 100644 --- a/test/prodstub/app/prodstub.py +++ b/test/prodstub/app/prodstub.py @@ -312,6 +312,10 @@ def disarm_type(producer_id, type_id): if (recursive_search(producer_dict, "ei_job_type",type_id) is True): return "TYPE_IN_USE",400 + elif (recursive_search(producer_dict, "ei_type_identity",type_id) is True): + return "TYPE_IN_USE",400 + elif (recursive_search(producer_dict, "info_type_identity",type_id) is True): + return "TYPE_IN_USE",400 type_list=producer_dict['types'] type_list.remove(type_id) @@ -339,17 +343,26 @@ def callback_create(producer_id): if (producer_dict is None): return PRODUCER_OR_JOB_NOT_FOUND,400 type_list=producer_dict['types'] - type_id=req_json_dict['ei_type_identity'] - if (type_id not in type_list): + + + if 'ei_type_identity' in req_json_dict.keys(): + type_key_name='ei_type_identity' + job_key_name='ei_job_identity' + elif 'info_type_identity' in req_json_dict.keys(): + type_key_name='info_type_identity' + job_key_name='info_job_identity' + else: return TYPE_NOT_FOUND, 400 - job_id=req_json_dict['ei_job_identity'] + type_id=req_json_dict[type_key_name] + job_id=req_json_dict[job_key_name] + job_dict=get_callback_dict(producer_id, job_id) if (job_dict is None): return PRODUCER_OR_JOB_NOT_FOUND,400 return_code=0 return_msg="" - if (req_json_dict['ei_job_identity'] == job_id): + if (req_json_dict[job_key_name] == job_id): print("Create callback received for producer: "+str(producer_id)+" and job: "+str(job_id)) return_code=job_dict['create_response'] if ((job_dict['create_response'] == 200) or (job_dict['create_response'] == 201)): diff --git a/test/simulator-group/ngw/application.yaml b/test/simulator-group/ngw/application.yaml index c7344614..7b062c2f 100644 --- a/test/simulator-group/ngw/application.yaml +++ b/test/simulator-group/ngw/application.yaml @@ -34,6 +34,10 @@ spring: uri: https://${ECS_DOMAIN_NAME}:${ECS_EXTERNAL_SECURE_PORT} predicates: - Path=/ei-producer/** + - id: A1-EI2 + uri: https://${ECS_DOMAIN_NAME}:${ECS_EXTERNAL_SECURE_PORT} + predicates: + - Path=/data-producer/** management: endpoint: gateway: -- 2.16.6