From 75948283c66bb465104ca7987a30ed05d5fa93f0 Mon Sep 17 00:00:00 2001 From: Brian Freeman Date: Tue, 14 May 2019 20:44:46 -0500 Subject: Set Version Read policy-version from create of operational Issue-ID: POLICY-1685 Change-Id: I6d98bd1149b99bc4a105d1d471657a7cff0d4446 Signed-off-by: Brian Freeman --- robot/assets/templates/policy/vFirewall_push.template | 2 +- robot/resources/policy_interface.robot | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/robot/assets/templates/policy/vFirewall_push.template b/robot/assets/templates/policy/vFirewall_push.template index aad32220..89c33ca6 100644 --- a/robot/assets/templates/policy/vFirewall_push.template +++ b/robot/assets/templates/policy/vFirewall_push.template @@ -6,7 +6,7 @@ }, { "policy-id": "operational.modifyconfig", - "policy-version": 1 + "policy-version": ${OP_POLICY_VERSION} } ] } diff --git a/robot/resources/policy_interface.robot b/robot/resources/policy_interface.robot index 66f29f50..1797afd7 100644 --- a/robot/resources/policy_interface.robot +++ b/robot/resources/policy_interface.robot @@ -164,10 +164,10 @@ Update vVFWCL Policy Create vFirewall Monitoring Policy Sleep 5s Log To Console Create vFWCL Operational Policy - Create vFirewall Operational Policy ${resource_id} + ${op_policy_version}= Create vFirewall Operational Policy ${resource_id} Sleep 5s Log To Console Push vFWCL To PDP Group - Push vFirewall Policies To PDP Group + Push vFirewall Policies To PDP Group ${op_policy_version} Sleep 20s Log To Console Validate vFWCL Policy Validate the vFWCL Policy @@ -230,10 +230,12 @@ Create vFirewall Operational Policy ${data}= Fill JSON Template File ${POLICY_TEMPLATES}/vFirewall_policy_operational_input.template ${dict} ${resp}= Run Policy Api Post Request /policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies ${data} Should Be Equal As Strings ${resp.status_code} 200 + [Return] ${resp.json()['policy-version']} Push vFirewall Policies To PDP Group - ${dict}= Create Dictionary + [Arguments] ${op_policy_version} + ${dict}= Create Dictionary OP_POLICY_VERSION=${op_policy_version} ${data}= Fill JSON Template File ${POLICY_TEMPLATES}/vFirewall_push.template ${dict} #${resp}= Run Policy Post Request /policy/pap/v1/pdps/policies ${data} ${resp}= Run Policy Pap Post Request /policy/pap/v1/pdps/policies ${data} -- cgit 1.2.3-korg