From 5e83a4b0e5e34aa81cb4c96dfabc4375ac0bf16e Mon Sep 17 00:00:00 2001 From: efiacor Date: Mon, 28 Feb 2022 17:27:23 +0000 Subject: [PATCH] [DCAE-PMSH] Removing dmaap mr from suite Signed-off-by: efiacor Change-Id: I1bb83e675667ae38e7e2d6d47f7e63165722cbb4 Issue-ID: DCAEGEN2-2922 --- .../testsuite/assets/cbs_sim/cbs-initializer.json | 6 +- .../testsuite/assets/kafka/zk_client_jaas.conf | 5 - .../testsuite/assets/mr/MsgRtrApi.properties | 166 --------------------- .../testsuite/assets/mr_sim/mr-initializer.json | 64 ++++++++ .../assets/mr_sim/mr_mockserver.properties | 27 ++++ .../testsuite/assets/zk/zk_server_jaas.conf | 4 - .../testsuite/docker-compose.yml | 88 +++-------- plans/dcaegen2-services-pmsh/testsuite/setup.sh | 26 +--- .../testcases/assets/aai-pnf-create.json | 118 +++++++-------- .../testcases/assets/aai-pnf-delete.json | 118 +++++++-------- .../assets/cbs-expectation-unlocked-config.json | 6 +- .../testcases/assets/mr-sim-reset.json | 64 ++++++++ .../assets/policy-sub-created-pnf-existing.json | 76 ++++++++-- .../assets/policy-sub-deleted-pnf-existing.json | 76 ++++++++-- tests/dcaegen2-services-pmsh/testcases/pmsh.robot | 98 ++++++------ 15 files changed, 480 insertions(+), 462 deletions(-) delete mode 100644 plans/dcaegen2-services-pmsh/testsuite/assets/kafka/zk_client_jaas.conf delete mode 100644 plans/dcaegen2-services-pmsh/testsuite/assets/mr/MsgRtrApi.properties create mode 100644 plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr-initializer.json create mode 100644 plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr_mockserver.properties delete mode 100644 plans/dcaegen2-services-pmsh/testsuite/assets/zk/zk_server_jaas.conf create mode 100644 tests/dcaegen2-services-pmsh/testcases/assets/mr-sim-reset.json diff --git a/plans/dcaegen2-services-pmsh/testsuite/assets/cbs_sim/cbs-initializer.json b/plans/dcaegen2-services-pmsh/testsuite/assets/cbs_sim/cbs-initializer.json index 194e556a..0c3592b4 100644 --- a/plans/dcaegen2-services-pmsh/testsuite/assets/cbs_sim/cbs-initializer.json +++ b/plans/dcaegen2-services-pmsh/testsuite/assets/cbs_sim/cbs-initializer.json @@ -87,7 +87,7 @@ "dmaap_info": { "client_id": "1475976809466", "client_role": "org.onap.dcae.pmPublisher", - "topic_url": "http://dmaap-mr:3904/events/unauthenticated.DCAE_CL_OUTPUT", + "topic_url": "http://mr-sim:3904/events/unauthenticated.DCAE_CL_OUTPUT", "location": "san-francisco" }, "type": "message_router" @@ -99,14 +99,14 @@ "dmaap_info": { "client_id": "1575976809466", "client_role": "org.onap.dcae.aaiSub", - "topic_url": "http://dmaap-mr:3904/events/AAI_EVENT", + "topic_url": "http://mr-sim:3904/events/AAI-EVENT", "location": "san-francisco" } }, "policy_pm_subscriber": { "dmaap_info": { "location": "san-francisco", - "topic_url": "http://dmaap-mr:3904/events/unauthenticated.PMSH_CL_INPUT", + "topic_url": "http://mr-sim:3904/events/unauthenticated.PMSH_CL_INPUT", "client_role": "org.onap.dcae.pmSubscriber", "client_id": "1575876809456" }, diff --git a/plans/dcaegen2-services-pmsh/testsuite/assets/kafka/zk_client_jaas.conf b/plans/dcaegen2-services-pmsh/testsuite/assets/kafka/zk_client_jaas.conf deleted file mode 100644 index 79a76017..00000000 --- a/plans/dcaegen2-services-pmsh/testsuite/assets/kafka/zk_client_jaas.conf +++ /dev/null @@ -1,5 +0,0 @@ -Client { - org.apache.zookeeper.server.auth.DigestLoginModule required - username="kafka" - password="kafka_secret"; - }; \ No newline at end of file diff --git a/plans/dcaegen2-services-pmsh/testsuite/assets/mr/MsgRtrApi.properties b/plans/dcaegen2-services-pmsh/testsuite/assets/mr/MsgRtrApi.properties deleted file mode 100644 index 47643216..00000000 --- a/plans/dcaegen2-services-pmsh/testsuite/assets/mr/MsgRtrApi.properties +++ /dev/null @@ -1,166 +0,0 @@ -# LICENSE_START======================================================= -# org.onap.dmaap -# ================================================================================ -# Copyright © 2017 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END========================================================= -# -# ECOMP is a trademark and service mark of AT&T Intellectual Property. -# -############################################################################### -############################################################################### -## -## Cambria API Server config -## -## Default values are shown as commented settings. -## -############################################################################### -## -## HTTP service -## -## 3904 is standard as of 7/29/14. -# -## Zookeeper Connection -## -## Both Cambria and Kafka make use of Zookeeper. -## -config.zk.servers=zookeeper:2181 - -############################################################################### -## -## Kafka Connection -## -## Items below are passed through to Kafka's producer and consumer -## configurations (after removing "kafka.") -## if you want to change request.required.acks it can take this one value -#kafka.metadata.broker.list=localhost:9092,localhost:9093 -#kafka.metadata.broker.list={{.Values.kafka.name}}:{{.Values.kafka.port}} -kafka.metadata.broker.list=kafka:9092 -##kafka.request.required.acks=-1 -#kafka.client.zookeeper=${config.zk.servers} -consumer.timeout.ms=100 -zookeeper.connection.timeout.ms=6000 -zookeeper.session.timeout.ms=20000 -zookeeper.sync.time.ms=2000 -auto.commit.interval.ms=1000 -fetch.message.max.bytes =1000000 -auto.commit.enable=false - -#(backoff*retries > zksessiontimeout) -kafka.rebalance.backoff.ms=10000 -kafka.rebalance.max.retries=6 - - -############################################################################### -## -## Secured Config -## -## Some data stored in the config system is sensitive -- API keys and secrets, -## for example. to protect it, we use an encryption layer for this section -## of the config. -## -## The key is a base64 encode AES key. This must be created/configured for -## each installation. -#cambria.secureConfig.key= -## -## The initialization vector is a 16 byte value specific to the secured store. -## This must be created/configured for each installation. -#cambria.secureConfig.iv= - -## Southfield Sandbox -cambria.secureConfig.key=b/7ouTn9FfEw2PQwL0ov/Q== -cambria.secureConfig.iv=wR9xP5k5vbz/xD0LmtqQLw== -authentication.adminSecret=fe3cCompound - - -############################################################################### -## -## Consumer Caching -## -## Kafka expects live connections from the consumer to the broker, which -## obviously doesn't work over connectionless HTTP requests. The Cambria -## server proxies HTTP requests into Kafka consumer sessions that are kept -## around for later re-use. Not doing so is costly for setup per request, -## which would substantially impact a high volume consumer's performance. -## -## This complicates Cambria server failover, because we often need server -## A to close its connection before server B brings up the replacement. -## - -## The consumer cache is normally enabled. -#cambria.consumer.cache.enabled=true - -## Cached consumers are cleaned up after a period of disuse. The server inspects -## consumers every sweepFreqSeconds and will clean up any connections that are -## dormant for touchFreqMs. -#cambria.consumer.cache.sweepFreqSeconds=15 -cambria.consumer.cache.touchFreqMs=120000 -##stickforallconsumerrequests=false -## The cache is managed through ZK. The default value for the ZK connection -## string is the same as config.zk.servers. -#cambria.consumer.cache.zkConnect=${config.zk.servers} - -## -## Shared cache information is associated with this node's name. The default -## name is the hostname plus the HTTP service port this host runs on. (The -## hostname is determined via InetAddress.getLocalHost ().getCanonicalHostName(), -## which is not always adequate.) You can set this value explicitly here. -## -#cambria.api.node.identifier= - -#cambria.rateLimit.maxEmptyPollsPerMinute=30 -#cambria.rateLimitActual.delay.ms=10 - -############################################################################### -## -## Metrics Reporting -## -## This server can report its metrics periodically on a topic. -## -#metrics.send.cambria.enabled=true -#metrics.send.cambria.topic=cambria.apinode.metrics -#msgrtr.apinode.metrics.dmaap -#metrics.send.cambria.sendEverySeconds=60 - -cambria.consumer.cache.zkBasePath=/fe3c/cambria/consumerCache -consumer.timeout=17 -default.partitions=3 -default.replicas=3 -############################################################################## -#100mb -maxcontentlength=10000 - - -############################################################################## -#AAF Properties -msgRtr.namespace.aaf=org.onap.dmaap.mr.topic -msgRtr.topicfactory.aaf=org.onap.dmaap.mr.topicFactory|:org.onap.dmaap.mr.topic: -enforced.topic.name.AAF=org.onap.dmaap.mr -forceAAF=false -transidUEBtopicreqd=false -defaultNSforUEB=org.onap.dmaap.mr -############################################################################## -#Mirror Maker Agent - -msgRtr.mirrormakeradmin.aaf=org.onap.dmaap.mr.mirrormaker|*|admin -msgRtr.mirrormakeruser.aaf=org.onap.dmaap.mr.mirrormaker|*|user -msgRtr.mirrormakeruser.aaf.create=org.onap.dmaap.mr.topicFactory|:org.onap.dmaap.mr.topic: -msgRtr.mirrormaker.timeout=15000 -msgRtr.mirrormaker.topic=org.onap.dmaap.mr.mirrormakeragent -msgRtr.mirrormaker.consumergroup=mmagentserver -msgRtr.mirrormaker.consumerid=1 - -kafka.max.poll.interval.ms=300000 -kafka.heartbeat.interval.ms=60000 -kafka.session.timeout.ms=240000 -kafka.max.poll.records=1000 \ No newline at end of file diff --git a/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr-initializer.json b/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr-initializer.json new file mode 100644 index 00000000..ed3ecb07 --- /dev/null +++ b/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr-initializer.json @@ -0,0 +1,64 @@ +[ + { + "id":"mr_aai_event", + "httpRequest":{ + "method":"GET", + "path":"/events/AAI-EVENT/.*", + "queryStringParameters":{ + "timeout":[ + "5000" + ] + } + }, + "httpResponse":{ + "statusCode":200, + "headers":{ + "content-type":[ + "application/json" + ] + }, + "body":{ + "type":"JSON", + "json":{ + + } + } + } + }, + { + "id":"pmsh_cl_input_event", + "httpRequest":{ + "path":"/events/unauthenticated.PMSH_CL_INPUT/.*", + "method":"GET", + "queryStringParameters":{ + "timeout":[ + "5000" + ] + } + }, + "httpResponse":{ + "statusCode":200, + "headers":{ + "content-type":[ + "application/json" + ] + }, + "body":{ + "type":"JSON", + "json":{ + + } + } + } + }, + { + "id":"dcae_cl_output_event", + "httpRequest":{ + "path":"/events/unauthenticated.DCAE_CL_OUTPUT/.*", + "method":"POST" + }, + "httpResponse":{ + "statusCode":200 + } + } +] \ No newline at end of file diff --git a/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr_mockserver.properties b/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr_mockserver.properties new file mode 100644 index 00000000..7aa31b29 --- /dev/null +++ b/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr_mockserver.properties @@ -0,0 +1,27 @@ +####################################### +# MockServer & Proxy Example Settings # +####################################### + +# Socket & Port Settings + +# socket timeout in milliseconds (default 120000) +mockserver.maxSocketTimeout=120000 + +# Certificate Generation + +# delete KeyStore file on JVM shutdown (default true) +mockserver.deleteGeneratedKeyStoreOnExit=true +# certificate domain name (default "localhost") +mockserver.sslCertificateDomainName=localhost +# comma separated list of domain names for Subject Alternative Name domain names (default empty list) +mockserver.sslSubjectAlternativeNameDomains=mr-sim +# comma separated list of ip addresses for Subject Alternative Name ips (default empty list) +mockserver.sslSubjectAlternativeNameIps=127.0.0.1 + + +# CORS + +# enable CORS for MockServer REST API +mockserver.enableCORSForAPI=true +# enable CORS for all responses +mockserver.enableCORSForAllResponses=true diff --git a/plans/dcaegen2-services-pmsh/testsuite/assets/zk/zk_server_jaas.conf b/plans/dcaegen2-services-pmsh/testsuite/assets/zk/zk_server_jaas.conf deleted file mode 100644 index 3d2767fa..00000000 --- a/plans/dcaegen2-services-pmsh/testsuite/assets/zk/zk_server_jaas.conf +++ /dev/null @@ -1,4 +0,0 @@ -Server { - org.apache.zookeeper.server.auth.DigestLoginModule required - user_kafka="kafka_secret"; -}; \ No newline at end of file diff --git a/plans/dcaegen2-services-pmsh/testsuite/docker-compose.yml b/plans/dcaegen2-services-pmsh/testsuite/docker-compose.yml index 73a7c075..a355c89c 100644 --- a/plans/dcaegen2-services-pmsh/testsuite/docker-compose.yml +++ b/plans/dcaegen2-services-pmsh/testsuite/docker-compose.yml @@ -1,76 +1,6 @@ version: '3.3' services: - zookeeper: - image: nexus3.onap.org:10001/onap/dmaap/zookeeper:6.1.0 - container_name: dmaap-zookeeper - ports: - - "2181:2181" - environment: - ZOOKEEPER_REPLICAS: 1 - ZOOKEEPER_TICK_TIME: 2000 - ZOOKEEPER_SYNC_LIMIT: 5 - ZOOKEEPER_INIT_LIMIT: 10 - ZOOKEEPER_MAX_CLIENT_CNXNS: 200 - ZOOKEEPER_AUTOPURGE_SNAP_RETAIN_COUNT: 3 - ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL: 24 - ZOOKEEPER_CLIENT_PORT: 2181 - KAFKA_OPTS: -Djava.security.auth.login.config=/etc/zookeeper/secrets/jaas/zk_server_jaas.conf -Dzookeeper.kerberos.removeHostFromPrincipal=true -Dzookeeper.kerberos.removeRealmFromPrincipal=true -Dzookeeper.authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider -Dzookeeper.requireClientAuthScheme=sasl -Dzookeeper.4lw.commands.whitelist=* - ZOOKEEPER_SERVER_ID: 1 - volumes: - - ./assets/zk/zk_server_jaas.conf:/etc/zookeeper/secrets/jaas/zk_server_jaas.conf - networks: - net: - aliases: - - zookeeper - - kafka: - image: nexus3.onap.org:10001/onap/dmaap/kafka111:1.1.0 - container_name: dmaap-kafka - ports: - - "9092:9092" - environment: - enableCadi: 'false' - KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 - KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS: 40000 - KAFKA_ZOOKEEPER_SESSION_TIMEOUT_MS: 40000 - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL_PLAINTEXT:PLAINTEXT,EXTERNAL_PLAINTEXT:PLAINTEXT - KAFKA_ADVERTISED_LISTENERS: INTERNAL_PLAINTEXT://kafka:9092 - KAFKA_LISTENERS: INTERNAL_PLAINTEXT://0.0.0.0:9092 - KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL_PLAINTEXT - KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE: 'false' - KAFKA_OPTS: -Djava.security.auth.login.config=/etc/kafka/secrets/jaas/zk_client_jaas.conf - KAFKA_ZOOKEEPER_SET_ACL: 'true' - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 - # Reduced the number of partitions only to avoid the timeout error for the first subscribe call in slow environment - KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS: 1 - volumes: - - ./assets/kafka/zk_client_jaas.conf:/etc/kafka/secrets/jaas/zk_client_jaas.conf - networks: - net: - aliases: - - kafka - depends_on: - - zookeeper - - dmaap-mr: - image: nexus3.onap.org:10001/onap/dmaap/dmaap-mr:1.3.0 - container_name: dmaap-mr - ports: - - "3904:3904" - - "3905:3905" - environment: - enableCadi: 'false' - volumes: - - ./assets/mr/MsgRtrApi.properties:/appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties - networks: - net: - aliases: - - dmaap-mr - depends_on: - - zookeeper - - kafka - db: container_name: db image: nexus3.onap.org:10001/library/postgres:10 @@ -118,12 +48,30 @@ services: net: aliases: - cbs-sim + mr-sim: + container_name: mr-sim + image: nexus3.onap.org:10001/mockserver/mockserver:latest + command: -logLevel DEBUG -serverPort 3904 + ports: + - 3904:1080 + environment: + MOCKSERVER_PROPERTY_FILE: /config/mockserver.properties + MOCKSERVER_INITIALIZATION_JSON_PATH: /config/mr-initializer.json + volumes: + - ./assets/mr_sim/mr_mockserver.properties:/config/mockserver.properties + - ./assets/mr_sim/mr-initializer.json:/config/mr-initializer.json + networks: + net: + aliases: + - mr-sim pmsh: container_name: pmsh image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.pmsh:latest depends_on: - db + ports: + - 8443:8443 volumes: - ./assets/ssl_certs/cert.pem:/opt/app/pmsh/etc/certs/cert.pem - ./assets/ssl_certs/key.pem:/opt/app/pmsh/etc/certs/key.pem diff --git a/plans/dcaegen2-services-pmsh/testsuite/setup.sh b/plans/dcaegen2-services-pmsh/testsuite/setup.sh index 73a219f7..a970c361 100644 --- a/plans/dcaegen2-services-pmsh/testsuite/setup.sh +++ b/plans/dcaegen2-services-pmsh/testsuite/setup.sh @@ -5,7 +5,7 @@ export DB_PASSWORD=pmsh TEST_PLANS_DIR=$WORKSPACE/plans/dcaegen2-services-pmsh/testsuite -docker-compose -f ${TEST_PLANS_DIR}/docker-compose.yml up -d zookeeper kafka dmaap-mr db aai cbs-sim +docker-compose -f ${TEST_PLANS_DIR}/docker-compose.yml up -d db aai cbs-sim mr-sim # Slow machine running CSITs can affect db coming up in time for PMSH echo "Waiting for postgres db to come up..." @@ -21,20 +21,6 @@ for i in {1..30}; do done [[ "$db_response" != "0" ]] && echo "Error: postgres db not accessible" && exit 1 -DMAAP_MR_IP=$(docker inspect -f "{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" dmaap-mr) - -echo "Waiting for dmaap-message-router to come up ..." -for i in {1..20}; do - dmaap_state=$(curl --write-out '%{http_code}' --silent --output /dev/null $DMAAP_MR_IP:3904/topics) - if [[ ${dmaap_state} == "200" ]] - then - break - else - sleep 5 - fi -done -[[ "$dmaap_state" != "200" ]] && echo "Error: DMaaP MR container state not healthy" && exit 1 - docker-compose -f ${TEST_PLANS_DIR}/docker-compose.yml up -d pmsh PMSH_IP=$(docker inspect -f "{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" pmsh) @@ -95,6 +81,7 @@ for i in {0..5}; do fi if [[ $(docker inspect --format '{{ .State.Running }}' cbs-sim) ]] && \ [[ $(docker inspect --format '{{ .State.Running }}' aai-sim) ]] && \ + [[ $(docker inspect --format '{{ .State.Running }}' mr-sim) ]] && \ [[ $(docker inspect --format '{{ .State.Running }}' db) ]] && \ [[ $(docker inspect --format '{{ .State.Running }}' pmsh) ]] then @@ -103,14 +90,9 @@ for i in {0..5}; do done [[ "$containers_ok" == "false" ]] && echo "Error: required container not running." && exit 1 -# Create topics on MR -curl -X POST http://${DMAAP_MR_IP}:3904/events/AAI_EVENT --header 'Content-Type: application/json' --data-raw '{"message": "dummy message"}' -sleep 2 -curl -X POST http://${DMAAP_MR_IP}:3904/events/unauthenticated.PMSH_CL_INPUT --header 'Content-Type: application/json' --data-raw '{"message": "dummy message"}' - - DB_IP_ADDRESS=$(docker inspect -f "{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" db) CBS_SIM_IP_ADDRESS=$(docker inspect -f "{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" cbs-sim) +MR_SIM_IP_ADDRESS=$(docker inspect -f "{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" mr-sim) #Pass any variables required by Robot test suites in ROBOT_VARIABLES -ROBOT_VARIABLES="-v PMSH_IP:${PMSH_IP} -v MR_IP_ADDRESS:${DMAAP_MR_IP} -v DB_IP_ADDRESS:${DB_IP_ADDRESS} -v CBS_SIM_IP_ADDRESS:${CBS_SIM_IP_ADDRESS}" +ROBOT_VARIABLES="-v PMSH_IP:${PMSH_IP} -v MR_SIM_IP_ADDRESS:${MR_SIM_IP_ADDRESS} -v DB_IP_ADDRESS:${DB_IP_ADDRESS} -v CBS_SIM_IP_ADDRESS:${CBS_SIM_IP_ADDRESS}" diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-create.json b/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-create.json index 534b7ce1..07d994b3 100644 --- a/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-create.json +++ b/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-create.json @@ -1,63 +1,63 @@ -{ - "cambria.partition":"AAI", - "event-header":{ - "severity":"NORMAL", - "entity-type":"pnf", - "top-entity-type":"pnf", - "entity-link":"/aai/v16/network/pnfs/pnf/pnf_newly_discovered", - "event-type":"AAI-EVENT", - "domain":"dev", - "action":"UPDATE", - "sequence-number":"0", - "id":"db09e090-196e-4f84-9645-e449b1cd3640", - "source-name":"dcae-curl", - "version":"v16", - "timestamp":"20200203-15:14:08:807" +[ + { + "id":"mr_aai_event", + "httpRequest":{ + "method":"GET", + "path":"/events/AAI-EVENT/.*", + "queryStringParameters":{ + "timeout":[ + "5000" + ] + } + }, + "httpResponse":{ + "headers":{ + "content-type":[ + "application/json" + ] + }, + "statusCode":200, + "body":{ + "type":"JSON", + "json":[ + "{\"cambria.partition\":\"AAI\",\"event-header\":{\"severity\":\"NORMAL\",\"entity-type\":\"pnf\",\"top-entity-type\":\"pnf\",\"entity-link\":\"/aai/v21/network/pnfs/pnf/pnf_newly_discovered\",\"event-type\":\"AAI-EVENT\",\"domain\":\"dev\",\"action\":\"UPDATE\",\"sequence-number\":\"0\",\"id\":\"db09e090-196e-4f84-9645-e449b1cd3640\",\"source-name\":\"dcae-curl\",\"version\":\"v21\",\"timestamp\":\"20200203-15:14:08:807\"},\"entity\":{\"ipaddress-v4-oam\":\"10.10.10.37\",\"nf-role\":\"gNB\",\"equip-type\":\"val8\",\"relationship-list\":{\"relationship\":[{\"related-to\":\"service-instance\",\"relationship-data\":[{\"relationship-value\":\"Demonstration\",\"relationship-key\":\"customer.global-customer-id\"},{\"relationship-value\":\"vCPE\",\"relationship-key\":\"service-subscription.service-type\"},{\"relationship-value\":\"2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-key\":\"service-instance.service-instance-id\"}],\"related-link\":\"/aai/v16/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-label\":\"org.onap.relationships.inventory.ComposedOf\",\"related-to-property\":[{\"property-key\":\"service-instance.service-instance-name\",\"property-value\":\"Svc6_1\"}]}]},\"equip-vendor\":\"Ericsson\",\"serial-number\":\"6061ZW3\",\"ipaddress-v6-oam\":\"2001:0db8:0:0:0:0:1428:57ab\",\"orchestration-status\":\"Active\",\"equip-model\":\"val6\",\"in-maint\":false,\"model-version-id\":\"e80a6ae3-cafd-4d24-850d-e14c084a5ca9\",\"resource-version\":\"1578668956804\",\"sw-version\":\"val7\",\"pnf-id\":\"eabcfaf7-b7f3-45fb-94e7-e6112fb3e8b8\",\"pnf-name\":\"pnf_newly_discovered\",\"model-invariant-id\":\"7129e420-d396-4efb-af02-6b83499b12f8\"}}" + ] + } + } }, - "entity":{ - "ipaddress-v4-oam":"10.10.10.37", - "nf-role":"gNB", - "equip-type":"val8", - "relationship-list":{ - "relationship":[ - { - "related-to":"service-instance", - "relationship-data":[ - { - "relationship-value":"Demonstration", - "relationship-key":"customer.global-customer-id" - }, - { - "relationship-value":"vCPE", - "relationship-key":"service-subscription.service-type" - }, - { - "relationship-value":"2c03b2a8-e31a-4749-9e99-3089ab441400", - "relationship-key":"service-instance.service-instance-id" - } - ], - "related-link":"/aai/v16/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/2c03b2a8-e31a-4749-9e99-3089ab441400", - "relationship-label":"org.onap.relationships.inventory.ComposedOf", - "related-to-property":[ - { - "property-key":"service-instance.service-instance-name", - "property-value":"Svc6_1" - } - ] + { + "id":"pmsh_cl_input_event", + "httpRequest":{ + "path":"/events/unauthenticated.PMSH_CL_INPUT/.*", + "method":"GET", + "queryStringParameters":{ + "timeout":[ + "5000" + ] + } + }, + "httpResponse":{ + "statusCode":200, + "headers":{ + "content-type":[ + "application/json" + ] + }, + "body":{ + "type":"JSON", + "json": { } - ] + } + } + }, + { + "id":"dcae_cl_output_event", + "httpRequest":{ + "path":"/events/unauthenticated.DCAE_CL_OUTPUT/.*", + "method":"POST" }, - "equip-vendor":"Ericsson", - "serial-number":"6061ZW3", - "ipaddress-v6-oam":"2001:0db8:0:0:0:0:1428:57ab", - "equip-model":"val6", - "in-maint":false, - "resource-version":"1578668956804", - "sw-version":"val7", - "pnf-id":"eabcfaf7-b7f3-45fb-94e7-e6112fb3e8b8", - "pnf-name":"pnf_newly_discovered", - "model-invariant-id":"7129e420-d396-4efb-af02-6b83499b12f8", - "model-version-id":"e80a6ae3-cafd-4d24-850d-e14c084a5ca9", - "orchestration-status":"Active" + "httpResponse":{ + "statusCode":200 + } } -} \ No newline at end of file +] \ No newline at end of file diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-delete.json b/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-delete.json index f2ffd050..20286a41 100644 --- a/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-delete.json +++ b/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-delete.json @@ -1,63 +1,61 @@ -{ - "cambria.partition":"AAI", - "event-header":{ - "severity":"NORMAL", - "entity-type":"pnf", - "top-entity-type":"pnf", - "entity-link":"/aai/v16/network/pnfs/pnf/pnf_newly_discovered", - "event-type":"AAI-EVENT", - "domain":"dev", - "action":"DELETE", - "sequence-number":"0", - "id":"db09e090-196e-4f84-9645-e449b1cd3640", - "source-name":"dcae-curl", - "version":"v16", - "timestamp":"20200203-15:14:08:807" +[ + { + "id":"mr_aai_event", + "httpRequest":{ + "method":"GET", + "path":"/events/AAI-EVENT/.*", + "queryStringParameters":{ + "timeout":[ + "5000" + ] + } + }, + "httpResponse":{ + "headers":{ + "content-type":[ + "application/json" + ] + }, + "statusCode":200, + "body":{ + "type":"JSON", + "json":[ + "{\"cambria.partition\":\"AAI\",\"event-header\":{\"severity\":\"NORMAL\",\"entity-type\":\"pnf\",\"top-entity-type\":\"pnf\",\"entity-link\":\"/aai/v21/network/pnfs/pnf/pnf_newly_discovered\",\"event-type\":\"AAI-EVENT\",\"domain\":\"dev\",\"action\":\"DELETE\",\"sequence-number\":\"0\",\"id\":\"db09e090-196e-4f84-9645-e449b1cd3640\",\"source-name\":\"dcae-curl\",\"version\":\"v21\",\"timestamp\":\"20200203-15:14:08:807\"},\"entity\":{\"ipaddress-v4-oam\":\"10.10.10.37\",\"nf-role\":\"gNB\",\"equip-type\":\"val8\",\"relationship-list\":{\"relationship\":[{\"related-to\":\"service-instance\",\"relationship-data\":[{\"relationship-value\":\"Demonstration\",\"relationship-key\":\"customer.global-customer-id\"},{\"relationship-value\":\"vCPE\",\"relationship-key\":\"service-subscription.service-type\"},{\"relationship-value\":\"2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-key\":\"service-instance.service-instance-id\"}],\"related-link\":\"/aai/v16/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-label\":\"org.onap.relationships.inventory.ComposedOf\",\"related-to-property\":[{\"property-key\":\"service-instance.service-instance-name\",\"property-value\":\"Svc6_1\"}]}]},\"equip-vendor\":\"Ericsson\",\"serial-number\":\"6061ZW3\",\"ipaddress-v6-oam\":\"2001:0db8:0:0:0:0:1428:57ab\",\"orchestration-status\":\"Active\",\"equip-model\":\"val6\",\"in-maint\":false,\"model-version-id\":\"e80a6ae3-cafd-4d24-850d-e14c084a5ca9\",\"resource-version\":\"1578668956804\",\"sw-version\":\"val7\",\"pnf-id\":\"eabcfaf7-b7f3-45fb-94e7-e6112fb3e8b8\",\"pnf-name\":\"pnf_newly_discovered\",\"model-invariant-id\":\"7129e420-d396-4efb-af02-6b83499b12f8\"}}" + ] + } + } + }, + { + "id":"pmsh_cl_input_event", + "httpRequest":{ + "path":"/events/unauthenticated.PMSH_CL_INPUT/.*", + "method":"GET", + "queryStringParameters":{ + "timeout":[ + "5000" + ] + } + }, + "httpResponse":{ + "statusCode":200, + "headers":{ + "content-type":[ + "application/json" + ] + }, + "body":{ + + } + } }, - "entity":{ - "ipaddress-v4-oam":"10.10.10.37", - "nf-role":"gNB", - "equip-type":"val8", - "relationship-list":{ - "relationship":[ - { - "related-to":"service-instance", - "relationship-data":[ - { - "relationship-value":"Demonstration", - "relationship-key":"customer.global-customer-id" - }, - { - "relationship-value":"vCPE", - "relationship-key":"service-subscription.service-type" - }, - { - "relationship-value":"2c03b2a8-e31a-4749-9e99-3089ab441400", - "relationship-key":"service-instance.service-instance-id" - } - ], - "related-link":"/aai/v16/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/2c03b2a8-e31a-4749-9e99-3089ab441400", - "relationship-label":"org.onap.relationships.inventory.ComposedOf", - "related-to-property":[ - { - "property-key":"service-instance.service-instance-name", - "property-value":"Svc6_1" - } - ] - } - ] + { + "id":"dcae_cl_output_event", + "httpRequest":{ + "path":"/events/unauthenticated.DCAE_CL_OUTPUT/.*", + "method":"POST" }, - "equip-vendor":"Ericsson", - "serial-number":"6061ZW3", - "ipaddress-v6-oam":"2001:0db8:0:0:0:0:1428:57ab", - "equip-model":"val6", - "in-maint":false, - "resource-version":"1578668956804", - "sw-version":"val7", - "pnf-id":"eabcfaf7-b7f3-45fb-94e7-e6112fb3e8b8", - "pnf-name":"pnf_newly_discovered", - "model-invariant-id":"7129e420-d396-4efb-af02-6b83499b12f8", - "model-version-id":"e80a6ae3-cafd-4d24-850d-e14c084a5ca9", - "orchestration-status":"Active" + "httpResponse":{ + "statusCode":200 + } } -} \ No newline at end of file +] \ No newline at end of file diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json b/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json index f5de1952..e6d0ef97 100644 --- a/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json +++ b/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json @@ -87,7 +87,7 @@ "dmaap_info": { "client_id": "1475976809466", "client_role": "org.onap.dcae.pmPublisher", - "topic_url": "http://dmaap-mr:3904/events/unauthenticated.DCAE_CL_OUTPUT", + "topic_url": "http://mr-sim:3904/events/unauthenticated.DCAE_CL_OUTPUT", "location": "san-francisco" }, "type": "message_router" @@ -99,14 +99,14 @@ "dmaap_info": { "client_id": "1575976809466", "client_role": "org.onap.dcae.aaiSub", - "topic_url": "http://dmaap-mr:3904/events/AAI_EVENT", + "topic_url": "http://mr-sim:3904/events/AAI-EVENT", "location": "san-francisco" } }, "policy_pm_subscriber": { "dmaap_info": { "location": "san-francisco", - "topic_url": "http://dmaap-mr:3904/events/unauthenticated.PMSH_CL_INPUT", + "topic_url": "http://mr-sim:3904/events/unauthenticated.PMSH_CL_INPUT", "client_role": "org.onap.dcae.pmSubscriber", "client_id": "1575876809456" }, diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/mr-sim-reset.json b/tests/dcaegen2-services-pmsh/testcases/assets/mr-sim-reset.json new file mode 100644 index 00000000..ed3ecb07 --- /dev/null +++ b/tests/dcaegen2-services-pmsh/testcases/assets/mr-sim-reset.json @@ -0,0 +1,64 @@ +[ + { + "id":"mr_aai_event", + "httpRequest":{ + "method":"GET", + "path":"/events/AAI-EVENT/.*", + "queryStringParameters":{ + "timeout":[ + "5000" + ] + } + }, + "httpResponse":{ + "statusCode":200, + "headers":{ + "content-type":[ + "application/json" + ] + }, + "body":{ + "type":"JSON", + "json":{ + + } + } + } + }, + { + "id":"pmsh_cl_input_event", + "httpRequest":{ + "path":"/events/unauthenticated.PMSH_CL_INPUT/.*", + "method":"GET", + "queryStringParameters":{ + "timeout":[ + "5000" + ] + } + }, + "httpResponse":{ + "statusCode":200, + "headers":{ + "content-type":[ + "application/json" + ] + }, + "body":{ + "type":"JSON", + "json":{ + + } + } + } + }, + { + "id":"dcae_cl_output_event", + "httpRequest":{ + "path":"/events/unauthenticated.DCAE_CL_OUTPUT/.*", + "method":"POST" + }, + "httpResponse":{ + "statusCode":200 + } + } +] \ No newline at end of file diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/policy-sub-created-pnf-existing.json b/tests/dcaegen2-services-pmsh/testcases/assets/policy-sub-created-pnf-existing.json index cc0dac4c..ffe3e3f3 100644 --- a/tests/dcaegen2-services-pmsh/testcases/assets/policy-sub-created-pnf-existing.json +++ b/tests/dcaegen2-services-pmsh/testcases/assets/policy-sub-created-pnf-existing.json @@ -1,14 +1,64 @@ -{ - "name":"ResponseEvent", - "nameSpace":"org.onap.policy.apex.onap.pmcontrol", - "source":"APEX", - "target":"DCAE", - "version":"0.0.1", - "status":{ - "subscriptionName":"subs_01", - "measurementGroupName": "msg_grp_01", - "nfName":"pnf-existing", - "changeType":"CREATE", - "message":"success" +[ + { + "id":"mr_aai_event", + "httpRequest":{ + "method":"GET", + "path":"/events/AAI-EVENT/.*", + "queryStringParameters":{ + "timeout":[ + "5000" + ] + } + }, + "httpResponse":{ + "statusCode":200, + "headers":{ + "content-type":[ + "application/json" + ] + }, + "body":{ + "type":"JSON", + "json":{ + + } + } + } + }, + { + "id":"pmsh_cl_input_event", + "httpRequest":{ + "path":"/events/unauthenticated.PMSH_CL_INPUT/.*", + "method":"GET", + "queryStringParameters":{ + "timeout":[ + "5000" + ] + } + }, + "httpResponse":{ + "statusCode":200, + "headers":{ + "content-type":[ + "application/json" + ] + }, + "body":{ + "type":"JSON", + "json":[ + "{\"name\":\"ResponseEvent\",\"nameSpace\":\"org.onap.policy.apex.onap.pmcontrol\",\"source\":\"APEX\",\"target\":\"DCAE\",\"version\":\"0.0.1\",\"status\":{\"subscriptionName\":\"subs_01\",\"measurementGroupName\": \"msg_grp_01\",\"nfName\":\"pnf-existing\",\"changeType\":\"CREATE\",\"message\":\"success\"}}" + ] + } + } + }, + { + "id":"dcae_cl_output_event", + "httpRequest":{ + "path":"/events/unauthenticated.DCAE_CL_OUTPUT/.*", + "method":"POST" + }, + "httpResponse":{ + "statusCode":200 + } } -} \ No newline at end of file +] \ No newline at end of file diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/policy-sub-deleted-pnf-existing.json b/tests/dcaegen2-services-pmsh/testcases/assets/policy-sub-deleted-pnf-existing.json index 0bc9c2ff..a94299e5 100644 --- a/tests/dcaegen2-services-pmsh/testcases/assets/policy-sub-deleted-pnf-existing.json +++ b/tests/dcaegen2-services-pmsh/testcases/assets/policy-sub-deleted-pnf-existing.json @@ -1,14 +1,64 @@ -{ - "name":"ResponseEvent", - "nameSpace":"org.onap.policy.apex.onap.pmcontrol", - "source":"APEX", - "target":"DCAE", - "version":"0.0.1", - "status":{ - "subscriptionName":"subs_01", - "measurementGroupName": "msg_grp_01", - "nfName":"pnf-existing", - "changeType":"DELETE", - "message":"success" +[ + { + "id":"mr_aai_event", + "httpRequest":{ + "method":"GET", + "path":"/events/AAI-EVENT/.*", + "queryStringParameters":{ + "timeout":[ + "5000" + ] + } + }, + "httpResponse":{ + "statusCode":200, + "headers":{ + "content-type":[ + "application/json" + ] + }, + "body":{ + "type":"JSON", + "json":{ + + } + } + } + }, + { + "id":"pmsh_cl_input_event", + "httpRequest":{ + "path":"/events/unauthenticated.PMSH_CL_INPUT/.*", + "method":"GET", + "queryStringParameters":{ + "timeout":[ + "5000" + ] + } + }, + "httpResponse":{ + "statusCode":200, + "headers":{ + "content-type":[ + "application/json" + ] + }, + "body":{ + "type":"JSON", + "json":[ + "{\"name\":\"ResponseEvent\",\"nameSpace\":\"org.onap.policy.apex.onap.pmcontrol\",\"source\":\"APEX\",\"target\":\"DCAE\",\"version\":\"0.0.1\",\"status\":{\"subscriptionName\":\"subs_01\",\"measurementGroupName\": \"msg_grp_01\",\"nfName\":\"pnf-existing\",\"changeType\":\"DELETE\",\"message\":\"success\"}}" + ] + } + } + }, + { + "id":"dcae_cl_output_event", + "httpRequest":{ + "path":"/events/unauthenticated.DCAE_CL_OUTPUT/.*", + "method":"POST" + }, + "httpResponse":{ + "statusCode":200 + } } -} +] \ No newline at end of file diff --git a/tests/dcaegen2-services-pmsh/testcases/pmsh.robot b/tests/dcaegen2-services-pmsh/testcases/pmsh.robot index 926e6991..44052b69 100644 --- a/tests/dcaegen2-services-pmsh/testcases/pmsh.robot +++ b/tests/dcaegen2-services-pmsh/testcases/pmsh.robot @@ -13,12 +13,11 @@ Test Teardown Delete All Sessions *** Variables *** ${PMSH_BASE_URL} https://${PMSH_IP}:8443 -${MR_BASE_URL} http://${MR_IP_ADDRESS}:3904 +${MR_SIM_BASE_URL} http://${MR_SIM_IP_ADDRESS}:3904 ${CBS_BASE_URL} https://${CBS_SIM_IP_ADDRESS}:10443 ${SUBSCRIPTION_ENDPOINT} /subscription -${POLICY_PUBLISH_MR_TOPIC} /events/unauthenticated.PMSH_CL_INPUT -${AAI_MR_TOPIC} /events/AAI_EVENT +${MR_SIM_RESET} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/mr-sim-reset.json ${MR_AAI_PNF_CREATED} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-create.json ${MR_AAI_PNF_REMOVED} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-delete.json ${MR_POLICY_RESPONSE_PNF_EXISTING} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/policy-sub-created-pnf-existing.json @@ -28,8 +27,6 @@ ${CREATE_SUBSCRIPTION_DATA} %{WORKSPACE}/tests/dcaegen2-services ${CREATE_SECOND_SUBSCRIPTION_DATA} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/create_second_subscription_request.json ${CREATE_SUBSCRIPTION_BAD_DATA} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/create_subscription_bad_request.json ${CREATE_SUBSCRIPTION_SCHEMA_ERROR_DATA} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/create_subscription_schema_error_request.json -${ADMIN_STATE_LOCKED_PATTERN} 'administrativeState': 'LOCKED' -${CLI_EXEC_GET_CBS_CONFIG_FIRST} docker exec pmsh /bin/sh -c "grep -m 1 'PMSH config from CBS' /var/log/ONAP/dcaegen2/services/pmsh/application.log" *** Test Cases *** Verify Get subscriptions with Network Functions None @@ -74,8 +71,9 @@ Verify Policy response on MR is handled [Tags] PMSH_04 [Documentation] Verify policy response on MR is handled [Timeout] 60 seconds - SimulatePolicyResponse ${MR_POLICY_RESPONSE_PNF_EXISTING} + AddCreatePolicyResponeToMrSim Sleep 31 seconds Ensure Policy response on MR is picked up + ResetMrSim ${resp}= GetMeasGrpCall /subscription/subs_01/measurementGroups/msg_grp_01 Should Be Equal As Strings ${resp.json()['subscriptionName']} subs_01 Should Be Equal As Strings ${resp.json()['administrativeState']} UNLOCKED @@ -86,8 +84,9 @@ Verify AAI event on MR detailing new PNF being detected is handled [Tags] PMSH_05 [Documentation] Verify PNF created AAI event on MR is handled [Timeout] 60 seconds - SimulateNewPNF ${MR_AAI_PNF_CREATED} - Sleep 31 seconds Ensure AAI event on MR is picked up + AddNewPnfToMrSim + Sleep 25 seconds Give sim time to set expectation + ResetMrSim ${resp}= GetMeasGrpCall /subscription/subs_01/measurementGroups/msg_grp_01 Should Be Equal As Strings ${resp.json()['subscriptionName']} subs_01 Should Be Equal As Strings ${resp.json()['administrativeState']} UNLOCKED @@ -98,8 +97,9 @@ Verify AAI event on MR detailing PNF being deleted is handled [Tags] PMSH_06 [Documentation] Verify PNF deleted AAI event on MR is handled [Timeout] 60 seconds - SimulateDeletedPNF ${MR_AAI_PNF_REMOVED} - Sleep 31 seconds Ensure AAI event on MR is picked up + RemoveNewPnfFromMrSim + Sleep 21 seconds Ensure AAI event on MR is picked up + ResetMrSim ${resp}= GetMeasGrpCall /subscription/subs_01/measurementGroups/msg_grp_01 Should Not Contain ${resp.text} pnf_newly_discovered @@ -195,8 +195,9 @@ Verify Measurement Group admin status update from Locking to Locked [Tags] PMSH_16 [Documentation] Verify Measurement Group admin status update from Locking to Locked [Timeout] 60 seconds - SimulatePolicyResponse ${MR_POLICY_RESPONSE_PNF_DELETED} + AddDeletePolicyResponeToMrSim Sleep 31 seconds Ensure Policy response on MR is picked up + ResetMrSim ${resp}= GetMeasGrpCall /subscription/subs_01/measurementGroups/msg_grp_01 Should Be Equal As Strings ${resp.json()['measurementGroupName']} msg_grp_01 Should Be Equal As Strings ${resp.json()['subscriptionName']} subs_01 @@ -295,40 +296,49 @@ SetAdministrativeStateToUnlocked ${resp} = PUT On Session cbs_sim_session url=/expectation data=${data} Should Be True ${resp.status_code} == 201 +AddCreatePolicyResponeToMrSim + ${data}= Get Data From File ${MR_POLICY_RESPONSE_PNF_EXISTING} + Create Session mr_sim_session ${MR_SIM_BASE_URL} verify=false + ${resp}= PUT On Session mr_sim_session url=/clear data={"id" : "pmsh_cl_input_event"} + Should Be True ${resp.status_code} == 200 + Sleep 2 Allow MR_SIM time to set expectation + ${resp} = PUT On Session mr_sim_session url=/expectation data=${data} + Should Be True ${resp.status_code} == 201 -SimulatePolicyResponse - [Arguments] ${expected_contents} - ${json_value}= json_from_file ${expected_contents} - ${resp}= PostMrCall ${POLICY_PUBLISH_MR_TOPIC} ${json_value} - log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - ${count}= Evaluate $resp.json().get('count') - log 'JSON Response Code:'${resp} - -SimulateNewPNF - [Arguments] ${expected_contents} - ${json_value}= json_from_file ${expected_contents} - ${resp}= PostMrCall ${AAI_MR_TOPIC} ${json_value} - log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - ${count}= Evaluate $resp.json().get('count') - log 'JSON Response Code:'${resp} - -SimulateDeletedPNF - [Arguments] ${expected_contents} - ${json_value}= json_from_file ${expected_contents} - ${resp}= PostMrCall ${AAI_MR_TOPIC} ${json_value} - log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - ${count}= Evaluate $resp.json().get('count') - log 'JSON Response Code:'${resp} - -PostMrCall - [Arguments] ${url} ${data} - Create Session mr_sim_session ${MR_BASE_URL} verify=false - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= POST On Session mr_sim_session url=${url} json=${data} headers=${headers} - [Return] ${resp} +AddDeletePolicyResponeToMrSim + ${data}= Get Data From File ${MR_POLICY_RESPONSE_PNF_DELETED} + Create Session mr_sim_session ${MR_SIM_BASE_URL} verify=false + ${resp}= PUT On Session mr_sim_session url=/clear data={"id" : "pmsh_cl_input_event"} + Should Be True ${resp.status_code} == 200 + Sleep 2 Allow MR_SIM time to set expectation + ${resp} = PUT On Session mr_sim_session url=/expectation data=${data} + Should Be True ${resp.status_code} == 201 + +AddNewPnfToMrSim + ${data}= Get Data From File ${MR_AAI_PNF_CREATED} + Create Session mr_sim_session ${MR_SIM_BASE_URL} verify=false + ${resp}= PUT On Session mr_sim_session url=/clear data={"id" : "mr_aai_event"} + Should Be True ${resp.status_code} == 200 + Sleep 2 Allow MR_SIM time to set expectation + ${resp} = PUT On Session mr_sim_session url=/expectation data=${data} + Should Be True ${resp.status_code} == 201 + +RemoveNewPnfFromMrSim + ${data}= Get Data From File ${MR_AAI_PNF_REMOVED} + Create Session mr_sim_session ${MR_SIM_BASE_URL} verify=false + ${resp}= PUT On Session mr_sim_session url=/clear data={"id" : "mr_aai_event"} + Should Be True ${resp.status_code} == 200 + Sleep 2 Allow MR_SIM time to set expectation + ${resp} = PUT On Session mr_sim_session url=/expectation data=${data} + Should Be True ${resp.status_code} == 201 + +ResetMrSim + ${data}= Get Data From File ${MR_SIM_RESET} + Create Session mr_sim_session ${MR_SIM_BASE_URL} verify=false + ${resp}= PUT On Session mr_sim_session url=/reset + Should Be True ${resp.status_code} == 200 + ${resp}= PUT On Session mr_sim_session url=/expectation data=${data} + Should Be True ${resp.status_code} == 201 GetSubsCall [Arguments] ${url} ${url_path_param} -- 2.16.6