test_notifications.c revision 8a4b0b791bf38ef8389a6501a586d8ab554e3711
0N/A * The contents of this file are subject to the terms of the Common Development and 0N/A * Distribution License (the License). You may not use this file except in compliance with the 0N/A * specific language governing permission and limitations under the License. 0N/A * When distributing Covered Software, include this CDDL Header Notice in each file and include 0N/A * Header, with the fields enclosed by brackets [] replaced by your own identifying 0N/A * information: "Portions copyright [year] [name of copyright owner]". 0N/A * Copyright 2014 - 2015 ForgeRock AS. 0N/A "<NotificationSet version='1.0'>" 0N/A //option - invalidate config changed ( not for specific instance ) 0N/A //" <AgentConfigChangeNotification />" 0N/A //option - invalidate session by sid ( state must be present, not is not used ) 0N/A //" <SessionNotification>" 0N/A //" <Session sid='my-session' state='destroyed' />" 0N/A //" </SessionNotification>" 0N/A //option remove specific resources from the cache - check that it is the right service 0N/A //these can't be removed by resource from the session cache 0N/A " <PolicyChangeNotification serviceName='identified-service' >" 0N/A " <ResourceName type='added' >a.b.c:3232/d/e/f</ResourceName>" 0N/A " <ResourceName type='deleted' >a.b.c:3232/d/e/f</ResourceName>" 0N/A " <ResourceName type='modified' >a.b.c:3232/d/e/f</ResourceName>" 0N/A " </PolicyChangeNotification>" 0N/A "</NotificationSet>";
0N/A /* this is not a notification */ 0N/A "<NotificationSet version='1.0'>" 0N/A //option - invalidate config changed ( not for specific instance ) 0N/A //" <AgentConfigChangeNotification />" 0N/A //option - invalidate session by sid ( state must be present, not is not used ) 0N/A //" <SessionNotification>" 0N/A //" <Session sid='my-session' state='destroyed' />" 0N/A //" </SessionNotification>" 0N/A //option remove specific resources from the cache - check that it is the right service 0N/A //these can't be removed by resource from the session cache 0N/A " <PolicyChangeNotification serviceName='identified-service' >" 0N/A " <ResourceName type='added' >a.b.c:3232/d/e/f</ResourceName>" 0N/A " <ResourceName type='deleted' >a.b.c:3232/d/e/f</ResourceName>" 0N/A " <ResourceName type='modified' >a.b.c:3232/d/e/f</ResourceName>" 0N/A " </PolicyChangeNotification>" 0N/A "</NotificationSet>";
0N/A sleep(
2);
/* must wait till worker pool is all set */ 0N/A /* this is a notification */ 0N/A "<NotificationSet version='1.0'>" 0N/A " <SessionNotification> <Session sid='XXX' state='destroyed' /> </SessionNotification>" 0N/A "</NotificationSet>";
0N/A "<PolicyService version='1.0' revisionNumber='60'>" 0N/A " <PolicyResponse requestId='4' issueInstant='1424783306343' >" 0N/A " <ResponseAttributes>" 0N/A " <!-- these can have multiple (0..n) value elements -->" 0N/A " <AttributeValuePair>" 0N/A " <Attribute name='Attributes,key:0,0'/> <Value>Attributes,value:0,0,0</Value> <Value>Attributes,value:0,0,1</Value>" 0N/A " </AttributeValuePair>" 0N/A " <AttributeValuePair>" 0N/A " <Attribute name='Attributes,key:0,1'/> <Value>Attributes,value:0,1,0</Value>" 0N/A " </AttributeValuePair>" 0N/A " </ResponseAttributes>" 0N/A " <ActionDecision timeToLive='1234'>" 0N/A " <!-- these can have no value elements, which defaults to ? -->" 0N/A " <AttributeValuePair>" 0N/A " <Attribute name='PUT'/> <Value>deny</Value>" 0N/A " </AttributeValuePair>" 0N/A " <AttributeValuePair>" 0N/A " <Attribute name='Advices,key:0,0'/> <Value>Advices,value:0,0,0</Value>" 0N/A " </AttributeValuePair>" 0N/A " <AttributeValuePair>" 0N/A " <Attribute name='Advices,key:0,1'/> <Value>Advices,value:0,1,0</Value>" 0N/A " </AttributeValuePair>" 0N/A " </ActionDecision>" 0N/A " <ResponseDecisions>" 0N/A " <AttributeValuePair>" 0N/A " <Attribute name='Decision,key:0,0'/> <Value>Decision,value:0,0,0</Value>" 0N/A " </AttributeValuePair>" 0N/A " <AttributeValuePair>" 0N/A " <Attribute name='Decision,key:0,1'/> <Value>Decision,value:0,1,0</Value>" 0N/A " </AttributeValuePair>" 0N/A " <AttributeValuePair>" 0N/A " <Attribute name='Decision,key:0,2'/> <Value>Decision,value:0,2,0</Value>" 0N/A " </AttributeValuePair>" 0N/A " </ResponseDecisions>" 0N/A " </PolicyDecision>" 0N/A " </ResourceResult>" 0N/A " </PolicyResponse>" 0N/A char*
pll =
"<?xml version='1.0' encoding='UTF-8' standalone='yes'?>" 0N/A "<ResponseSet vers='1.0' svcid='poicy' reqid='48'>" 0N/A " <Response><![CDATA[%s]]></Response>" 0N/A sleep(
2);
/* must wait till worker pool is all set */ 0N/A /* find the session */ 0N/A /* this is a notification */ 0N/A /* wait for the worker to have finished */ 0N/A "<NotificationSet version='1.0'>" 0N/A " <PolicyChangeNotification serviceName='identified-service' >" 0N/A " <ResourceName type='deleted' >a.b.c:3232/d/e/f</ResourceName>" 0N/A " <ResourceName type='modified' >a.b.c:3232/d/e/f</ResourceName>" 0N/A " </PolicyChangeNotification>" 0N/A "</NotificationSet>";
"<PolicyService version='1.0' revisionNumber='60'>" " <PolicyResponse requestId='4' issueInstant='1424783306343' >" " <ResourceResult name='a.b.c:3232/d/e/f'>" " <!-- these can have multiple (0..n) value elements -->" " <Attribute name='Attributes,key:0,0'/> <Value>Attributes,value:0,0,0</Value> <Value>Attributes,value:0,0,1</Value>" " <Attribute name='Attributes,key:0,1'/> <Value>Attributes,value:0,1,0</Value>" " <ActionDecision timeToLive='1234'>" " <!-- these can have no value elements, which defaults to ? -->" " <Attribute name='PUT'/> <Value>deny</Value>" " <Attribute name='Advices,key:0,0'/> <Value>Advices,value:0,0,0</Value>" " <Attribute name='Advices,key:0,1'/> <Value>Advices,value:0,1,0</Value>" " <Attribute name='Decision,key:0,0'/> <Value>Decision,value:0,0,0</Value>" " <Attribute name='Decision,key:0,1'/> <Value>Decision,value:0,1,0</Value>" " <Attribute name='Decision,key:0,2'/> <Value>Decision,value:0,2,0</Value>" char *
pll =
"<?xml version='1.0' encoding='UTF-8' standalone='yes'?>" "<ResponseSet vers='1.0' svcid='poicy' reqid='48'>" " <Response><![CDATA[%s]]></Response>" /* when the worker has finished, the session result list should be unchanged, but policy cache entry removed */ sleep(
2);
/* must wait till worker pool is all set */ /* add the resources to the policy cache */ /* send a resource notification for the cached resource */