aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/test
AgeCommit message (Collapse)AuthorFilesLines
2020-05-04Eliminate spurious notifications from PAPJim Hahn2-33/+8
Tracked it down to the following sequence: - policies were deployed to the pdp - received a request to undeploy a policy - generated a notification for the formerly deployed policy - this should not have been generated - undeployed the policy - received a response from the pdp indicating the policy had been undeployed - generated a notification indicating the policy was undeployed Removed the code that generated a notification when a policy is initially moved from deployed to undeployed (or vice versa). Issue-ID: POLICY-2539 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: If175974b5fa5ccda6a1e1ab8fa1326b263bb8005
2020-04-29PAP should discard responses for old requestsJim Hahn1-1/+17
This is a more robust solution to the race condition previously identified with back-to-back deployment requests. The old fix has been rolled back and replaced with this fix. Issue-ID: POLICY-2527 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I2ea93f3a5eaac822abecf5d0745429b95712c861
2020-03-27Point to latest snapshotsPamela Dragosh1-1/+1
Issue-ID: POLICY-2378 Change-Id: Ica314e9facad9ac45351d708505b566e37c1e347 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-03-25Cleanup eclipse warningsPamela Dragosh3-21/+17
Issue-ID: POLICY-2271 Change-Id: Ib28a6f5321cc05b03994e180867461a631d40d75 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-03-17renew policy certs till 03/17/2021jhh1-0/+0
Issue-ID: POLICY-2402 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I6386a6185089bfcc4358db2a0bdfe7a977b23992
2020-02-28Add test cases for consolidated policy health checkhuaxing2-1/+277
Issue-ID: POLICY-1689 Signed-off-by: huaxing <huaxing.jin@est.tech> Change-Id: Ifda17a4486e1bce1ce0f523cc1984519b7fbc1aa
2020-02-12Update PAP for policy DB response changesliamfallon1-1/+6
Policy models now throws an exception with a 404 code when policies are not found. This change amends PAP to cope with this change. Note: This change should be merged directly after the following policy-models patch: https://gerrit.onap.org/r/c/policy/models/+/101544 Issue-ID: POLICY-1402 Change-Id: Id38af4b2ad65797592c077e276861b962bc53ea2 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-02-10Cleanup the sonar issues in PAPa.sreekumar6-25/+39
Change-Id: I0eccc6064eb0b49d84370104d1219074ec8bde71 Issue-ID: POLICY-2271 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2020-02-03Policy notifications appear to be reversedJim Hahn7-42/+475
Modified the code as follows: Until all PDPs have responded (or been removed), no notifications for their associated policies will be generated. However, once a response has been received for every PDP, then a notification is generated. For deployed policies, the notifications will continue to be generated as PDPs move back and forth between the success and failed states, as long as the policy is not undeployed. For undeployed policies, on the other hand, no additional notifications will be generated once all PDPs have successfully undeployed the policy. However, until that point, like with deployed policies, notifications will continue to be generated as PDPs move back and forth between the success and failed states. Added notification verifications in deploy and undeploy end-to-end tests. Issue-ID: POLICY-2347 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I7d18dad1a7500e1efb7074e89ddaca4b1d368965
2020-01-23Handling supported policy type during PdpGroup Updatea.sreekumar2-5/+7
Change-Id: I14daaa3d56d3293095227e0e3121e4fd82425b68 Issue-ID: POLICY-2023 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2020-01-14policy/pap jdk11 upgradesHOCKLA5-24/+24
Issue-ID: POLICY-1593 Change-Id: I61be9364d09b520e30aeac6d825b6c84574790ac Signed-off-by: HOCKLA <ah999m@att.com>
2020-01-10Merge "validate and save PdpStatistisc"Jim Hahn3-2/+145
2020-01-10validate and save PdpStatistiscHenry.Sun3-3/+148
Issue-ID: POLICY-2303 Change-Id: Ide10256556a20e2ab3977ab2cfd876dd82e44390 Signed-off-by: Henry.Sun <henry.a.sun@est.tech>
2020-01-09statistics rest api updatening.xi3-1/+95
Issue-ID: POLICY-1629 Signed-off-by: ning.xi <ning.xi@est.tech> Change-Id: I104fc448d27a282c01e7f54db300f918374b8d07
2020-01-09Changes related to persisiting data type of policy in dba.sreekumar1-1/+2
Change-Id: I09b373a511eaa20603d4d2de71a2a5a6bf652b3b Issue-ID: POLICY-2315 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2019-12-11consolidate Policy Health Check into PAPHengye6-5/+115
Issue-ID: POLICY-1689 Change-Id: I3b84094e217c8cda115efdbf3444e92f08013a7c Signed-off-by: Hengye <yehui.wang@est.tech>
2019-12-09Only update policies in PAP REST APIJim Hahn11-353/+571
Modified the deploy controller and provider to only update the policies within a group, while leaving the other fields unchanged. Added delta operations so that only additions or deletions need be included instead of providing the complete list of policies. Change-Id: Id2b69dac15f97b8a898f459f8d3f09216fc3618e Issue-ID: POLICY-2274 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-12-05Create PAP API to only create/update PdpGroupsa.sreekumar8-182/+876
Create an API to create/update PdpGroups. Policies are not allowed to be deployed as part of PDPGroup create/update operation. There will be a separate API as part of POLICY-2274 to deploy policies into individual group/subgroups. Change-Id: I4e2cb43fefe08b22d6f70a1db7c026e83f0ebde0 Issue-ID: POLICY-2273 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2019-12-03Move deploy/undeploy REST classesJim Hahn9-12/+10
Moved classes from rest.depundep to rest, as they will no longer be specific to deploy/undeploy. Change-Id: Iea7c4e35fcd00ed83e678f7cd980e0aa9659f18e Issue-ID: POLICY-1866 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-11-22Update Pdp Group state per PAP APIJim Hahn1-0/+16
The PAP API can be used to update the state of a Pdp Group. However, the state wasn't being updated - fixed. Issue-ID: POLICY-2269 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I67fa3409424cfdb4b53b17e86f4cf354732d87e8
2019-11-22Re-register pdp if not found in DBramverma2-11/+56
During heartbeat processing, if the pdp instance is not found in the DB then registering the pdp again. So that it doesn't go out of sync. Added related test cases. Issue-ID: POLICY-2158 Change-Id: I557e2397536fd5b3a2783ec89d75ca0e43dcf9d0 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-11-21Merge "Undeploy policies when deploy fails"Jim Hahn6-3/+372
2019-11-21Adding pdpGroup to PdpRegistrationHandlerramverma3-26/+310
Adding pdpGroup as the matching condition for registration of Pdps. Removing the check of supported policy types in pdp heartbeat. Adding check of policies in pdp heartbeat. Adding comprehensive unit test coverage (98%) for the heartbeat listener. Issue-ID: POLICY-2231 Change-Id: I0fb961717c74656c5f1b6937b6c3a1410382a76e Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-11-20Undeploy policies when deploy failsJim Hahn6-3/+372
Modified the code so that if a PDP fails to deploy one or more policies specified in a PDP-UPDATE message, PAP will undeploy those policies that failed to deploy to the PDP. This entails removing the policies from the Pdp Group(s), issuing new PDP-UPDATE requests, and updating the notification tracking data. Issue-ID: POLICY-2155 Change-Id: I1740282385b0fa804254ebdf57537ef0f3a7a4c8 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-11-07PAP should not deactivate PDPsJim Hahn1-56/+74
Modified the code so that it does not send a PASSIVE request to PDPs when they are fail, whether due to an inability to deploy a policy or due to a timeout. However, it still removes the PDP from the PDP Group, if a timeout occurs (but not due to a deployment failure). This review does not include any changes to undeploy failed policies; that will come in a later review. Issue-ID: POLICY-2155 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I15821d299bc3261478fd7fbb9ee62ea4a90123a4
2019-11-06Support policy types with wild-cardsJim Hahn5-2/+182
Allow supported policy types to end with ".*", which causes the prefix to be matched when new policies are deployed. This entailed updates in three areas: - when a subgroup is added via the group api - when a subgroup is updated via the group api - when a policy is deployed via the simple api Issue-ID: POLICY-1636 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I4ae15971481ce5b2042b5d6fdfd16e11ad099c50 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-11-05Simplify request handling in PAPJim Hahn6-351/+178
PAP handles outgoing requests using a complicated priority queue. Simplified it significantly. Change-Id: I9f49dfebd7bf323c5e81bc8ca3459913fa95c43d Issue-ID: POLICY-2155 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-11-04Add REST api to query policy status from PAPJim Hahn7-18/+472
As part of this, added code to pre-load the deployed policy tracker by reading the policies and groups from the DB. Change-Id: Ifc6c787d114a3a7add4ea54acc1cc969d6c3ca1c Issue-ID: POLICY-2024 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-10-31Add tests for policy type in notificationsJim Hahn3-0/+10
The junit tests verified that the policy specified in the notifications, but did not verify the policy type. Added additional tests. Issue-ID: POLICY-2190 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Iad2a06163f9dce3dff3753cddef98db9e9ad2eea
2019-10-29Generate notifications when policies changejh735818-32/+340
Updated existing PAP code to make use of new notification classes. Change-Id: I4637ad92ac4f432f215cfc837e672c75074d88b5 Issue-ID: POLICY-1841 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-10-25Add notifier for generating notificationsJim Hahn3-4/+218
Also modified the Publisher class to make it generic so that it could be used to publish PdpMessage AND PolicyNotification. Issue-ID: POLICY-1841 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I305de21a4ef84730f163af63446bafadab11a809
2019-10-24Add trackers for generating notificationsJim Hahn4-0/+629
Issue-ID: POLICY-1841 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I7d6fe29707685e4711120b6a1e8448f25870a0ef Signed-off-by: Jim Hahn <jrh3@att.com>
2019-10-24Merge "Add PolicyPdpNotificationData for generating notifications"Jim Hahn1-0/+121
2019-10-23Add PolicyPdpNotificationData for generating notificationsJim Hahn1-0/+121
Issue-ID: POLICY-1841 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Icf5616190a8c3da38e2a1e33122b47a78e729d08
2019-10-23Add PolicyTrackerData for generating notificationsJim Hahn1-0/+239
Change-Id: Ife3ab77c0664101bbf32def5fb4d1a5ac194f459 Issue-ID: POLICY-1841 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-09-12Add yaml support to pap rest serverjrh31-0/+11
Change-Id: I3e3d5c46bfa4f1d093e64b8be9a9720570e6000c Issue-ID: POLICY-2085 Signed-off-by: jrh3 <jrh3@att.com>
2019-09-04Knock on of changing policy types to mapliamfallon1-161/+156
This review adapts policy-pap for the change in the structure of the toasca service template from a list of maps to a plain map. There is only a change to one test file. Issue-ID: POLICY-2047 Change-Id: Ieeeeb43d8f0300d075b3072b67f8d459def27ee7 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-08-22update keystorejhh1-0/+0
Issue-ID: POLICY-1988 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I3e7d08621b6ac529f3517de8c2b910d2fa7c5151 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2019-07-31Remove remaining ParameterUtils from PAPjrh31-4/+1
Issue-ID: POLICY-1953 Signed-off-by: jrh3 <jrh3@att.com> Change-Id: I2bc56dfe2d5982d7dadb54311a94d6c6f95fa595
2019-07-30Use new addTopic(TopicParameterGroup) method in PAPjrh31-5/+1
Issue-ID: POLICY-1953 Signed-off-by: jrh3 <jrh3@att.com> Change-Id: I225dc5f03d867efe6167fd20781c9959af34e0e9 Signed-off-by: jrh3 <jrh3@att.com>
2019-07-08Fix pap due to sonar changes in commonjrh35-19/+19
Fixed breakages due to changes made in policy/common to satisfy sonar. Issue-ID: POLICY-1791 Signed-off-by: jrh3 <jrh3@att.com> Change-Id: If8685462e1dd5cbbe58c329defff74ff2accf559
2019-07-01Remove topic.properties and incorporate into overall config filea.sreekumar12-70/+79
1) The properties in the topic.properties file is moved into overall config json file and the topic.properties file is removed. 2) Common parameters such as RestServer and Topic related parameters from policy-common is used. Change-Id: I390bbe3cda101a69e7ce614404ecdfbf98598dd2 Issue-ID: POLICY-1744 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2019-06-26Use ToStringTester from utils-testramverma1-1/+1
Changing ToStringTester from utils to utils-test. Correcting the policy/common & policy/models version. Change-Id: Ib0a14da17227f0f65004dc525a47f17519e25110 Issue-ID: POLICY-1746 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-06-21Merge "Allow integer version when using PDP Group Deploy"Jorge Hernandez5-4/+194
2019-06-21Adding PdpGroup healthcheck REST API in PAPramverma3-0/+272
Adding PdpGroup healthcheck REST API in PAP to return the health status of all the Pdps registered with this PAP instance. The healthcheck status will be based on the regular heartbeat coming from the pdps. Change-Id: Ia0f1603b513bf62ce1df3058427dc6ccaf179cb3 Issue-ID: POLICY-1770 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-06-20Allow integer version when using PDP Group Deployjrh35-4/+194
The policies listed in a "PDP Group Deploy" request may not have fully qualified versions. Modified the code to replace the versions in the request with fully qualified versions. Also improved performance by avoiding look-ups of policies that are already in the subgroup. Change-Id: I37899c2b45228b97a80b7ef44f69694ba57e8f4a Issue-ID: POLICY-1784 Signed-off-by: jrh3 <jrh3@att.com>
2019-06-11Add PDP heart beat expiration timerjrh39-3/+271
Added heart beat interval to the PDP-UPDATE message sent in response to a heart beat message received from a PDP. Added timers to detect missing heart beats and remove the PDP from the DB - PdpTracker. Modified current heart beat listener to update PdpTracker when a heart beat is received. Allow 3 missed heart beats instead of 2. Change-Id: I81621fefbe494e0c4d6f0b9767b00b2a9dd398d8 Issue-ID: POLICY-1795 Signed-off-by: jrh3 <jrh3@att.com>
2019-06-07Undeploy all versions of a policyJim Hahn2-8/+30
Modified the code to undeploy all versions of a policy if the version is not specified. Change-Id: Ic3815733b918e1cff8f381d54bceb710a35319b7 Issue-ID: POLICY-1782 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-05Reject policy deployment with version mismatchJim Hahn2-0/+105
PAP should not allow multiple versions of a policy to be deployed to the same PDP. Modified the code to reject deployment requests where a different version of the policy is already deployed. This impacts both the PDP-Group-Deploy and the Simple-Deploy REST APIs. Change-Id: I586b764951c20228d0d80ec8326869215e970fdf Issue-ID: POLICY-1785 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-04Undeploy policies when subgroup is deletedJim Hahn2-0/+112
When a subgroup is deleted via the PDP Group create/update API, any PDPs in the subgroup should have all of its policies undeployed. In the process, refactored addOrUpdateSubGroups() out of updateGroup(). Change-Id: I0750802bfb133a655e38493a868744b512ca3fb4 Issue-ID: POLICY-1803 Signed-off-by: Jim Hahn <jrh3@att.com>