Fix slashes in the test and lib codes

Change-Id: I18e30b45e0326bb4318a1468bbe3f9b66bbf0b29
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/rest_client.robot b/lib/rest_client.robot
index ffed49f..3969ea7 100644
--- a/lib/rest_client.robot
+++ b/lib/rest_client.robot
@@ -234,8 +234,11 @@
     #                   contain the value to set the property to at the 'data'
     #                   key (e.g. data={"data": 1}).
 
+    # Make sure uri ends with slash.
+    ${uri}=  Add Trailing Slash  ${uri}
+
     ${base_uri}=  Catenate  SEPARATOR=  ${DBUS_PREFIX}  ${uri}
-    ${resp}=  Openbmc Put Request  ${base_uri}/attr/${attr}
+    ${resp}=  Openbmc Put Request  ${base_uri}attr/${attr}
     ...  timeout=${timeout}  &{kwargs}
     Should Be Equal As Strings  ${resp.status_code}  ${HTTP_OK}
 
diff --git a/lib/utils.robot b/lib/utils.robot
index b959f5e..51a6d03 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -223,7 +223,7 @@
     #                   True or False.
 
     ${log_dict}=  Create Dictionary  data=${policy_setting}
-    Write Attribute  ${BMC_LOGGING_URI}${/}rest_api_logs  Enabled
+    Write Attribute  ${BMC_LOGGING_URI}rest_api_logs  Enabled
     ...  data=${log_dict}  verify=${1}  expected_value=${policy_setting}
 
 
diff --git a/tests/test_boot_devices.robot b/tests/test_boot_devices.robot
index 9811532..45f400b 100644
--- a/tests/test_boot_devices.robot
+++ b/tests/test_boot_devices.robot
@@ -26,7 +26,7 @@
     Set Boot Source  ${BOOT_SOURCE_DEFAULT}
 
     ${boot_source}=
-    ...  Read Attribute  ${CONTROL_HOST_URI}/boot/one_time  BootSource
+    ...  Read Attribute  ${CONTROL_HOST_URI}boot/one_time  BootSource
     Should Be Equal As Strings  ${boot_source}  ${BOOT_SOURCE_DEFAULT}
 
     ${output}=  Run IPMI Standard Command  chassis bootparam get 5
@@ -41,7 +41,7 @@
     Run IPMI command  0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00
 
     ${boot_source}=
-    ...  Read Attribute  ${CONTROL_HOST_URI}/boot/one_time  BootSource
+    ...  Read Attribute  ${CONTROL_HOST_URI}boot/one_time  BootSource
     Should Be Equal As Strings  ${boot_source}  ${BOOT_SOURCE_DEFAULT}
 
     ${output}=  Run IPMI Standard Command  chassis bootparam get 5
@@ -56,7 +56,7 @@
     Set Boot Source  ${BOOT_SOURCE_NETWORK}
 
     ${boot_source}=
-    ...  Read Attribute  ${CONTROL_HOST_URI}/boot/one_time  BootSource
+    ...  Read Attribute  ${CONTROL_HOST_URI}boot/one_time  BootSource
     Should Be Equal As Strings  ${boot_source}  ${BOOT_SOURCE_NETWORK}
 
     ${output}=  Run IPMI Standard Command  chassis bootparam get 5
@@ -71,7 +71,7 @@
     Run IPMI command  0x0 0x8 0x05 0x80 0x04 0x00 0x00 0x00
 
     ${boot_source}=
-    ...  Read Attribute  ${CONTROL_HOST_URI}/boot/one_time  BootSource
+    ...  Read Attribute  ${CONTROL_HOST_URI}boot/one_time  BootSource
     Should Be Equal As Strings  ${boot_source}  ${BOOT_SOURCE_NETWORK}
 
     ${output}=  Run IPMI Standard Command  chassis bootparam get 5
@@ -86,7 +86,7 @@
     Set Boot Source  ${BOOT_SOURCE_DISK}
 
     ${boot_source}=
-    ...  Read Attribute  ${CONTROL_HOST_URI}/boot/one_time  BootSource
+    ...  Read Attribute  ${CONTROL_HOST_URI}boot/one_time  BootSource
     Should Be Equal As Strings  ${boot_source}  ${BOOT_SOURCE_DISK}
 
     ${output}=  Run IPMI Standard Command  chassis bootparam get 5
@@ -101,7 +101,7 @@
     Run IPMI command  0x0 0x8 0x05 0x80 0x08 0x00 0x00 0x00
 
     ${boot_source}=
-    ...  Read Attribute  ${CONTROL_HOST_URI}/boot/one_time  BootSource
+    ...  Read Attribute  ${CONTROL_HOST_URI}boot/one_time  BootSource
     Should Be Equal As Strings  ${boot_source}  ${BOOT_SOURCE_DISK}
 
     ${output}=  Run IPMI Standard Command  chassis bootparam get 5
@@ -115,7 +115,7 @@
 
     Set Boot Mode  ${BOOT_MODE_SAFE}
 
-    ${boot_mode}=  Read Attribute  ${CONTROL_HOST_URI}/boot/one_time  BootMode
+    ${boot_mode}=  Read Attribute  ${CONTROL_HOST_URI}boot/one_time  BootMode
     Should Be Equal As Strings  ${boot_mode}  ${BOOT_MODE_SAFE}
 
     ${output}=  Run IPMI Standard Command  chassis bootparam get 5
@@ -129,7 +129,7 @@
 
     Run IPMI command  0x0 0x8 0x05 0x80 0x0C 0x00 0x00 0x00
 
-    ${boot_mode}=  Read Attribute  ${CONTROL_HOST_URI}/boot/one_time  BootMode
+    ${boot_mode}=  Read Attribute  ${CONTROL_HOST_URI}boot/one_time  BootMode
     Should Be Equal As Strings  ${boot_mode}  ${BOOT_MODE_SAFE}
 
     ${output}=  Run IPMI Standard Command  chassis bootparam get 5
@@ -144,7 +144,7 @@
     Set Boot Source  ${BOOT_SOURCE_CDROM}
 
     ${boot_source}=
-    ...  Read Attribute  ${CONTROL_HOST_URI}/boot/one_time  BootSource
+    ...  Read Attribute  ${CONTROL_HOST_URI}boot/one_time  BootSource
     Should Be Equal As Strings  ${boot_source}  ${BOOT_SOURCE_CDROM}
 
     ${output}=  Run IPMI Standard Command  chassis bootparam get 5
@@ -159,7 +159,7 @@
     Run IPMI command  0x0 0x8 0x05 0x80 0x14 0x00 0x00 0x00
 
     ${boot_source}=
-    ...  Read Attribute  ${CONTROL_HOST_URI}/boot/one_time  BootSource
+    ...  Read Attribute  ${CONTROL_HOST_URI}boot/one_time  BootSource
     Should Be Equal As Strings  ${boot_source}  ${BOOT_SOURCE_CDROM}
 
     ${output}=  Run IPMI Standard Command  chassis bootparam get 5
@@ -173,7 +173,7 @@
 
     Set Boot Mode  ${BOOT_MODE_SETUP}
 
-    ${boot_mode}=  Read Attribute  ${CONTROL_HOST_URI}/boot/one_time  BootMode
+    ${boot_mode}=  Read Attribute  ${CONTROL_HOST_URI}boot/one_time  BootMode
     Should Be Equal As Strings  ${boot_mode}  ${BOOT_MODE_SETUP}
 
     ${output}=  Run IPMI Standard Command  chassis bootparam get 5
@@ -187,7 +187,7 @@
 
     Run IPMI command  0x0 0x8 0x05 0x80 0x18 0x00 0x00 0x00
 
-    ${boot_mode}=  Read Attribute  ${CONTROL_HOST_URI}/boot/one_time  BootMode
+    ${boot_mode}=  Read Attribute  ${CONTROL_HOST_URI}boot/one_time  BootMode
     Should Be Equal As Strings  ${boot_mode}  ${BOOT_MODE_SETUP}
 
     ${output}=  Run IPMI Standard Command  chassis bootparam get 5
@@ -203,7 +203,7 @@
     # boot_source  Boot source which need to be set.
 
     ${valueDict}=  Create Dictionary  data=${boot_source}
-    Write Attribute  ${CONTROL_HOST_URI}/boot/one_time  BootSource
+    Write Attribute  ${CONTROL_HOST_URI}boot/one_time  BootSource
     ...  data=${valueDict}
 
 
@@ -214,7 +214,7 @@
     # boot_mode  Boot mode which need to be set.
 
     ${valueDict}=  Create Dictionary  data=${boot_mode}
-    Write Attribute  ${CONTROL_HOST_URI}/boot/one_time  BootMode
+    Write Attribute  ${CONTROL_HOST_URI}boot/one_time  BootMode
     ...  data=${valueDict}
 
 
@@ -243,5 +243,5 @@
 
     # Set boot policy to default i.e. one time enabled.
     ${valueDict}=  Create Dictionary  data=${1}
-    Write Attribute  ${CONTROL_HOST_URI}/boot/one_time  Enabled
+    Write Attribute  ${CONTROL_HOST_URI}boot/one_time  Enabled
     ...  data=${valueDict}
diff --git a/tests/test_boot_policies.robot b/tests/test_boot_policies.robot
index 02b049e..3239744 100644
--- a/tests/test_boot_policies.robot
+++ b/tests/test_boot_policies.robot
@@ -29,7 +29,7 @@
     [Tags]  Set_Boot_Policy_To_ONETIME_via_REST
 
     Set Boot Policy  ${ONETIME}
-    ${boot}=   Read Attribute  ${CONTROL_URI}/host0/boot/one_time  Enabled
+    ${boot}=   Read Attribute  ${CONTROL_URI}host0/boot/one_time  Enabled
     Should Be Equal  ${boot}  ${ONETIME}
     ${output}=  Run IPMI Standard Command  chassis bootparam get 5
     Should Contain  ${output}  Options apply to only next boot
@@ -40,7 +40,7 @@
     [Tags]  Set_Boot_Policy_To_PERMANENT_via_REST
 
     Set Boot Policy  ${PERMANENT}
-    ${boot}=   Read Attribute  ${CONTROL_URI}/host0/boot/one_time  Enabled
+    ${boot}=   Read Attribute  ${CONTROL_URI}host0/boot/one_time  Enabled
     Should Be Equal  ${boot}  ${PERMANENT}
     ${output}=  Run IPMI Standard Command  chassis bootparam get 5
     Should Contain  ${output}  Options apply to all future boots
@@ -51,7 +51,7 @@
     [Tags]  Set_Boot_Policy_To_ONETIME_via_IPMITOOL
 
     Run IPMI command  0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00
-    ${boot}=   Read Attribute  ${CONTROL_URI}/host0/boot/one_time  Enabled
+    ${boot}=   Read Attribute  ${CONTROL_URI}host0/boot/one_time  Enabled
     Should Be Equal  ${boot}  ${ONETIME}
     ${output}=  Run IPMI Standard Command  chassis bootparam get 5
     Should Contain  ${output}  Options apply to only next boot
@@ -62,7 +62,7 @@
     [Tags]  Set_Boot_Policy_To_PERMANENT_via_IPMITOOL
 
     Run IPMI command   0x0 0x8 0x05 0xC0 0x00 0x00 0x00 0x0
-    ${boot}=   Read Attribute  ${CONTROL_URI}/host0/boot/one_time  Enabled
+    ${boot}=   Read Attribute  ${CONTROL_URI}host0/boot/one_time  Enabled
     Should Be Equal  ${boot}  ${PERMANENT}
     ${output}=  Run IPMI Standard Command  chassis bootparam get 5
     Should Contain  ${output}  Options apply to all future boots
@@ -76,10 +76,10 @@
     Set Boot Policy  ${PERMANENT}
     Set Boot Source  ${BOOT_SOURCE_CDROM}
 
-    ${boot}=   Read Attribute  ${CONTROL_URI}/host0/boot/one_time  Enabled
+    ${boot}=   Read Attribute  ${CONTROL_URI}host0/boot/one_time  Enabled
     Should Be Equal  ${boot}  ${PERMANENT}
 
-    ${flag}=   Read Attribute  ${CONTROL_URI}/host0/boot/  BootSource
+    ${flag}=   Read Attribute  ${CONTROL_URI}host0/boot/  BootSource
     Should Be Equal  ${flag}  ${BOOT_SOURCE_CDROM}
 
 Persist ONETIME Boot Policy After Reset
@@ -92,10 +92,10 @@
 
     OBMC Reboot (off)
 
-    ${boot}=   Read Attribute  ${CONTROL_URI}/host0/boot/one_time  Enabled
+    ${boot}=   Read Attribute  ${CONTROL_URI}host0/boot/one_time  Enabled
     Should Be Equal  ${boot}  ${ONETIME}
 
-    ${flag}=   Read Attribute  ${CONTROL_URI}/host0/boot/  BootSource
+    ${flag}=   Read Attribute  ${CONTROL_URI}host0/boot/  BootSource
     Should Be Equal  ${flag}  ${BOOT_SOURCE_NETWORK}
 
 Persist PERMANENT Boot Policy After Reset
@@ -108,10 +108,10 @@
 
     OBMC Reboot (off)
 
-    ${boot}=   Read Attribute  ${CONTROL_URI}/host0/boot/one_time  Enabled
+    ${boot}=   Read Attribute  ${CONTROL_URI}host0/boot/one_time  Enabled
     Should Be Equal  ${boot}  ${PERMANENT}
 
-    ${flag}=   Read Attribute  ${CONTROL_URI}/host0/boot/  BootSource
+    ${flag}=   Read Attribute  ${CONTROL_URI}host0/boot/  BootSource
     Should Be Equal  ${flag}  ${BOOT_SOURCE_CDROM}
 
 Verify Boot Mode Persistency After BMC Reboot
diff --git a/tests/test_rest_interfaces.robot b/tests/test_rest_interfaces.robot
index fb7cfff..3ff4eb5 100644
--- a/tests/test_rest_interfaces.robot
+++ b/tests/test_rest_interfaces.robot
@@ -223,7 +223,7 @@
 
     ${dict_data}=  Create Dictionary  data=${HOST_POWEROFF_TRANS}
     ${resp}=  Openbmc Put Request
-    ...  ${HOST_STATE_URI}/attr/RequestedHostTransition  data=${dict_data}
+    ...  ${HOST_STATE_URI}attr/RequestedHostTransition  data=${dict_data}
     Should Be Equal As Strings  ${resp.status_code}  ${HTTP_OK}
     ${jsondata}=  To JSON  ${resp.content}
     Should Be Equal  ${jsondata["data"]}  ${None}