Merge "Modify svnfm CSIT"
diff --git a/test/csit/plans/aai/resources/setup.sh b/test/csit/plans/aai/resources/setup.sh
index ee20460..30b4b29 100644
--- a/test/csit/plans/aai/resources/setup.sh
+++ b/test/csit/plans/aai/resources/setup.sh
@@ -24,16 +24,14 @@
 NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt)
 DOCKER_IMAGE_VERSION=$(cat /opt/config/docker_version.txt)
 DOCKER_REGISTRY=${NEXUS_DOCKER_REPO}
-DOCKER_IMAGE_VERSION=$(cat /opt/config/docker_version.txt)
-
-docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO
+DOCKER_IMAGE_VERSION=1.1-STAGING-latest
 
 function wait_for_container() {
 
     CONTAINER_NAME="$1";
     START_TEXT="$2";
 
-    TIMEOUT=160
+    TIMEOUT=240
 
     # wait for the real startup
     AMOUNT_STARTUP=$(docker logs ${CONTAINER_NAME} 2>&1 | grep "$START_TEXT" | wc -l)
@@ -43,6 +41,7 @@
         AMOUNT_STARTUP=$(docker logs ${CONTAINER_NAME} 2>&1 | grep "$START_TEXT" | wc -l)
         if [ "$TIMEOUT" = "0" ];
         then
+            docker logs ${CONTAINER_NAME};
             echo "ERROR: $CONTAINER_NAME deployment failed."
             exit 1
         fi
@@ -54,6 +53,7 @@
 DOCKER_COMPOSE_CMD="docker-compose";
 export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1);
 export DOCKER_REGISTRY="nexus3.onap.org:10001";
+export AAI_HAPROXY_IMAGE="${AAI_HAPROXY_IMAGE:-aaionap/haproxy}";
 export HBASE_IMAGE="${HBASE_IMAGE:-harisekhon/hbase}";
 
 docker pull ${DOCKER_REGISTRY}/openecomp/aai-resources:${DOCKER_IMAGE_VERSION};
@@ -74,9 +74,10 @@
 # Start the resources microservice
 RESOURCES_CONTAINER_NAME=$(${DOCKER_COMPOSE_CMD} up -d aai-resources.api.simpledemo.openecomp.org 2>&1 | grep 'Creating' | grep -v 'volume' | grep -v 'network' | awk '{ print $2; }' | head -1);
 wait_for_container ${RESOURCES_CONTAINER_NAME} '0.0.0.0:8447';
+docker logs ${CONTAINER_NAME};
 
 # Start the traversal microservice
-GRAPH_CONTAINER_NAME=$($DOCKER_COMPOSE_CMD up -d aai-traversal.api.simpledemo.openecomp.org 2>&1 | grep 'Creating' | awk '{ print $2; }' | head -1);
+GRAPH_CONTAINER_NAME=$(${DOCKER_COMPOSE_CMD} up -d aai-traversal.api.simpledemo.openecomp.org 2>&1 | grep 'Creating' | awk '{ print $2; }' | head -1);
 wait_for_container ${GRAPH_CONTAINER_NAME} '0.0.0.0:8446';
 
 # Start the haproxy to route requests between resources and traversal
@@ -84,12 +85,11 @@
 
 echo "A&AI Microservices, resources and traversal, are up and running along with HAProxy";
 
-docker exec -it $GRAPH_CONTAINER_NAME "/opt/app/aai-traversal/scripts/install/updateQueryData.sh" && {
+docker exec $GRAPH_CONTAINER_NAME "/opt/app/aai-traversal/scripts/install/updateQueryData.sh" && {
 	echo "Successfully loaded the widget related data into db";
 } || {
 	echo "Unable to load widget related data into db";
 }
 
-HAPROXY_IP=$(${SCRIPTS}/get-instance-ip.sh ${HAPROXY_CONTAINER_NAME});
 # Set the host ip for robot from the haproxy
-ROBOT_VARIABLES="-v HOST_IP:${HAPROXY_IP}"
+ROBOT_VARIABLES="-v HOST_IP:`ip addr show docker0 | head -3 | tail -1 | cut -d' ' -f6 | cut -d'/' -f1`"
diff --git a/test/csit/tests/aai/resources/suite1/pserver.robot b/test/csit/tests/aai/resources/suite1/pserver.robot
index 5a1d9d3..55e57bc 100644
--- a/test/csit/tests/aai/resources/suite1/pserver.robot
+++ b/test/csit/tests/aai/resources/suite1/pserver.robot
@@ -5,62 +5,61 @@
 Library       Collections
 
 *** Variables ***
-${TARGETURL}  https://${HOST_IP}:8443/v11/cloud-infrastructure/pservers/pserver/pserver-test1
+${TARGETURL}  https://${HOST_IP}:8443/aai/v11/cloud-infrastructure/pservers/pserver/pserver-test1
 ${PSERVERDATA}  {"hostname": "pserver-test1"}
 
 *** Test Cases ***
 
 Run AAI Put Pserver
-    [Documentation]             Create an index and verify success
+    [Documentation]             Create an pserver object
     ${resp}=                    PutWithCert              ${TARGETURL}              ${PSERVERDATA}
+    log                         ${TARGETURL}
+    log                         ${resp.text}
     Should Be Equal As Strings  ${resp.status_code}      201
 
 Run AAI Get Pserver
-    [Documentation]             Get the document that was just created
+    [Documentation]             Get the pserver object just created
     ${resp}                     GetWithCert              ${TARGETURL}
-    ${content}=                 Evaluate                 $resp.json()
+    log                         ${resp}
+    log                         ${resp.json()}
     Should Be Equal As Strings  ${resp.status_code}      200
-    ${resource_version}=        Evaluate                 $resp.json()['resource-version']
+    ${resource_version}=        Evaluate                 $resp.json().get('resource-version')
+    Set Global Variable			${resource_version}
 
 Run AAI Delete Pserver
-    [Documentation]             Delete the index
+    [Documentation]             Delete the pserver just created
     ${resp}=                    DeleteWithCert           ${TARGETURL}?resource-version=${resource_version}
+    log                         ${resp.text}
     Should Be Equal As Strings  ${resp.status_code}      204
 
 *** Keywords ***
 PutWithCert
     [Arguments]      ${url}      ${data}
-    ${auth}=         Create List  AAI AAI
-    ${uuid}=         Generate UUID
-    ${headers}=      Create Dictionary     Accept=application/json    Content-Type=application/json    X-TransactionId=${uuid}    X-FromAppId=integration-aai
+    ${headers}=      Create Dictionary     Accept=application/json    Content-Type=application/json    X-TransactionId=integration-aai    X-FromAppId=integration-aai   Authorization=Basic QUFJOkFBSQ==
     ${certinfo}=     Evaluate    ('${CURDIR}/aai.crt', '${CURDIR}/aai.key')
-    ${resp}=         Evaluate    requests.put('${url}', data='${data}', auth=${auth}, headers=${headers}, cert=${certinfo}, verify=False)    requests
+    ${resp}=         Evaluate    requests.put('${url}', data='${data}', headers=${headers}, cert=${certinfo}, verify=False)    requests
     [return]         ${resp}
 
 PostWithCert
     [Arguments]      ${url}      ${data}
     ${auth}=         Create List  AAI AAI
-    ${uuid}=         Generate UUID
-    ${headers}=      Create Dictionary     Accept=application/json    Content-Type=application/json    X-TransactionId=${uuid}    X-FromAppId=integration-aai
+    ${headers}=      Create Dictionary     Accept=application/json    Content-Type=application/json    X-TransactionId=integration-aai    X-FromAppId=integration-aai   Authorization=Basic QUFJOkFBSQ==
     ${certinfo}=     Evaluate    ('${CURDIR}/aai.crt', '${CURDIR}/aai.key')
-    ${resp}=         Evaluate    requests.post('${url}', data='${data}', auth=${auth}, headers=${headers}, cert=${certinfo}, verify=False)    requests
+    ${resp}=         Evaluate    requests.post('${url}', data='${data}', headers=${headers}, cert=${certinfo}, verify=False)    requests
     [return]         ${resp}
 
 GetWithCert
     [Arguments]      ${url}
-    ${auth}=         Create List  AAI AAI
-    ${uuid}=         Generate UUID
-    ${headers}=      Create Dictionary     Accept=application/json    Content-Type=application/json    X-TransactionId=${uuid}    X-FromAppId=integration-aai
+    ${headers}=      Create Dictionary     Accept=application/json    Content-Type=application/json    X-TransactionId=integration-aai    X-FromAppId=integration-aai   Authorization=Basic QUFJOkFBSQ==
     ${certinfo}=     Evaluate    ('${CURDIR}/aai.crt', '${CURDIR}/aai.key')
-    ${resp}=         Evaluate    requests.get('${url}', auth=${auth}, headers=${headers}, cert=${certinfo}, verify=False)    requests
+    ${resp}=         Evaluate    requests.get('${url}', headers=${headers}, cert=${certinfo}, verify=False)    requests
     [return]         ${resp}
 
 DeleteWithCert
     [Arguments]      ${url}
     ${auth}=         Create List  AAI AAI
-    ${uuid}=         Generate UUID
-    ${headers}=      Create Dictionary     Accept=application/json    Content-Type=application/json    X-TransactionId=${uuid}    X-FromAppId=integration-aai
+    ${headers}=      Create Dictionary     Accept=application/json    Content-Type=application/json    X-TransactionId=integration-aai    X-FromAppId=integration-aai   Authorization=Basic QUFJOkFBSQ==
     ${certinfo}=     Evaluate    ('${CURDIR}/aai.crt', '${CURDIR}/aai.key')
-    ${resp}=         Evaluate    requests.delete('${url}', auth=${auth}, headers=${headers}, cert=${certinfo}, verify=False)    requests
+    ${resp}=         Evaluate    requests.delete('${url}', headers=${headers}, cert=${certinfo}, verify=False)    requests
     [return]         ${resp}
     
diff --git a/test/csit/tests/cli/startup/startup_check.robot b/test/csit/tests/cli/startup/startup_check.robot
index a104670..053a6d1 100644
--- a/test/csit/tests/cli/startup/startup_check.robot
+++ b/test/csit/tests/cli/startup/startup_check.robot
@@ -20,7 +20,7 @@
     ${cli_cmd_output}=    Run Process   ${cli_exec} --help    shell=yes
     Log    ${cli_cmd_output.stdout}
     Should Be Equal As Strings    ${cli_cmd_output.rc}    0
-    Should Contain    ${cli_cmd_output.stdout}    ONAP Command-line interface
+    Should Contain    ${cli_cmd_output.stdout}    CLI version
 
 Check Cli Version Default
     [Documentation]    check cli default version