fi
# Check the job data in the producer
-prodstub_check_jobdata 200 prod-a job1 type1 $TARGET1 testdata/ecs/job-template.json
+prodstub_check_jobdata 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
ecs_api_a1_get_job_ids 200 type1 NOWNER job1
ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1
prodstub_equal create/prod-a/job1 1
-ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 $TARGET1 testdata/ecs/job-template.json
+ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
## Create a second job for prod-a
## job2 - prod-a
fi
# Check the job data in the producer
-prodstub_check_jobdata 200 prod-a job2 type1 $TARGET2 testdata/ecs/job-template.json
+prodstub_check_jobdata 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
ecs_api_a1_get_job_ids 200 type1 NOWNER job1 job2
ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1
prodstub_equal create/prod-a/job2 1
-ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 $TARGET1 testdata/ecs/job-template.json job2 type1 $TARGET2 testdata/ecs/job-template.json
+ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
## Setup prod-b
ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
prodstub_equal create/prod-b/job3 1
# Check the job data in the producer
-prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 testdata/ecs/job-template.json
+prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
ecs_api_a1_get_job_ids 200 type1 NOWNER job1 job2
ecs_api_a1_get_job_ids 200 type2 NOWNER job3
ecs_api_a1_get_job_status 200 job3 ENABLED
fi
-ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 $TARGET1 testdata/ecs/job-template.json job2 type1 $TARGET2 testdata/ecs/job-template.json
-ecs_api_edp_get_producer_jobs 200 prod-b job3 type2 $TARGET3 testdata/ecs/job-template.json
+ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
+ecs_api_edp_get_producer_jobs 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
## Setup prod-c (no types)
ecs_api_a1_get_job_status 200 job3 ENABLED
fi
-prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 testdata/ecs/job-template2.json
+prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
cr_equal received_callbacks?id=job3-status 2
cr_api_check_all_ecs_events 200 job3-status ENABLED
-prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 testdata/ecs/job-template2.json
+prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
## Setup prod-d
ecs_api_a1_put_job 201 job8 type4 $TARGET8 ricsim_g3_4 $STATUS8 testdata/ecs/job-template.json
fi
-prodstub_check_jobdata 200 prod-d job8 type4 $TARGET8 testdata/ecs/job-template.json
+prodstub_check_jobdata 200 prod-d job8 type4 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json
prodstub_equal create/prod-d/job8 1
prodstub_equal delete/prod-d/job8 0
ecs_api_a1_put_job 201 job10 type6 $TARGET10 ricsim_g3_4 $STATUS10 testdata/ecs/job-template.json
fi
-prodstub_check_jobdata 200 prod-e job10 type6 $TARGET10 testdata/ecs/job-template.json
+prodstub_check_jobdata 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
prodstub_equal create/prod-e/job10 1
prodstub_equal delete/prod-e/job10 0
ecs_api_a1_get_job_ids 200 type6 NOWNER job10
-prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 testdata/ecs/job-template.json
+prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
prodstub_equal create/prod-f/job10 1
prodstub_equal delete/prod-f/job10 0
#Job 10 should be updated when the producer goes enabled
deviation "Job 10 should be updated when the producer prod-e goes enabled"
-prodstub_check_jobdata 200 prod-e job10 type6 $TARGET10 testdata/ecs/job-template2.json
-prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 testdata/ecs/job-template2.json
+prodstub_check_jobdata 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json
+prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json
prodstub_arm_producer 200 prod-f 400
for ((i=1; i<=$NUM_JOBS; i++))
do
if [ $(($i%5)) -eq 0 ]; then
- prodstub_check_jobdata 200 prod-a job$i type1 $TARGET testdata/ecs/job-template.json
- prodstub_check_jobdata 200 prod-b job$i type1 $TARGET testdata/ecs/job-template.json
- prodstub_check_jobdata 200 prod-c job$i type1 $TARGET testdata/ecs/job-template.json
+ prodstub_check_jobdata 200 prod-a job$i type1 $TARGET ric1 testdata/ecs/job-template.json
+ 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
fi
if [ $(($i%5)) -eq 1 ]; then
- prodstub_check_jobdata 200 prod-b job$i type2 $TARGET testdata/ecs/job-template.json
- prodstub_check_jobdata 200 prod-c job$i type2 $TARGET testdata/ecs/job-template.json
+ 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
fi
if [ $(($i%5)) -eq 2 ]; then
- prodstub_check_jobdata 200 prod-c job$i type3 $TARGET testdata/ecs/job-template.json
+ prodstub_check_jobdata 200 prod-c job$i type3 $TARGET ric1 testdata/ecs/job-template.json
fi
if [ $(($i%5)) -eq 3 ]; then
- prodstub_check_jobdata 200 prod-d job$i type4 $TARGET testdata/ecs/job-template.json
+ prodstub_check_jobdata 200 prod-d job$i type4 $TARGET ric1 testdata/ecs/job-template.json
fi
if [ $(($i%5)) -eq 4 ]; then
- prodstub_check_jobdata 200 prod-d job$i type5 $TARGET testdata/ecs/job-template.json
+ prodstub_check_jobdata 200 prod-d job$i type5 $TARGET ric1 testdata/ecs/job-template.json
fi
done
fi
# Check the job data in the producer
-prodstub_check_jobdata 200 prod-a job1 type1 $TARGET1 testdata/ecs/job-template.json
+prodstub_check_jobdata 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
## Create a second job for prod-a
fi
# Check the job data in the producer
-prodstub_check_jobdata 200 prod-a job2 type1 $TARGET2 testdata/ecs/job-template.json
+prodstub_check_jobdata 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
| arg list |
|--|
-| `<response-code> <producer-id> (EMPTY | [<job-id> <type-id> <target-url> <template-job-file>]+)` |
+| `<response-code> <producer-id> (EMPTY | [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
| parameter | description |
| --------- | ----------- |
| `<job-id>` | Id of the job |
| `<type-id>` | Id of the EI type |
| `<target-url>` | Target url for data delivery |
+| `<job-owner>` | Id of the job owner |
| `<template-job-file>` | Path to a job template file |
| `EMPTY` | The list of job/type/target/job-file tuples is empty |
| arg list |
|--|
-| `<response-code> <producer-id> <job-id> <type-id> <target-url> <template-job-file>` |
+| `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
| parameter | description |
| --------- | ----------- |
| `<job-id>` | Id of the job |
| `<type-id>` | Id of the type |
| `<target-url>` | Target url for data delivery |
+| `<job-owner>` | Id of the job owner |
| `<template-job-file>` | Path to a job template file |
## Function: prodstub_delete_jobdata() ##
}
# API Test function: GET /ei-producer/v1/eiproducers/{eiProducerId}/eijobs
-# args: <response-code> <producer-id> (EMPTY | [<job-id> <type-id> <target-url> <template-job-file>]+)
+# args: <response-code> <producer-id> (EMPTY | [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)
# (Function for test scripts)
ecs_api_edp_get_producer_jobs() {
__log_test_start $@
- #Valid number of parameter 2,3,6,10
+ #Valid number of parameter 2,3,7,11
paramError=1
if [ $# -eq 2 ]; then
paramError=0
paramError=0
fi
variablecount=$(($#-2))
- if [ $# -gt 3 ] && [ $(($variablecount%4)) -eq 0 ]; then
+ if [ $# -gt 3 ] && [ $(($variablecount%5)) -eq 0 ]; then
paramError=0
fi
if [ $paramError -eq 1 ]; then
- __print_err "<response-code> <producer-id> (EMPTY | [<job-id> <type-id> <target-url> <template-job-file>]+)" $@
+ __print_err "<response-code> <producer-id> (EMPTY | [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)" $@
return 1
fi
targetJson="["
if [ $# -gt 3 ]; then
arr=(${@:3})
- for ((i=0; i<$(($#-3)); i=i+4)); do
+ for ((i=0; i<$(($#-3)); i=i+5)); do
if [ "$targetJson" != "[" ]; then
targetJson=$targetJson","
fi
- if [ -f ${arr[$i+3]} ]; then
- jobfile=$(cat ${arr[$i+3]})
+ if [ -f ${arr[$i+4]} ]; then
+ jobfile=$(cat ${arr[$i+4]})
jobfile=$(echo "$jobfile" | sed "s/XXXX/${arr[$i]}/g")
else
- _log_test_fail_general "Job template file "${arr[$i+3]}", does not exist"
+ _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]}\",\"ei_job_data\":$jobfile}"
+ 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}"
done
fi
targetJson=$targetJson"]"
}
# Prodstub API: Get job data for a job and compare with a target job json
-# <response-code> <producer-id> <job-id> <type-id> <target-url> <template-job-file>
+# <response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>
# (Function for test scripts)
prodstub_check_jobdata() {
__log_test_start $@
- if [ $# -ne 6 ]; then
- __print_err "<response-code> <producer-id> <job-id> <type-id> <target-url> <template-job-file>" $@
+ if [ $# -ne 7 ]; then
+ __print_err "<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>" $@
return 1
fi
- if [ -f $6 ]; then
- jobfile=$(cat $6)
+ if [ -f $7 ]; then
+ jobfile=$(cat $7)
jobfile=$(echo "$jobfile" | sed "s/XXXX/$3/g")
else
- _log_test_fail_general "Template file "$6" for jobdata, does not exist"
+ _log_test_fail_general "Template file "$7" for jobdata, does not exist"
return 1
fi
- targetJson="{\"ei_job_identity\":\"$3\",\"ei_type_identity\":\"$4\",\"target_uri\":\"$5\",\"ei_job_data\":$jobfile}"
+ targetJson="{\"ei_job_identity\":\"$3\",\"ei_type_identity\":\"$4\",\"target_uri\":\"$5\",\"owner\":\"$6\", \"ei_job_data\":$jobfile}"
file="./tmp/.p.json"
echo "$targetJson" > $file