Update test suites with new URI changes
This changes addresses:
- variables updation with new URI
- Fix minor spacing exceeding 80 characters
Change-Id: I3fa314f51d0b52e36649f0bfa605a02a3820e875
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/tests/test_boot.robot b/tests/test_boot.robot
index 89fbd8c..ca8aad9 100644
--- a/tests/test_boot.robot
+++ b/tests/test_boot.robot
@@ -11,8 +11,11 @@
Suite Teardown Close All Connections
Test Setup Initialize DBUS cmd "boot_flags"
Test Teardown FFDC On Test Case Fail
+
*** Variables ***
+${HOST_SETTINGS} ${SETTINGS_URI}host0
+
*** Test Cases ***
Set the Boot Device as Default using REST API
@@ -21,8 +24,8 @@
${bootDevice}= Set Variable Default
${valueDict}= create dictionary data=${bootDevice}
- Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}
- Read the Attribute /org/openbmc/settings/host0 boot_flags
+ Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
+ Read the Attribute ${HOST_SETTINGS} boot_flags
Response Should Be Equal Default
${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
Should Be Empty ${stderr}
@@ -34,7 +37,7 @@
... ipmitool.
Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00
- Read the Attribute /org/openbmc/settings/host0 boot_flags
+ Read the Attribute ${HOST_SETTINGS} boot_flags
Response Should Be Equal Default
${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
Should Be Empty ${stderr}
@@ -46,8 +49,8 @@
${bootDevice}= Set Variable Network
${valueDict}= create dictionary data=${bootDevice}
- Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}
- Read the Attribute /org/openbmc/settings/host0 boot_flags
+ Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
+ Read the Attribute ${HOST_SETTINGS} boot_flags
Response Should Be Equal Network
${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
Should Be Empty ${stderr}
@@ -59,7 +62,7 @@
... ipmitool.
Run IPMI command 0x0 0x8 0x05 0x80 0x04 0x00 0x00 0x00
- Read the Attribute /org/openbmc/settings/host0 boot_flags
+ Read the Attribute ${HOST_SETTINGS} boot_flags
Response Should Be Equal Network
${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
Should Be Empty ${stderr}
@@ -71,8 +74,8 @@
${bootDevice}= Set Variable Disk
${valueDict}= create dictionary data=${bootDevice}
- Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}
- Read the Attribute /org/openbmc/settings/host0 boot_flags
+ Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
+ Read the Attribute ${HOST_SETTINGS} boot_flags
Response Should Be Equal Disk
${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
Should Be Empty ${stderr}
@@ -84,7 +87,7 @@
... ipmitool.
Run IPMI command 0x0 0x8 0x05 0x80 0x08 0x00 0x00 0x00
- Read the Attribute /org/openbmc/settings/host0 boot_flags
+ Read the Attribute ${HOST_SETTINGS} boot_flags
Response Should Be Equal Disk
${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
Should Be Empty ${stderr}
@@ -96,8 +99,8 @@
${bootDevice}= Set Variable Safe
${valueDict}= create dictionary data=${bootDevice}
- Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}
- Read the Attribute /org/openbmc/settings/host0 boot_flags
+ Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
+ Read the Attribute ${HOST_SETTINGS} boot_flags
Response Should Be Equal Safe
${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
Should Be Empty ${stderr}
@@ -109,7 +112,7 @@
... ipmitool.
Run IPMI command 0x0 0x8 0x05 0x80 0x0C 0x00 0x00 0x00
- Read the Attribute /org/openbmc/settings/host0 boot_flags
+ Read the Attribute ${HOST_SETTINGS} boot_flags
Response Should Be Equal Safe
${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
Should Be Empty ${stderr}
@@ -121,8 +124,8 @@
${bootDevice}= Set Variable CDROM
${valueDict}= create dictionary data=${bootDevice}
- Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}
- Read the Attribute /org/openbmc/settings/host0 boot_flags
+ Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
+ Read the Attribute ${HOST_SETTINGS} boot_flags
Response Should Be Equal CDROM
${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
Should Be Empty ${stderr}
@@ -134,7 +137,7 @@
... ipmitool.
Run IPMI command 0x0 0x8 0x05 0x80 0x14 0x00 0x00 0x00
- Read the Attribute /org/openbmc/settings/host0 boot_flags
+ Read the Attribute ${HOST_SETTINGS} boot_flags
Response Should Be Equal CDROM
${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
Should Be Empty ${stderr}
@@ -146,8 +149,8 @@
${bootDevice}= Set Variable Setup
${valueDict}= create dictionary data=${bootDevice}
- Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}
- Read the Attribute /org/openbmc/settings/host0 boot_flags
+ Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
+ Read the Attribute ${HOST_SETTINGS} boot_flags
Response Should Be Equal Setup
${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
Should Be Empty ${stderr}
@@ -159,7 +162,7 @@
... ipmitool.
Run IPMI command 0x0 0x8 0x05 0x80 0x18 0x00 0x00 0x00
- Read the Attribute /org/openbmc/settings/host0 boot_flags
+ Read the Attribute ${HOST_SETTINGS} boot_flags
Response Should Be Equal Setup
${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
Should Be Empty ${stderr}
diff --git a/tests/test_bootpolicy.robot b/tests/test_bootpolicy.robot
index fdb7166..2f26d6f 100644
--- a/tests/test_bootpolicy.robot
+++ b/tests/test_bootpolicy.robot
@@ -13,6 +13,7 @@
Test Teardown FFDC On Test Case Fail
*** Variables ***
+${HOST_SETTINGS} ${SETTINGS_URI}host0
*** Test Cases ***
@@ -22,7 +23,7 @@
Set Boot Policy ONETIME
- ${boot}= Read Attribute /org/openbmc/settings/host0 boot_policy
+ ${boot}= Read Attribute ${HOST_SETTINGS} boot_policy
Should Be Equal ${boot} ONETIME
${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
Should Be Empty ${stderr}
@@ -34,7 +35,7 @@
Set Boot Policy PERMANENT
- ${boot}= Read Attribute /org/openbmc/settings/host0 boot_policy
+ ${boot}= Read Attribute ${HOST_SETTINGS} boot_policy
Should Be Equal ${boot} PERMANENT
${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
Should Be Empty ${stderr}
@@ -45,7 +46,7 @@
... and then verify using REST URI and ipmitool.\n
Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00
- ${boot}= Read Attribute /org/openbmc/settings/host0 boot_policy
+ ${boot}= Read Attribute ${HOST_SETTINGS} boot_policy
Should Be Equal ${boot} ONETIME
${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
Should Be Empty ${stderr}
@@ -56,7 +57,7 @@
... and then verify using REST URI and ipmitool.
Run IPMI command 0x0 0x8 0x05 0xC0 0x00 0x00 0x00 0x00
- ${boot}= Read Attribute /org/openbmc/settings/host0 boot_policy
+ ${boot}= Read Attribute ${HOST_SETTINGS} boot_policy
Should Be Equal ${boot} PERMANENT
${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
Should Be Empty ${stderr}
@@ -75,10 +76,10 @@
Initiate Power On
- ${boot}= Read Attribute /org/openbmc/settings/host0 boot_policy
+ ${boot}= Read Attribute ${HOST_SETTINGS} boot_policy
Should Be Equal ${boot} PERMANENT
- ${flag}= Read Attribute /org/openbmc/settings/host0 boot_flags
+ ${flag}= Read Attribute ${HOST_SETTINGS} boot_flags
Should Be Equal ${flag} CDROM
Persist ONETIME Boot Policy After Reset
@@ -94,10 +95,10 @@
Trigger Warm Reset
- ${boot}= Read Attribute /org/openbmc/settings/host0 boot_policy
+ ${boot}= Read Attribute ${HOST_SETTINGS} boot_policy
Should Be Equal ${boot} ONETIME
- ${flag}= Read Attribute /org/openbmc/settings/host0 boot_flags
+ ${flag}= Read Attribute ${HOST_SETTINGS} boot_flags
Should Be Equal ${flag} Network
Persist PERMANENT Boot Policy After Reset
@@ -113,10 +114,10 @@
Trigger Warm Reset
- ${boot}= Read Attribute /org/openbmc/settings/host0 boot_policy
+ ${boot}= Read Attribute ${HOST_SETTINGS} boot_policy
Should Be Equal ${boot} PERMANENT
- ${flag}= Read Attribute /org/openbmc/settings/host0 boot_flags
+ ${flag}= Read Attribute ${HOST_SETTINGS} boot_flags
Should Be Equal ${flag} CDROM
Set boot policy to invalid value
@@ -126,7 +127,7 @@
Run Keyword and Ignore Error Set Boot Policy abc
- ${boot}= Read Attribute /org/openbmc/settings/host0 boot_policy
+ ${boot}= Read Attribute ${HOST_SETTINGS} boot_policy
Should Not Be Equal ${boot} abc
*** Keywords ***
@@ -135,13 +136,13 @@
[Arguments] ${args}
${bootpolicy}= Set Variable ${args}
${valueDict}= create dictionary data=${bootpolicy}
- Write Attribute /org/openbmc/settings/host0 boot_policy data=${valueDict}
+ Write Attribute ${HOST_SETTINGS} boot_policy data=${valueDict}
Set Boot Device
[Arguments] ${args}
- ${bootDevice}= Set Variable ${args}
- ${valueDict}= create dictionary data=${bootDevice}
- Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}
+ ${bootDevice} = Set Variable ${args}
+ ${valueDict} = create dictionary data=${bootDevice}
+ Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict}
diff --git a/tests/test_eventlog.robot b/tests/test_eventlog.robot
index 71ea017..1e79897 100644
--- a/tests/test_eventlog.robot
+++ b/tests/test_eventlog.robot
@@ -19,20 +19,22 @@
${SYSTEM_SHUTDOWN_TIME} 1min
${WAIT_FOR_SERVICES_UP} 3min
+${EVENT_RECORD} ${RECORDS_URI}events/
+
*** Test Cases ***
valid path to logs
[Documentation] Test list all events
[Tags] CI
- ${resp}= openbmc get request /org/openbmc/records/events/
+ ${resp}= openbmc get request ${EVENT_RECORD}
should be equal as strings ${resp.status_code} ${HTTP_OK}
clear any logs
[Documentation] Test delete all events
[Tags] CI clear_any_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']}
@@ -103,14 +105,14 @@
[Documentation] This is to test events are in place even after the
... event service is restarted.
[Tags] CI
- ${resp}= openbmc get request /org/openbmc/records/events/
+ ${resp}= openbmc get request ${EVENT_RECORD}
${json}= to json ${resp.content}
${logs_pre_restart}= set variable ${json['data']}
${uptime}= Execute Command systemctl restart obmc-phosphor-event.service
Sleep ${10}
- ${resp}= openbmc get request /org/openbmc/records/events/
+ ${resp}= openbmc get request ${EVENT_RECORD}
${json}= to json ${resp.content}
${logs_post_restart}= set variable ${json['data']}
List Should Contain Sub List ${logs_post_restart} ${logs_pre_restart} msg=Failed to find all the eventlogs which are present before restart of event service
@@ -187,12 +189,12 @@
clearing logs results in no logs
[Documentation] This testcase is for clearning the events when no logs present
[Tags] CI
- ${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']}
- ${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}
@@ -201,9 +203,9 @@
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}
diff --git a/tests/test_fw_version.robot b/tests/test_fw_version.robot
index 73a4873..3cc59cd 100755
--- a/tests/test_fw_version.robot
+++ b/tests/test_fw_version.robot
@@ -16,7 +16,8 @@
... $ git describe --dirty
... v0.1-34-g95f7347
... $
- ${resp}= OpenBMC Get Request /org/openbmc/inventory/system/chassis/motherboard/bmc
+ ${resp}= OpenBMC Get Request
+ ... ${INVENTORY_URI}system/chassis/motherboard/bmc
Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
${jsondata}= To Json ${resp.content}
Should not be empty ${jsondata["data"]["version"]} msg=version field is empty
@@ -29,7 +30,7 @@
... $
[Tags] chassisboot Test_BIOS_Version
- ${resp}= OpenBMC Get Request /org/openbmc/inventory/system/bios
+ ${resp}= OpenBMC Get Request ${INVENTORY_URI}system/bios
Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
${jsondata}= To Json ${resp.content}
Should not be empty ${jsondata["data"]["Version"]} msg=Version field is empty
diff --git a/tests/test_generic_conf.robot b/tests/test_generic_conf.robot
index 7f68b88..1d47419 100755
--- a/tests/test_generic_conf.robot
+++ b/tests/test_generic_conf.robot
@@ -12,6 +12,8 @@
${MIN_POWER_VALUE} ${0}
${MAX_POWER_VALUE} ${1000}
+${SETTING_HOST} ${SETTINGS_URI}host0
+
*** Test Cases ***
@@ -21,7 +23,7 @@
... This test case tries to get the boot flags
...
- ${resp}= Read Attribute /org/openbmc/settings/host0/ boot_flags
+ ${resp}= Read Attribute ${SETTING_HOST} boot_flags
should not be empty ${resp}
Get the power
@@ -30,7 +32,7 @@
... This test case tries to get the power value and it should be
... between ${MIN_POWER_VALUE} and ${MAX_POWER_VALUE}
- ${powerValue}= Read Attribute /org/openbmc/settings/host0/ power_cap
+ ${powerValue}= Read Attribute ${SETTING_HOST} power_cap
should be true ${powerValue} >= ${MIN_POWER_VALUE} and ${powerValue} <= ${MAX_POWER_VALUE}
Set the power with string of characters
@@ -43,8 +45,8 @@
${valueToBeSet}= Set Variable abcdefg
${valueDict}= create dictionary data=${valueToBeSet}
- Write Attribute /org/openbmc/settings/host0 power_cap data=${valueDict}
- ${value}= Read Attribute /org/openbmc/settings/host0 power_cap
+ Write Attribute ${SETTING_HOST} power_cap data=${valueDict}
+ ${value}= Read Attribute ${SETTING_HOST} power_cap
should not be true '${value}'=='${valueToBeSet}'
Set the power with greater then MAX_POWER_VALUE
@@ -57,8 +59,8 @@
${valueToBeSet}= Set Variable ${1010}
${valueDict}= create dictionary data=${valueToBeSet}
- Write Attribute /org/openbmc/settings/host0 power_cap data=${valueDict}
- ${value}= Read Attribute /org/openbmc/settings/host0 power_cap
+ Write Attribute ${SETTING_HOST} power_cap data=${valueDict}
+ ${value}= Read Attribute ${SETTING_HOST} power_cap
should not be equal ${value} ${valueToBeSet}
Set the power with MIN_POWER_VALUE
@@ -69,8 +71,8 @@
${valueToBeSet}= Set Variable ${MIN_POWER_VALUE}
${valueDict}= create dictionary data=${valueToBeSet}
- Write Attribute /org/openbmc/settings/host0 power_cap data=${valueDict}
- ${value}= Read Attribute /org/openbmc/settings/host0 power_cap
+ Write Attribute ${SETTING_HOST} power_cap data=${valueDict}
+ ${value}= Read Attribute ${SETTING_HOST} power_cap
Should Be Equal ${value} ${valueToBeSet}
Set the power with MAX_POWER_VALUE
@@ -81,8 +83,8 @@
${valueToBeSet}= Set Variable ${MAX_POWER_VALUE}
${valueDict}= create dictionary data=${valueToBeSet}
- Write Attribute /org/openbmc/settings/host0 power_cap data=${valueDict}
- ${value}= Read Attribute /org/openbmc/settings/host0 power_cap
+ Write Attribute ${SETTING_HOST} power_cap data=${valueDict}
+ ${value}= Read Attribute ${SETTING_HOST} power_cap
Should Be Equal ${value} ${valueToBeSet}
Set the boot flags with string
@@ -95,7 +97,7 @@
${valueToBeSet}= Set Variable 3ab56f
${valueDict}= create dictionary data=${valueToBeSet}
- Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}
- ${value}= Read Attribute /org/openbmc/settings/host0 boot_flags
+ Write Attribute ${SETTING_HOST} boot_flags data=${valueDict}
+ ${value}= Read Attribute ${SETTING_HOST} boot_flags
Should not Be Equal ${value} ${valueToBeSet}
diff --git a/tests/test_inventory.robot b/tests/test_inventory.robot
index 9f23451..6b97219 100644
--- a/tests/test_inventory.robot
+++ b/tests/test_inventory.robot
@@ -81,7 +81,7 @@
Setup The Suite
BMC Power On
- ${resp}= Read Properties /org/openbmc/inventory/enumerate
+ ${resp}= Read Properties ${INVENTORY_URI}enumerate
Set Suite Variable ${SYSTEM_INFO} ${resp}
log Dictionary ${resp}