changing restapi property values for xos user

Change-Id: I11003b308789d48e9a122bf16267c5869432f012
diff --git a/Jenkinsfile-ecord-global b/Jenkinsfile-ecord-global
index 8351f9d..b3cb9d2 100644
--- a/Jenkinsfile-ecord-global
+++ b/Jenkinsfile-ecord-global
@@ -35,6 +35,10 @@
         timeout(10) {
             try {
                 runHeadNodeCmd("""
+                export SERVER_IP=localhost
+                export SERVER_PORT=9101
+                export XOS_USER=xosadmin@opencord.org
+                export XOS_PASSWD=\$(cat /opt/credentials/xosadmin@opencord.org)
                 rm -rf ~/diag-*
                 cd /opt/cord/build; make collect-diag
                 cd /opt/cord/test/cord-tester/src/test/diag/
@@ -51,10 +55,10 @@
         timeout(10) {
             try {
                 runHeadNodeCmd("""
-                cd /opt/cord/test/cord-tester/src/test/cord-api/Properties/
-                sed -i s/^SERVER_IP\\ =\\ .*/SERVER_IP\\ =\\ \\'localhost\\'/ RestApiProperties.py
-                sed -i s/^SERVER_PORT\\ =\\ .*/SERVER_PORT\\ =\\ \\'9101\\'/ RestApiProperties.py
-                sed -i s/^PASSWD\\ =\\ .*/PASSWD\\ =\\ \\'\\\$(cat /opt/credentials/xosadmin@opencord.org)\\'/ RestApiProperties.py
+                export SERVER_IP=localhost
+                export SERVER_PORT=9101
+                export XOS_USER=xosadmin@opencord.org
+                export XOS_PASSWD=\$(cat /opt/credentials/xosadmin@opencord.org)
                 """)
             } catch(error) { currentBuild.result = 'FAILURE' }
         }
diff --git a/Jenkinsfile-ecord-local b/Jenkinsfile-ecord-local
index 28ab7cb..0066d8d 100644
--- a/Jenkinsfile-ecord-local
+++ b/Jenkinsfile-ecord-local
@@ -35,6 +35,10 @@
         timeout(10) {
             try {
                 runHeadNodeCmd("""
+                export SERVER_IP=localhost
+                export SERVER_PORT=9101
+                export XOS_USER=xosadmin@opencord.org
+                export XOS_PASSWD=\$(cat /opt/credentials/xosadmin@opencord.org)
                 rm -rf ~/diag-*
                 cd /opt/cord/build; make collect-diag
                 cd /opt/cord/test/cord-tester/src/test/diag/
@@ -51,6 +55,10 @@
         timeout(10) {
             try {
                 runHeadNodeCmd("""
+                export SERVER_IP=localhost
+                export SERVER_PORT=9101
+                export XOS_USER=xosadmin@opencord.org
+                export XOS_PASSWD=\$(cat /opt/credentials/xosadmin@opencord.org)
                 cd /opt/cord/test/cord-tester/src/test/robot/
                 rm -r Log/ || true
                 rm -r TestDoc/ || true
@@ -58,6 +66,10 @@
                 """)
                 if (deployment_config.fabric_switches != null) {
                     runHeadNodeCmd("""
+                    export SERVER_IP=localhost
+                    export SERVER_PORT=9101
+                    export XOS_USER=xosadmin@opencord.org
+                    export XOS_PASSWD=\$(cat /opt/credentials/xosadmin@opencord.org)
                     cd /opt/cord/test/cord-tester/src/test/robot/
                     pybot --exclude notready -v FABRIC:on -v PUBLIC_IFACE:${pod_config.external_iface} -v CORD_PROFILE:${pod_config.cord_profile} -d Log -T SanityPhyPOD.robot
                     python -m robot.testdoc SanityPhyPOD.robot TestDoc/SanityPhyPOD.html
@@ -66,6 +78,10 @@
                 else {
                     // Exclude fabric related tests
                     runHeadNodeCmd("""
+                    export SERVER_IP=localhost
+                    export SERVER_PORT=9101
+                    export XOS_USER=xosadmin@opencord.org
+                    export XOS_PASSWD=\$(cat /opt/credentials/xosadmin@opencord.org)
                     cd /opt/cord/test/cord-tester/src/test/robot/
                     pybot --exclude notready --exclude fabric -v FABRIC:off -v PUBLIC_IFACE:${pod_config.external_iface} -v CORD_PROFILE:${pod_config.cord_profile} -d Log -T SanityPhyPOD.robot
                     python -m robot.testdoc SanityPhyPOD.robot TestDoc/SanityPhyPOD.html
@@ -78,10 +94,10 @@
         timeout(10) {
             try {
                 runHeadNodeCmd("""
-                cd /opt/cord/test/cord-tester/src/test/cord-api/Properties/
-                sed -i s/^SERVER_IP\\ =\\ .*/SERVER_IP\\ =\\ \\'localhost\\'/ RestApiProperties.py
-                sed -i s/^SERVER_PORT\\ =\\ .*/SERVER_PORT\\ =\\ \\'9101\\'/ RestApiProperties.py
-                sed -i s/^PASSWD\\ =\\ .*/PASSWD\\ =\\ \\'\\\$(cat /opt/credentials/xosadmin@opencord.org)\\'/ RestApiProperties.py
+                export SERVER_IP=localhost
+                export SERVER_PORT=9101
+                export XOS_USER=xosadmin@opencord.org
+                export XOS_PASSWD=\$(cat /opt/credentials/xosadmin@opencord.org)
                 """)
             } catch(error) { currentBuild.result = 'FAILURE' }
         }
diff --git a/Jenkinsfile-mcord b/Jenkinsfile-mcord
index 62a2d31..1379074 100644
--- a/Jenkinsfile-mcord
+++ b/Jenkinsfile-mcord
@@ -35,6 +35,10 @@
         timeout(10) {
             try {
                 runHeadNodeCmd("""
+                export SERVER_IP=localhost
+                export SERVER_PORT=9101
+                export XOS_USER=xosadmin@opencord.org
+                export XOS_PASSWD=\$(cat /opt/credentials/xosadmin@opencord.org)
                 rm -rf ~/diag-*
                 cd /opt/cord/build; make collect-diag
                 cd /opt/cord/test/cord-tester/src/test/diag/
@@ -51,6 +55,10 @@
         timeout(10) {
             try {
                 runHeadNodeCmd("""
+                export SERVER_IP=localhost
+                export SERVER_PORT=9101
+                export XOS_USER=xosadmin@opencord.org
+                export XOS_PASSWD=\$(cat /opt/credentials/xosadmin@opencord.org)
                 cd /opt/cord/test/cord-tester/src/test/robot/
                 rm -r Log/ || true
                 rm -r TestDoc/ || true
@@ -58,6 +66,10 @@
                 """)
                 if (deployment_config.fabric_switches != null) {
                     runHeadNodeCmd("""
+                    export SERVER_IP=localhost
+                    export SERVER_PORT=9101
+                    export XOS_USER=xosadmin@opencord.org
+                    export XOS_PASSWD=\$(cat /opt/credentials/xosadmin@opencord.org)
                     cd /opt/cord/test/cord-tester/src/test/robot/
                     pybot --exclude notready -v FABRIC:on -v PUBLIC_IFACE:${pod_config.external_iface} -v CORD_PROFILE:${pod_config.cord_profile} -d Log -T SanityPhyPOD.robot
                     python -m robot.testdoc SanityPhyPOD.robot TestDoc/SanityPhyPOD.html
@@ -66,6 +78,10 @@
                 else {
                     // Exclude fabric related tests
                     runHeadNodeCmd("""
+                    export SERVER_IP=localhost
+                    export SERVER_PORT=9101
+                    export XOS_USER=xosadmin@opencord.org
+                    export XOS_PASSWD=\$(cat /opt/credentials/xosadmin@opencord.org)
                     cd /opt/cord/test/cord-tester/src/test/robot/
                     pybot --exclude notready --exclude fabric -v FABRIC:off -v PUBLIC_IFACE:${pod_config.external_iface} -v CORD_PROFILE:${pod_config.cord_profile} -d Log -T SanityPhyPOD.robot
                     python -m robot.testdoc SanityPhyPOD.robot TestDoc/SanityPhyPOD.html
@@ -78,10 +94,10 @@
         timeout(10) {
             try {
                 runHeadNodeCmd("""
-                cd /opt/cord/test/cord-tester/src/test/cord-api/Properties/
-                sed -i s/^SERVER_IP\\ =\\ .*/SERVER_IP\\ =\\ \\'localhost\\'/ RestApiProperties.py
-                sed -i s/^SERVER_PORT\\ =\\ .*/SERVER_PORT\\ =\\ \\'9101\\'/ RestApiProperties.py
-                sed -i s/^PASSWD\\ =\\ .*/PASSWD\\ =\\ \\'\\\$(cat /opt/credentials/xosadmin@opencord.org)\\'/ RestApiProperties.py
+                export SERVER_IP=localhost
+                export SERVER_PORT=9101
+                export XOS_USER=xosadmin@opencord.org
+                export XOS_PASSWD=\$(cat /opt/credentials/xosadmin@opencord.org)
                 """)
             } catch(error) { currentBuild.result = 'FAILURE' }
         }
diff --git a/Jenkinsfile-rcord b/Jenkinsfile-rcord
index 0d08309..c7641d7 100644
--- a/Jenkinsfile-rcord
+++ b/Jenkinsfile-rcord
@@ -84,6 +84,10 @@
                 rm -r Log/ || true
                 rm -r TestDoc/ || true
                 mkdir TestDoc || true
+                export SERVER_IP=localhost
+                export SERVER_PORT=9101
+                export XOS_USER=xosadmin@opencord.org
+                export XOS_PASSWD=\$(cat /opt/credentials/xosadmin@opencord.org)
                 pybot -v CORD_PROFILE:${pod_config.cord_profile} -d Log -T verifyCollectDiag.robot
                 python -m robot.testdoc verifyCollectDiag.robot TestDoc/verifyCollectDiag.html
                 """)
@@ -101,6 +105,10 @@
                 """)
                 if (deployment_config.fabric_switches != null) {
                     runHeadNodeCmd("""
+                    export SERVER_IP=localhost
+                    export SERVER_PORT=9101
+                    export XOS_USER=xosadmin@opencord.org
+                    export XOS_PASSWD=\$(cat /opt/credentials/xosadmin@opencord.org)
                     cd /opt/cord/test/cord-tester/src/test/robot/
                     pybot --exclude notready -v FABRIC:on -v PUBLIC_IFACE:${pod_config.external_iface} -v CORD_PROFILE:${pod_config.cord_profile} -d Log -T SanityPhyPOD.robot
                     python -m robot.testdoc SanityPhyPOD.robot TestDoc/SanityPhyPOD.html
@@ -109,6 +117,10 @@
                 else {
                     // Exclude fabric related tests
                     runHeadNodeCmd("""
+                    export SERVER_IP=localhost
+                    export SERVER_PORT=9101
+                    export XOS_USER=xosadmin@opencord.org
+                    export XOS_PASSWD=\$(cat /opt/credentials/xosadmin@opencord.org)
                     cd /opt/cord/test/cord-tester/src/test/robot/
                     pybot --exclude notready --exclude fabric -v FABRIC:off -v PUBLIC_IFACE:${pod_config.external_iface} -v CORD_PROFILE:${pod_config.cord_profile} -d Log -T SanityPhyPOD.robot
                     python -m robot.testdoc SanityPhyPOD.robot TestDoc/SanityPhyPOD.html
@@ -121,10 +133,10 @@
         timeout(10) {
             try {
                 runHeadNodeCmd("""
-                cd /opt/cord/test/cord-tester/src/test/cord-api/Properties/
-                sed -i s/^SERVER_IP\\ =\\ .*/SERVER_IP\\ =\\ \\'localhost\\'/ RestApiProperties.py
-                sed -i s/^SERVER_PORT\\ =\\ .*/SERVER_PORT\\ =\\ \\'9101\\'/ RestApiProperties.py
-                sed -i s/^PASSWD\\ =\\ .*/PASSWD\\ =\\ \\'\\\$(cat /opt/credentials/xosadmin@opencord.org)\\'/ RestApiProperties.py
+                export SERVER_IP=localhost
+                export SERVER_PORT=9101
+                export XOS_USER=xosadmin@opencord.org
+                export XOS_PASSWD=\$(cat /opt/credentials/xosadmin@opencord.org)
                 all_passed=true
                 cd /opt/cord/test/cord-tester/src/test/cord-api/
                 rm -r Log/ || true
@@ -151,6 +163,10 @@
         timeout(30) {
             try {
                 runHeadNodeCmd("""
+                export SERVER_IP=localhost
+                export SERVER_PORT=9101
+                export XOS_USER=xosadmin@opencord.org
+                export XOS_PASSWD=\$(cat /opt/credentials/xosadmin@opencord.org)
                 cd /opt/cord/test/cord-tester/src/test/vsg/
                 rm -r Log/ || true
                 rm -r TestDoc/ || true
@@ -158,6 +174,10 @@
                 """)
                 if (deployment_config.pod_config.file_name != 'calix-pod1.yml') {
                     runHeadNodeCmd("""
+                    export SERVER_IP=localhost
+                    export SERVER_PORT=9101
+                    export XOS_USER=xosadmin@opencord.org
+                    export XOS_PASSWD=\$(cat /opt/credentials/xosadmin@opencord.org)
                     cd /opt/cord/test/cord-tester/src/test/vsg/
                     pybot -L TRACE -v pod:${deployment_config.pod_config.file_name} -d Log -T vsg_dataplane_test.robot
                     python -m robot.testdoc vsg_dataplane_test.robot TestDoc/vsg_dataplane_test.html
@@ -165,6 +185,10 @@
                 }
                 else {
                     runHeadNodeCmd("""
+                    export SERVER_IP=localhost
+                    export SERVER_PORT=9101
+                    export XOS_USER=xosadmin@opencord.org
+                    export XOS_PASSWD=\$(cat /opt/credentials/xosadmin@opencord.org)
                     cd /opt/cord/test/cord-tester/src/test/vsg/
                     pybot -L TRACE -v pod:${deployment_config.pod_config.file_name} -e dataplane -d Log -T vsg_dataplane_test.robot
                     python -m robot.testdoc vsg_dataplane_test.robot TestDoc/vsg_dataplane_test.html
diff --git a/Jenkinsfile/verify-api-tests-JenkinsFile b/Jenkinsfile/verify-api-tests-JenkinsFile
index 3c981c0..811bde4 100644
--- a/Jenkinsfile/verify-api-tests-JenkinsFile
+++ b/Jenkinsfile/verify-api-tests-JenkinsFile
@@ -68,10 +68,6 @@
             if [ '$GERRIT_PROJECT' = 'vMME' ] || [ '$GERRIT_PROJECT' = 'vHSS' ]; then
                 CORE_CONTAINER=mcordcavium_xos_core_1
             fi
-            cd ~/cord/test/cord-tester/src/test/cord-api/Properties/
-            sed -i \"s/^\\(SERVER_IP = \\).*/\\1\'127.0.0.1\'/\" RestApiProperties.py
-            sed -i \"s/^\\(SERVER_PORT = \\).*/\\1\'9101\'/\" RestApiProperties.py
-            sed -i \"s/^\\(PASSWD = \\).*/\\1\'\$(cat ~/cord/build/platform-install/credentials/xosadmin@opencord.org)\'/\" RestApiProperties.py
             docker cp ~/cord/test/cord-tester/src/test/cord-api/Tests/targets/xosapitests.xtarget \$CORE_CONTAINER:/opt/xos/lib/xos-genx/xosgenx/targets/xosapitests.xtarget
             docker exec -i \$CORE_CONTAINER /bin/bash -c "xosgenx --target /opt/xos/lib/xos-genx/xosgenx/targets/./xosapitests.xtarget /opt/xos/core/models/core.xproto" > ~/cord/test/cord-tester/src/test/cord-api/Tests/XOSCoreAPITests.robot
             SERVICES=\$(docker exec -i \$CORE_CONTAINER /bin/bash -c "cd /opt/xos/dynamic_services/;find -name '*.xproto'" | awk -F[//] '{print \$2}')
@@ -96,10 +92,16 @@
                 if [ '$GERRIT_PROJECT' = 'vMME' ] || [ '$GERRIT_PROJECT' = 'vHSS' ]; then
                     CORE_CONTAINER=mcordcavium_xos_core_1
                 fi
-                    cd ~/cord/test/cord-tester/src/test/cord-api/Tests
                     export testname=_service_api.robot
                     SERVICES=\$(docker exec -i \$CORE_CONTAINER /bin/bash -c "cd /opt/xos/dynamic_services/;find -name '*.xproto'" | awk -F[//] '{print \$2}')
                     echo \$SERVICES
+                    export SERVER_IP=localhost
+                    export SERVER_PORT=9101
+                    export XOS_USER=xosadmin@opencord.org
+                    export XOS_PASSWD=\$(cat ~/cord/build/platform-install/credentials/xosadmin@opencord.org)
+                    cd ~/cord/test/cord-tester/src/test/cord-api/Properties/
+                    sed -i \"s/^\\(XOS_PASSWD = \\).*/\\1\'\$(cat ~/cord/build/platform-install/credentials/xosadmin@opencord.org)\'/\" RestApiProperties.py
+                    cd ~/cord/test/cord-tester/src/test/cord-api/Tests
                     pybot -d Log -T -e TenantWithContainer -e Port -e ControllerImages -e ControllerNetwork -e ControllerSlice XOSCoreAPITests.robot  || true
                     for i in \$SERVICES; do bash -c "pybot -d Log -T -e AddressManagerServiceInstance -v xos_service:\$i \$i\$testname"; done || true
                     """
diff --git a/src/test/cord-api/Framework/restApi.py b/src/test/cord-api/Framework/restApi.py
index a11664f..ba2de91 100644
--- a/src/test/cord-api/Framework/restApi.py
+++ b/src/test/cord-api/Framework/restApi.py
@@ -28,8 +28,8 @@
         self.rp = readProperties(os.path.abspath(os.path.dirname(__file__))+"/../Properties/"+ propertyFile)
         self.controllerIP = self.getValueFromProperties("SERVER_IP")
         self.controllerPort = self.getValueFromProperties("SERVER_PORT")
-        self.user = self.getValueFromProperties("USER")
-        self.password = self.getValueFromProperties("PASSWD")
+        self.user = self.getValueFromProperties("XOS_USER")
+        self.password = self.getValueFromProperties("XOS_PASSWD")
         self.jsonHeader = {'Content-Type': 'application/json'}
 
     def getValueFromProperties(self, key):
diff --git a/src/test/cord-api/Properties/RestApiProperties.py b/src/test/cord-api/Properties/RestApiProperties.py
index 83a3253..c34a378 100644
--- a/src/test/cord-api/Properties/RestApiProperties.py
+++ b/src/test/cord-api/Properties/RestApiProperties.py
@@ -16,10 +16,10 @@
 
 #!/usr/bin/env python
 
-SERVER_IP = '10.192.4.62'
+SERVER_IP = 'localhost'
 SERVER_PORT = '9101'
-USER = 'xosadmin@opencord.org'
-PASSWD = ''
+XOS_USER = 'xosadmin@opencord.org'
+XOS_PASSWD = ''
 VOLT_SUBSCRIBER = '/xosapi/v1/rcord/cordsubscriberroots'
 VOLT_TENANT = '/xosapi/v1/volt/voltserviceinstances'
 CH_CORE_SERVICELINK = '/xosapi/v1/core/serviceinstancelinks'
diff --git a/src/test/cord-api/Tests/CordVTN.txt b/src/test/cord-api/Tests/CordVTN.txt
index 4ff9d33..08fb772 100644
--- a/src/test/cord-api/Tests/CordVTN.txt
+++ b/src/test/cord-api/Tests/CordVTN.txt
@@ -310,7 +310,7 @@
 
 *** Keywords ***
 Suite Setup
-    ${auth} =    Create List    ${USER}    ${PASSWD}
+    ${auth} =    Create List    ${XOS_USER}    ${XOS_PASSWD}
     ${HEADERS}    Create Dictionary    Content-Type=application/json
     Create Session    ${SERVER_IP}    http://${SERVER_IP}:${SERVER_PORT}    auth=${AUTH}    headers=${HEADERS}
     Read InputFile
diff --git a/src/test/cord-api/Tests/targets/xosapitests.xtarget b/src/test/cord-api/Tests/targets/xosapitests.xtarget
index 269f6bf..bfa3ff2 100644
--- a/src/test/cord-api/Tests/targets/xosapitests.xtarget
+++ b/src/test/cord-api/Tests/targets/xosapitests.xtarget
@@ -200,7 +200,7 @@
     {% endfor -%}
     @{dependent_models}=    Create List
     Set Suite Variable    ${dependent_models}
-    ${auth} =    Create List    ${USER}    ${PASSWD}
+    ${auth} =    Create List    ${XOS_USER}    ${XOS_PASSWD}
     ${HEADERS}    Create Dictionary    Content-Type=application/json
     Create Session    ${SERVER_IP}    http://${SERVER_IP}:${SERVER_PORT}    auth=${AUTH}    headers=${HEADERS}
     Generate JSON Data