Integrated PMS 2.0 to test env and test cases

Issue-ID: NONRTRIC-307

Signed-off-by: BjornMagnussonXA <bjorn.magnusson@est.tech>
Change-Id: I696591192eeb3f9a04c91d6b0c3b19d7005cd6ec
diff --git a/test/auto-test/FTC1100.sh b/test/auto-test/FTC1100.sh
index 63c2931..0a1a014 100755
--- a/test/auto-test/FTC1100.sh
+++ b/test/auto-test/FTC1100.sh
@@ -29,6 +29,8 @@
 
 #### TEST BEGIN ####
 
+FLAT_A1_EI="1"
+
 clean_containers
 
 use_ecs_rest_http
@@ -94,14 +96,27 @@
 
 ecs_api_edp_delete_producer 404 test-prod
 
-ecs_api_a1_get_job_ids 404 test-type NOWNER
-ecs_api_a1_get_job_ids 404 test-type test-owner
+if [  -z "$FLAT_A1_EI" ]; then
+    ecs_api_a1_get_job_ids 404 test-type NOWNER
+    ecs_api_a1_get_job_ids 404 test-type test-owner
 
-ecs_api_a1_get_job 404 test-type test-job
+    ecs_api_a1_get_job 404 test-type test-job
 
-ecs_api_a1_get_job_status 404 test-type test-job
+    ecs_api_a1_get_job_status 404 test-type test-job
+else
+    ecs_api_a1_get_job_ids 200 test-type NOWNER EMPTY
+    ecs_api_a1_get_job_ids 200 test-type test-owner EMPTY
 
-ecs_api_a1_delete_job 404 test-type test-job
+    ecs_api_a1_get_job 404 test-job
+
+    ecs_api_a1_get_job_status 404 test-job
+fi
+
+if [  -z "$FLAT_A1_EI" ]; then
+    ecs_api_a1_delete_job 404 test-type test-job
+else
+    ecs_api_a1_delete_job 404 test-job
+fi
 
 ecs_api_edp_get_producer_jobs 404 test-prod
 
@@ -112,7 +127,11 @@
 ecs_api_edp_put_producer 200 prod-a http://producer-stub:8092/callbacks/create/prod-a http://producer-stub:8092/callbacks/delete/prod-a http://producer-stub:8092/callbacks/supervision/prod-a type1 testdata/ecs/ei-type-1.json
 
 ecs_api_a1_get_type_ids 200 type1
-ecs_api_a1_get_type 200 type1 testdata/ecs/ei-type-1.json
+if [  -z "$FLAT_A1_EI" ]; then
+    ecs_api_a1_get_type 200 type1 testdata/ecs/ei-type-1.json
+else
+    ecs_api_a1_get_type 200 type1 testdata/ecs/empty-type.json
+fi
 
 ecs_api_edp_get_type_ids 200 type1
 ecs_api_edp_get_type 200 type1 testdata/ecs/ei-type-1.json prod-a
@@ -125,40 +144,72 @@
 ecs_api_a1_get_job_ids 200 type1 NOWNER EMPTY
 ecs_api_a1_get_job_ids 200 type1 test-owner EMPTY
 
-ecs_api_a1_get_job 404 type1 test-job
+if [  -z "$FLAT_A1_EI" ]; then
+    ecs_api_a1_get_job 404 type1 test-job
 
-ecs_api_a1_get_job_status 404 type1 test-job
+    ecs_api_a1_get_job_status 404 type1 test-job
+else
+    ecs_api_a1_get_job 404 test-job
+
+    ecs_api_a1_get_job_status 404 test-job
+fi
 
 ecs_api_edp_get_producer_jobs 200 prod-a EMPTY
 
 
 #job1 - prod-a
-ecs_api_a1_put_job 201 type1 job1 http://localhost:80/target1 ric1 testdata/ecs/job-template.json
+if [  -z "$FLAT_A1_EI" ]; then
+    ecs_api_a1_put_job 201 type1 job1 http://localhost:80/target1 ric1 testdata/ecs/job-template.json
+else
+    ecs_api_a1_put_job 201 job1 type1 http://localhost:80/target1 ric1 http://localhost:80/status1 testdata/ecs/job-template.json
+fi
 
 prodstub_check_jobdata 200 prod-a job1 type1 http://localhost:80/target1 testdata/ecs/job-template.json
 
 ecs_api_a1_get_job_ids 200 type1 NOWNER job1
 ecs_api_a1_get_job_ids 200 type1 ric1 job1
+if [ ! -z "$FLAT_A1_EI" ]; then
+    ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1
+fi
 
-ecs_api_a1_get_job 200 type1 job1 http://localhost:80/target1 ric1 testdata/ecs/job-template.json
+if [  -z "$FLAT_A1_EI" ]; then
+    ecs_api_a1_get_job 200 type1 job1 http://localhost:80/target1 ric1 testdata/ecs/job-template.json
 
-ecs_api_a1_get_job_status 200 type1 job1 ENABLED
+    ecs_api_a1_get_job_status 200 type1 job1 ENABLED
+else
+    ecs_api_a1_get_job 200 job1 type1 http://localhost:80/target1 ric1 http://localhost:80/status1 testdata/ecs/job-template.json
+
+    ecs_api_a1_get_job_status 200 job1 ENABLED
+fi
 
 ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 http://localhost:80/target1 testdata/ecs/job-template.json
 
 
 #job2 - prod-a
-ecs_api_a1_put_job 201 type1 job2 http://localhost:80/target2 ric2 testdata/ecs/job-template.json
+if [  -z "$FLAT_A1_EI" ]; then
+    ecs_api_a1_put_job 201 type1 job2 http://localhost:80/target2 ric2 testdata/ecs/job-template.json
+else
+    ecs_api_a1_put_job 201 job2 type1 http://localhost:80/target2 ric2 http://localhost:80/status2 testdata/ecs/job-template.json
+fi
 
 prodstub_check_jobdata 200 prod-a job2 type1 http://localhost:80/target2 testdata/ecs/job-template.json
 
 ecs_api_a1_get_job_ids 200 type1 NOWNER job1 job2
 ecs_api_a1_get_job_ids 200 type1 ric1 job1
 ecs_api_a1_get_job_ids 200 type1 ric2 job2
+if [ ! -z "$FLAT_A1_EI" ]; then
+    ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
+fi
 
-ecs_api_a1_get_job 200 type1 job2 http://localhost:80/target2 ric2 testdata/ecs/job-template.json
+if [  -z "$FLAT_A1_EI" ]; then
+    ecs_api_a1_get_job 200 type1 job2 http://localhost:80/target2 ric2 testdata/ecs/job-template.json
 
-ecs_api_a1_get_job_status 200 type1 job2 ENABLED
+    ecs_api_a1_get_job_status 200 type1 job2 ENABLED
+else
+    ecs_api_a1_get_job 200 job2 type1 http://localhost:80/target2 ric2 http://localhost:80/status2 testdata/ecs/job-template.json
+
+    ecs_api_a1_get_job_status 200 job2 ENABLED
+fi
 
 ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 http://localhost:80/target1 testdata/ecs/job-template.json job2 type1 http://localhost:80/target2 testdata/ecs/job-template.json
 
@@ -167,8 +218,13 @@
 ecs_api_edp_put_producer 201 prod-b http://producer-stub:8092/callbacks/create/prod-b http://producer-stub:8092/callbacks/delete/prod-b http://producer-stub:8092/callbacks/supervision/prod-b type2 testdata/ecs/ei-type-2.json
 
 ecs_api_a1_get_type_ids 200 type1 type2
-ecs_api_a1_get_type 200 type1 testdata/ecs/ei-type-1.json
-ecs_api_a1_get_type 200 type2 testdata/ecs/ei-type-2.json
+if [  -z "$FLAT_A1_EI" ]; then
+    ecs_api_a1_get_type 200 type1 testdata/ecs/ei-type-1.json
+    ecs_api_a1_get_type 200 type2 testdata/ecs/ei-type-2.json
+else
+    ecs_api_a1_get_type 200 type1 testdata/ecs/empty-type.json
+    ecs_api_a1_get_type 200 type2 testdata/ecs/empty-type.json
+fi
 
 ecs_api_edp_get_type_ids 200 type1 type2
 ecs_api_edp_get_type 200 type1 testdata/ecs/ei-type-1.json prod-a
@@ -182,7 +238,11 @@
 
 
 #job3 - prod-b
-ecs_api_a1_put_job 201 type2 job3 http://localhost:80/target3 ric3 testdata/ecs/job-template.json
+if [  -z "$FLAT_A1_EI" ]; then
+    ecs_api_a1_put_job 201 type2 job3 http://localhost:80/target3 ric3 testdata/ecs/job-template.json
+else
+    ecs_api_a1_put_job 201 job3 type2 http://localhost:80/target3 ric3 http://localhost:80/status3 testdata/ecs/job-template.json
+fi
 
 prodstub_check_jobdata 200 prod-b job3 type2 http://localhost:80/target3 testdata/ecs/job-template.json
 
@@ -192,9 +252,15 @@
 ecs_api_a1_get_job_ids 200 type1 ric2 job2
 ecs_api_a1_get_job_ids 200 type2 ric3 job3
 
-ecs_api_a1_get_job 200 type2 job3 http://localhost:80/target3 ric3 testdata/ecs/job-template.json
+if [  -z "$FLAT_A1_EI" ]; then
+    ecs_api_a1_get_job 200 type2 job3 http://localhost:80/target3 ric3 testdata/ecs/job-template.json
 
-ecs_api_a1_get_job_status 200 type2 job3 ENABLED
+    ecs_api_a1_get_job_status 200 type2 job3 ENABLED
+else
+    ecs_api_a1_get_job 200 job3 type2 http://localhost:80/target3 ric3 http://localhost:80/status3 testdata/ecs/job-template.json
+
+    ecs_api_a1_get_job_status 200 job3 ENABLED
+fi
 
 ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 http://localhost:80/target1 testdata/ecs/job-template.json job2 type1 http://localhost:80/target2 testdata/ecs/job-template.json
 ecs_api_edp_get_producer_jobs 200 prod-b job3 type2 http://localhost:80/target3 testdata/ecs/job-template.json
@@ -210,7 +276,11 @@
 
 ecs_api_edp_get_producer_status 200 prod-c ENABLED
 
-ecs_api_a1_delete_job 204 type2 job3
+if [  -z "$FLAT_A1_EI" ]; then
+    ecs_api_a1_delete_job 204 type2 job3
+else
+    ecs_api_a1_delete_job 204 job3
+fi
 
 ecs_api_edp_delete_producer 204 prod-b
 
@@ -222,8 +292,12 @@
 
 ecs_api_a1_get_job_ids 200 type4 NOWNER EMPTY
 
-ecs_api_a1_put_job 201 type4 job8 http://localhost:80/target8 ric4 testdata/ecs/job-template.json
-
+if [  -z "$FLAT_A1_EI" ]; then
+    ecs_api_a1_put_job 201 type4 job8 http://localhost:80/target8 ric4 testdata/ecs/job-template.json
+else
+    ecs_api_a1_put_job 201 job8 type4 http://localhost:80/target8 ric4 http://localhost:80/status4 testdata/ecs/job-template.json
+fi
+read -p "<continue>"
 prodstub_equal create/prod-d/job8 1
 prodstub_equal delete/prod-d/job8 0
 
@@ -231,11 +305,32 @@
 
 ecs_api_edp_put_producer 200 prod-d http://producer-stub:8092/callbacks/create/prod-d http://producer-stub:8092/callbacks/delete/prod-d http://producer-stub:8092/callbacks/supervision/prod-d NOTYPE
 
-ecs_api_a1_get_job_ids 404 type4 NOWNER
+if [  -z "$FLAT_A1_EI" ]; then
+    ecs_api_a1_get_job_ids 404 type4 NOWNER
+else
+    ecs_api_a1_get_job_ids 200 type4 NOWNER EMPTY
+    ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job8
+fi
 
 prodstub_equal create/prod-d/job8 1
 prodstub_equal delete/prod-d/job8 0
 
+
+
+ecs_api_edp_put_producer 200 prod-d http://producer-stub:8092/callbacks/create/prod-d http://producer-stub:8092/callbacks/delete/prod-d http://producer-stub:8092/callbacks/supervision/prod-d type4 testdata/ecs/ei-type-1.json
+
+if [  -z "$FLAT_A1_EI" ]; then
+    ecs_api_a1_get_job_ids 404 type4 NOWNER
+else
+    ecs_api_a1_get_job_ids 200 type4 NOWNER EMPTY
+    ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job8
+fi
+
+
+
+
+
+
 check_sdnc_logs
 
 check_ecs_logs