From 9d04a9cc8c6f4b12ae60cc0d4d42f71085f72328 Mon Sep 17 00:00:00 2001 From: sebdet Date: Sun, 24 Jan 2021 16:40:18 +0100 Subject: Add new Camel route Add the new rest endpoint in camel + add new permission type + add robot test for that route + small refactoring of trst files Issue-ID: POLICY-2924 Signed-off-by: sebdet Change-Id: I623cc8ec1724513cdb92eeea000adca5c2433bae --- .../robotframework/robotframework-test.properties | 15 ++++++++------- .../robotframework/tests/02_policy_queries.robot | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 src/test/resources/robotframework/tests/02_policy_queries.robot (limited to 'src/test/resources/robotframework') diff --git a/src/test/resources/robotframework/robotframework-test.properties b/src/test/resources/robotframework/robotframework-test.properties index 665842b84..1e173f961 100644 --- a/src/test/resources/robotframework/robotframework-test.properties +++ b/src/test/resources/robotframework/robotframework-test.properties @@ -2,7 +2,7 @@ # ============LICENSE_START======================================================= # ONAP CLAMP # ================================================================================ -# Copyright (C) 2017-2018 AT&T Intellectual Property. All rights +# Copyright (C) 2017-2018, 2021 AT&T Intellectual Property. All rights # reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); @@ -152,12 +152,13 @@ clamp.config.dcae.deployment.userName=test clamp.config.dcae.deployment.password=test #Define user permission related parameters, the permission type can be changed but MUST be redefined in clds-users.properties in that case ! -clamp.config.security.permission.type.cl=permission-type-cl -clamp.config.security.permission.type.cl.manage=permission-type-cl-manage -clamp.config.security.permission.type.cl.event=permission-type-cl-event -clamp.config.security.permission.type.filter.vf=permission-type-filter-vf -clamp.config.security.permission.type.template=permission-type-template -clamp.config.security.permission.type.tosca=permission-type-tosca +clamp.config.security.permission.type.cl=org.onap.clamp.clds.cl +clamp.config.security.permission.type.cl.manage=org.onap.clamp.clds.cl.manage +clamp.config.security.permission.type.cl.event=org.onap.clamp.clds.cl.event +clamp.config.security.permission.type.filter.vf=org.onap.clamp.clds.filter.vf +clamp.config.security.permission.type.template=org.onap.clamp.clds.template +clamp.config.security.permission.type.tosca=org.onap.clamp.clds.tosca +clamp.config.security.permission.type.policies=org.onap.clamp.clds.policies #This one indicates the type of instances (dev|prod|perf...), this must be set accordingly in clds-users.properties clamp.config.security.permission.instance=dev clamp.config.security.authentication.class=org.onap.aaf.cadi.principal.X509Principal, org.onap.aaf.cadi.principal.CachedBasicPrincipal diff --git a/src/test/resources/robotframework/tests/02_policy_queries.robot b/src/test/resources/robotframework/tests/02_policy_queries.robot new file mode 100644 index 000000000..e62e03476 --- /dev/null +++ b/src/test/resources/robotframework/tests/02_policy_queries.robot @@ -0,0 +1,21 @@ +*** Settings *** +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json +Library OperatingSystem +*** Variables *** +${login} admin +${passw} password +${reponse_pdp_group} pdpGroupInfo +*** Keywords *** +Create the sessions +*** Test Cases *** +Get Requests policies list ok + ${port} = Get Environment Variable CLAMP_PORT + ${auth} = Create List ${login} ${passw} + Create Session clamp http://localhost:${port} auth=${auth} disable_warnings=1 + Set Global Variable ${clamp_session} clamp + ${response_query}= Get Request ${clamp_session} /restservices/clds/v2/policies/list + Should Be Equal As Strings ${response_query.status_code} 200 + Should Contain ${response_query.text} ${reponse_pdp_group} \ No newline at end of file -- cgit 1.2.3-korg