summaryrefslogtreecommitdiffstats
path: root/controlloop/templates
AgeCommit message (Collapse)AuthorFilesLines
2018-02-06Add JUnit and Remove Technical Debt in Guardliamfallon1-5/+5
Unit test for guard added and technical debt removed. Issue-ID: POLICY-455 Change-Id: I440766660ddae078013e21b1991ee49c8e488bb3 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-01-18Fix Tech Debt/JUnit on control loop event POJOsLiam Fallon6-375/+375
Mainly making fields private, fixing field and methods to follow Java guidelines, and adding getter and setter methods. Unit test added for all classes in org.onap.policy.controlloop Issue-ID: POLICY-455 Change-Id: I445b7cfaf9eb921a230bbb72b06ff4455fe003ce Signed-off-by: Liam Fallon <liam.fallon@ericsson.com>
2018-01-16Fix Sonar Technical Debt, Unit Test for APPC POJOsLiam Fallon2-4/+3
Mainly making fields private, fixing field and methods to follow Java guidelines, and adding getter and setter methods. Unit test added for all classes in org.onap.policy.appc Change-Id: If3db740bc146a09f8f7387f02c12b048ad00b201 Signed-off-by: Liam Fallon <liam.fallon@ericsson.com> Issue-ID: POLICY-455 Signed-off-by: Liam Fallon <liam.fallon@ericsson.com>
2017-12-08remove synchronized calls to avoid race conditionsJorge Hernandez1-26/+0
This is to prevent potential problems where multiple jar versions are updated one after the other. Change-Id: I78835b485e57125efb213cfdefba60351d815916 Issue-ID: POLICY-487 Signed-off-by: Jorge Hernandez <jh1730@att.com> (cherry picked from commit f2715bc0f272e5e657ed8a82c0f4e520a7c7706d)
2017-11-21Bump minor versionJessica Wagantall3-3/+3
Bump minor version in preparation for Amsterdam branching. Change-Id: Ia7e97a72053a2d1cd10c0b9d5c179817c3ac7e23 Issue-ID: CIMAN-120 Signed-off-by: Jessica Wagantall <jwagantall@linuxfoundation.org>
2017-11-15Upgrade to 1.1.2-SNAPSHOTPamela Dragosh3-3/+3
Released 1.1.1, now must bump patch by 1 Issue-ID: POLICY-436 Change-Id: I3f5e4c369575f6fe1fa06cabb96a5bd43cb11087 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2017-11-13default archetype tooling to 1.1.1Jorge Hernandez1-4/+4
Change-Id: I84cf9fe9e954a9ee9bac8eaff56169e44154e9c5 Issue-ID: POLICY-446 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-11-09Merge "Fix SO Request body"Jorge Hernandez1-3/+4
2017-11-08Fix SO Request bodyHockla, Ali (ah999m)1-3/+4
- Renamed modelNameVersionId to modelVersionId in SOModelInfo - Removed requestID from SO Request body - As a result of this, an SOResponseWrapper was needed in order to attach the control loop event requestId to use in the SOResponse rule in drl (the requestID that is returned in the SO response is a newly generated requestId with no relation to the Policy control loop event requestId as per Arthur) - Updated drl to reflect the above mentioned change - Updated simulator and junits to reflect changes - Added an additional null httpResponse check/logger statement in SOManager and RestManager Issue-ID: POLICY-438 Change-Id: I5f414ba69b60b5565cca9073b47f4c4835e5abbf Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
2017-11-08Update SNAPSHOT versionPamela Dragosh3-3/+3
Releasing v1.1.0 so need to update version to 1.1.1 Issue-ID: POLICY-436 Change-Id: I8b85de39bb3a32f5f4faeeb4fcdfb5d95291ae31 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2017-11-03Fix Generic VNF isClosedLoopDisableddaniel1-5/+18
No A&AI queries will be done for enriched events. The event manager now understands prepended "generic-vnf." in front of is-closed-loop-disabled from DCAE onsets. A test case was revised to include sample data from an enriched onset with vnf data based on the VES documentation. Issue-Id: POLICY-350 Change-Id: Id7f59f8b860b9f147087067a2a9a7766f167f7e4 Signed-off-by: Daniel Cruz <dc443y@att.com>
2017-11-02Write to DB on guard denyTemoc Rodriguez1-0/+1
When an operations was denied by guard, it was not writing to the DB at all. Only in the deny case we start the operation, then setOperationHasGuardDeny, then finish the operation. Had to add start operation just before finishing it. This allows the write to occur at setOperationHasGuardDeny. Issue-ID: POLICY-345 Change-Id: I665b9cfaa684493e39e731102d4d43ecb39fad7c Signed-off-by: Temoc Rodriguez <cr056n@att.com>
2017-10-31Fix Abatement Processingdaniel1-1/+3
The drools engine will now only fire the event rule if the event is an onset. This prevents abatements from being processed as onsets. Issue-Id: POLICY-407 Change-Id: Ic74efa74fbb1dc0e01d7c36a06fdaf48fc8a3238 Signed-off-by: Daniel Cruz <dc443y@att.com>
2017-10-30Merge "Fix Final Failure on AAI Queries"Pamela Dragosh4-64/+59
2017-10-30Fix Final Failure on AAI Queriesdaniel4-64/+59
The drools engine will now send final failure notifications if there is an error returned from A&AI queries instead of rejected notifications. Issue-Id: POLICY-364 Change-Id: Ie9c22686d859c633bad47d223726957cc9599f7c Signed-off-by: Daniel Cruz <dc443y@att.com>
2017-10-27Send final failure on null vfc requestCharles Cole2-2/+62
Made sure a final failure is sent and the memroy is cleaned up if we cannot contruct a vfc request. Issue-Id: POLICY-350 Change-Id: Ia9bc827572042ae6ff2d2d2851d33034ee86fc49 Signed-off-by: Charles Cole <cc847m@att.com>
2017-10-27remove explicit call to shutdown in junitsJorge Hernandez6-15/+27
since it will exit the process immediately in a graceful case and affect junit execution. Change-Id: Ibcbb65269203e189515f68c557686c29667307e2 Issue-ID: POLICY-386 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-10-25Fix Source/Target Lockdaniel4-8/+19
The locking of the target is now taken care of when the operation manager is initialized. This allows us to keep the template flow the same and to ensure that for vFW we will not lock the source if it is not intended to be the target. NOTE: This will have to be revised in the future if policy chaining will support having different targets specified for each policy in the chain. Additional work was done for hardening the APPC model code to make sure exceptions are caught and we gracefully end processing the event with memory clean up and a final failure notification sent. Issue-Id: POLICY-367 Change-Id: Ic796d95eb5400067744492f810dd8069ba6241b3 Signed-off-by: Daniel Cruz <dc443y@att.com> Signed-off-by: daniel <dc443y@att.com>
2017-10-24change drl line to avoid velocity bugJorge Hernandez1-3/+7
generating a control loop project from archetype (but not from junits) runs into velocity parse failures as specified in ticket. The existing .drl code for the line that fails the parsing has been slightly modified to bypass this problem. In addition a logging statement has been added to the catch. Change-Id: I3eec82c9b710cc9d2a13dc68032a8a6074016b40 Issue-ID: POLICY-376 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-10-24Change vnf-id to vnf-namedaniel2-13/+13
These changes now allow a lookup of the source vnf-id based on the onset's vnf-name. Issue-Id: POLICY-366 Change-Id: I6f6bd500b892dddbbb9e12156b4486208309e21d Signed-off-by: Daniel Cruz <dc443y@att.com>
2017-10-23Merge "Fix handling of aai 'get' errors"Jorge Hernandez6-116/+311
2017-10-23Fix handling of aai 'get' errorsCharles Cole6-116/+311
Now reject an event if the AAI get query for the event fails. Added test cases for this behavior. Fixed some issues from my previous pull request. Issue-Id: POLICY-314 Change-Id: I674e95302a271423c307a88d061064e12e491a7a Signed-off-by: Charles Cole <cc847m@att.com>
2017-10-20Removed pre-Amsterdam policy template codeMagnusen, Drew (dm741q)13-1585/+0
Removed the deprecated pre-Amsterdam policy template code from repository. Issue-Id: POLICY-308 Change-Id: I5000f61acddf3b84eef5fbfdbceabfc69aeb96c4 Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
2017-10-18Add support for AAI Named Query error handlingCharles Cole2-4/+114
Errors from AAI after a Named query now throw an AAIEXception. This is caught in the template to allow the resources to be removed from memory and a final failure to be thrown. Issue-ID: POLICY-314 Change-Id: I319d29ef537b2d01ca288622aac1d9dbbe05f5eb Signed-off-by: Charles Cole <cc847m@att.com>
2017-10-17Fix Target Entity Lockdaniel2-59/+436
This fix enables the pdp to stop events with different requestId's/controlLoopNames from being processed if the target entity specified is already being processed by another event/controlloop. The lock timeout rule is removed to stop the event from waiting to obtain a lock if it was not already required. Handling of the lock denied case is taken care of in the event manager rule instead of in a seperate rule to avoid further unneccessary computation. A new control loop test case was created that is for testing general control loop errors. The test case included is for testing that the lock will deny a request with a duplicate target entity. Issue-ID: POLICY-341 Change-Id: Ib62286eff74ec22b2c645f32f385cb331fb1dff3 Signed-off-by: Daniel Cruz <dc443y@att.com>
2017-10-17Merge "Fix operation history DB properties for Junits"Jorge Hernandez1-0/+5
2017-10-17Merge "Update SO Interface AAI NQ response from v8 to v11"Jorge Hernandez1-1/+6
2017-10-17Update SO Interface AAI NQ response from v8 to v11Hockla, Ali (ah999m)1-1/+6
- Removed nonBaseIndex since there is only base vf Module in v11 response - Reverted to checkExtractedFields() - Modified the AAI Simulator to return the v11 response - If AAI NQ fails then the SO Request will not be constructed. In this case, we are retracting objects from the transaction and inserting policyResult.FAILURE into current operation to prevent null values in finishOperation Issue-ID: POLICY-339 Change-Id: I1c48fac4f9a51467ad54b0706543f5d1baa70389 Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
2017-10-17Fix operation history DB properties for JunitsTemoc Rodriguez1-0/+5
Removed operation_history.properties / operations-history.properties. Changed the properties in persistence.xml so that it uses the correct values. Previously junit would never write to db because the "guard.disabled" property was not set. Set this property. Additionally the operationshistory10 table was trying to be created even though it exists. These values work in junit code. Not tested on rackspace yet. Issue-ID: POLICY-345 Change-Id: Id755b3152ae6ac4991ea9c314154592ea0105070 Signed-off-by: Temoc Rodriguez <cr056n@att.com>
2017-10-16Update abatement=false and add Abated eventPamela Dragosh5-12/+22
Missing abatement=false for Use Cases other than vCPE. Added DCAE Control Loop Event message for ABATED. Issue-ID: POLICY-346 Change-Id: Ic8890dd81607ff8657a6f9e49cd9be51cb410fe1 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2017-10-11Enable junits to work with the archetype templateCharles Cole6-1295/+161
Control loop junits now use the actual PolicyEngine instead of a simulation, allowing them to work with the archetype template Issue-ID: POLICY-101 Change-Id: I910961996aaf831f4e91b7d7173d05fdfdd77683 Signed-off-by: Charles Cole <cc847m@att.com>
2017-10-10add structure only for PAP rule managementJorge Hernandez1-0/+21
PAP currently generates a set up rule that inserts a Params object when the session is loaded. Since the official template also has an equivalent rule that is used by the drools applications team to perform initializations tasks, at runtime we end up with 2 Params objects with the same control loop data. This has sideeffects where the same rule becomes true for 2 Params objects therefore performing duplicated actions which introduces somewhat anomalous behavior. The PapParams is introduced to satisfy current PAP needs for management of rules. The structure is included here only for those purposes but it carries no significance at runtime during drools executions since the rules go by Params instead of PapParams. In the near future, the plan is to have the PAP not generating SET UP rules. There is a companion review on the PAP side to refer to PapParams instead of Params to fulfill the resolution of POLICY-302. Change-Id: I2f9ed3cee3d5d5209eecd43823cfc44a4b937600 Issue-ID: POLICY-302 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-10-09strengthen APPC Response Cleanup RulesJorge Hernandez1-2/+2
The existing APPC Response Cleanup Rules will drop responses that are not specific for that control loop. For example vDNS control loop will drop LCM Response for vCPE control loops preventing progress of the use cases. This only happens when the control loops coexist with the current set of rules. Change-Id: I5a9ae26e39ecce8dd7f1098d02b6c6b97650b67a Issue-ID: POLICY-298 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-10-06Fix Build Errorsdaniel11-2488/+8
Removing the legacy "demo" project as this uses obsolete code. The operation and control loop timeouts were increased to allow more time for the simulators to respond. Issue-Id: POLICY-291 Change-Id: I1143352cefaf9749ca0eca55927960535b2599b8 Signed-off-by: Daniel Cruz <dc443y@att.com>
2017-10-05Fix JUnit Race Conditionsdaniel9-1210/+452
This fix now implements the observer pattern for the PolicyEngineJUnitImpl so that the test cases can be notified when an event is available to be pulled. This eliminates the need to sleep the thread for some arbitrary time to let the rules process events. Issue-ID: POLICY-291 Change-Id: I884c959c20b95a1b58f357602099d8a01c8d2e3c Signed-off-by: Daniel Cruz <dc443y@att.com>
2017-09-28missing $ in guard expansion variablesJorge Hernandez1-4/+3
Change-Id: I05c577e8760f5b4b8e6375f50a327c9dde575e06 Issue-ID: POLICY-260 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-09-28Make Guard Configurabledaniel1-2/+5
This allows the user to disable or enable guard through the .properties.environment file. Verified and tested in a pdp. Properties were added to the simulators properties file for the simulators to work out of the box. Issue-ID: POLICY-259 Change-Id: I0027a5d28f1b30e81bdbe42fa17621b36a61c850 Signed-off-by: Daniel Cruz <dc443y@att.com>
2017-09-28Delete ControlLoopXacmlGuardTest.javaTemoc Rodriguez7-426/+13
Deleted ControlLoopXacmlGuardTest.java so avoid sonar blockers. This junit will reduce coverage a bit but is not significant. This junit is already covered by the other use case junit files in template demo. A more robust junit is in need to test guard permit, deny, and pdp-x misconnecion in relation to the drl operations and rules. For now, this file does not add useful testing. Issue-ID: POLICY-260 Change-Id: Iaed0ad62f72ddc5b9a6b7626a037c26d6fd1ca52 Signed-off-by: Temoc Rodriguez <cr056n@att.com>
2017-09-28Fix Retries for Policiesdaniel8-37/+30
This applies changes to make retries work properly for all control loops. The current design was ignoring the upper bound of the retries and retrying until either a success or control loop timeout occured. This is now fixed to only do retries until the limit is reached that is specified from the policy. The operation is now started in the GUARD.PERMITTED rule. I think this is better because it stops Policy from doing extra processing if there is a guard deny. This is also needed so that we can properly do retries for all cases. The notifications sent in GUARD_NOT_YET_QUERIED and GUARD.RESPONSE are now more informative with the message specifying the actor and recipe. The not queried rule has a message stating that we are sending a query to guard and the guard response message in the guard response rule specifices the result from guard. During a retest of vDNS it appeared that the archetype template was no longer working, this was because there were changes in the JUnit template that were not reflected in the archetype template. These were added to archetype and vDNS is verified to work again. Another small fix needed was making sure the action for vCPE is "Restart" instead of "restart". APPC will reject our request if "Restart" is not sent as the action. Issue-ID: POLICY-259 Change-Id: I28dd3c9a629d297b408775a01afadd5c19351e37 Signed-off-by: Daniel Cruz <dc443y@att.com>
2017-09-28Add missing auth headers to guard requestTemoc Rodriguez4-4/+11
Added guard authentication, client authentication, and environment http headers to the pdp-x guard restful request. Properties are set to PolicyEngine.manager. Property getter, setter, and properties in guard/.../Util.java. Test properties defined in junits themselves. Added code from GuardContext.java to grab the properties and make restful request. PolicyGuardXacmlHelper now closely resembles GuardContext in order to mimic functionality. Guard url no longer is passed into CallGuardTask, it is now a property. Issue-ID: POLICY-260 Change-Id: I5b144764828b6da0e7b738a578e4f6596a0f4f36 Signed-off-by: Temoc Rodriguez <cr056n@att.com>
2017-09-27Merge "Create common object to consolidate AAI response"Jorge Hernandez1-2/+2
2017-09-27Create common object to consolidate AAI responseJoseph Chou1-2/+2
Remove duplicate/obsolete code (NQF199) Change-Id: Ibe0d4d958a1fe5ae0bae93f740e8b32196a3b07b Issue-ID: POLICY-228 Signed-off-by: Joseph Chou <jc2555@att.com>
2017-09-27Fix Use Case Templatedaniel5-17/+42
This is a WIP for getting guard to work. Currently the A&AI GET and named queries are connecting to the simulator and working in the labs. Guard is not connecting to simulator and needs further analysis. Issue-ID: POLICY-259 Change-Id: If9875bfd83cbd82dcae04a876b3818ec9c07b1f7 Signed-off-by: Daniel Cruz <dc443y@att.com>
2017-09-26force maven dependency plugin version to latestJorge Hernandez6-34/+39
the 2.1 version that comes with the ubuntu installation have problems with the maven repositoryUrls. disable asserts in fact counts, it seems almost impossible to get clean builds in jenkins server because these junit failures. Change-Id: I551f00a4a927f87a5e6294d936e9b9c926f21880 Issue-ID: POLICY-265 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-09-26Fix TestSO propertiesTemoc Rodriguez5-13/+22
TestSO was missing the environment properties for AAI and SO url, user, and pass. Set SO and AAI properties in TestSO.java. If this is not set, then the response will be null and the junit will fail. Moved setting properties to Util.java to promote code reuse. Issue-ID: POLICY-259 Change-Id: Id73611abab900675a1f2b543f71566baa05318b2 Signed-off-by: Temoc Rodriguez <cr056n@att.com>
2017-09-25Fix Usecase Template for VoLTEdaniel4-7/+127
This includes VoLTE support for the amsterdam template. As of right now all use cases are able to get a final success with guard disabled and no A&AI GET queries. Currently, the GET query is not working in the lab. I will address this in another pull request. Issue-ID: POLICY-259 Change-Id: I216aa84daaa1e93ab12c56ee53283b4cb413a7c3 Signed-off-by: Daniel Cruz<dc443y@att.com>
2017-09-22Fix Use Case Testingdaniel17-36/+214
These changes are necessary to get the use cases working on an actual PDP. So far vCPE, vFW, and vDNS have been tested successfully on a pdp. These are priliminary tests to just test a FINAL SUCCESS without A&AI GET queries being used. A&AI named queries for vFW and vDNS have been verified to work. Changes in the template were made for SO as there were changes in the JUnit template that did not get reflected in the archetype template. Changes in the code were made in various places to use the environment properties for REST urls, usernames, and passwords. Due to VoLTE not being tested yet, the url for VFC is still hard coded and will be changed later. It has been confirmed with APPC that LCM will have two topics: APPC-LCM-READ and APPC-LCM-WRITE. Policy needs to sink to APPC-LCM-READ and pull from source APPC-LCM-WRITE. This has been reflected in the controller properties file. Issue-ID: POLICY-259 Change-Id: Ib9a8df07ae5ad9d3052c88907c1e522952af474d Signed-off-by: Daniel Cruz <dc443y@att.com>
2017-09-21Add VFC Response in Working Memory & JUNITRitu Sood3-6/+402
Adding code to insert VFC reponse in working memory and handling that response. Also adding JUNIT and yaml file for VoLTE usecase. Issue-Id: POLICY-212 Change-Id: I74a13272ccd931478d27d80715d8c3ac756fb5c7 Signed-off-by: Ritu Sood <ritu.sood@intel.com>
2017-09-21Merge "Implement restful call to xacml pdp guard"Jorge Hernandez5-11/+17
2017-09-21Implement restful call to xacml pdp guardTemoc Rodriguez5-11/+17
Removed the embedded guard decision and replace with restful call to xacml pdp to restore guard functionality. Set guard URL with PolicyEngine env properties. Modified templates accordingly. Issue-Id: POLICY-260 Change-Id: Ic1558a6ebdd5f6d1b74a748f69433f6213dbf984 Signed-off-by: Temoc Rodriguez <cr056n@att.com> Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>