chmod -R 777 authz
cd authz
fi
-
+echo "Current Dir: ${PWD}"
# Locate to Docker dir
cd auth/docker
if [ ! -e d.props ]; then
cp d.props.init d.props
fi
+echo "Current Dir: ${PWD}"
source d.props
# Fill in anything missing
$SED "s/^LATITUDE=.*/LATITUDE=${LATITUDE:=38.0}/" d.props
$SED "s/^LONGITUDE=.*/LONGITUDE=${LONGITUDE:=-72.0}/" d.props
+$SED "s/^LONGITUDE=.*/LONGITUDE=${LONGITUDE:=-72.0}/" d.props
# For Jenkins, gotta use 10001, not 10003
DOCKER_REPOSITORY=nexus3.onap.org:10001
$SED "s/DOCKER_REPOSITORY=.*/DOCKER_REPOSITORY=$DOCKER_REPOSITORY/" d.props
DOCKER_NAME=$(docker info | grep Name | awk '{print $2}' )
echo "Docker Name is $DOCKER_NAME"
-if [ "$DOCKER_NAME" = "minikube" ]; then
- echo "Minikube IP"
- HOST_IP=$(minikube ip)
-else
- echo "Trying to get IP from Docker $DOCKER_NAME with 'ip route' method"
- # ip route get 8.8.8.8
- HOST_IP=$(ip route get 8.8.8.8 | awk '{print $7}')
- if [ -z "$HOST_IP" ]; then
- echo "Critical HOST_IP could not be obtained by 2 different methods. Exiting..."
- exit
- fi
- echo
-fi
-$SED "s/HOST_IP=.*/HOST_IP=$HOST_IP/" d.props
-
-cat d.props
-
-# Pull latest Dockers
-AAF_DOCKER_VERSION=${VERSION}
-NEXUS_USERNAME=anonymous
-NEXUS_PASSWD=anonymous
-echo "$NEXUS_PASSWD" | docker login -u $NEXUS_USERNAME --password-stdin $DOCKER_REPOSITORY
-
-docker pull $DOCKER_REPOSITORY/onap/aaf/aaf_cass:$AAF_DOCKER_VERSION
-docker pull $DOCKER_REPOSITORY/onap/aaf/aaf_config:$AAF_DOCKER_VERSION
-docker pull $DOCKER_REPOSITORY/onap/aaf/aaf_cm:$AAF_DOCKER_VERSION
-docker pull $DOCKER_REPOSITORY/onap/aaf/aaf_fs:$AAF_DOCKER_VERSION
-docker pull $DOCKER_REPOSITORY/onap/aaf/aaf_gui:$AAF_DOCKER_VERSION
-docker pull $DOCKER_REPOSITORY/onap/aaf/aaf_hello:$AAF_DOCKER_VERSION
-docker pull $DOCKER_REPOSITORY/onap/aaf/aaf_locate:$AAF_DOCKER_VERSION
-docker pull $DOCKER_REPOSITORY/onap/aaf/aaf_oauth:$AAF_DOCKER_VERSION
-docker pull $DOCKER_REPOSITORY/onap/aaf/aaf_service:$AAF_DOCKER_VERSION
+#if [ "$DOCKER_NAME" = "minikube" ]; then
+# echo "Minikube IP"
+# HOST_IP=$(minikube ip)
+#else
+# echo "Trying to get IP from Docker $DOCKER_NAME with 'ip route' method"
+# # ip route get 8.8.8.8
+# HOST_IP=$(ip route get 8.8.8.8 | awk '{print $7}')
+# if [ -z "$HOST_IP" ]; then
+# echo "Critical HOST_IP could not be obtained by 2 different methods. Exiting..."
+# exit
+# fi
+# echo
+#fi
+#$SED "s/HOST_IP=.*/HOST_IP=$HOST_IP/" d.props
+
+if [ -z "$SKIP_PULL" ]; then
+ # Pull latest Dockers
+ AAF_DOCKER_VERSION=${VERSION}
+ NEXUS_USERNAME=anonymous
+ NEXUS_PASSWD=anonymous
+ echo "$NEXUS_PASSWD" | docker login -u $NEXUS_USERNAME --password-stdin $DOCKER_REPOSITORY
+
+ docker pull $DOCKER_REPOSITORY/onap/aaf/aaf_cass:$AAF_DOCKER_VERSION
+ docker pull $DOCKER_REPOSITORY/onap/aaf/aaf_config:$AAF_DOCKER_VERSION
+ docker pull $DOCKER_REPOSITORY/onap/aaf/aaf_cm:$AAF_DOCKER_VERSION
+ docker pull $DOCKER_REPOSITORY/onap/aaf/aaf_fs:$AAF_DOCKER_VERSION
+ docker pull $DOCKER_REPOSITORY/onap/aaf/aaf_gui:$AAF_DOCKER_VERSION
+ docker pull $DOCKER_REPOSITORY/onap/aaf/aaf_hello:$AAF_DOCKER_VERSION
+ docker pull $DOCKER_REPOSITORY/onap/aaf/aaf_locate:$AAF_DOCKER_VERSION
+ docker pull $DOCKER_REPOSITORY/onap/aaf/aaf_oauth:$AAF_DOCKER_VERSION
+ docker pull $DOCKER_REPOSITORY/onap/aaf/aaf_service:$AAF_DOCKER_VERSION
+fi
# Cassandra Install/Start
cd ../auth-cass/docker
echo Cassandra Install
docker ps -a
-for C in aaf_service aaf_locate aaf_oauth aaf_cm aaf_gui aaf_hello aaf_fs; do
+for C in aaf-service aaf-locate aaf-oauth aaf-cm aaf-gui aaf-hello aaf-fs; do
docker logs $C
done
-bash ./aaf.sh wait aaf_service
+bash ./aaf.sh wait aaf-service
-AAF_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' aaf_service)
+AAF_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' aaf-service)
echo AAF_IP=${AAF_IP}
-#Pass any variables required by Robot test suites in ROBOT_VARIABLES
-ROBOT_VARIABLES="-v AAF_IP:${AAF_IP}"
+openssl s_client -connect $AAF_IP:8100
+
+export ROBOT_VARIABLES="-v AAF_IP:${AAF_IP}"
pmmapper:
container_name: pmmapper
image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.pm-mapper:1.0-SNAPSHOT
+ ports:
+ - "8081:8081"
environment:
CONFIG_BINDING_SERVICE_SERVICE_HOST: CBSIP
CONFIG_BINDING_SERVICE_SERVICE_PORT: 10000
+++ /dev/null
-#!/bin/bash
-#
-# Copyright 2017 ZTE Corporation.
-#
-# 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.
-#
-# Place the scripts in run order:
-# Start all process required for executing test case
-
-source ${SCRIPTS}/common_functions.sh
-
-#start msb
-docker run -d -p 8500:8500 --name msb_consul consul:0.9.3
-MSB_CONSUL_IP=`get-instance-ip.sh msb_consul`
-echo MSB_CONSUL_IP=${MSB_CONSUL_IP}
-
-docker run -d -p 10081:10081 -e CONSUL_IP=$MSB_CONSUL_IP --name msb_discovery nexus3.onap.org:10001/onap/msb/msb_discovery
-MSB_DISCOVERY_IP=`get-instance-ip.sh msb_discovery`
-echo DISCOVERY_IP=${MSB_DISCOVERY_IP}
-
-docker run -d -p 80:80 -e CONSUL_IP=$MSB_CONSUL_IP -e SDCLIENT_IP=$MSB_DISCOVERY_IP --name msb_internal_apigateway nexus3.onap.org:10001/onap/msb/msb_apigateway
-MSB_IAG_IP=`get-instance-ip.sh msb_internal_apigateway`
-echo MSB_IAG_IP=${MSB_IAG_IP}
-
-docker run -d -p 3306:3306 --name vfc-db nexus3.onap.org:10001/onap/vfc/db
-VFC_DB_IP=`get-instance-ip.sh vfc-db`
-echo VFC_DB_IP=${VFC_DB_IP}
-
-# Wait for initialization(8500 Consul, 10081 Service Registration & Discovery, 80 api gateway)
-for i in {1..10}; do
- curl -sS -m 1 ${MSB_CONSUL_IP}:8500 && curl -sS -m 1 ${MSB_DISCOVERY_IP}:10081 && curl -sS -m 1 ${MSB_IAG_IP}:80 && break
- echo sleep $i
- sleep $i
-done
-
-# Wait for initialization(3306 DB)
-for i in {1..3}; do
- curl -sS -m 1 ${VFC_DB_IP}:3306 && break
- echo sleep $i
- sleep $i
-done
-
-# wait for container initalization
-echo sleep 30
-sleep 30
-
-# start vfc-vnfmgr
-docker run -d --name vfc-vnfmgr -e MSB_ADDR=${MSB_IAG_IP}:80 -e MYSQL_ADDR=${VFC_DB_IP}:3306 nexus3.onap.org:10001/onap/vfc/vnfmgr
-VNFMGR_IP=`get-instance-ip.sh vfc-vnfmgr`
-for i in {1..10}; do
- curl -sS -m 1 ${VNFMGR_IP}:8803 && break
- echo sleep $i
- sleep $i
-done
-
-# Pass any variables required by Robot test suites in ROBOT_VARIABLES
-ROBOT_VARIABLES="-v MSB_IAG_IP:${MSB_IAG_IP} -v VNFMGR_IP:${VNFMGR_IP} -v SCRIPTS:${SCRIPTS}"
+++ /dev/null
-#!/bin/bash
-#
-# Copyright 2017 ZTE Corporation.
-#
-# 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.
-#
-
-# This script is sourced by run-csit.sh after Robot test completion.
-kill-instance.sh msb_internal_apigateway
-kill-instance.sh msb_discovery
-kill-instance.sh msb_consul
-kill-instance.sh vfc-db
-kill-instance.sh vfc-vnfmgr
+++ /dev/null
-# Test suites are relative paths under [integration/csit.git]/tests/.
-# Place the suites in run order.
-vfc/gvnfm-vnfmgr/test.robot
sleep $i
done
-# start vfc-jujudriver
-docker run -d --name vfc-jujudriver -e MSB_ADDR=${MSB_IAG_IP}:80 nexus3.onap.org:10001/onap/vfc/jujudriver
-JUJUDRIVER_IP=`get-instance-ip.sh vfc-jujudriver`
-
-# Wait for initialization
-for i in {1..10}; do
- curl -sS ${JUJUDRIVER_IP}:8483 && break
- echo sleep $i
- sleep $i
-done
-
# Pass any variables required by Robot test suites in ROBOT_VARIABLES
-ROBOT_VARIABLES="-v MSB_IAG_IP:${MSB_IAG_IP} -v GVNFMDRIVER_IP:${GVNFMDRIVER_IP} -v JUJUDRIVER_IP:${JUJUDRIVER_IP}"
+ROBOT_VARIABLES="-v MSB_IAG_IP:${MSB_IAG_IP} -v GVNFMDRIVER_IP:${GVNFMDRIVER_IP}"
kill-instance.sh msb_internal_apigateway
kill-instance.sh msb_discovery
kill-instance.sh msb_consul
-kill-instance.sh vfc-gvnfmdriver
-
-kill-instance.sh vfc-jujudriver
+kill-instance.sh vfc-gvnfmdriver
# Place the suites in run order.
vfc/nfvo-driver-gvnfm/gvnfmdriver.robot
-
-vfc/nfvo-driver-gvnfm/jujudriver.robot
-FROM python:2.7
+FROM python:2.7-alpine
EXPOSE 8080
-FROM python:2.7
+FROM python:2.7-alpine
EXPOSE 8080
*** Settings ***
-Documentation 5G Bulk PM E2E Testcases
+Documentation PM Mapper Testcases
Library RequestsLibrary
Library Process
+Test Setup Create Session mapper_session ${PMMAPPER_BASE_URL}
+Test Teardown Delete All Sessions
+
*** Variables ***
${CLI_EXEC_CLI_CONFIG} { head -n 5 | tail -1;} < /tmp/pmmapper.log
${CLI_EXEC_CLI_SUBS} curl -k https://${DR_PROV_IP}:8443/internal/prov
+${PMMAPPER_BASE_URL} http://${PMMAPPER_IP}:8081
+${DELIVERY_ENDPOINT} /delivery
*** Test Cases ***
Should Be Equal As Strings ${cli_cmd_output.rc} 0
Should Contain ${cli_cmd_output.stdout} 3gpppmmapper
+Verify 3GPP PM Mapper responds appropriately when no metadata is provided
+ [Tags] PM_MAPPER_10
+ [Documentation] Verify 3GPP PM Mapper responds 400 with the message "Missing Metadata." when no metadata is provided
+ [Timeout] 1 minute
+ ${headers}= Create Dictionary X-ONAP-RequestID=1 Content-Type=application/xml
+ ${resp}= Put Request mapper_session ${DELIVERY_ENDPOINT} data='${EMPTY}' headers=${headers}
+ Should Be Equal As Strings ${resp.status_code} 400
+ Should Be Equal As Strings ${resp.content} Missing Metadata.
+
+Verify 3GPP PM Mapper responds appropriately when invalid metadata is provided
+ [Tags] PM_MAPPER_11
+ [Documentation] Verify 3GPP PM Mapper responds 400 with the message "Malformed Metadata." when invalid metadata is provided
+ [Timeout] 1 minute
+ ${headers}= Create Dictionary X-ONAP-RequestID=1 X-ATT-DR-META='not metadata' Content-Type=application/xml
+ ${resp}= Put Request mapper_session ${DELIVERY_ENDPOINT} data='${EMPTY}' headers=${headers}
+ Should Be Equal As Strings ${resp.status_code} 400
+ Should Be Equal As Strings ${resp.content} Malformed Metadata.
+
*** Keywords ***
PostCall
*** Variables ***
${TARGET_URL} https://${DR_PROV_IP}:8443
${TARGET_URL_FEED} https://${DR_PROV_IP}:8443/feed/1
+${TARGET_URL_EXISTS_LOGGING} https://${DR_PROV_IP}:8443/feedlog/1?type=pub&filename=csit_test
+${TARGET_URL_NOT_EXISTS_LOGGING} https://${DR_PROV_IP}:8443/feedlog/1?type=pub&filename=file_that_doesnt_exist
${TARGET_URL_SUBSCRIBE} https://${DR_PROV_IP}:8443/subscribe/1
${TARGET_URL_SUBSCRIPTION} https://${DR_PROV_IP}:8443/subs/1
${TARGET_URL_PUBLISH_PROV} https://${DR_PROV_IP}:8443/publish/1/csit_test
Should Contain ${resp.text} "UPDATED-CSIT_Test"
log 'JSON Response Code:'${resp}
+Run Get With Filename That Exists
+ [Documentation] Get publish record with a specified filename
+ [Timeout] 2 minutes
+ sleep 1 minute 45 seconds needed to ensure logs have been updated
+ ${resp}= GetCall ${TARGET_URL_EXISTS_LOGGING} ${FEED_CONTENT_TYPE} rs873m
+ log ${resp.text}
+ Should Contain ${resp.text} "fileName":"csit_test"
+ log 'JSON Response Code:'${resp}
+
+Run Get With Filename That Doesnt Exist
+ [Documentation] Get publish record with a specified filename
+ [Timeout] 1 minute
+ ${resp}= GetCall ${TARGET_URL_NOT_EXISTS_LOGGING} ${FEED_CONTENT_TYPE} rs873m
+ log ${resp.text}
+ Should Contain ${resp.text} []
+ log 'JSON Response Code:'${resp}
+
+
Run Delete Subscription
[Documentation] Delete Subscription
[Timeout] 1 minute
Log Creating session https://${POLICY_PAP_IP}:6969
${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth}
${headers}= Create Dictionary Accept=application/json Content-Type=application/json
- ${resp}= Get Request policy /healthcheck headers=${headers}
+ ${resp}= Get Request policy /policy/pap/v1/healthcheck headers=${headers}
Log Received response from policy ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
Should Be Equal As Strings ${resp.json()['code']} 200
Log Creating session https://${POLICY_PAP_IP}:6969
${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth}
${headers}= Create Dictionary Accept=application/json Content-Type=application/json
- ${resp}= Get Request policy /statistics headers=${headers}
+ ${resp}= Get Request policy /policy/pap/v1/statistics headers=${headers}
Log Received response from policy ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
Should Be Equal As Strings ${resp.json()['code']} 200
${RESOURCE_PATH_CREATE_PUSH} /pdp/api/pushPolicy
${RESOURCE_PATH_CREATE_DELETE} /pdp/api/deletePolicy
${RESOURCE_PATH_GET_CONFIG} /pdp/api/getConfig
+${RESOURCE_PATH_LISTPOLICY} /pdp/api/listPolicy
${CREATE_CONFIG_VFW_TEMPLATE} ${CURDIR}/configpolicy_vFW_R1.template
${CREATE_CONFIG_VDNS_TEMPLATE} ${CURDIR}/configpolicy_vDNS_R1.template
${CREATE_CONFIG_VCPE_TEMPLATE} ${CURDIR}/configpolicy_vCPE_R1.template
${DEL_POLICY_TEMPLATE} ${CURDIR}/deletepolicy.template
${GETCONFIG_TEMPLATE} ${CURDIR}/getconfigpolicy.template
${GETOOF_TEMPLATE} ${CURDIR}/getoofpolicy.template
+${LISTPOLICY_TEMPLATE} ${CURDIR}/listpolicy.template
${CONFIG_POLICY_VFW_NAME} vFirewall
${CONFIG_POLICY_VFW_TYPE} MicroService
${CONFIG_POLICY_VDNS_NAME} vLoadBalancer
Sleep 5s
Get OOF HPA Policy
+ListPolicy
+ ListPolicy test com.Config_Sample.1.xml
+
*** Keywords ***
VFW Policy Tests
# ${files}= Create Dictionary file ${file_data}
${put_resp} = Run Policy Post form Request ${RESOURCE_PATH_UPLOAD} ${files}
Should Be Equal As Strings ${put_resp.status_code} 200
+
+ListPolicy test
+ [Documentation] Listing Config Policies
+ [Arguments] ${policy_name}
+ ${dict}= Create Dictionary policy_name=${policy_name}
+ ${output} = Fill JSON Template File ${LISTPOLICY_TEMPLATE} ${dict}
+ ${put_resp} = policy_interface.Run Policy Post Request ${RESOURCE_PATH_LISTPOLICY} ${output}
+ Should Be Equal As Strings ${put_resp.status_code} 200
+
--- /dev/null
+{
+ "policyName": "${policy_name}"
+}
${resp}= Put Request policy ${data_path} data=${data} headers=${headers}
Log Received response from policy ${resp.text}
[Return] ${resp}
-
+
+Run Policy Post Request
+ [Documentation] Runs Policy Post request
+ [Arguments] ${data_path} ${data}
+ Log Creating session ${GLOBAL_POLICY_SERVER_URL}
+ ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_URL}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json Authorization=Basic ${GLOBAL_POLICY_AUTH} ClientAuth=${GLOBAL_POLICY_CLIENTAUTH} Environment=TEST
+ ${resp}= Post Request policy ${data_path} data=${data} headers=${headers}
+ Log Received response from policy ${resp.text}
+ [Return] ${resp}
+
Run Policy Delete Request
[Documentation] Runs Policy Delete request
[Arguments] ${data_path} ${data}
${headers}= Create Dictionary Accept=application/json Content-Type=application/json Authorization=Basic ${GLOBAL_POLICY_AUTH} ClientAuth=${GLOBAL_POLICY_CLIENTAUTH}
${resp}= Post Request policy ${data_path} data=${data} headers=${headers}
Log Received response from policy ${resp.text}
- [Return] ${resp}
\ No newline at end of file
+ [Return] ${resp}