Update test association with new URI changes

This changes address:
   - variables updation with new URI
   - Fix minor spacing exceeding 80 characters

Change-Id: I8d91231bd738f9299b17a2d40fd3179e0204a57b
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/tests/test_association.robot b/tests/test_association.robot
index 53fdb45..4ba24d5 100755
--- a/tests/test_association.robot
+++ b/tests/test_association.robot
@@ -20,23 +20,30 @@
 
 ${WAIT_FOR_SERVICES_UP}           3min
 
-${CREATE_ERROR_SINGLE_FRU}        busctl call org.openbmc.records.events /org/openbmc/records/events org.openbmc.recordlog acceptHostMessage sssay "Error" "Testing failure" "/org/openbmc/inventory/system/chassis/motherboard/dimm1" 1 1
+${EVENT_RECORD}        ${RECORDS_URI}events/
+${DIMM_PREFIX}         ${INVENTORY_URI}system/chassis/motherboard/
+${DIMM1_URI}           ${DIMM_PREFIX}dimm1
+${DIMM2_URI}           ${DIMM_PREFIX}dimm2
+${DIMM3_URI}           ${DIMM_PREFIX}dimm3
 
-${CREATE_ERROR_INVALID_FRU}       busctl call org.openbmc.records.events /org/openbmc/records/events org.openbmc.recordlog acceptHostMessage sssay "Error" "Testing with invalid FRU" "abc" 1 1
+${BUSCTL_PREFIX}                busctl call ${OPENBMC_BASE_DBUS}.records.events
+...                             ${OPENBMC_BASE_URI}records/events
+...                             ${OPENBMC_BASE_DBUS}.recordlog
+...                             acceptHostMessage sssay "Error"
 
-${CREATE_ERROR_NO_FRU}            busctl call org.openbmc.records.events /org/openbmc/records/events org.openbmc.recordlog acceptHostMessage sssay "Error" "Testing with no fru" "" 1 1
+${CREATE_ERROR_SINGLE_FRU}      ${BUSCTL_PREFIX} "Testing failure"
+...                             "${DIMM1_URI}" 1 1
 
-${CREATE_ERROR_VIRTUAL_SENSOR}    busctl call org.openbmc.records.events /org/openbmc/records/events org.openbmc.recordlog acceptHostMessage sssay "Error" "Testing with a virtual sensor" "/org/openbmc/inventory/system/systemevent " 1 1
+${CREATE_ERROR_INVALID_FRU}     ${BUSCTL_PREFIX} "Testing with invalid FRU"
+...                             "abc" 1 1
 
-${DIMM1_URI}                      /org/openbmc/inventory/system/chassis/motherboard/dimm1
+${CREATE_ERROR_NO_FRU}          ${BUSCTL_PREFIX} "Testing with no fru" "" 1 1
 
-${DIMM2_URI}                      /org/openbmc/inventory/system/chassis/motherboard/dimm2
+${CREATE_ERROR_VIRTUAL_SENSOR}  ${BUSCTL_PREFIX}
+...                             "Testing with a virtual sensor"
+...                             "${INVENTORY_URI}system/systemevent " 1 1
 
-${DIMM3_URI}                      /org/openbmc/inventory/system/chassis/motherboard/dimm3
-
-&{NIL}                            data=@{EMPTY}
-
-${EVENT_RECORD}                   /org/openbmc/records/events
+&{NIL}                          data=@{EMPTY}
 
 *** Test Cases ***
 
@@ -56,11 +63,11 @@
     ${log_list}=     Get EventList
     Should Contain   '${log_list}'   ${elog.strip('q ')}
 
-    ${association_uri} =
-    ...   catenate  SEPARATOR=   ${EVENT_RECORD}/${elog.strip('q ')}  /fru
+    ${association_uri}=
+    ...   catenate  SEPARATOR=   ${EVENT_RECORD}${elog.strip('q ')}  /fru
 
-    ${association_content} =
-    ...     Read Attribute    ${association_uri}    endpoints
+    ${association_content}=
+    ...   Read Attribute    ${association_uri}    endpoints
     Should Contain     ${association_content}    ${DIMM1_URI}
 
     ${dimm1_event}=     Read Attribute     ${DIMM1_URI}/event   endpoints
@@ -92,19 +99,17 @@
     ...                 their association.\n
 
     : FOR    ${INDEX}    IN RANGE    1    4
-        \    Log    ${INDEX}
-        \    ${log_uri}=      Create a test log
-        \    ${association_uri}=    catenate    SEPARATOR=   ${log_uri}   /fru
-
-        \    ${association_content}=     Read Attribute    ${association_uri}    endpoints
-        \    Should Contain     ${association_content}    ${DIMM3_URI}
-        \    Should Contain     ${association_content}    ${DIMM2_URI}
-
-        \    ${dimm3_event}=     Read Attribute     ${DIMM3_URI}/event   endpoints
-        \    Should Contain     ${dimm3_event}    ${log_uri}
-
-        \    ${dimm2_event}=     Read Attribute     ${DIMM2_URI}/event   endpoints
-        \    Should Contain     ${dimm2_event}    ${log_uri}
+    \    Log    ${INDEX}
+    \    ${log_uri}=      Create a test log
+    \    ${association_uri}=   catenate    SEPARATOR=   ${log_uri}   /fru
+    \    ${association_content}=
+    ...   Read Attribute   ${association_uri}    endpoints
+    \    Should Contain    ${association_content}   ${DIMM3_URI}
+    \    Should Contain    ${association_content}   ${DIMM2_URI}
+    \    ${dimm3_event}=   Read Attribute   ${DIMM3_URI}/event   endpoints
+    \    Should Contain    ${dimm3_event}   ${log_uri}
+    \    ${dimm2_event}=   Read Attribute   ${DIMM2_URI}/event   endpoints
+    \    Should Contain    ${dimm2_event}   ${log_uri}
 
 
 Delete error log
@@ -148,8 +153,8 @@
     ${log_list}=     Get EventList
     Should Contain   '${log_list}'   ${elog.strip('q ')}
 
-    ${association_uri} =
-    ...   catenate  SEPARATOR=  ${EVENT_RECORD}/${elog.strip('q ')}  /fru
+    ${association_uri}=
+    ...   catenate  SEPARATOR=  ${EVENT_RECORD}${elog.strip('q ')}  /fru
 
     ${resp}=     openbmc get request     ${association_uri}
     ${jsondata}=    to json    ${resp.content}
@@ -171,8 +176,8 @@
     ${log_list}=     Get EventList
     Should Contain   '${log_list}'   ${elog.strip('q ')}
 
-    ${association_uri} =
-    ...   catenate    SEPARATOR=   ${EVENT_RECORD}/${elog.strip('q ')}  /fru
+    ${association_uri}=
+    ...   catenate    SEPARATOR=   ${EVENT_RECORD}${elog.strip('q ')}  /fru
 
     ${resp}=     openbmc get request     ${association_uri}
     ${jsondata}=    to json    ${resp.content}
@@ -195,13 +200,14 @@
     ${log_list}=     Get EventList
     Should Contain   '${log_list}'   ${elog.strip('q ')}
 
-    ${association_uri} =
-    ...   catenate    SEPARATOR=   ${EVENT_RECORD}/${elog.strip('q ')}  /fru
+    ${association_uri}=
+    ...   catenate    SEPARATOR=   ${EVENT_RECORD}${elog.strip('q ')}  /fru
 
-    ${association_content} =
-    ...     Read Attribute    ${association_uri}    endpoints
+    ${association_content}=
+    ...   Read Attribute    ${association_uri}    endpoints
     Should Contain
-    ...     ${association_content}    /org/openbmc/inventory/system/systemevent
+    ...  ${association_content}
+    ...  ${OPENBMC_BASE_URI}inventory/system/systemevent
 
 Association unchanged after reboot
     [Documentation]     ***GOOD PATH***
@@ -210,7 +216,7 @@
     [Tags]  bmcreboot  Association_Unchanged_After_Reboot
 
     ${pre_reboot_log_uri}=      Create a test log
-    ${association_uri} =
+    ${association_uri}=
     ...    catenate    SEPARATOR=   ${pre_reboot_log_uri}   /fru
     ${pre_reboot_association_content} =
     ...   Read Attribute   ${association_uri}    endpoints
@@ -228,7 +234,8 @@
     ${post_reboot_association_content} =
     ...   Read Attribute    ${association_uri}    endpoints
     Should Be Equal
-    ...   ${post_reboot_association_content}   ${pre_reboot_association_content}
+    ...   ${post_reboot_association_content}
+    ...   ${pre_reboot_association_content}
 
     ${post_reboot_dimm3_event} =
     ...   Read Attribute   ${DIMM3_URI}/event   endpoints
@@ -242,7 +249,7 @@
 *** Keywords ***
 
 Get EventList
-    ${resp}=   openbmc get request     /org/openbmc/records/events/
+    ${resp}=   openbmc get request   ${EVENT_RECORD}
     should be equal as strings    ${resp.status_code}    ${HTTP_OK}
     ${jsondata}=    to json    ${resp.content}
     [return]    ${jsondata['data']}
@@ -250,17 +257,19 @@
 Create a test log
     [arguments]
     ${data}=   create dictionary   data=@{EMPTY}
-    ${resp}=   openbmc post request     /org/openbmc/records/events/action/acceptTestMessage    data=${data}
+    ${resp}=   openbmc post request
+    ...     ${EVENT_RECORD}action/acceptTestMessage    data=${data}
     should be equal as strings      ${resp.status_code}     ${HTTP_OK}
     ${json}=   to json         ${resp.content}
     ${LOGID}=    convert to integer    ${json['data']}
-    ${uri}=     catenate    SEPARATOR=   /org/openbmc/records/events/   ${LOGID}
+    ${uri}=     catenate    SEPARATOR=   ${EVENT_RECORD}   ${LOGID}
     [return]  ${uri}
 
 Clear all logs
-    ${resp}=   openbmc post request     /org/openbmc/records/events/action/clear    data=${NIL}
+    ${resp}=   openbmc post request
+    ...   ${EVENT_RECORD}action/clear    data=${NIL}
     should be equal as strings      ${resp.status_code}     ${HTTP_OK}
-    ${resp}=   openbmc get request     /org/openbmc/records/events/
+    ${resp}=   openbmc get request   ${EVENT_RECORD}
     ${json}=   to json         ${resp.content}
     Should Be Empty     ${json['data']}