summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plans/aaf/aafapi/setup.sh171
-rw-r--r--plans/aaf/aafapi/teardown.sh12
-rw-r--r--tests/aaf/aafapi/aafapi.robot66
3 files changed, 182 insertions, 67 deletions
diff --git a/plans/aaf/aafapi/setup.sh b/plans/aaf/aafapi/setup.sh
index dd6cb29e..d561ee09 100644
--- a/plans/aaf/aafapi/setup.sh
+++ b/plans/aaf/aafapi/setup.sh
@@ -25,52 +25,169 @@
source ${SCRIPTS}/common_functions.sh
# Clone AAF Authz repo
-mkdir -p $WORKSPACE/archives/aafcsit
-cd $WORKSPACE/archives/aafcsit
-#unset http_proxy https_proxy
+mkdir -p $WORKSPACE/archives/opt
+cd $WORKSPACE/archives/opt
+
+
+HOST_IP=$(ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $NF}')
+export HOST_IP=${HOST_IP}
+
+CURRENT_DIR=$(pwd) export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1)
+
+NEXUS_USERNAME=anonymous
+NEXUS_PASSWD=anonymous
+NEXUS_DOCKER_REPO=nexus3.onap.org:10001
+AAF_DOCKER_VERSION=2.1.3-SNAPSHOT
+
+docker login -u $NEXUS_USERNAME -p "$NEXUS_PASSWD" $NEXUS_DOCKER_REPO
+
+docker pull $NEXUS_DOCKER_REPO/onap/aaf/aaf_cass:$AAF_DOCKER_VERSION
+docker pull $NEXUS_DOCKER_REPO/onap/aaf/aaf_config:$AAF_DOCKER_VERSION
+docker pull $NEXUS_DOCKER_REPO/onap/aaf/aaf_cm:$AAF_DOCKER_VERSION
+docker pull $NEXUS_DOCKER_REPO/onap/aaf/aaf_fs:$AAF_DOCKER_VERSION
+docker pull $NEXUS_DOCKER_REPO/onap/aaf/aaf_gui:$AAF_DOCKER_VERSION
+docker pull $NEXUS_DOCKER_REPO/onap/aaf/aaf_hello:$AAF_DOCKER_VERSION
+docker pull $NEXUS_DOCKER_REPO/onap/aaf/aaf_locate:$AAF_DOCKER_VERSION
+docker pull $NEXUS_DOCKER_REPO/onap/aaf/aaf_oauth:$AAF_DOCKER_VERSION
+docker pull $NEXUS_DOCKER_REPO/onap/aaf/aaf_service:$AAF_DOCKER_VERSION
+
+docker tag $NEXUS_DOCKER_REPO/onap/aaf/aaf_cass:$AAF_DOCKER_VERSION nexus3.onap.org:10003/onap/aaf/aaf_cass:$AAF_DOCKER_VERSION
git clone --depth 1 http://gerrit.onap.org/r/aaf/authz -b master
git pull
-cd $WORKSPACE/archives/aafcsit/authz/auth/auth-service/src/main/resources/docker-compose
+chmod -R 777 authz
+cd authz
+CURRENT_DIR=$(pwd)
+
pwd
-chmod -R 777 $WORKSPACE/archives/aafcsit/authz/auth/auth-service/src/main/resources/docker-compose
+if [ ! -e auth/csit/d.props ]; then
+ cp auth/csit/d.props.init auth/csit/d.props
+fi
-# start aaf containers with docker compose and configuration from docker-compose.yml
-docker-compose up -d
-export aaf_service=$(get_docker_compose_service aaf_container)
-export cassandra_service=$(get_docker_compose_service cassandra_container)
+if [ ! -e auth/docker/d.props ]; then
+ cp auth/docker/d.props.init auth/docker/d.props
+fi
-# Wait for initialization of Docker container for AAF & Cassandra
-for i in {1..12}; do
- if [ $(docker inspect --format '{{ .State.Running }}' $aaf_service) ] && \
- [ $(docker inspect --format '{{ .State.Running }}' $cassandra_service) ]
- then
- echo "AAF Service Running"
- break
- else
- echo sleep $i
- sleep $i
- fi
+
+NEXUS_USERNAME=anonymous
+NEXUS_PASSWD=anonymous
+NEXUS_DOCKER_REPO=nexus3.onap.org:10001
+sed -i "s/DOCKER_REPOSITORY=.*/DOCKER_REPOSITORY=$NEXUS_DOCKER_REPO/" auth/csit/d.props
+. auth/csit/d.props
+
+sed -i "s/DOCKER_REPOSITORY=.*/DOCKER_REPOSITORY=$NEXUS_DOCKER_REPO/" auth/docker/d.props
+. auth/docker/d.props
+
+
+HOSTNAME=`hostname`
+FQDN=aaf.api.simpledemo.onap.org
+HOST_IP=$(ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $NF}')
+export HOST_IP=${HOST_IP}
+
+
+CASS_IP=`docker inspect aaf_cass | grep '"IPAddress' | head -1 | cut -d '"' -f 4`
+CASS_HOST="cass.aaf.osaaf.org:"$CASS_IP
+
+cd auth/auth-cass/docker
+if [ "`docker container ls | grep aaf_cass`" = "" ]; then
+ # Cassandra Install
+ echo Cassandra Install
+ bash ./dinstall.sh
+fi
+
+CASS_IP=`docker inspect aaf_cass | grep '"IPAddress' | head -1 | cut -d '"' -f 4`
+CASS_HOST="cass.aaf.osaaf.org:"$CASS_IP
+if [ ! -e $WORKSPACE/archives/opt/authz/auth/csit/cass.props ]; then
+ cp $WORKSPACE/archives/opt/authz/auth/csit/cass.props.init $WORKSPACE/archives/opt/authz/auth/csit/cass.props
+fi
+
+sed -i "s/CASS_HOST=.*/CASS_HOST="$CASS_HOST"/g" $WORKSPACE/archives/opt/authz/auth/csit/cass.props
+
+if [ ! -e $WORKSPACE/archives/opt/authz/auth/docker/cass.props ]; then
+ cp $WORKSPACE/archives/opt/authz/auth/docker/cass.props.init $WORKSPACE/archives/opt/authz/auth/docker/cass.props
+fi
+
+sed -i "s/CASS_HOST=.*/CASS_HOST="$CASS_HOST"/g" $WORKSPACE/archives/opt/authz/auth/docker/cass.props
+# TODO Pull from Config Dir
+if [ "$LATITUDE" = "" ]; then
+ LATITUDE=37.781
+ LONGITUDE=-122.261
+ sed -i "s/LATITUDE=.*/LATITUDE=$LATITUDE/g" $WORKSPACE/archives/opt/authz/auth/csit/d.props
+ sed -i "s/LONGITUDE=.*/LONGITUDE=$LONGITUDE/g" $WORKSPACE/archives/opt/authz/auth/csit/d.props
+fi
+
+sed -i "s/VERSION=.*/VERSION=$VERSION/g" $WORKSPACE/archives/opt/authz/auth/csit/d.props
+sed -i "s/HOSTNAME=.*/HOSTNAME=$HOSTNAME/g" $WORKSPACE/archives/opt/authz/auth/csit/d.props
+sed -i "s/HOST_IP=.*/HOST_IP=$HOST_IP/g" $WORKSPACE/archives/opt/authz/auth/csit/d.props
+sed -i "s/AAF_REGISTER_AS=.*/AAF_REGISTER_AS=$FQDN/g" $WORKSPACE/archives/opt/authz/auth/csit/d.props
+
+pwd
+
+cd ../../
+
+pwd
+
+cd csit
+tty
+# Need new Deployment system properties
+bash ./aaf.sh
+
+# run it
+bash ./drun.sh
+
+docker images
+
+docker ps -a
+
+cat /etc/sudoers
+
+docker logs aaf_hello
+
+docker logs aaf_locate
+
+docker logs aaf_cm
+
+docker logs aaf_gui
+
+docker logs aaf_fs
+
+docker logs aaf_oauth
+
+docker logs aaf_service
+
+# Wait for initialization of Docker containers
+for i in {1..50}; do
+ if [ $(docker inspect --format '{{ .State.Running }}' aaf_hello) ] && \
+ [ $(docker inspect --format '{{ .State.Running }}' aaf_cm) ] && \
+ [ $(docker inspect --format '{{ .State.Running }}' aaf_fs) ] && \
+ [ $(docker inspect --format '{{ .State.Running }}' aaf_gui) ] && \
+ [ $(docker inspect --format '{{ .State.Running }}' aaf_oauth) ] && \
+ [ $(docker inspect --format '{{ .State.Running }}' aaf_locate) ] && \
+ [ $(docker inspect --format '{{ .State.Running }}' aaf_service) ]
+ then
+ echo "aaf Service Running"
+ break
+ else
+ echo sleep $i
+ sleep $i
+ fi
done
-AAF_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $aaf_service)
-CASSANDRA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $cassandra_service)
-bypass_ip_adress $AAF_IP
-bypass_ip_adress $CASSANDRA_IP
+AAF_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' aaf_service)
+CASSANDRA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' aaf_cass)
echo AAF_IP=${AAF_IP}
echo CASSANDRA_IP=${CASSANDRA_IP}
-
# Wait for initialization of docker services
for i in {1..12}; do
- curl -sS -m 1 ${AAF_IP}:8101 && break
+ curl -k -u aaf_admin@people.osaaf.org:demo123456! https://${AAF_IP}:8100/authz/nss/org.osaaf.people && break
echo sleep $i
sleep $i
done
#Pass any variables required by Robot test suites in ROBOT_VARIABLES
-ROBOT_VARIABLES="-v AAF_IP:${AAF_IP}"
+ROBOT_VARIABLES="-v AAF_IP:${AAF_IP}" \ No newline at end of file
diff --git a/plans/aaf/aafapi/teardown.sh b/plans/aaf/aafapi/teardown.sh
index 41e0b00e..742a1b36 100644
--- a/plans/aaf/aafapi/teardown.sh
+++ b/plans/aaf/aafapi/teardown.sh
@@ -17,8 +17,12 @@
# Modifications copyright (c) 2017 AT&T Intellectual Property
#
-kill-instance.sh $aaf_service
-kill-instance.sh $cassandra_service
-unset aaf_service
-unset cassandra_service
+kill-instance.sh aaf_service
+kill-instance.sh aaf_locate
+kill-instance.sh aaf_hello
+kill-instance.sh aaf_cm
+kill-instance.sh aaf_gui
+kill-instance.sh aaf_fs
+kill-instance.sh aaf_oauth
+kill-instance.sh aaf_cass
diff --git a/tests/aaf/aafapi/aafapi.robot b/tests/aaf/aafapi/aafapi.robot
index 0f2267be..93b6ce36 100644
--- a/tests/aaf/aafapi/aafapi.robot
+++ b/tests/aaf/aafapi/aafapi.robot
@@ -1,45 +1,39 @@
*** Settings ***
-Suite Setup Run keywords Created header Created session
+Library OperatingSystem
Library RequestsLibrary
+Library requests
Library Collections
+Library String
*** Variables ***
+${TARGETURL_NAMESPACE} https://${AAF_IP}:8100/authz/nss/org.osaaf.people
+${TARGETURL_PERMS} https://${AAF_IP}:8100/authz/perms/user/aaf_admin@people.osaaf.org
+${TARGETURL_ROLES} https://${AAF_IP}:8100/authz/roles/user/aaf_admin@people.osaaf.org
+${username} aaf_admin@people.osaaf.org
+${password} demo123456!
-*** Test Cases ***
-View information from app
- [Template] Get template
- /authz/nss/org.openecomp
- authz/perms/user/dgl@openecomp.org
- authz/roles/user/dgl@openecomp.org
-Cleanup Namespace ( 424 Response - Delete dependencies and try again )
- [Tags] delete
- ${resp}= Delete Request ${suite_aaf_session} authz/ns/org.openecomp.dmaapBC headers=${suite_headers}
- Should Be Equal As Strings ${resp.status_code} 424
+*** Test Cases ***
+View Namesapce
+ [Tags] get
+ CreateSession aaf https://${AAF_IP}:8100
+ &{headers}= Create Dictionary Authorization=Basic YWFmX2FkbWluQHBlb3BsZS5vc2FhZi5vcmc6ZGVtbzEyMzQ1NiE= Content-Type=application/json Accept=application/json
+ ${resp}= Get Request aaf /authz/nss/org.osaaf.people headers=&{headers}
+ Should Be Equal As Strings ${resp.status_code} 200
log 'JSON Response Code :'${resp.text}
-
-Add information to app
- [Template] Post template
- authz/ns/org.openecomp.dmaapBC/admin/alexD@openecomp.org 403
- authz/perms/user/m99751@dmaapBC.openecomp.org 406
-
-*** Keywords ***
-Created session
- Create Session aaf_session http://${AAF_IP}:8101
- Set Suite Variable ${suite_aaf_session} aaf_session
-
-Created header
- ${headers}= Create Dictionary Authorization=Basic ZGdsQG9wZW5lY29tcC5vcmc6ZWNvbXBfYWRtaW4= Content-Type=application/json Accept=application/json
- Set Suite Variable ${suite_headers} ${headers}
-
-Get template
- [Arguments] ${topic}
- ${resp}= Get Request ${suite_aaf_session} ${topic} headers=${suite_headers}
+
+View by User Permission
+ [Tags] get
+ CreateSession aaf https://${AAF_IP}:8100
+ &{headers}= Create Dictionary Authorization=Basic YWFmX2FkbWluQHBlb3BsZS5vc2FhZi5vcmc6ZGVtbzEyMzQ1NiE= Content-Type=application/json Accept=application/json
+ ${resp}= Get Request aaf authz/perms/user/aaf_admin@people.osaaf.org headers=&{headers}
Should Be Equal As Strings ${resp.status_code} 200
- log 'JSON Response Code :'${resp.text}
-
-Post template
- [Arguments] ${topic} ${response_status_code}
- ${resp}= Post Request ${suite_aaf_session} ${topic} headers=${suite_headers}
- Should Be Equal As Strings ${resp.status_code} ${response_status_code}
- log 'JSON Response Code :'${resp.text}
+ log 'JSON Response Code :'${resp.text}
+
+View by User Role
+ [Tags] get
+ CreateSession aaf https://${AAF_IP}:8100
+ &{headers}= Create Dictionary Authorization=Basic YWFmX2FkbWluQHBlb3BsZS5vc2FhZi5vcmc6ZGVtbzEyMzQ1NiE= Content-Type=application/json Accept=application/json
+ ${resp}= Get Request aaf authz/roles/user/aaf_admin@people.osaaf.org headers=&{headers}
+ Should Be Equal As Strings ${resp.status_code} 200
+ log 'JSON Response Code :'${resp.text} \ No newline at end of file