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/.gitignore b/test/auto-test/.gitignore
index 89e22de..6091e4a 100644
--- a/test/auto-test/.gitignore
+++ b/test/auto-test/.gitignore
@@ -14,3 +14,4 @@
.timer*
.pid*
.result*
+tmp
diff --git a/test/auto-test/FTC1.sh b/test/auto-test/FTC1.sh
index e4482b6..4d05b9b 100755
--- a/test/auto-test/FTC1.sh
+++ b/test/auto-test/FTC1.sh
@@ -79,6 +79,9 @@
start_ric_simulators ricsim_g1 1 OSC_2.1.0
start_ric_simulators ricsim_g2 1 STD_1.1.3
+ if [ "$PMS_VERSION" == "V2" ]; then
+ start_ric_simulators ricsim_g3 1 STD_2.0.0
+ fi
start_mr
@@ -107,15 +110,27 @@
sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
- api_equal json:rics 2 60
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:rics 3 60
- api_equal json:policy_schemas 2 120
+ #api_equal json:policy_schemas 2 120
- api_equal json:policy_types 2
+ api_equal json:policy-types 2 120
- api_equal json:policies 0
+ api_equal json:policies 0
- api_equal json:policy_ids 0
+ api_equal json:policy_instances 0
+ else
+ api_equal json:rics 2 60
+
+ api_equal json:policy_schemas 2 120
+
+ api_equal json:policy_types 2
+
+ api_equal json:policies 0
+
+ api_equal json:policy_ids 0
+ fi
echo "############################################"
echo "############## Health check ################"
@@ -137,25 +152,40 @@
echo "############## RIC Repository ##############"
echo "############################################"
- api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:AVAILABLE ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE"
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:AVAILABLE ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE ricsim_g3_1:me1_ricsim_g3_1,me2_ricsim_g3_1:NOTYPE:AVAILABLE"
+ else
+ api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:AVAILABLE ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE"
+ fi
echo "############################################"
echo "########### A1 Policy Management ###########"
echo "############################################"
- api_put_policy 201 "serv1" ricsim_g1_1 1 5000 NOTRANSIENT testdata/OSC/pi1_template.json
- api_put_policy 200 "serv1" ricsim_g1_1 1 5000 NOTRANSIENT testdata/OSC/pi1_template.json
+ if [ "$PMS_VERSION" == "V2" ]; then
+ notificationurl="http://localhost:80"
+ else
+ notificationurl=""
+ fi
+ api_put_policy 201 "serv1" ricsim_g1_1 1 5000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
+ api_put_policy 200 "serv1" ricsim_g1_1 1 5000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
- api_put_policy 201 "serv1" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT testdata/STD/pi1_template.json
- api_put_policy 200 "serv1" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT testdata/STD/pi1_template.json
+ api_put_policy 201 "serv1" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json
+ api_put_policy 200 "serv1" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json
api_delete_policy 204 5000
api_delete_policy 204 5100
- api_equal json:policies 0
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policies 0
- api_equal json:policy_ids 0
+ api_equal json:policy_instances 0
+ else
+ api_equal json:policies 0
+
+ api_equal json:policy_ids 0
+ fi
cr_equal received_callbacks 0
@@ -173,9 +203,15 @@
if [[ $interface = *"SDNC"* ]]; then
sim_contains_str ricsim_g1_1 remote_hosts "a1-controller"
sim_contains_str ricsim_g2_1 remote_hosts "a1-controller"
+ if [ "$PMS_VERSION" == "V2" ]; then
+ sim_contains_str ricsim_g3_1 remote_hosts "a1-controller"
+ fi
else
sim_contains_str ricsim_g1_1 remote_hosts "policy-agent"
sim_contains_str ricsim_g2_1 remote_hosts "policy-agent"
+ if [ "$PMS_VERSION" == "V2" ]; then
+ sim_contains_str ricsim_g3_1 remote_hosts "policy-agent"
+ fi
fi
check_policy_agent_logs
diff --git a/test/auto-test/FTC10.sh b/test/auto-test/FTC10.sh
index 42b8f58..52a2bb3 100755
--- a/test/auto-test/FTC10.sh
+++ b/test/auto-test/FTC10.sh
@@ -47,6 +47,10 @@
start_ric_simulators ricsim_g2 5 STD_1.1.3
+if [ "$PMS_VERSION" == "V2" ]; then
+ start_ric_simulators ricsim_g3 1 STD_2.0.0
+fi
+
start_mr
start_cr
@@ -70,38 +74,52 @@
sim_print ricsim_g2_1 interface
+if [ "$PMS_VERSION" == "V2" ]; then
+ sim_print ricsim_g3_1 interface
+fi
+
sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
-api_equal json:policy_types 2 60
-
+if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy-types 2 60
+else
+ api_equal json:policy_types 2 60
+fi
# Create policies
+
+if [ "$PMS_VERSION" == "V2" ]; then
+ notificationurl="http://localhost:80"
+else
+ notificationurl=""
+fi
+
use_agent_rest_http
api_put_service 201 "service1" 3600 "$CR_PATH/1"
-api_put_policy 201 "service1" ricsim_g1_1 1 2000 NOTRANSIENT testdata/OSC/pi1_template.json 1
+api_put_policy 201 "service1" ricsim_g1_1 1 2000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json 1
sim_equal ricsim_g1_1 num_instances 1
use_agent_dmaap_http
-api_put_policy 201 "service1" ricsim_g1_1 1 3000 NOTRANSIENT testdata/OSC/pi1_template.json 1
+api_put_policy 201 "service1" ricsim_g1_1 1 3000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json 1
sim_equal ricsim_g1_1 num_instances 2
use_agent_rest_http
-api_put_policy 201 "service1" ricsim_g2_1 NOTYPE 2100 NOTRANSIENT testdata/STD/pi1_template.json 1
+api_put_policy 201 "service1" ricsim_g2_1 NOTYPE 2100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json 1
sim_equal ricsim_g2_1 num_instances 1
use_agent_dmaap_http
-api_put_policy 201 "service1" ricsim_g2_1 NOTYPE 3100 NOTRANSIENT testdata/STD/pi1_template.json 1
+api_put_policy 201 "service1" ricsim_g2_1 NOTYPE 3100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json 1
sim_equal ricsim_g2_1 num_instances 2
@@ -111,14 +129,14 @@
api_put_service 200 "service1" 3600 "$CR_PATH/1"
-api_put_policy 200 "service1" ricsim_g1_1 1 2000 NOTRANSIENT testdata/OSC/pi1_template.json 1
+api_put_policy 200 "service1" ricsim_g1_1 1 2000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json 1
sim_equal ricsim_g1_1 num_instances 2
use_agent_dmaap_http
-api_put_policy 200 "service1" ricsim_g1_1 1 3000 NOTRANSIENT testdata/OSC/pi1_template.json 1
+api_put_policy 200 "service1" ricsim_g1_1 1 3000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json 1
sim_equal ricsim_g1_1 num_instances 2
@@ -126,22 +144,29 @@
use_agent_rest_http
-api_put_policy 200 "service1" ricsim_g2_1 NOTYPE 2100 NOTRANSIENT testdata/STD/pi1_template.json 1
+api_put_policy 200 "service1" ricsim_g2_1 NOTYPE 2100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json 1
sim_equal ricsim_g2_1 num_instances 2
use_agent_dmaap_http
-api_put_policy 200 "service1" ricsim_g2_1 NOTYPE 3100 NOTRANSIENT testdata/STD/pi1_template.json 1
+api_put_policy 200 "service1" ricsim_g2_1 NOTYPE 3100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json 1
sim_equal ricsim_g2_1 num_instances 2
# Check policies
-api_get_policy 200 2000 testdata/OSC/pi1_template.json
-api_get_policy 200 3000 testdata/OSC/pi1_template.json
-api_get_policy 200 2100 testdata/STD/pi1_template.json
-api_get_policy 200 3100 testdata/STD/pi1_template.json
+if [ "$PMS_VERSION" == "V2" ]; then
+ api_get_policy 200 2000 testdata/OSC/pi1_template.json "service1" ricsim_g1_1 1 false $notificationurl
+ api_get_policy 200 3000 testdata/OSC/pi1_template.json "service1" ricsim_g1_1 1 false $notificationurl
+ api_get_policy 200 2100 testdata/STD/pi1_template.json "service1" ricsim_g2_1 NOTYPE false $notificationurl
+ api_get_policy 200 3100 testdata/STD/pi1_template.json "service1" ricsim_g2_1 NOTYPE false $notificationurl
+else
+ api_get_policy 200 2000 testdata/OSC/pi1_template.json
+ api_get_policy 200 3000 testdata/OSC/pi1_template.json
+ api_get_policy 200 2100 testdata/STD/pi1_template.json
+ api_get_policy 200 3100 testdata/STD/pi1_template.json
+fi
# Remove policies
@@ -157,10 +182,17 @@
sim_equal ricsim_g1_1 num_instances 0
sim_equal ricsim_g2_1 num_instances 0
+if [ "$PMS_VERSION" == "V2" ]; then
+ sim_equal ricsim_g3_1 num_instances 0
+fi
+
# Check remote host access to simulator
sim_contains_str ricsim_g1_1 remote_hosts "policy-agent"
sim_contains_str ricsim_g2_1 remote_hosts "policy-agent"
+if [ "$PMS_VERSION" == "V2" ]; then
+ sim_contains_str ricsim_g3_1 remote_hosts "policy-agent"
+fi
# Check policy removal
use_agent_rest_http
diff --git a/test/auto-test/FTC100.sh b/test/auto-test/FTC100.sh
index b617d3f..13d375b 100755
--- a/test/auto-test/FTC100.sh
+++ b/test/auto-test/FTC100.sh
@@ -33,8 +33,10 @@
# Tested variants of REST/DMAAP/SDNC config
TESTED_VARIANTS="REST DMAAP REST+SDNC DMAAP+SDNC"
+
#Test agent and simulator protocol versions (others are http only)
TESTED_PROTOCOLS="HTTP HTTPS"
+
for __httpx in $TESTED_PROTOCOLS ; do
for interface in $TESTED_VARIANTS ; do
@@ -77,6 +79,9 @@
start_ric_simulators ricsim_g1 1 OSC_2.1.0
start_ric_simulators ricsim_g2 1 STD_1.1.3
+ if [ "$PMS_VERSION" == "V2" ]; then
+ start_ric_simulators ricsim_g3 1 STD_2.0.0
+ fi
start_mr
@@ -105,15 +110,27 @@
sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
sim_put_policy_type 201 ricsim_g1_1 2 testdata/OSC/sim_2.json
- api_equal json:rics 2 60
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:rics 3 60
- api_equal json:policy_schemas 3 120
+ #api_equal json:policy-schemas 3 120
- api_equal json:policy_types 3
+ api_equal json:policy-types 3 120
- api_equal json:policies 0
+ api_equal json:policies 0
- api_equal json:policy_ids 0
+ api_equal json:policy_instances 0
+ else
+ api_equal json:rics 2 60
+
+ api_equal json:policy_schemas 3 120
+
+ api_equal json:policy_types 3
+
+ api_equal json:policies 0
+
+ api_equal json:policy_ids 0
+ fi
echo "############################################"
@@ -204,47 +221,90 @@
echo "############## RIC Repository ##############"
echo "############################################"
- api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE"
-
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE ricsim_g3_1:me1_ricsim_g3_1,me2_ricsim_g3_1:NOTYPE:AVAILABLE"
+ else
+ api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE"
+ fi
api_get_rics 200 1 "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE"
api_get_rics 404 47
api_get_rics 404 "test"
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_get_ric 200 me1_ricsim_g1_1 NORIC "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE"
- api_get_ric 200 me1_ricsim_g1_1 ricsim_g1_1
+ api_get_ric 200 me2_ricsim_g1_1 NORIC "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE"
- api_get_ric 200 me2_ricsim_g1_1 ricsim_g1_1
+ api_get_ric 200 me1_ricsim_g2_1 NORIC "ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE"
- api_get_ric 200 me1_ricsim_g2_1 ricsim_g2_1
+ api_get_ric 200 me2_ricsim_g2_1 NORIC "ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE"
- api_get_ric 200 me2_ricsim_g2_1 ricsim_g2_1
+ api_get_ric 200 NOME ricsim_g1_1 "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE"
- api_get_ric 404 test
+ api_get_ric 200 NOME ricsim_g2_1 "ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE"
+ api_get_ric 404 NOME test1
+
+ api_get_ric 404 test NORIC
+
+ api_get_ric 400 me1_ricsim_g1_1 ricsim_g1_1
+
+ api_get_ric 400 me1_ricsim_g1_1 TESTRIC
+
+ api_get_ric 400 TESTME ricsim_g1_1
+
+ else
+ api_get_ric 200 me1_ricsim_g1_1 ricsim_g1_1
+
+ api_get_ric 200 me2_ricsim_g1_1 ricsim_g1_1
+
+ api_get_ric 200 me1_ricsim_g2_1 ricsim_g2_1
+
+ api_get_ric 200 me2_ricsim_g2_1 ricsim_g2_1
+
+ api_get_ric 404 test
+ fi
echo "############################################"
echo "########### A1 Policy Management ###########"
echo "############################################"
- deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx"
- #Behaviour accepted for now
- api_get_policy_schema 200 1 testdata/OSC/1-agent-modified.json
- deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx"
- #Behaviour accepted for now
- api_get_policy_schema 200 2 testdata/OSC/2-agent-modified.json
- api_get_policy_schema 404 3
- deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx"
- #Behaviour accepted for now
- api_get_policy_schemas 200 NORIC testdata/OSC/1-agent-modified.json testdata/OSC/2-agent-modified.json NOFILE
- deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx"
- #Behaviour accepted for now
- api_get_policy_schemas 200 ricsim_g1_1 testdata/OSC/1-agent-modified.json testdata/OSC/2-agent-modified.json
+ if [ "$PMS_VERSION" == "V2" ]; then
+ deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx"
+ #Behaviour accepted for now
+ api_get_policy_type 200 1 testdata/OSC/1-agent-modified.json
+ deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx"
+ #Behaviour accepted for now
+ api_get_policy_type 200 2 testdata/OSC/2-agent-modified.json
- api_get_policy_schemas 200 ricsim_g2_1 NOFILE
+ api_get_policy_type 404 3
+ else
+ deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx"
+ #Behaviour accepted for now
+ api_get_policy_schema 200 1 testdata/OSC/1-agent-modified.json
+ deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx"
+ #Behaviour accepted for now
+ api_get_policy_schema 200 2 testdata/OSC/2-agent-modified.json
- api_get_policy_schemas 404 test
+ api_get_policy_schema 404 3
+ fi
+
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_get_policy_schemas 404
+ else
+ deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx"
+ #Behaviour accepted for now
+ api_get_policy_schemas 200 NORIC testdata/OSC/1-agent-modified.json testdata/OSC/2-agent-modified.json NOFILE
+ deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx"
+ #Behaviour accepted for now
+ api_get_policy_schemas 200 ricsim_g1_1 testdata/OSC/1-agent-modified.json testdata/OSC/2-agent-modified.json
+
+ api_get_policy_schemas 200 ricsim_g2_1 NOFILE
+
+ api_get_policy_schemas 404 test
+ fi
@@ -260,23 +320,28 @@
api_put_service 201 "service10" 3600 "$CR_PATH/1"
+ if [ "$PMS_VERSION" == "V2" ]; then
+ notificationurl="http://localhost:80"
+ else
+ notificationurl=""
+ fi
deviation "TR10 - agent allows policy creation on unregistered service (orig problem) - test combo $interface and $__httpx"
#Kept until decison
#api_put_policy 400 "unregistered-service" ricsim_g1_1 1 2000 NOTRANSIENT testdata/OSC/pi1_template.json
#Allow 201 for now
- api_put_policy 201 "unregistered-service" ricsim_g1_1 1 2000 NOTRANSIENT testdata/OSC/pi1_template.json
+ api_put_policy 201 "unregistered-service" ricsim_g1_1 1 2000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
- api_put_policy 201 "service10" ricsim_g1_1 1 5000 NOTRANSIENT testdata/OSC/pi1_template.json
- api_put_policy 200 "service10" ricsim_g1_1 1 5000 NOTRANSIENT testdata/OSC/pi1_template.json
+ api_put_policy 201 "service10" ricsim_g1_1 1 5000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
+ api_put_policy 200 "service10" ricsim_g1_1 1 5000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
- api_put_policy 200 "service10" ricsim_g1_1 1 5000 true testdata/OSC/pi1_template.json
- api_put_policy 200 "service10" ricsim_g1_1 1 5000 false testdata/OSC/pi1_template.json
+ api_put_policy 200 "service10" ricsim_g1_1 1 5000 true $notificationurl testdata/OSC/pi1_template.json
+ api_put_policy 200 "service10" ricsim_g1_1 1 5000 false $notificationurl testdata/OSC/pi1_template.json
- api_put_policy 201 "service10" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT testdata/STD/pi1_template.json
- api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT testdata/STD/pi1_template.json
+ api_put_policy 201 "service10" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json
+ api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json
- api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 true testdata/STD/pi1_template.json
- api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 false testdata/STD/pi1_template.json
+ api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 true $notificationurl testdata/STD/pi1_template.json
+ api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 false $notificationurl testdata/STD/pi1_template.json
VAL='NOT IN EFFECT'
api_get_policy_status 200 5000 OSC "$VAL" "false"
@@ -293,7 +358,11 @@
#kept until decision
#api_equal json:policy_ids 2
#Allow 3 for now
- api_equal json:policy_ids 3
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy_instances 3
+ else
+ api_equal json:policy_ids 3
+ fi
deviation "TR10 - agent allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
#kept until decision
@@ -323,14 +392,19 @@
api_get_policy_ids 200 ricsim_g2_1 NOSERVICE 1 NOID
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_get_policy 200 5000 testdata/OSC/pi1_template.json "service10" ricsim_g1_1 1 false $notificationurl
- api_get_policy 200 5000 testdata/OSC/pi1_template.json
+ api_get_policy 200 5100 testdata/STD/pi1_template.json "service10" ricsim_g2_1 NOTYPE false $notificationurl
- api_get_policy 200 5100 testdata/STD/pi1_template.json
+ api_get_policies 200 ricsim_g1_1 "service10" 1 5000 ricsim_g1_1 "service10" 1 false $notificationurl testdata/OSC/pi1_template.json
+ else
+ api_get_policy 200 5000 testdata/OSC/pi1_template.json
+ api_get_policy 200 5100 testdata/STD/pi1_template.json
- api_get_policies 200 ricsim_g1_1 "service10" 1 5000 ricsim_g1_1 "service10" 1 testdata/OSC/pi1_template.json
-
+ api_get_policies 200 ricsim_g1_1 "service10" 1 5000 ricsim_g1_1 "service10" 1 testdata/OSC/pi1_template.json
+ fi
deviation "TR10 - agent allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
#kept until decision
@@ -344,13 +418,21 @@
api_equal json:policies 1
- api_equal json:policy_ids 1
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy_instances 1
+ else
+ api_equal json:policy_ids 1
+ fi
api_delete_policy 204 5100
api_equal json:policies 0
- api_equal json:policy_ids 0
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy_instances 0
+ else
+ api_equal json:policy_ids 0
+ fi
cr_equal received_callbacks 0
@@ -369,9 +451,15 @@
if [[ $interface = *"SDNC"* ]]; then
sim_contains_str ricsim_g1_1 remote_hosts "a1-controller"
sim_contains_str ricsim_g2_1 remote_hosts "a1-controller"
+ if [ "$PMS_VERSION" == "V2" ]; then
+ sim_contains_str ricsim_g3_1 remote_hosts "a1-controller"
+ fi
else
sim_contains_str ricsim_g1_1 remote_hosts "policy-agent"
sim_contains_str ricsim_g2_1 remote_hosts "policy-agent"
+ if [ "$PMS_VERSION" == "V2" ]; then
+ sim_contains_str ricsim_g3_1 remote_hosts "policy-agent"
+ fi
fi
check_policy_agent_logs
diff --git a/test/auto-test/FTC110.sh b/test/auto-test/FTC110.sh
index c840800..23f68c7 100755
--- a/test/auto-test/FTC110.sh
+++ b/test/auto-test/FTC110.sh
@@ -45,6 +45,10 @@
clean_containers
start_ric_simulators ricsim_g1 1 OSC_2.1.0
+start_ric_simulators ricsim_g2 1 STD_1.1.3
+if [ "$PMS_VERSION" == "V2" ]; then
+ start_ric_simulators ricsim_g3 1 STD_2.0.0
+fi
start_mr
@@ -70,6 +74,10 @@
#Print simulator interface version
sim_print ricsim_g1_1 interface
+sim_print ricsim_g2_1 interface
+if [ "$PMS_VERSION" == "V2" ]; then
+ sim_print ricsim_g3_1 interface
+fi
api_put_service 201 "service1" 15 "$CR_PATH/service1"
@@ -151,32 +159,54 @@
sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
-api_equal json:rics 1 60
+if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:rics 3 60
-api_equal json:policy_schemas 1 120
+ #api_equal json:policy_schemas 2 120
-api_equal json:policy_types 1
+ api_equal json:policy-types 2 120
-api_equal json:policies 0
+ api_equal json:policies 0
+else
+ api_equal json:rics 2 60
-api_put_policy 201 "service10" ricsim_g1_1 1 5000 NOTRANSIENT testdata/OSC/pi1_template.json
+ api_equal json:policy_schemas 2 120
-api_equal json:policies 1
+ api_equal json:policy_types 2
-sim_equal ricsim_g1_1 num_instances 1
+ api_equal json:policies 0
+fi
-api_put_policy 201 "service10" ricsim_g1_1 1 5001 true testdata/OSC/pi1_template.json
+if [ "$PMS_VERSION" == "V2" ]; then
+ notificationurl="http://localhost:80"
+else
+ notificationurl=""
+fi
+
+api_put_policy 201 "service10" ricsim_g1_1 1 5000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
+api_put_policy 201 "service10" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json
api_equal json:policies 2
+sim_equal ricsim_g1_1 num_instances 1
+sim_equal ricsim_g2_1 num_instances 1
+
+api_put_policy 201 "service10" ricsim_g1_1 1 5001 true $notificationurl testdata/OSC/pi1_template.json
+api_put_policy 201 "service10" ricsim_g2_1 NOTYPE 5101 true $notificationurl testdata/STD/pi1_template.json
+
+api_equal json:policies 4
+
sim_equal ricsim_g1_1 num_instances 2
+sim_equal ricsim_g2_1 num_instances 2
sim_post_delete_instances 200 ricsim_g1_1
+sim_post_delete_instances 200 ricsim_g2_1
#Wait for recreate of non transient policy
-api_equal json:policies 1 180
+api_equal json:policies 2 180
sim_equal ricsim_g1_1 num_instances 1
+sim_equal ricsim_g2_1 num_instances 1
api_put_service 200 "service10" 10 "$CR_PATH/service10"
@@ -184,12 +214,13 @@
api_equal json:policies 0 120
sim_equal ricsim_g1_1 num_instances 0
-
+sim_equal ricsim_g2_1 num_instances 0
api_get_service_ids 200
deviation "TR18 Agents sends callback with empty body"
-cr_equal received_callbacks 4
+deviation "TR18 Unclear when callbacks are sent...."
+#cr_equal received_callbacks 8
mr_equal requests_submitted 0
check_policy_agent_logs
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
diff --git a/test/auto-test/FTC150.sh b/test/auto-test/FTC150.sh
index bb527be..1cd7754 100755
--- a/test/auto-test/FTC150.sh
+++ b/test/auto-test/FTC150.sh
@@ -55,6 +55,9 @@
start_ric_simulators ricsim_g1 1 OSC_2.1.0
start_ric_simulators ricsim_g2 1 STD_1.1.3
+ if [ "$PMS_VERSION" == "V2" ]; then
+ start_ric_simulators ricsim_g3 1 STD_2.0.0
+ fi
start_sdnc
diff --git a/test/auto-test/FTC300.sh b/test/auto-test/FTC300.sh
index fb7bc34..6e00c9d 100755
--- a/test/auto-test/FTC300.sh
+++ b/test/auto-test/FTC300.sh
@@ -17,7 +17,7 @@
# ============LICENSE_END=================================================
#
-TC_ONELINE_DESCR="Resync 10000 policies using OSC interface over REST"
+TC_ONELINE_DESCR="Resync 10000 policies using OSC and STD interface"
#App names to include in the test, space separated list
INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
@@ -78,6 +78,10 @@
start_ric_simulators ricsim_g2 4 STD_1.1.3
+ if [ "$PMS_VERSION" == "V2" ]; then
+ start_ric_simulators ricsim_g3 4 STD_2.0.0
+ fi
+
start_mr
start_cr
@@ -105,65 +109,79 @@
sim_print ricsim_g2_1 interface
+ if [ "$PMS_VERSION" == "V2" ]; then
+ sim_print ricsim_g3_1 interface
+ fi
+
sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
- api_equal json:policy_types 2 120 #Wait for the agent to refresh types from the simulator
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy-types 2 120 #Wait for the agent to refresh types from the simulator
+ else
+ api_equal json:policy_types 2 120 #Wait for the agent to refresh types from the simulator
+ fi
api_put_service 201 "serv1" 3600 "$CR_PATH/1"
START_ID=2000
NUM_POLICIES=10000
- if [[ $interface == *"BATCH"* ]]; then
- api_put_policy_batch 201 "serv1" ricsim_g1_1 1 $START_ID NOTRANSIENT testdata/OSC/pi1_template.json $NUM_POLICIES
+ if [ "$PMS_VERSION" == "V2" ]; then
+ notificationurl="http://localhost:80"
else
- api_put_policy 201 "serv1" ricsim_g1_1 1 $START_ID NOTRANSIENT testdata/OSC/pi1_template.json $NUM_POLICIES
+ notificationurl=""
fi
- sim_equal ricsim_g1_1 num_instances 10000
+ if [[ $interface == *"BATCH"* ]]; then
+ api_put_policy_batch 201 "serv1" ricsim_g1_1 1 $START_ID NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json $NUM_POLICIES
+ else
+ api_put_policy 201 "serv1" ricsim_g1_1 1 $START_ID NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json $NUM_POLICIES
+ fi
+
+ sim_equal ricsim_g1_1 num_instances $NUM_POLICIES
sim_post_delete_instances 200 ricsim_g1_1
sim_equal ricsim_g1_1 num_instances 0
- sim_equal ricsim_g1_1 num_instances 10000 300
+ sim_equal ricsim_g1_1 num_instances $NUM_POLICIES 300
- START_ID=$(($START_ID+$NUM_POLICIES))
+ START_ID2=$(($START_ID+$NUM_POLICIES))
if [[ $interface == *"BATCH"* ]]; then
- api_put_policy_batch 201 "serv1" ricsim_g2_1 NOTYPE $START_ID NOTRANSIENT testdata/STD/pi1_template.json $NUM_POLICIES
+ api_put_policy_batch 201 "serv1" ricsim_g2_1 NOTYPE $START_ID2 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json $NUM_POLICIES
else
- api_put_policy 201 "serv1" ricsim_g2_1 NOTYPE $START_ID NOTRANSIENT testdata/STD/pi1_template.json $NUM_POLICIES
+ api_put_policy 201 "serv1" ricsim_g2_1 NOTYPE $START_ID2 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json $NUM_POLICIES
fi
- sim_equal ricsim_g2_1 num_instances 10000
+ sim_equal ricsim_g2_1 num_instances $NUM_POLICIES
sim_post_delete_instances 200 ricsim_g2_1
sim_equal ricsim_g2_1 num_instances 0
- sim_equal ricsim_g2_1 num_instances 10000 300
+ sim_equal ricsim_g2_1 num_instances $NUM_POLICIES 300
- api_delete_policy 204 2435
+ api_delete_policy 204 $(($START_ID+47))
- api_delete_policy 204 8693
+ api_delete_policy 204 $(($START_ID+$NUM_POLICIES-39))
sim_post_delete_instances 200 ricsim_g1_1
- sim_equal ricsim_g1_1 num_instances 9998 300
+ sim_equal ricsim_g1_1 num_instances $(($NUM_POLICIES-2)) 300
- api_delete_policy 204 12435
+ api_delete_policy 204 $(($START_ID2+37))
- api_delete_policy 204 18693
+ api_delete_policy 204 $(($START_ID2+$NUM_POLICIES-93))
- api_delete_policy 204 18697
+ api_delete_policy 204 $(($START_ID2+$NUM_POLICIES-91))
sim_post_delete_instances 200 ricsim_g2_1
- sim_equal ricsim_g1_1 num_instances 9998 300
+ sim_equal ricsim_g1_1 num_instances $(($NUM_POLICIES-2)) 300
- sim_equal ricsim_g2_1 num_instances 9997 300
+ sim_equal ricsim_g2_1 num_instances $(($NUM_POLICIES-3)) 300
- api_equal json:policies 19995
+ api_equal json:policies $(($NUM_POLICIES-2+$NUM_POLICIES-3))
check_policy_agent_logs
diff --git a/test/auto-test/FTC310.sh b/test/auto-test/FTC310.sh
index 856d6f5..bf5785e 100755
--- a/test/auto-test/FTC310.sh
+++ b/test/auto-test/FTC310.sh
@@ -38,6 +38,9 @@
# Start one RIC of each type
start_ric_simulators ricsim_g1 1 OSC_2.1.0
start_ric_simulators ricsim_g2 1 STD_1.1.3
+if [ "$PMS_VERSION" == "V2" ]; then
+ start_ric_simulators ricsim_g3 1 STD_2.0.0
+fi
start_mr
@@ -53,29 +56,41 @@
start_policy_agent
-api_equal json:rics 2 120
+if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:rics 3 120
+else
+ api_equal json:rics 2 120
+fi
-# Add an OSC RIC and check
+# Add an STD RIC and check
start_ric_simulators ricsim_g2 2 STD_1.1.3
prepare_consul_config NOSDNC ".consul_config.json"
consul_config_app ".consul_config.json"
-api_equal json:rics 3 120
+if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:rics 4 120
+else
+ api_equal json:rics 3 120
+fi
check_policy_agent_logs
check_control_panel_logs
-# Remove one OSC RIC and check
+# Remove one RIC RIC and check
start_ric_simulators ricsim_g2 1 STD_1.1.3
prepare_consul_config NOSDNC ".consul_config.json"
consul_config_app ".consul_config.json"
-api_equal json:rics 2 120
+if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:rics 3 120
+else
+ api_equal json:rics 2 120
+fi
check_policy_agent_logs
check_control_panel_logs
diff --git a/test/auto-test/FTC350.sh b/test/auto-test/FTC350.sh
index 4b2e3cb..4f2244c 100755
--- a/test/auto-test/FTC350.sh
+++ b/test/auto-test/FTC350.sh
@@ -138,17 +138,31 @@
sim_put_policy_type 201 ricsim_g1_8 5 testdata/OSC/sim_5.json
sim_put_policy_type 201 ricsim_g1_9 5 testdata/OSC/sim_5.json
- api_equal json:policy_types 5 120
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy-types 5 120
- echo "Check the number of types in the agent for each ric"
- api_equal json:policy_types?ric=ricsim_g1_1 1 120
- api_equal json:policy_types?ric=ricsim_g1_2 2 120
- api_equal json:policy_types?ric=ricsim_g1_3 3 120
- api_equal json:policy_types?ric=ricsim_g1_4 4 120
- api_equal json:policy_types?ric=ricsim_g1_5 5 120
- api_equal json:policy_types?ric=ricsim_g1_6 4 120
- api_equal json:policy_types?ric=ricsim_g1_7 3 120
- api_equal json:policy_types?ric=ricsim_g1_8 2 120
+ echo "Check the number of types in the agent for each ric"
+ api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
+ api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
+ api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
+ api_equal json:policy-types?ric_id=ricsim_g1_4 4 120
+ api_equal json:policy-types?ric_id=ricsim_g1_5 5 120
+ api_equal json:policy-types?ric_id=ricsim_g1_6 4 120
+ api_equal json:policy-types?ric_id=ricsim_g1_7 3 120
+ api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
+ else
+ api_equal json:policy_types 5 120
+
+ echo "Check the number of types in the agent for each ric"
+ api_equal json:policy_types?ric=ricsim_g1_1 1 120
+ api_equal json:policy_types?ric=ricsim_g1_2 2 120
+ api_equal json:policy_types?ric=ricsim_g1_3 3 120
+ api_equal json:policy_types?ric=ricsim_g1_4 4 120
+ api_equal json:policy_types?ric=ricsim_g1_5 5 120
+ api_equal json:policy_types?ric=ricsim_g1_6 4 120
+ api_equal json:policy_types?ric=ricsim_g1_7 3 120
+ api_equal json:policy_types?ric=ricsim_g1_8 2 120
+ fi
api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
@@ -165,17 +179,33 @@
api_equal json:rics 10 120
- echo "Check the number of types in the agent for each ric"
- api_equal json:policy_types?ric=ricsim_g1_1 1 120
- api_equal json:policy_types?ric=ricsim_g1_2 2 120
- api_equal json:policy_types?ric=ricsim_g1_3 3 120
- api_equal json:policy_types?ric=ricsim_g1_4 4 120
- api_equal json:policy_types?ric=ricsim_g1_5 5 120
- api_equal json:policy_types?ric=ricsim_g1_6 4 120
- api_equal json:policy_types?ric=ricsim_g1_7 3 120
- api_equal json:policy_types?ric=ricsim_g1_8 2 120
- api_equal json:policy_types?ric=ricsim_g1_9 1 120
- api_equal json:policy_types?ric=ricsim_g1_10 0 120
+ if [ "$PMS_VERSION" == "V2" ]; then
+
+ echo "Check the number of types in the agent for each ric"
+ api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
+ api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
+ api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
+ api_equal json:policy-types?ric_id=ricsim_g1_4 4 120
+ api_equal json:policy-types?ric_id=ricsim_g1_5 5 120
+ api_equal json:policy-types?ric_id=ricsim_g1_6 4 120
+ api_equal json:policy-types?ric_id=ricsim_g1_7 3 120
+ api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
+ api_equal json:policy-types?ric_id=ricsim_g1_9 1 120
+ api_equal json:policy-types?ric_id=ricsim_g1_10 0 120
+ else
+
+ echo "Check the number of types in the agent for each ric"
+ api_equal json:policy_types?ric=ricsim_g1_1 1 120
+ api_equal json:policy_types?ric=ricsim_g1_2 2 120
+ api_equal json:policy_types?ric=ricsim_g1_3 3 120
+ api_equal json:policy_types?ric=ricsim_g1_4 4 120
+ api_equal json:policy_types?ric=ricsim_g1_5 5 120
+ api_equal json:policy_types?ric=ricsim_g1_6 4 120
+ api_equal json:policy_types?ric=ricsim_g1_7 3 120
+ api_equal json:policy_types?ric=ricsim_g1_8 2 120
+ api_equal json:policy_types?ric=ricsim_g1_9 1 120
+ api_equal json:policy_types?ric=ricsim_g1_10 0 120
+ fi
api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
@@ -191,13 +221,27 @@
#No policy type in sim #10
- api_equal json:policy_types 5
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy-types 5
+ else
+ api_equal json:policy_types 5
+ fi
api_put_service 201 "serv1" 3600 "$CR_PATH/serv1"
- api_put_policy 201 "serv1" ricsim_g1_9 5 2000 NOTRANSIENT testdata/OSC/pi5_template.json 1
+ if [ "$PMS_VERSION" == "V2" ]; then
+ notificationurl="http://localhost:80"
+ else
+ notificationurl=""
+ fi
- api_equal json:policy_ids 1
+ api_put_policy 201 "serv1" ricsim_g1_9 5 2000 NOTRANSIENT $notificationurl testdata/OSC/pi5_template.json 1
+
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy_instances 1
+ else
+ api_equal json:policy_ids 1
+ fi
sim_equal ricsim_g1_9 num_instances 1
@@ -207,15 +251,27 @@
api_equal json:rics 8 120
- echo "Check the number of types in the agent for each ric"
- api_equal json:policy_types?ric=ricsim_g1_1 1 120
- api_equal json:policy_types?ric=ricsim_g1_2 2 120
- api_equal json:policy_types?ric=ricsim_g1_3 3 120
- api_equal json:policy_types?ric=ricsim_g1_4 4 120
- api_equal json:policy_types?ric=ricsim_g1_5 5 120
- api_equal json:policy_types?ric=ricsim_g1_6 4 120
- api_equal json:policy_types?ric=ricsim_g1_7 3 120
- api_equal json:policy_types?ric=ricsim_g1_8 2 120
+ if [ "$PMS_VERSION" == "V2" ]; then
+ echo "Check the number of types in the agent for each ric"
+ api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
+ api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
+ api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
+ api_equal json:policy-types?ric_id=ricsim_g1_4 4 120
+ api_equal json:policy-types?ric_id=ricsim_g1_5 5 120
+ api_equal json:policy-types?ric_id=ricsim_g1_6 4 120
+ api_equal json:policy-types?ric_id=ricsim_g1_7 3 120
+ api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
+ else
+ echo "Check the number of types in the agent for each ric"
+ api_equal json:policy_types?ric=ricsim_g1_1 1 120
+ api_equal json:policy_types?ric=ricsim_g1_2 2 120
+ api_equal json:policy_types?ric=ricsim_g1_3 3 120
+ api_equal json:policy_types?ric=ricsim_g1_4 4 120
+ api_equal json:policy_types?ric=ricsim_g1_5 5 120
+ api_equal json:policy_types?ric=ricsim_g1_6 4 120
+ api_equal json:policy_types?ric=ricsim_g1_7 3 120
+ api_equal json:policy_types?ric=ricsim_g1_8 2 120
+ fi
api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
@@ -228,7 +284,11 @@
sleep_wait 120
- api_equal json:policy_ids 0
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy_instances 0
+ else
+ api_equal json:policy_ids 0
+ fi
api_get_policy_types 404 ricsim_g1_9
@@ -241,17 +301,31 @@
api_equal json:rics 10 120
- echo "Check the number of types in the agent for each ric"
- api_equal json:policy_types?ric=ricsim_g1_1 1 120
- api_equal json:policy_types?ric=ricsim_g1_2 2 120
- api_equal json:policy_types?ric=ricsim_g1_3 3 120
- api_equal json:policy_types?ric=ricsim_g1_4 4 120
- api_equal json:policy_types?ric=ricsim_g1_5 5 120
- api_equal json:policy_types?ric=ricsim_g1_6 4 120
- api_equal json:policy_types?ric=ricsim_g1_7 3 120
- api_equal json:policy_types?ric=ricsim_g1_8 2 120
- api_equal json:policy_types?ric=ricsim_g1_9 1 120
- api_equal json:policy_types?ric=ricsim_g1_10 0 120
+ if [ "$PMS_VERSION" == "V2" ]; then
+ echo "Check the number of types in the agent for each ric"
+ api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
+ api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
+ api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
+ api_equal json:policy-types?ric_id=ricsim_g1_4 4 120
+ api_equal json:policy-types?ric_id=ricsim_g1_5 5 120
+ api_equal json:policy-types?ric_id=ricsim_g1_6 4 120
+ api_equal json:policy-types?ric_id=ricsim_g1_7 3 120
+ api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
+ api_equal json:policy-types?ric_id=ricsim_g1_9 1 120
+ api_equal json:policy-types?ric_id=ricsim_g1_10 0 120
+ else
+ echo "Check the number of types in the agent for each ric"
+ api_equal json:policy_types?ric=ricsim_g1_1 1 120
+ api_equal json:policy_types?ric=ricsim_g1_2 2 120
+ api_equal json:policy_types?ric=ricsim_g1_3 3 120
+ api_equal json:policy_types?ric=ricsim_g1_4 4 120
+ api_equal json:policy_types?ric=ricsim_g1_5 5 120
+ api_equal json:policy_types?ric=ricsim_g1_6 4 120
+ api_equal json:policy_types?ric=ricsim_g1_7 3 120
+ api_equal json:policy_types?ric=ricsim_g1_8 2 120
+ api_equal json:policy_types?ric=ricsim_g1_9 1 120
+ api_equal json:policy_types?ric=ricsim_g1_10 0 120
+ fi
api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
@@ -266,7 +340,11 @@
sleep_wait 120
- api_equal json:policy_ids 0
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy_instances 0
+ else
+ api_equal json:policy_ids 0
+ fi
sim_equal ricsim_g1_9 num_instances 0
@@ -278,16 +356,29 @@
sleep_wait 120
- api_equal json:policy_types?ric=ricsim_g1_1 1 120
- api_equal json:policy_types?ric=ricsim_g1_2 2 120
- api_equal json:policy_types?ric=ricsim_g1_3 3 120
- api_equal json:policy_types?ric=ricsim_g1_4 3 120
- api_equal json:policy_types?ric=ricsim_g1_5 4 120
- api_equal json:policy_types?ric=ricsim_g1_6 3 120
- api_equal json:policy_types?ric=ricsim_g1_7 2 120
- api_equal json:policy_types?ric=ricsim_g1_8 2 120
- api_equal json:policy_types?ric=ricsim_g1_9 1 120
- api_equal json:policy_types?ric=ricsim_g1_10 0 120
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
+ api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
+ api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
+ api_equal json:policy-types?ric_id=ricsim_g1_4 3 120
+ api_equal json:policy-types?ric_id=ricsim_g1_5 4 120
+ api_equal json:policy-types?ric_id=ricsim_g1_6 3 120
+ api_equal json:policy-types?ric_id=ricsim_g1_7 2 120
+ api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
+ api_equal json:policy-types?ric_id=ricsim_g1_9 1 120
+ api_equal json:policy-types?ric_id=ricsim_g1_10 0 120
+ else
+ api_equal json:policy_types?ric=ricsim_g1_1 1 120
+ api_equal json:policy_types?ric=ricsim_g1_2 2 120
+ api_equal json:policy_types?ric=ricsim_g1_3 3 120
+ api_equal json:policy_types?ric=ricsim_g1_4 3 120
+ api_equal json:policy_types?ric=ricsim_g1_5 4 120
+ api_equal json:policy_types?ric=ricsim_g1_6 3 120
+ api_equal json:policy_types?ric=ricsim_g1_7 2 120
+ api_equal json:policy_types?ric=ricsim_g1_8 2 120
+ api_equal json:policy_types?ric=ricsim_g1_9 1 120
+ api_equal json:policy_types?ric=ricsim_g1_10 0 120
+ fi
api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
@@ -302,7 +393,11 @@
sim_delete_policy_type 204 ricsim_g1_8 4
- api_equal json:policy_types?ric=ricsim_g1_8 1 120
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy-types?ric_id=ricsim_g1_8 1 120
+ else
+ api_equal json:policy_types?ric=ricsim_g1_8 1 120
+ fi
api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \
ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \
diff --git a/test/auto-test/FTC800.sh b/test/auto-test/FTC800.sh
index 25678be..6d25c29 100755
--- a/test/auto-test/FTC800.sh
+++ b/test/auto-test/FTC800.sh
@@ -72,6 +72,9 @@
start_ric_simulators ricsim_g1 1 OSC_2.1.0
start_ric_simulators ricsim_g2 1 STD_1.1.3
+ if [ "$PMS_VERSION" == "V2" ]; then
+ start_ric_simulators ricsim_g3 1 STD_2.0.0
+ fi
start_mr
@@ -105,13 +108,22 @@
sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
-
- api_equal json:policy_types 2 120 #Wait for the agent to refresh types from the simulators
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy-types 2 120 #Wait for the agent to refresh types from the simulators
+ else
+ api_equal json:policy_types 2 120 #Wait for the agent to refresh types from the simulators
+ fi
api_put_service 201 "serv1" 3600 "$CR_PATH/1"
+ if [ "$PMS_VERSION" == "V2" ]; then
+ notificationurl="http://localhost:80"
+ else
+ notificationurl=""
+ fi
+
start_timer "Create polices in OSC via agent REST and $interface using "$__httpx
- api_put_policy 201 "serv1" ricsim_g1_1 1 $START_ID NOTRANSIENT testdata/OSC/pi1_template.json $NUM_POLICIES
+ api_put_policy 201 "serv1" ricsim_g1_1 1 $START_ID NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json $NUM_POLICIES
print_timer "Create polices in OSC via agent REST and $interface using "$__httpx
sim_equal ricsim_g1_1 num_instances $NUM_POLICIES
@@ -119,7 +131,7 @@
START_ID=$(($START_ID+$NUM_POLICIES))
start_timer "Create polices in STD via agent REST and $interface using "$__httpx
- api_put_policy 201 "serv1" ricsim_g2_1 NOTYPE $START_ID NOTRANSIENT testdata/STD/pi1_template.json $NUM_POLICIES
+ api_put_policy 201 "serv1" ricsim_g2_1 NOTYPE $START_ID NOTRANSIENT $notificationurl testdata/STD/pi1_template.json $NUM_POLICIES
print_timer "Create polices in STD via agent REST and $interface using "$__httpx
sim_equal ricsim_g2_1 num_instances $NUM_POLICIES
@@ -135,7 +147,7 @@
START_ID=$(($START_ID+$NUM_POLICIES))
start_timer "Create polices in OSC via agent DMAAP, one by one, and $interface using "$__httpx
- api_put_policy 201 "serv1" ricsim_g1_1 1 $START_ID NOTRANSIENT testdata/OSC/pi1_template.json $NUM_POLICIES
+ api_put_policy 201 "serv1" ricsim_g1_1 1 $START_ID NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json $NUM_POLICIES
print_timer "Create polices in OSC via agent DMAAP, one by one, and $interface using "$__httpx
sim_equal ricsim_g1_1 num_instances $((2*$NUM_POLICIES))
@@ -143,7 +155,7 @@
START_ID=$(($START_ID+$NUM_POLICIES))
start_timer "Create polices in STD via agent DMAAP, one by one, and $interface using "$__httpx
- api_put_policy 201 "serv1" ricsim_g2_1 NOTYPE $START_ID NOTRANSIENT testdata/STD/pi1_template.json $NUM_POLICIES
+ api_put_policy 201 "serv1" ricsim_g2_1 NOTYPE $START_ID NOTRANSIENT $notificationurl testdata/STD/pi1_template.json $NUM_POLICIES
print_timer "Create polices in STD via agent DMAAP, one by one, and $interface using "$__httpx
sim_equal ricsim_g2_1 num_instances $((2*$NUM_POLICIES))
@@ -151,7 +163,7 @@
START_ID=$(($START_ID+$NUM_POLICIES))
start_timer "Create polices in OSC via agent DMAAP in batch and $interface using "$__httpx
- api_put_policy_batch 201 "serv1" ricsim_g1_1 1 $START_ID NOTRANSIENT testdata/OSC/pi1_template.json $NUM_POLICIES
+ api_put_policy_batch 201 "serv1" ricsim_g1_1 1 $START_ID NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json $NUM_POLICIES
print_timer "Create polices in OSC via agent DMAAP in batch and $interface using "$__httpx
sim_equal ricsim_g1_1 num_instances $((3*$NUM_POLICIES))
@@ -159,7 +171,7 @@
START_ID=$(($START_ID+$NUM_POLICIES))
start_timer "Create polices in STD via agent DMAAP in batch and $interface using "$__httpx
- api_put_policy_batch 201 "serv1" ricsim_g2_1 NOTYPE $START_ID NOTRANSIENT testdata/STD/pi1_template.json $NUM_POLICIES
+ api_put_policy_batch 201 "serv1" ricsim_g2_1 NOTYPE $START_ID NOTRANSIENT $notificationurl testdata/STD/pi1_template.json $NUM_POLICIES
print_timer "Create polices in STD via agent DMAAP in batch and $interface using "$__httpx
sim_equal ricsim_g2_1 num_instances $((3*$NUM_POLICIES))
@@ -167,9 +179,15 @@
if [ $interface == "SDNC" ]; then
sim_contains_str ricsim_g1_1 remote_hosts "a1-controller"
sim_contains_str ricsim_g2_1 remote_hosts "a1-controller"
+ if [ "$PMS_VERSION" == "V2" ]; then
+ sim_contains_str ricsim_g3_1 remote_hosts "a1-controller"
+ fi
else
sim_contains_str ricsim_g1_1 remote_hosts "policy-agent"
sim_contains_str ricsim_g2_1 remote_hosts "policy-agent"
+ if [ "$PMS_VERSION" == "V2" ]; then
+ sim_contains_str ricsim_g3_1 remote_hosts "policy-agent"
+ fi
fi
check_policy_agent_logs
diff --git a/test/auto-test/FTC810.sh b/test/auto-test/FTC810.sh
index 009efc0..4cc00bd 100755
--- a/test/auto-test/FTC810.sh
+++ b/test/auto-test/FTC810.sh
@@ -114,12 +114,20 @@
done
echo "Wait for the agent to refresh types from the simulator"
-api_equal json:policy_types 2 120
+if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy-types 2 120
+else
+ api_equal json:policy_types 2 120
+fi
echo "Check the number of types in the agent for each ric is 1"
for ((i=1; i<=$NUM_RICS; i++))
do
- api_equal json:policy_types?ric=ricsim_g1_$i 1 120
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy-types?ric_id=ricsim_g1_$i 1 120
+ else
+ api_equal json:policy_types?ric=ricsim_g1_$i 1 120
+ fi
done
echo "Register a service"
@@ -132,6 +140,12 @@
MR_MESSAGES=0
+if [ "$PMS_VERSION" == "V2" ]; then
+ notificationurl="http://localhost:80"
+else
+ notificationurl=""
+fi
+
while [ $(($SECONDS-$TEST_START)) -lt $TEST_DURATION ]; do
echo ""
@@ -166,14 +180,14 @@
INSTANCE_ID=200000
INSTANCES=0
if [ $interface == "REST_PARALLEL" ]; then
- api_put_policy_parallel 201 "serv1" ricsim_g1_ $NUM_RICS 1 $INSTANCE_ID NOTRANSIENT testdata/OSC/pi1_template.json $NUM_INSTANCES 3
+ api_put_policy_parallel 201 "serv1" ricsim_g1_ $NUM_RICS 1 $INSTANCE_ID NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json $NUM_INSTANCES 3
fi
for ((i=1; i<=$NUM_RICS; i++))
do
if [ $interface == "DMAAP-BATCH" ]; then
- api_put_policy_batch 201 "serv1" ricsim_g1_$i 1 $INSTANCE_ID NOTRANSIENT testdata/OSC/pi1_template.json $NUM_INSTANCES
+ api_put_policy_batch 201 "serv1" ricsim_g1_$i 1 $INSTANCE_ID NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json $NUM_INSTANCES
elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then
- api_put_policy 201 "serv1" ricsim_g1_$i 1 $INSTANCE_ID NOTRANSIENT testdata/OSC/pi1_template.json $NUM_INSTANCES
+ api_put_policy 201 "serv1" ricsim_g1_$i 1 $INSTANCE_ID NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json $NUM_INSTANCES
fi
if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then
MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES))
@@ -183,18 +197,22 @@
INSTANCES=$(($INSTANCES+$NUM_INSTANCES))
done
- api_equal json:policy_ids $INSTANCES
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy_instances $INSTANCES
+ else
+ api_equal json:policy_ids $INSTANCES
+ fi
echo "Create $NUM_INSTANCES instances in each STD RIC"
if [ $interface == "REST_PARALLEL" ]; then
- api_put_policy_parallel 201 "serv1" ricsim_g2_ $NUM_RICS NOTYPE $INSTANCE_ID NOTRANSIENT testdata/STD/pi1_template.json $NUM_INSTANCES 3
+ api_put_policy_parallel 201 "serv1" ricsim_g2_ $NUM_RICS NOTYPE $INSTANCE_ID NOTRANSIENT $notificationurl testdata/STD/pi1_template.json $NUM_INSTANCES 3
fi
for ((i=1; i<=$NUM_RICS; i++))
do
if [ $interface == "DMAAP-BATCH" ]; then
- api_put_policy_batch 201 "serv1" ricsim_g2_$i NOTYPE $INSTANCE_ID NOTRANSIENT testdata/STD/pi1_template.json $NUM_INSTANCES
+ api_put_policy_batch 201 "serv1" ricsim_g2_$i NOTYPE $INSTANCE_ID NOTRANSIENT $notificationurl testdata/STD/pi1_template.json $NUM_INSTANCES
elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then
- api_put_policy 201 "serv1" ricsim_g2_$i NOTYPE $INSTANCE_ID NOTRANSIENT testdata/STD/pi1_template.json $NUM_INSTANCES
+ api_put_policy 201 "serv1" ricsim_g2_$i NOTYPE $INSTANCE_ID NOTRANSIENT $notificationurl testdata/STD/pi1_template.json $NUM_INSTANCES
fi
if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then
MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES))
@@ -204,7 +222,11 @@
INSTANCES=$(($INSTANCES+$NUM_INSTANCES))
done
- api_equal json:policy_ids $INSTANCES
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy_instances $INSTANCES
+ else
+ api_equal json:policy_ids $INSTANCES
+ fi
echo "Delete all instances in each OSC RIC"
@@ -228,7 +250,11 @@
INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES))
done
- api_equal json:policy_ids $INSTANCES
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy_instances $INSTANCES
+ else
+ api_equal json:policy_ids $INSTANCES
+ fi
echo "Delete all instances in each STD RIC"
@@ -250,7 +276,11 @@
INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES))
done
- api_equal json:policy_ids 0
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy_instances $INSTANCES
+ else
+ api_equal json:policy_ids $INSTANCES
+ fi
cr_equal received_callbacks 0
diff --git a/test/auto-test/FTC850.sh b/test/auto-test/FTC850.sh
index 7391331..b6376f0 100755
--- a/test/auto-test/FTC850.sh
+++ b/test/auto-test/FTC850.sh
@@ -20,7 +20,7 @@
TC_ONELINE_DESCR="Create/delete policies in parallel over a number of ric using a number of child process"
#App names to include in the test, space separated list
-INCLUDED_IMAGES="CBS CONSUL, CP, CR, MR, PA, RICSIM, SDNC"
+INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
. ../common/testcase_common.sh $@
. ../common/agent_api_functions.sh
@@ -42,6 +42,12 @@
generate_uuid
+if [ "$PMS_VERSION" == "V2" ]; then
+ notificationurl="http://localhost:80"
+else
+ notificationurl=""
+fi
+
for __httpx in $TESTED_PROTOCOLS ; do
for interface in $TESTED_VARIANTS ; do
@@ -108,22 +114,29 @@
sim_put_policy_type 201 ricsim_g1_$i 1 testdata/OSC/sim_1.json
done
-
- api_equal json:policy_types 1 120 #Wait for the agent to refresh types from the simulator
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy-types 1 120 #Wait for the agent to refresh types from the simulator
+ else
+ api_equal json:policy_types 1 120 #Wait for the agent to refresh types from the simulator
+ fi
api_put_service 201 "serv1" 600 "$CR_PATH/1"
echo "Check the number of types in the agent for each ric is 1"
for ((i=1; i<=$NUM_RICS; i++))
do
- api_equal json:policy_types?ric=ricsim_g1_$i 1 120
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy-types?ric_id=ricsim_g1_$i 1 120
+ else
+ api_equal json:policy_types?ric=ricsim_g1_$i 1 120
+ fi
done
START_ID=2000
start_timer "Create $((NUM_POLICIES_PER_RIC*$NUM_RICS)) polices over $interface using "$__httpx
- api_put_policy_parallel 201 "serv1" ricsim_g1_ $NUM_RICS 1 $START_ID NOTRANSIENT testdata/OSC/pi1_template.json $NUM_POLICIES_PER_RIC 7
+ api_put_policy_parallel 201 "serv1" ricsim_g1_ $NUM_RICS 1 $START_ID NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json $NUM_POLICIES_PER_RIC 7
print_timer "Create $((NUM_POLICIES_PER_RIC*$NUM_RICS)) polices over $interface using "$__httpx
diff --git a/test/auto-test/FTC900.sh b/test/auto-test/FTC900.sh
index 3256797..6dbe544 100755
--- a/test/auto-test/FTC900.sh
+++ b/test/auto-test/FTC900.sh
@@ -43,6 +43,10 @@
start_ric_simulators $RIC_SIM_PREFIX"_g2" $STD_NUM_RICS STD_1.1.3
+if [ "$PMS_VERSION" == "V2" ]; then
+ start_ric_simulators $RIC_SIM_PREFIX"_g3" $STD_NUM_RICS STD_2.0.0
+fi
+
start_mr #Just to prevent errors in the agent log...
start_control_panel
@@ -82,36 +86,58 @@
#Check the number of schemas and the individual schemas in OSC
-api_equal json:policy_types 4 120
+if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy-types 4 120
-for ((i=1; i<=$OSC_NUM_RICS; i++))
-do
- api_equal json:policy_types?ric=$RIC_SIM_PREFIX"_g1_"$i 3 120
-done
+ for ((i=1; i<=$OSC_NUM_RICS; i++))
+ do
+ api_equal json:policy-types?ric_id=$RIC_SIM_PREFIX"_g1_"$i 3 120
+ done
-# Check the schemas in OSC
-for ((i=1; i<=$OSC_NUM_RICS; i++))
-do
- api_get_policy_schema 200 2 testdata/OSC/hw-agent-modified.json
- api_get_policy_schema 200 100 testdata/OSC/qos-agent-modified.json
- api_get_policy_schema 200 20008 testdata/OSC/tsa-agent-modified.json
-done
+ # Check the schemas in OSC
+ for ((i=1; i<=$OSC_NUM_RICS; i++))
+ do
+ api_get_policy_type 200 2 testdata/OSC/hw-agent-modified.json
+ api_get_policy_type 200 100 testdata/OSC/qos-agent-modified.json
+ api_get_policy_type 200 20008 testdata/OSC/tsa-agent-modified.json
+ done
+else
+ api_equal json:policy_types 4 120
+ for ((i=1; i<=$OSC_NUM_RICS; i++))
+ do
+ api_equal json:policy_types?ric=$RIC_SIM_PREFIX"_g1_"$i 3 120
+ done
+
+ # Check the schemas in OSC
+ for ((i=1; i<=$OSC_NUM_RICS; i++))
+ do
+ api_get_policy_schema 200 2 testdata/OSC/hw-agent-modified.json
+ api_get_policy_schema 200 100 testdata/OSC/qos-agent-modified.json
+ api_get_policy_schema 200 20008 testdata/OSC/tsa-agent-modified.json
+ done
+fi
# Create policies
use_agent_rest_http
api_put_service 201 "Emergency-response-app" 0 "$CR_PATH/1"
+if [ "$PMS_VERSION" == "V2" ]; then
+ notificationurl="http://localhost:80"
+else
+ notificationurl=""
+fi
+
# Create policies in OSC
for ((i=1; i<=$OSC_NUM_RICS; i++))
do
generate_uuid
- api_put_policy 201 "Emergency-response-app" $RIC_SIM_PREFIX"_g1_"$i 2 $((2000+$i)) NOTRANSIENT testdata/OSC/pihw_template.json 1
+ api_put_policy 201 "Emergency-response-app" $RIC_SIM_PREFIX"_g1_"$i 2 $((2000+$i)) NOTRANSIENT $notificationurl testdata/OSC/pihw_template.json 1
generate_uuid
- api_put_policy 201 "Emergency-response-app" $RIC_SIM_PREFIX"_g1_"$i 100 $((3000+$i)) NOTRANSIENT testdata/OSC/piqos_template.json 1
+ api_put_policy 201 "Emergency-response-app" $RIC_SIM_PREFIX"_g1_"$i 100 $((3000+$i)) NOTRANSIENT $notificationurl testdata/OSC/piqos_template.json 1
generate_uuid
- api_put_policy 201 "Emergency-response-app" $RIC_SIM_PREFIX"_g1_"$i 20008 $((4000+$i)) NOTRANSIENT testdata/OSC/pitsa_template.json 1
+ api_put_policy 201 "Emergency-response-app" $RIC_SIM_PREFIX"_g1_"$i 20008 $((4000+$i)) NOTRANSIENT $notificationurl testdata/OSC/pitsa_template.json 1
done
@@ -126,7 +152,7 @@
for ((i=1; i<=$STD_NUM_RICS; i++))
do
generate_uuid
- api_put_policy 201 "Emergency-response-app" $RIC_SIM_PREFIX"_g2_"$i NOTYPE $((2100+$i)) NOTRANSIENT testdata/STD/pi1_template.json 1
+ api_put_policy 201 "Emergency-response-app" $RIC_SIM_PREFIX"_g2_"$i NOTYPE $((2100+$i)) NOTRANSIENT $notificationurl testdata/STD/pi1_template.json 1
done
diff --git a/test/auto-test/PM_DEMO.sh b/test/auto-test/PM_DEMO.sh
index 3696d56..c309ddc 100755
--- a/test/auto-test/PM_DEMO.sh
+++ b/test/auto-test/PM_DEMO.sh
@@ -32,6 +32,13 @@
##########################
# Path to callback receiver
CR_PATH="http://$CR_APP_NAME:$CR_EXTERNAL_PORT/callbacks"
+
+if [ "$PMS_VERSION" == "V2" ]; then
+ notificationurl="http://localhost:80"
+else
+ notificationurl=""
+fi
+
use_cr_http
use_agent_rest_http
use_sdnc_http
@@ -87,19 +94,35 @@
#Check the number of schemas and the individual schemas in OSC
-api_equal json:policy_types 3 120
+if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy-types 3 120
-for ((i=1; i<=$OSC_NUM_RICS; i++))
-do
- api_equal json:policy_types?ric=$RIC_SIM_PREFIX"_g1_"$i 2 120
-done
+ for ((i=1; i<=$OSC_NUM_RICS; i++))
+ do
+ api_equal json:policy-types?ric_id=$RIC_SIM_PREFIX"_g1_"$i 2 120
+ done
-# Check the schemas in OSC
-for ((i=1; i<=$OSC_NUM_RICS; i++))
-do
- api_get_policy_schema 200 100 demo-testdata/OSC/qos-agent-modified.json
- api_get_policy_schema 200 20008 demo-testdata/OSC/tsa-agent-modified.json
-done
+ # Check the schemas in OSC
+ for ((i=1; i<=$OSC_NUM_RICS; i++))
+ do
+ api_get_policy_type 200 100 demo-testdata/OSC/qos-agent-modified.json
+ api_get_policy_type 200 20008 demo-testdata/OSC/tsa-agent-modified.json
+ done
+else
+ api_equal json:policy_types 3 120
+
+ for ((i=1; i<=$OSC_NUM_RICS; i++))
+ do
+ api_equal json:policy_types?ric=$RIC_SIM_PREFIX"_g1_"$i 2 120
+ done
+
+ # Check the schemas in OSC
+ for ((i=1; i<=$OSC_NUM_RICS; i++))
+ do
+ api_get_policy_schema 200 100 demo-testdata/OSC/qos-agent-modified.json
+ api_get_policy_schema 200 20008 demo-testdata/OSC/tsa-agent-modified.json
+ done
+fi
# Create policies
@@ -111,9 +134,9 @@
for ((i=1; i<=$OSC_NUM_RICS; i++))
do
generate_uuid
- api_put_policy 201 "Emergency-response-app" $RIC_SIM_PREFIX"_g1_"$i 100 $((3000+$i)) NOTRANSIENT demo-testdata/OSC/piqos_template.json 1
+ api_put_policy 201 "Emergency-response-app" $RIC_SIM_PREFIX"_g1_"$i 100 $((3000+$i)) NOTRANSIENT $notificationurl demo-testdata/OSC/piqos_template.json 1
generate_uuid
- api_put_policy 201 "Emergency-response-app" $RIC_SIM_PREFIX"_g1_"$i 20008 $((4000+$i)) NOTRANSIENT demo-testdata/OSC/pitsa_template.json 1
+ api_put_policy 201 "Emergency-response-app" $RIC_SIM_PREFIX"_g1_"$i 20008 $((4000+$i)) NOTRANSIENT $notificationurl demo-testdata/OSC/pitsa_template.json 1
done
@@ -128,7 +151,7 @@
for ((i=1; i<=$STD_NUM_RICS; i++))
do
generate_uuid
- api_put_policy 201 "Emergency-response-app" $RIC_SIM_PREFIX"_g2_"$i NOTYPE $((2100+$i)) NOTRANSIENT demo-testdata/STD/pi1_template.json 1
+ api_put_policy 201 "Emergency-response-app" $RIC_SIM_PREFIX"_g2_"$i NOTYPE $((2100+$i)) NOTRANSIENT $notificationurl demo-testdata/STD/pi1_template.json 1
done
diff --git a/test/auto-test/README.md b/test/auto-test/README.md
index 0429e36..95e523c 100644
--- a/test/auto-test/README.md
+++ b/test/auto-test/README.md
@@ -4,7 +4,7 @@
## Automated test scripts
There are two types of scripts, filenames in the format FTCXXX.sh test one or more components of the Non-RT RIC. Filenames in the format SuiteZZZZ.sh tests a number of FTCXXX.sh script as one suite. (XXX is an integer selected from the categories described further below).
-FTC is short for Function Test Case.
+FTC is short for Function Test Case. In addition, there are also other test scripts with other naming format used for demo setup etc (e.g PM_DEMO.sh).
The requirements, in terms of the execution enviroment, to run a script or a suite is to have docker, docker-compose and python3 installed (the scripts warns if not installed).
The scripts have been tested to work on both MacOS and Ubuntu. They should work also in git bash on windows but not yet verified.
@@ -24,7 +24,7 @@
The test scripts produce quite a number of logs; all container logs, a log of all http/htps calls from the test scripts including the payload, some configuration created during test and also a test case log (same as what is printed on the screen during execution). All these logs are stored in `logs/FTCXXX/`. So each test script is using its own log directory.
## Test case categories
-The test script are number using these basic categories.
+The test script are number using these basic categories where 0-999 are releated to the policy managment and 1000-1999 are related to enrichment management.
1-99 - Basic sanity tests
diff --git a/test/auto-test/Suite-all.sh b/test/auto-test/Suite-all.sh
deleted file mode 100755
index 9a51d3b..0000000
--- a/test/auto-test/Suite-all.sh
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/bash
-
-# ============LICENSE_START===============================================
-# Copyright (C) 2020 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=================================================
-#
-
-TS_ONELINE_DESCR="Test suite - all test cases except the stab test(s)"
-
-. ../common/testsuite_common.sh
-
-suite_setup
-
-############# TEST CASES #################
-ARG1=$1
-
-./FTC1.sh $ARG1
-
-if [ $ARG1 == "remote-remove" ]; then
- #Prevent image removal for every test case
- ARG1="remote"
-fi
-
-./FTC10.sh $ARG1
-./FTC100.sh $ARG1
-./FTC110.sh $ARG1
-./FTC150.sh $ARG1
-./FTC300.sh $ARG1
-./FTC310.sh $ARG1
-./FTC350.sh $ARG1
-./FTC800.sh $ARG1
-./FTC850.sh $ARG1
-
-##########################################
-
-suite_complete
\ No newline at end of file
diff --git a/test/auto-test/Suite-interfaces.sh b/test/auto-test/Suite-policy-all.sh
similarity index 78%
copy from test/auto-test/Suite-interfaces.sh
copy to test/auto-test/Suite-policy-all.sh
index 7a21646..c032d2d 100755
--- a/test/auto-test/Suite-interfaces.sh
+++ b/test/auto-test/Suite-policy-all.sh
@@ -17,7 +17,7 @@
# ============LICENSE_END=================================================
#
-TS_ONELINE_DESCR="Test suite - interface testing. Agent REST, DMAAP and SNDC controller resconf"
+TS_ONELINE_DESCR="Test suite - all test cases except the stab test(s)"
. ../common/testsuite_common.sh
@@ -25,17 +25,16 @@
############# TEST CASES #################
-ARG1=$1
-
-./FTC100.sh $ARG1
-
-if [ $ARG1 == "remote-remove" ]; then
- #Prevent image removal for every test case
- ARG1="remote"
-fi
-
-./FTC110.sh $ARG1
-./FTC150.sh $ARG1
+./FTC1.sh $@
+./FTC10.sh $@
+./FTC100.sh $@
+./FTC110.sh $@
+./FTC150.sh $@
+./FTC300.sh $@
+./FTC310.sh $@
+./FTC350.sh $@
+./FTC800.sh $@
+./FTC850.sh $@
##########################################
diff --git a/test/auto-test/Suite-interfaces.sh b/test/auto-test/Suite-policy-interfaces.sh
similarity index 87%
rename from test/auto-test/Suite-interfaces.sh
rename to test/auto-test/Suite-policy-interfaces.sh
index 7a21646..afa3b66 100755
--- a/test/auto-test/Suite-interfaces.sh
+++ b/test/auto-test/Suite-policy-interfaces.sh
@@ -27,15 +27,9 @@
ARG1=$1
-./FTC100.sh $ARG1
-
-if [ $ARG1 == "remote-remove" ]; then
- #Prevent image removal for every test case
- ARG1="remote"
-fi
-
-./FTC110.sh $ARG1
-./FTC150.sh $ARG1
+./FTC100.sh $@
+./FTC110.sh $@
+./FTC150.sh $@
##########################################
diff --git a/test/auto-test/testdata/ecs/empty-type.json b/test/auto-test/testdata/ecs/empty-type.json
new file mode 100644
index 0000000..9e26dfe
--- /dev/null
+++ b/test/auto-test/testdata/ecs/empty-type.json
@@ -0,0 +1 @@
+{}
\ No newline at end of file