move test data json files to drools-apps 20/118920/1
authorTaka Cho <takamune.cho@att.com>
Mon, 8 Mar 2021 19:45:58 +0000 (14:45 -0500)
committerTaka Cho <takamune.cho@att.com>
Mon, 8 Mar 2021 19:47:52 +0000 (14:47 -0500)
refactor robot file and
move testdata json from under
csit/tests/data

Issue-ID: POLICY-2895
Change-Id: Id6bac948963349af644afe77d5ed7adcf7687095
Signed-off-by: Taka Cho <takamune.cho@att.com>
csit/plans/setup.sh
csit/tests/data/deploy.drools.policies.json [new file with mode: 0644]
csit/tests/data/deploy.xacml.policies.json [new file with mode: 0644]
csit/tests/data/vcpeOnset.json [new file with mode: 0644]
csit/tests/data/vdnsOnset.json [new file with mode: 0644]
csit/tests/data/vfwOnset.json [new file with mode: 0644]
csit/tests/drools-applications-test.robot

index 76abc50..dcad3a3 100755 (executable)
@@ -52,10 +52,12 @@ ${SCRIPTS}/wait_for_port.sh ${DROOLS_IP} 6969
 sleep 15
 
 DATA=${WORKSPACE}/models/models-examples/src/main/resources/policies
+DATA2=${TESTPLANDIR}/csit/tests/data
 
 ROBOT_VARIABLES=""
 ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SCR2:${SCRIPTS}"
 ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA:${DATA}"
+ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA2:${DATA2}"
 ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DROOLS_IP:${DROOLS_IP}"
 ROBOT_VARIABLES="${ROBOT_VARIABLES} -v API_IP:${API_IP}"
 ROBOT_VARIABLES="${ROBOT_VARIABLES} -v PAP_IP:${PAP_IP}"
diff --git a/csit/tests/data/deploy.drools.policies.json b/csit/tests/data/deploy.drools.policies.json
new file mode 100644 (file)
index 0000000..24c90d0
--- /dev/null
@@ -0,0 +1,27 @@
+{
+    "groups": [
+        {
+            "name": "defaultGroup",
+            "deploymentSubgroups": [
+                {
+                    "pdpType": "drools",
+                    "action": "POST",
+                    "policies": [
+                        {
+                            "name": "operational.restart",
+                            "version": "1.0.0"
+                        },
+                        {
+                            "name": "operational.scaleout",
+                            "version": "1.0.0"
+                        },
+                        {
+                            "name": "operational.modifyconfig",
+                            "version": "1.0.0"
+                        }
+                    ]
+                }
+            ]
+        }
+    ]
+}
diff --git a/csit/tests/data/deploy.xacml.policies.json b/csit/tests/data/deploy.xacml.policies.json
new file mode 100644 (file)
index 0000000..46da902
--- /dev/null
@@ -0,0 +1,27 @@
+{
+    "groups": [
+        {
+            "name": "defaultGroup",
+            "deploymentSubgroups": [
+                {
+                    "pdpType": "xacml",
+                    "action": "POST",
+                    "policies": [
+                        {
+                            "name": "onap.restart.tca",
+                            "version": "1.0.0"
+                        },
+                        {
+                            "name": "onap.scaleout.tca",
+                            "version": "1.0.0"
+                        },
+                        {
+                            "name": "onap.vfirewall.tca",
+                            "version": "1.0.0"
+                        }
+                    ]
+                }
+            ]
+        }
+    ]
+}
diff --git a/csit/tests/data/vcpeOnset.json b/csit/tests/data/vcpeOnset.json
new file mode 100644 (file)
index 0000000..7dd9d5a
--- /dev/null
@@ -0,0 +1,16 @@
+{
+  "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e",
+  "closedLoopAlarmStart": 1463679805324,
+  "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca",
+  "closedLoopEventStatus": "ONSET",
+  "requestID": "664be3d2-6c12-4f4b-a3e7-c349acced200",
+  "target_type": "VNF",
+  "target": "generic-vnf.vnf-id",
+  "AAI": {
+    "vserver.is-closed-loop-disabled": "false",
+    "vserver.prov-status": "ACTIVE",
+    "generic-vnf.vnf-id": "vCPE_Infrastructure_vGMUX_demo_app"
+  },
+  "from": "DCAE",
+  "version": "1.0.2"
+}
diff --git a/csit/tests/data/vdnsOnset.json b/csit/tests/data/vdnsOnset.json
new file mode 100644 (file)
index 0000000..13f6909
--- /dev/null
@@ -0,0 +1,16 @@
+{
+  "closedLoopControlName": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
+  "closedLoopAlarmStart": 1463679805324,
+  "closedLoopEventClient": "microservice.stringmatcher",
+  "closedLoopEventStatus": "ONSET",
+  "requestID": "c7c6a4aa-bb61-4a15-b831-ba1472dd4a65",
+  "target_type": "VNF",
+  "target": "vserver.vserver-name",
+  "AAI": {
+    "vserver.is-closed-loop-disabled": "false",
+    "vserver.prov-status": "ACTIVE",
+    "vserver.vserver-name": "OzVServer"
+  },
+  "from": "DCAE",
+  "version": "1.0.2"
+}
diff --git a/csit/tests/data/vfwOnset.json b/csit/tests/data/vfwOnset.json
new file mode 100644 (file)
index 0000000..7782867
--- /dev/null
@@ -0,0 +1,17 @@
+{
+  "closedLoopControlName": "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a",
+  "closedLoopAlarmStart": 1463679805324,
+  "closedLoopEventClient": "microservice.stringmatcher",
+  "closedLoopEventStatus": "ONSET",
+  "requestID": "c7c6a4aa-bb61-4a15-b831-ba1472dd4a65",
+  "target_type": "VNF",
+  "target": "generic-vnf.vnf-name",
+  "AAI": {
+    "vserver.is-closed-loop-disabled": "false",
+    "vserver.prov-status": "ACTIVE",
+    "generic-vnf.vnf-name": "fw0002vm002fw002",
+    "vserver.vserver-name": "OzVServer"
+  },
+  "from": "DCAE",
+  "version": "1.0.2"
+}
index 2ab0581..e8b41b3 100644 (file)
@@ -117,7 +117,7 @@ DeployXacmlPolicies
     [Documentation]    Deploys the Policies to Xacml
     ${auth}=    Create List    healthcheck    zb!XztG34
     Log    Creating session https://${PAP_IP}:6969
-    ${postjson}=  Get file  ${SCR2}/deploy.xacml.policies.json
+    ${postjson}=  Get file  ${DATA2}/deploy.xacml.policies.json
     ${session}=    Create Session      policy  https://${PAP_IP}:6969   auth=${auth}
     ${headers}=  Create Dictionary     Accept=application/json    Content-Type=application/json
     ${resp}=   Post Request     policy  /policy/pap/v1/pdps/deployments/batch    data=${postjson}     headers=${headers}
@@ -135,7 +135,7 @@ DeployDroolsPolicies
     [Documentation]    Deploys the Policies to Drools
     ${auth}=    Create List    healthcheck    zb!XztG34
     Log    Creating session https://${PAP_IP}:6969
-    ${postjson}=  Get file  ${SCR2}/deploy.drools.policies.json
+    ${postjson}=  Get file  ${DATA2}/deploy.drools.policies.json
     ${session}=    Create Session      policy  https://${PAP_IP}:6969   auth=${auth}
     ${headers}=  Create Dictionary     Accept=application/json    Content-Type=application/json
     ${resp}=   Post Request     policy  /policy/pap/v1/pdps/deployments/batch    data=${postjson}     headers=${headers}
@@ -152,7 +152,7 @@ DeployDroolsPolicies
 
 VcpeExecute
     [Documentation]    Executes VCPE Policy
-    ${result}=     Run Process        ${SCR2}/onset.sh     ${SCR2}/vcpeOnset.json
+    ${result}=     Run Process        ${SCR2}/onset.sh     ${DATA2}/vcpeOnset.json
     Should Be Equal As Integers        ${result.rc}    0
     ${result}=     Run Process        ${SCR2}/wait_topic.sh     POLICY-CL-MGT
     ...            ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e
@@ -194,7 +194,7 @@ VcpeExecute
 
 VdnsExecute
     [Documentation]    Executes VDNS Policy
-    ${result}=     Run Process        ${SCR2}/onset.sh     ${SCR2}/vdnsOnset.json
+    ${result}=     Run Process        ${SCR2}/onset.sh     ${DATA2}/vdnsOnset.json
     Should Be Equal As Integers        ${result.rc}    0
     ${result}=     Run Process        ${SCR2}/wait_topic.sh     POLICY-CL-MGT
     ...            ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3
@@ -235,7 +235,7 @@ VdnsExecute
 
 VfwExecute
     [Documentation]    Executes VFW Policy
-    ${result}=     Run Process        ${SCR2}/onset.sh     ${SCR2}/vfwOnset.json
+    ${result}=     Run Process        ${SCR2}/onset.sh     ${DATA2}/vfwOnset.json
     Should Be Equal As Integers        ${result.rc}    0
     ${result}=     Run Process        ${SCR2}/wait_topic.sh     POLICY-CL-MGT
     ...            ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a